Add the chilies, ginger, garlic, and water to a pressure cooker and stir well.
Close the lid of the cooker and pressure cook for 3 whistles on high heat.
Remove the cooker from heat and let the pressure release naturally. Open the lid.
Cool the chilies to room temperature and add them to a blender along with the liquid. Add vinegar, salt, and sugar and blend to make a smooth paste.
Pass the mixture through a fine-mesh strainer and discard the leftover.
Transfer the mixture to a frying pan and cook for 4-5 minutes over medium heat until the sauce is thickened.
Remove the pan from the heat and let the sauce cool down to room temperature. Transfer it to an airtight glass container and refrigerate for up to 15 days. Use as desired.