Rinse fermented black beans with tap water, drain, and coarsely chop them. I like to leave some bigger pieces of the beans, to give the sauce more texture.
(Optional) You can use a food processor to mince all the ingredients. Add black beans, onion, and garlic into a food processor. 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 (if you’re using these ingredients). 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.