Preheat oven to 350℉/180℃. Line a muffin tin with cupcake liners and set aside.
In a medium bowl, sift together flour, cocoa powder, baking soda, and salt. Set aside.
In a standing mixer fitted with the paddle attachment, beat together butter and sugar on medium speed until light and fluffy, about 2-3 minutes. Scrape down the sides and bottom of the bowl as necessary. On medium speed, beat in eggs, one at a time, beating well after each addition. Add vanilla extract and beat until combined.
With the mixer on low speed, add half of the dry ingredients and beat just until combined. Then beat in milk, followed by the other half of the dry ingredients, beating slowly until combined.
Add hot water and beat just until combined. Do not overmix—the less you mix, the lighter the cake will be. The batter should be liquid.
In the bowl of an electric mixer fitted with the paddle attachment, beat butter at medium speed until pale and fluffy, about 2 minutes. Add powdered sugar in 2 additions and beat until smooth. Add cocoa powder and beat until completely creamy and smooth. Beat in vanilla extract, melted chocolate, and heavy cream, mixing until combined. Add powdered sugar as necessary until frosting is spreadable.
Use frosting immediately to frost cupcakes, or store in the fridge, covered, for up to 3 days. Before using, bring to room temperature and whisk until smooth.
*Cocoa powder: If you’re using dutch-process cocoa powder, use 2 teaspoons of baking powder instead of the baking soda.
Cupcakes are best the same day they’re made, but can be kept in an airtight container at room temperature for up to 3 days. Unfrosted cupcakes can be kept in the freezer for up to 2 months. Thaw, still covered, on the counter or overnight in the fridge.