Preheat oven to 350ºF, and line a muffin pan with cupcake liners.
In a medium saucepan, melt the butter over medium-low heat. As the butter melts, it’ll start to foam, then turn a clear golden color. Continue to stir the butter, scraping up any browned specks from the bottom of the pan as it starts to brown. It should have a nutty aroma.
Once browned and nutty, turn off the heat and allow to cool for 5 minutes.
In a large mixing bowl, whisk together the flour, baking soda, salt, and sugar until well combined. Add the browned butter, sour cream, and egg, and continue stirring with a whisk. Batter will be thick so you’ll have to add some of the buttermilk to stir more easily. Add the rest of the buttermilk along with the vanilla and stir until combined.
Pour batter into cupcake liners, filling 2/3 of the way. Bake in the oven for 18-20 minutes, or until a toothpick inserted in the center comes out with few crumbs attached. Allow cupcakes to cool in the pan for 5 minutes before transferring to a wire rack to cool completely.
Make the Buttercream:
In a small saucepan over medium heat, whisk flour and milk together, stirring constantly, until it thickens. It should have a thick pudding consistency. Remove from heat and immediately pour mixture into a bowl to cool completely.*
After the pudding mixture has come to room temperature, use a stand mixer fitted with the paddle attachment or a beater to cream the butter, sugar, vanilla, and salt together on medium high until light and fluffy, about 3 minutes.
Replace the paddle attachment with a whisk attachment, then add the completely cooled pudding mixture, and beat it for about 5-7 minutes on high until it looks like whipped cream. The mixture may look curdled at first, but as you continue whipping it, it should come together. If you can still see streaks of butter, keep beating it until you can’t. (See picture above.)
Pipe or spread buttercream on top of cupcakes. Top with sprinkles, if desired.
Notes
*The milk mixture can be refrigerated to speed up the cooling process.