In a medium bowl, mix flour, baking powder, baking soda, and salt until combined. Set the dry ingredients to the side.If you are not using a kitchen scale, sift the flour into a bowl. Then spoon the sifted flour into a measuring cup and level off with a knife. This will give you the most accurate flour measurement. 350 grams all-purpose flour, sifted, 6 grams baking powder, 3 grams baking soda, 5 grams salt
In a large bowl, whisk the milk, sourdough discard, and lemon juice until smooth. Set to the side.
240 grams milk, 280 grams sourdough discard, 80 grams lemon juice, freshly squeezed
With a hand mixer or a stand mixer fitted with a paddle attachment, beat the soft butter until creamy, about 2 minutes, on medium speed.
226 grams unsalted butter, room temperature
Add the sugar and lemon zest and beat on medium speed until light and fluffy, about 5 minutes. Stop to scrape the sides and bottom of the bowl when necessary.
350 grams sugar, 2 Tablespoons lemon zest
To the butter/sugar mixture, add the vanilla extract and then the eggs, one at a time. Scrape down the bowl between each addition. Beat on medium speed until the mixture is fluffy and a pale yellow color, about 3 minutes.
8 grams vanilla extract, 3 eggs
Now, alternate adding the dry and wet ingredients to the stand mixer. First add a third of the flour mixture, followed by half of the sourdough discard mixture. Be sure not to over-mix the cake batter! This can lead to a tough crumb. Stop mixing once the flour mixture is just combined. Sometimes I will fold in the last third of the flour mixture by hand with a rubber spatula.
Divide the cake batter into two and pour the batter into the prepared pan. Tap the pans on the counter to release any air bubbles in the batter.
Place both cake pans into the oven on the middle oven rack. Bake for 25-30 minutes, or until it's golden brown and a toothpick comes out clean.
Place the warm cake on a cooling rack and cool completely before frosting.