In a medium saucepan, whisk together milk, sugar, cocoa powder, and espresso powder over medium heat. Warm just until sugar dissolves and the mixture is smooth (do not boil).
Remove from heat and stir in heavy cream, vanilla, and salt.
Chill the mixture thoroughly in the refrigerator for at least 4 hours, preferably overnight.
Pour into your ice cream maker and churn according to manufacturer’s instructions (usually 20–25 minutes).
Stir in chocolate chips or shavings during the last minute of churning (if using).
Transfer to a container, cover, and freeze for 2–4 hours until firm.
Scoop and enjoy!