Set the saucepan over medium-high heat. When the mixture comes to a boil, reduce the heat to medium and monitor the color of the caramel closely (no walking away!). The syrup will begin to turn golden at the edges; to even out the color, swirl the pan gently without lifting it off the heat.
Cook the mixture until it’s uniformly deep golden brown, 5 to 8 minutes.
Remove the caramel from the heat, immediately add 6 tablespoons (85g) of the butter, and stir with a flexible spatula.
Place the cream in a microwave-safe bowl or liquid measuring cup and heat it in the microwave for about 15 seconds, until warm. Slowly pour the cream into the caramel mixture and continue stirring. Add the vanilla and stir until the sauce is smooth.
Pour the caramel sauce into a small bowl or storage container, cover, and chill in the refrigerator, at least 4 hours and up to 2 weeks. The sauce will be very thin right after it’s made and will thicken considerably as it cools.
To make the cupcakes: Preheat the oven to 350°F with a rack in the center position. Line a standard muffin pan with baking cups and spray with nonstick spray.
In a large bowl, whisk together the sugar, flour, cocoa, baking soda, salt, and espresso powder. Add the water, oil, vinegar, and vanilla; whisk until thoroughly combined.
Pour the batter into the prepared baking cups, filling each about two-thirds full (about 60g); a scant 4-Tablespoon Scoop works well here.
Bake the cupcakes for 20 to 24 minutes, or until a toothpick or knife inserted into the center comes out clean, or with a few moist crumbs clinging to it, and the cupcakes spring back when lightly touched.
Remove the cupcakes from the oven and let them cool in the pan before gently tilting them out onto a rack to cool completely, at least 30 minutes. (Unfrosted cupcakes can be stored in an airtight container at room temperature for up to 2 days, or in the freezer for up to 1 month.) While the cupcakes cool, remove the caramel from the refrigerator and allow it to warm up at room temperature for about 20 minutes to ensure it whips easily; this tempering step is only necessary if the caramel has been refrigerated for more than 4 hours.
To finish the whipped caramel frosting: Transfer the caramel to a medium bowl or the bowl of a stand mixer fitted with the whisk attachment.
Add the remaining 6 tablespoons (85g) of butter to the bowl and mix at low speed to combine, about 1 minute. Increase to high speed and whip for 2 to 3 minutes, until light and fluffy. If the frosting looks dense, curdled, or greasy at this point, it’s too cold. To fix it, gently warm the frosting by setting the bowl over a pan of steaming water for a few minutes (just until you see the edges begin to soften/melt), then re-whip until smooth. If the frosting feels soupy or loose, it’s too warm. Chill for 15 to 20 minutes in the refrigerator before re-whipping.
To finish the cupcakes: Once the cupcakes are cool, spread or pipe the frosting onto the tops; you should have enough frosting for a generous 3 tablespoons (about 43g) per cupcake. Garnish each cupcake with sprinkles, if desired.
Storage information: Store frosted cupcakes in an airtight container at room temperature for up to 5 days.