Preheat oven to 325°F. Line an 8x8-inch baking pan with parchment or foil, leaving an overhang on two sides.
In a medium saucepan over low heat, melt butter, sugar, cocoa, and salt, stirring occasionally until smooth and warm.
Remove from heat and let cool slightly. Stir in vanilla.
Add eggs one at a time, beating vigorously after each addition.
When batter looks thick and shiny, add flour and stir until fully incorporated.
Beat vigorously for 40 strokes. Stir in nuts if using.
Spread batter evenly in the pan and bake 20-25 minutes, or until a toothpick emerges slightly moist with batter.
Cool completely in pan before lifting out and cutting into squares.