The Second Method:
On a fine grate over a grill (or under the broiler, on low), roast the shallots, garlic, and dried chilies until the shallots and garlic are soft and slightly charred and the chilies brittle. (These things roast at different rates, so it’s better to roast them separately.)
Grind or pound the roasted ingredients into a fine paste using a food processor or a granite mortar; set aside.
Wrap the shrimp paste with a piece of banana leaf or a piece of foil and roast it over an open flame on the stove for 2-3 minutes; set aside.
For the second method, follow these instructions:
In a granite mortar, pound the dried shrimp into flakes (or use a coffee grinder as instructed
here); set aside.
Put all the ingredients into a wide and shallow pan and fry over medium-high heat for about 30 minutes, stirring occasionally. You know you have reached Nam Prik Pao consistency when you can make a 3-inch hole in the middle of the paste and the hole keeps its shape.
Remove the pan from heat and let the paste cool completely before storing it in a glass jar. No need to drain off the oil.