Soak the trotters in cold water for 1 hour, changing the water once, to draw out surface blood.
Blanch in boiling water with the peppercorns and bay leaves for 5 minutes, then drain and rinse off any scum clinging to the skin.
Combine the soy sauce, water, onion, garlic, ginger, scallions, coffee grounds, cinnamon, star anise, chilies, and sugar in a heavy pot and add the trotters.
Bring to a boil, then reduce to a low, steady simmer, cover, and cook for 2 hours.
Stir in the doenjang (and gochugaru, if using), then continue simmering uncovered for 20 to 30 minutes to reduce and darken the liquid, until the skin looks glossy and a chopstick passes through the thickest part easily.
Lift the trotters out and let them firm up for 10 minutes before slicing crosswise into 1.5 cm / half-inch pieces.
Arrange on a plate and serve with lettuce, saeujeot or ssamjang, garlic slices, and kimchi for wrapping.