Line an 8 inch square baking dish or pan with foil. Allow the foil to hang over the sides. Lightly grease the foil with butter.
Add cocoa, sugar, salt and milk to a medium heavy saucepan. Bring to a boil over medium heat stirring constantly. This will take up to five minutes. Once mixture comes to a boil, continue cooking without stirring until mixture reaches 234 degrees on a candy thermometer or forms a soft ball in cold water.
Remove from heat and transfer pan to a sink with at least two inches of cold water. Add the butter and vanilla but do not stir. Allow pan to set in cold water until mixture reaches room temperature.
Remove pan from cold water. Using a wooden spoon mix to incorporate the melted butter and vanilla. Beat the mixture with a wooden spoon until the mixture begins to lose its shiny glossy appearance and starts to take on a satiny sheen appearance. This can take a while. See notes below the recipe.
Add nuts if using, and immediately spread fudge into the prepared dish. Allow to sit for at least an hour before cutting into pieces.
Store in a candy tin or airtight container.