Heat 1 tbsp. oil in a small pan and saute coconut till it is light brown. Add 5 red chillies, coriander seeds, cumin seeds, peppercorns and fry till it emits an aroma. Add the turmeric powder. Stir-fry for 2-3 seconds. Keep aside to cool. Grind into a coarse powder.
Heat 2 tbsp. oil and add the mustard seeds, curry leaves and remaining red chillies. When the seeds start spluttering, add asafoetida and onions. Saute for 5 minutes on a medium flame. Add the ground masala powder and cook for a few seconds. Add water, tamarind extract, salt and sugar and bring to a boil. Simmer for 5-7 minutes. Serve hot with steamed rice.