Line an 8x8-inch baking dish with parchment paper, leaving some overhang for easy removal later.
In a medium saucepan, combine the semi-sweet chocolate chips and sweetened condensed milk over low heat. Stir continuously until the chocolate is melted and the mixture is smooth.
Remove the saucepan from heat and add the unsweetened cocoa powder, brewed espresso, and vanilla extract. Stir until thoroughly combined with no lumps.
Add the chopped walnuts or pecans if using, and fold them into the mixture until evenly distributed.
Pour the fudge mixture into the prepared baking dish and spread it evenly using a spatula.
Sprinkle a pinch of sea salt over the top for an extra flavor boost.
Place the baking dish in the refrigerator and allow the fudge to firm up for at least 2 hours.
Once set, use the parchment paper overhang to lift the fudge out of the dish. Cut it into squares or rectangles with a sharp knife.
Notes
Arrange the fudge pieces on a decorative plate and drizzle with melted chocolate for extra flair. You can also garnish with a sprinkle of cocoa powder or a light dusting of powdered sugar.