To Make Nuôc Châm: Combine sugar, smashed garlic, and chilies in a jar. Add hot water and stir to dissolve the sugar. Let this mixture steep 15 minutes to allow the garlic and chilies to release their oils. Add fish sauce and vinegar. (If using lime or other citrus juice, make sure the water has completely cooled before adding it to the pot; otherwise, the warm liquids may cause the juice to become bitter.) Stir to combine. Add the peanuts, if using. The Nuôc Châm can be used right away, but its flavor will improve the next day. Nuôc Châm made with vinegar will last at least 1 week, and sauce made with lime juice is best used within the week it's made.
To Make the Shrimp Paste: Add the shrimp, scallions, garlic, toasted rice powder, shallots, sugar, fish sauce, oil, and white pepper to the bowl of a food processor. Pulse 15 –20 times, then test if the paste is ready. Take 2 Tbsp. shrimp paste and form it into a ball; if the paste holds the shape without flattening on the bottom, it’s ready. If not, pulse a few more times and re-test, being sure not to overprocess, or it will fall apart and become mealy. Cover the shrimp paste and place in the fridge to firm up for 1 hour.
If grilling, place your grill over low coals or preheat the grill to medium. If baking, preheat the oven to 350°F. If cooking on a stovetop, oil a cast-iron pan and set it aside.
To shape the shrimp paste, first dip your fingers in the bowl of oil and coat your hands to prevent the paste from sticking. Pinch off about 2 Tbsp. shrimp paste and flatten it onto your palm. Place a sugarcane in the middle of the paste and close your palm to wrap the paste around the sugarcane. The shrimp paste should cover most of the sugarcane, leaving about 1⁄2-inch on each end. Pinch the ends of the paste to seal it onto the sugarcane. Apply a coat of oil onto each sugarcane shrimp. Repeat for the remaining shrimp paste.
If grilling: Grill the shrimp 10–15 minutes, rotating the stalk every 3 minutes to ensure even cooking. If baking: Place the shrimp on a baking sheet and bake for 10 minutes, rotating the shrimp and the pan after 5 minutes. If cooking on the stovetop: Place the well-oiled cast-iron skillet over medium heat and cook for 8-10 minutes, rotating the shrimp every 3 minutes.
To serve, place the shrimp on a serving platter and set on the table along with the lettuce, herbs, peanut-coconut Nuôc Châm for dipping, and, if using, rice noodles or rice wrappers.