Position a rack in the lower third of the oven and preheat the oven to 325°F Line the bottom and sides of an 8×8-inch square baking pan with parchment paper or foil, leaving an overhang on two opposite sides.
Spray the pan and lining with cooking spray.
Combine the butter, sugar, cocoa, and salt in a medium heatproof bowl and set the bowl in a wide skillet of barely simmering water.
Stir occasionally until the butter is melted and the mixture is smooth, though it will appear somewhat gritty.
Remove the bowl from the skillet and set aside briefly until the mixture is only warm, not at all hot.
Stir in the vanilla with a wooden spoon.
Add the eggs one at a time, stirring well after each one.
When the batter looks thick, shiny, and well-blended, add the flour and stir until all the streaks of flour disappear, then beat vigorously for 40 more strokes with the wooden spoon or a rubber spatula.
Stir in the nuts, if using. Spread evenly in the prepared pan.
Bake until a toothpick plunged into the center emerges slightly moist with batter, about 25 minutes.
Let cool completely on a wire rack.
Set the pan in the freezer for 10 minutes (it will make for clean cutting of the brownies).
Lift up the ends of the parchment or foil liner, and transfer the brownies to a cutting board.