.Grease a 23cm (9in) square cake tin and line with baking paper. Sift the flour with the baking powder and cocoa into a bowl.
Put the chocolate into a heatproof bowl over a saucepan of hot water and leave until melted (alternatively microwave on medium pwer, stirring occasionally, until the chocolate is just melted).
In a large bowl, whisk the eggs with the sugar and vanilla until slightly thickened. Whisk in the chocolate mixture. Fold in the flour mixture, mayonnaise, and walnuts. Pour into the prepared tin and bake in a preheated oven at gas 4, 180C, fan 160C for 30-35 minutes or until a skewer inserted into the centre comes out clean.
Leave to cool in the tin before cutting into squares. Serve with ice cream.