2 1/2 cups / 535 grams dried beans, such as pinto, navy, or cannellini
1/3 cup peanut or vegetable oil, plus more for finishing
1 sliced yellow onion
5 garlic cloves, smashed
1 (2-inch) piece of ginger, peeled and minced (about 1/3 cup)
3 tomatoes, diced
Pinch of chile flakes
2 green onions, sliced (optional)
Lime wedges (optional)
Rinse the beans well in a colander. Transfer to a large bowl, cover with 2 inches of cool water, and let soak for at least 4 hours or overnight.
Drain the beans, transfer to a 4- to 6-quart pot, and add water to cover by about 1 inch. Place over high heat and bring to a boil. Adjust the heat to a gentle simmer and cook uncovered for 1 1/2 hours, or until tender.
Remove from the heat, stir in 2 teaspoons salt, and let the beans stand in their cooking liquid for at least 30 minutes (or refrigerate them in their cooking liquid and finish the dish the next day). Drain the beans, reserving the cooking liquid (you’ll have about 4 cups).
In the same pot used to cook the beans, heat the oil over medium heat. Add the onion, garlic, and a generous pinch of salt and cook until the onion has softened, about 6 minutes. While cooking, mash the garlic against the side of the pot to break it down.
Stir in the ginger and cook for about 1 minute. Stir in the tomatoes and chile flakes and cook until the tomatoes have softened, 2 to 3 minutes.
Stir in the beans, another teaspoon of salt, and 2 cups of the saved cooking liquid. Simmer gently, stirring occasionally, for about 20 minutes, or until the beans achieve a creamy consistency. Taste, adding more salt as desired (beans do need a fair amount, so don’t shy away from the salt if they taste flat). If the beans are too thick, stir in a little more of the cooking water and continue to cook.
Remove from the heat. (At this point, the beans can be cooled, covered, and refrigerated for up to 1 week. Reheat gently before serving.) Drizzle peanut oil on top to serve, if desired. Serve with lime wedges if you want the beans to taste a bit brighter