Preheat the oven to 350°F (175°C). Line a 12 cup muffin tin with liners.
In a medium bowl, sift together flour, cocoa, baking soda, salt, and espresso powder if using. Set aside.
In another bowl or measuring cup, whisk together buttermilk, vinegar, vanilla, and food coloring.
In a large mixing bowl, beat egg and sugar together for 1–2 minutes until pale and thick. Slowly stream in the oil and continue beating until fully emulsified.
Alternate adding dry ingredients and buttermilk mixture to the wet ingredients in thirds, starting and ending with the dry. Mix until just combined.
Fill cupcake liners about ⅔ full. Bake for 18–20 minutes, or until a toothpick comes out with just a few moist crumbs.
Let cool completely before frosting. (While they cool, make the frosting.)