Preheat your oven to 350°F (175°C). Grease your 9x13 inch baking dish with a little unsalted butter and dust it with flour.
In a large mixing bowl, whisk together the flour, cocoa powder, baking soda, and kosher salt until well combined. Set aside.
Cream together the unsalted butter and sugar until the mixture is light and fluffy, about 3-5 minutes.
Add the eggs one at a time, mixing well after each addition. Then, pour in the buttermilk and vanilla extract, mixing until well incorporated.
Gradually add the dry ingredients to the wet mixture, mixing just until combined.
Pour the batter into the prepared baking dish and smooth the top with a spatula. Bake for 25-30 minutes, or until a toothpick comes out clean.
While the cake is cooling, prepare the frosting by beating together the unsalted butter, cocoa powder, milk, powdered sugar, and vanilla extract until smooth and creamy.
Once the cake has cooled completely, spread the frosting evenly over the top.
Sprinkle the chopped pistachios and sea salt over the frosted cake.
Cut the cake into squares and serve.