Preheat the oven at 350 F/180 C. Grease the bottom and sides of an 8 inch(20cm) square baking tin. Grind the walnuts with a few tablespoons of the sugar in a food processor or blender. In a bowl, combine the ground walnuts, remaining sugar and flour. With your fingertips, rub in the butter until the mixture resembles coarse breadcrumbs. Alternatively, process all the ingredients in a food processor until the mixture resembles coarse breadcrumbs. Pat the walnut mixture into the bottom of the prepared tin in an even layer. Bake for 25 minutes.
Meanwhile, for the topping, melt the butter with the water. Whisk in the cocoa and sugar. Remove from the heat, stir in the vanilla and salt and let cool for 5 min. Whisk in the eggs until blended. Pour the topping over the crust when baked. Return to the oven and bake until set, about 20 min. Set the tin on a rack to cool. Dust with icing sugar (optional). Store in the refrigerator.