Put the tamarind in a small bowl and pour one cup hot water in it. Let the tamarind soak in hot water for 15-20 minutes as you go about the other tasks. After about 20 minutes, pass the mixture through a tea strainer to get tamarind water. You can discard the solids or seeds left behind.
Cut off the tops of all the eggplants and make deep vertical slits without slicing them in half. Heat half the cooking oil (3 tbsp) in a dutch oven and fry the eggplants until they soften a little (5 minutes).
In the same oil that you fried the eggplant, add the sliced onions and fry them until reddish brown. Take them out with a slotted spoon and keep them aside.
Take a small frypan and set it on medium heat. Add the peanuts and stir them with a spoon until they turn golden. After about a minute, remove them from the heat and onto a plate. Repeat this step with the sesame seeds, cumin seeds, and coconut, taking care to roast them one by one and not all together. There's no need for oil in this step.
Add the above to a blender along with the fried onions and a few tablespoons of the tamarind water (step 1) and blend. The mixture will be quite thick so keep adding the tamarind water as you are blending to get a smooth paste. Your wet masala is ready.
Heat the remaining 3 tablespoon oil and and tip in the ginger and garlic pastes. Add the powdered spices (coriander, turmeric, and Kashmiri red chilli) and salt and a couple tablespoons water. Fry for about two minutes.
Add the wet masala you prepared in step 5 above and half a cup water. Stir well with a spoon and cover with a lid. Cook this for about 10-12 minutes on medium heat.
Add the previously fried eggplants, green chillies, and some more water if required. Cover and cook for 20 minutes on low to medium heat. Once the eggplants are soft and the oil separates, your dish is ready. Garnish with cilantro leaves if using and serve hot with bread or rice.