Put the oil in a heavy-based frying pan on a medium-low heat, then slowly sweat the onions and garlic for about 15 minutes, until they caramelise and go very soft.
Stir in the spent coffee grounds and all the spices, cook for five minutes more, then stir in the molasses, miso, vinegar and tomatoes.
Bring the sauce to a gentle boil, turn down to a simmer and cook for about 20 minutes, or until the sauce has thickened to your liking.
Leave to cool, then decant into a clean jar, seal and keep in the fridge for up to a week; alternatively, put it in a sealed container and freeze for up to six months.
