Preheat your oven to 350°F (175°C). Grease a 9x5-inch loaf pan or line it with parchment paper.
In a mixing bowl, mash the ripe bananas with a fork until smooth. Stir in the melted butter.
Mix in the baking soda and salt.
Add the sugar, beaten egg, and vanilla extract, and mix until well combined.
Gradually add the flour, stirring until just incorporated. Be careful not to overmix. If using, fold in the chopped walnuts.
Pour the batter into the prepared loaf pan and smooth the top with a spatula.
Bake in the preheated oven for 60-65 minutes, or until a toothpick inserted into the center comes out clean.
Allow the bread to cool in the pan for about 10 minutes, then transfer it to a wire rack to cool completely.