Pour water into a small saucepan, then gently whisk in the sugar, cocoa, and salt.
Bring mixture to a boil, stirring occasionally, for several minutes.
Reduce heat and cook for 1 minute.
Remove from heat and stir in vanilla. Cool. Store in the refrigerator in an airtight glass container.
Fill a cocktail shaker with ice. Pour in vodka and chocolate syrup. Put the top on the shaker and shake well to thoroughly mix and chill the drink.
Strain into martini glasses and garnish with raspberries, if desired. Serve immediately.
*Syrup will keep for several weeks in the fridge.