Make the chocolate base. In a medium saucepan, whisk together the cocoa powder, espresso powder (if using), sea salt, and 1 cup of the half-and-half until smooth. Whisk in the remaining half-and-half and the heavy cream. Heat over medium, stirring occasionally, until the mixture just begins to simmer. Remove from the heat.
½ cup unsweetened cocoa powder, 1 tbsp espresso powder, ⅛ tsp sea salt, 1 cup half and half, 2 cups half and half, 1 cup heavy whipping cream
Beat the eggs. In a medium mixing bowl, beat the egg yolks until lighter in color. Add the sugar and continue beating until thick and smooth.
8 large egg yolks, 1 cup granulated sugar
Temper the eggs. While mixing constantly, slowly drizzle about one-third of the warm chocolate mixture into the egg mixture. Return the saucepan to low heat and slowly whisk the tempered eggs back into the remaining chocolate mixture.
Cook the custard. Cook over medium heat, stirring constantly, until the custard slightly thickens and reaches 170–175°F.
Strain and chill. Pour through a fine mesh sieve into a clean bowl. Stir in the vanilla. Cool to room temperature, then refrigerate until thoroughly chilled (40°F or below).
2 tsps vanilla extract
Churn. Churn according to your ice cream maker's directions, about 20–25 minutes.
Freeze. Enjoy immediately for soft-serve consistency, or transfer to an airtight container and freeze overnight for the creamiest texture and best flavor.
Optional Chocolate Shavings: Before churning, finely shave your favorite chocolate bar with a sharp knife and break into small pieces if needed. Stir into the custard, then pour into the ice cream maker. Add as much or as little as you like (I used about 8 ounces bittersweet chocolate in the photos).
Pour the custard into an ice cream maker and process according to the manufacturer's instructions. This should take approximately 20-25 minutes. You may serve as soft serve ice cream at this point but I highly recommend freezing it overnight as the flavor is just going to get better and better.