Preheat your oven to 350°F (175°C). Line a muffin tin with cupcake liners. This recipe makes about 16 cupcakes, so you may need to bake in batches.
In a large mixing bowl, whisk together the flour, natural unsweetened cocoa powder, baking soda, baking powder, salt, and sugar.
In a medium mixing bowl using a hand or stand mixer, mix together the oil, eggs, vanilla extract, and sourdough discard until smooth and fully combined. Add the wet ingredients to the dry ingredients and mix until just combined. The batter will be very thick at this point. Don’t worry!
Stir in the room temperature milk to loosen the batter. It should now look smoother but still thick.
Slowly and carefully pour in the hot water (about 190°F or 88°C) while mixing. Mix until fully incorporated. The batter will become very thin, and that’s exactly what you want for soft, moist cupcakes.
Divide the batter evenly between the liners, filling each one about ⅔ to ¾ full for a nice rise. Try to keep the portions even so they bake consistently.
In a preheated oven, bake for 17–19 minutes, or until a toothpick inserted in the center comes out clean. Bake one tray at a time for best results.
Let the cupcakes cool in the pan for 10 minutes, then transfer to a wire rack to cool completely before frosting.
In a large bowl, beat the room temperature butter until smooth. Add powdered sugar, cocoa powder, vanilla, and salt. Beat on low (so you don’t have a powdered sugar snowstorm) until light and fluffy. Add 2 tablespoons of milk, if necessary add an extra tablespoon of milk for desired consistency.
These cupcakes are made to be slathered in a generous swirl of frosting.