Rinse and drain fermented black beans and chop coarsely.
Add black beans, onion, and garlic into a food processor or blender. Blend until both ingredients are minced, but not a fine paste.
Heat oil and dried chili peppers in a saucepan over medium heat until warm. Turn to medium low heat. Cook until the chili peppers turn dark, but not black. Stir occasionally. Scoop out the chili peppers and discard them.
Add the black beans and onion. Cook and stir, until the sauce looks a bit dry. (The beans will absorb oil at first, but release the oil once they’re cooked.)
Add Shaoxing wine, light soy sauce, and sugar. Simmer and stir until the onion turns tender. It takes about 10 minutes or so. The sauce can be easily burned, so make sure to keep the heat low and stir the sauce constantly to ensure even cooking.
Add garlic and ginger. Continue to cook and stir the sauce until the onion turns very tender. You should see oil floating on top of the sauce.
Transfer the sauce to a large bowl to cool off completely.
Store the sauce in an airtight jar in the fridge for 2 weeks to a month.