Make the dry spice powder. Add all of the ingredients to a small food processor. Blend until you have a find powder. It may need to be then further crushed with a mortar and pestle, to make sure it's smooth. Set aside in a small glass or container and rinse the food processor's blade and bowl.
Make the ginger, garlic and serrano paste. Add the garlic cloves, ginger and serrano peppers to a small food processor and blend into a fine paste. You may need to scrape the sides a few times to get it to blend properly. (Alternatively you can crush or grate the ginger using other methods and finely chop the serrano peppers before combining together.)
Heat 2 tbsp oil over medium-high in a large Dutch oven. Add the sliced red onions and cook, mostly undisturbed, until softened and browning at the edges. Lower the heat to medium and add the garlic, ginger and serrano paste and stir well until fragrant, about 2-3 minutes. Add the ground spices and mix well, cooking for 2-3 minutes until aromatic. Avoid scorching or burning the garlic and spices.
Add the can of tomatoes and the 1 tsp sugar. Add salt to taste. Mix well and cook for 10-20 minutes until the sauce has cooked down some and the oil begins to separate. (This is a good time to start to cook rice, if you're serving with rice.)
Blend the sauce using an immersion blender. You can add a bit of the water the beans cooked in if the beans are done and you need more liquid in the sauce.
Once the beans are done, add to the sauce and allow to cook for 5-10 minutes until combined.
Serve topped with chopped cilantro.