Preheat the oven to 350°F (175°C). Grease and flour two 8-inch round cake pans.
In a large bowl, sift together the flour, cocoa powder, baking powder, baking soda, and salt.
In another bowl, whisk the granulated sugar, brown sugar, and eggs until smooth and creamy. Add the milk, vegetable oil, and vanilla extract, mixing until well combined.
Gradually add the dry ingredients to the wet ingredients, mixing gently. Slowly pour in the boiling water and stir until smooth. The batter will be thin—that’s normal.
Fold in the chopped pistachios and chocolate chips, if using.
Divide the batter evenly between the prepared pans and bake for 30-35 minutes, or until a toothpick inserted into the center comes out clean.
Remove the cakes from the oven and let them cool in the pans for 10 minutes. Then transfer to a wire rack to cool completely before frosting or serving.