01 - Preheat oven to 350°F. Line an 8-inch square baking pan with parchment paper, leaving an overhang for easy removal.
02 - In a heatproof bowl over simmering water, melt the chocolate and butter together, stirring until smooth. Remove from heat and allow to cool slightly.
03 - Whisk in granulated and brown sugars until fully integrated.
04 - Add eggs one at a time, whisking thoroughly after each addition. Blend in vanilla extract.
05 - Sift together flour, cocoa powder, baking powder, and salt. Gently fold into wet mixture with a spatula until just combined, avoiding overmixing.
06 - Fold in nuts and/or chocolate chips if desired.
07 - Pour batter into prepared pan and smooth the surface evenly.
08 - Bake for 28 to 32 minutes, or until a toothpick inserted into the center comes out with a few moist crumbs but no wet batter.
09 - Allow to cool completely in the pan on a wire rack before lifting out and cutting into 16 squares.