Preheat the oven to 350°F (175°C). Butter and lightly flour a 9×13-inch baking pan; set aside.
In a small saucepan, combine 1 cup butter, 1/4 cup cocoa powder (for the cake) and 1 cup water. Bring to a boil, whisking, then remove from heat and set aside.
In a large bowl, whisk together 2 cups sugar, 2 cups flour, 1 teaspoon baking soda and 1 teaspoon kosher salt.
Make a well in the dry ingredients and add the 2 large eggs, 1/2 cup buttermilk and 1 teaspoon vanilla. Whisk or beat to combine, then gradually fold in the cocoa/butter mixture until the batter is smooth.
Pour the batter into the prepared pan and smooth the top with a spatula.
Bake for about 35–40 minutes, or until a toothpick inserted in the center comes out clean. Remove from the oven.
While the cake is baking (a few minutes before it finishes), make the frosting: in a small saucepan over low heat, melt 1/4 cup butter with 3 tablespoons milk and 2 tablespoons cocoa powder, whisking until smooth; do not boil.
Remove the frosting mixture from heat and whisk in 1 1/2 cups powdered sugar and 1 teaspoon vanilla until glossy and smooth.
Pour the warm frosting evenly over the warm cake and smooth the surface. Immediately sprinkle with 1/2 to 1 cup roughly chopped pistachios and 1 teaspoon sea salt.
Let the cake cool to warm or room temperature before slicing and serving.