Preheat oven to 325F. Butter and flour an 8-inch square pan.
Place butter and chocolate in a saucepan. Heat over medium-low heat until chocolate melts. Remove from heat.
Stir in sugar, eggs and vanilla. Beat well. Stir in flour and salt. Stir in walnuts, if using.
Bake about 40 minutes. Let cool and cut into 2-inch squares.