XO sauce is served as a condiment at high-end Chinese restaurants in Hong Kong. Despite its name, it has nothing to do with XO cognac - it's called that because the name evokes a sense of luxury, reflected in the expensive ingredients, especially the dried scallops.
I first published this recipe in 2012, but over the years, I've adapted it to make it easier. The hardest part of the recipe is shredding the conpoy (dried scallops) before cooking them with the other ingredients. If you use the easiest method of softening the scallops - soaking them in water to cover, it dilutes the flavour of the intense seafood. I used to steam them, then pound them in the mortar while they're hot because they get hard again if allowed to cool. Doing it this way is a lot of work. Now, I put the dried scallops with some water in a pressure cooker and cook them for about 15 minutes to soften them. Then, while the scallops are hot, I use the plastic dough blade (not the sharp metal blade) of a food processor to shred them. It's essential that you avoid using the processor's sharp blade, or else the scallops will be chopped into tiny pieces, rather than shredded. If you don't have a pressure cooker (like an Instant Pot!) or a food processor, I've given the technique for that, too.
You can buy the scallops at Chinese dried seafood vendors. They're priced according to size, with the largest ones being the most expensive. Ignore the tiny ones, which are tough; buy the scallops that are about 2cm (⅞in) in diameter. You can save a little money by buying the imperfect ones - the scallops that are slightly broken (not perfect discs), because you're going to shred them anyway.
While the scallops should be large, the dried shrimp should be very small. If possible, buy the tiny dried shrimp that are known as sakura ebi (because they're pink, like cherry blossoms), which are sold at Japanese grocery shops.
Rinse the dried scallops briefly under running water. If using a pressure cooker, put the scallops in the pan and add 180ml (¾ cup) of water. Heat the pressure cooker to the maximum pressure and cook for 15 minutes. Turn off the heat and cool the pressure cooker until it can be safely opened.
Open the lid and scoop out one-third of the scallops and put them in the bowl of a food processor fitted with the plastic dough blade attachment; immediately cover the remaining scallops in the cooker with the lid, to retain the heat. Pulse the food processor until the scallops are in fine shreds, then put them in a bowl. Process the remaining scallops in two more batches the same way.
If the scallops get cold and hard, put them back in the pressure cooker with a little more water and cook again to soften them before shredding.
If you don't have a pressure cooker or food processor with a dough blade attachment, rinse the scallops and put them in a heat-proof bowl with 180ml (¾ cup) of water. Place the bowl in a tiered steamer (or in a wok with a low-footed rack). Place the lid on the steamer (or wok) and steam over a high flame for about an hour, checking often to make sure there's enough water in the lower part of the steamer.
After an hour, scoop out some of the scallops (letting the rest continue to steam) and put them in a mortar, then pound with the pestle until they are in fine shreds. If the scallops get hard as they're being pounded, put them back in the steamer to heat again. Pound all the scallops the same way.
Finely mince the shallots and garlic. Mince the bird's-eye chillies; if your spice tolerance is low, remove and discard the seeds as you chop the chillies. Cut the dried ham (if using) into tiny cubes.
Put the dried scallops, shallots, garlic, fresh chillies, ham and shrimp into a wok (or a large pot) and mix in 1 litre (4 cups) of oil. Place the wok over a medium-low flame, then add the chilli flakes, fish or soy sauce, and the shrimp eggs (if using). The mixture should be thick and oily; if it seems dry, add more oil. Heat the ingredients until they start to sizzle, stirring frequently. Turn the flame as low as possible and cook, stirring often, for at least three hours. The mixture should sizzle very gently, not fry - if necessary, use a heat diffuser to tame the heat of the stovetop. When it's ready, the XO sauce will be dark, rich and oily.
Let the XO sauce cool to room temperature. While the XO sauce is cooling, wash a large jar or container and rinse it with very hot water before letting it air-dry. Ladle the XO sauce into the jar, pressing down on the solids. The solids should be submerged in oil by about 1cm (7/16in); if necessary, add more oil. Store in the fridge, and decant into smaller jars when needed. As long as the solids remain submerged in oil, the XO sauce keeps for several months in the fridge.