Grind half the chillies to a paste and mix with the ginger and garlic pastes; slash the chicken, rub the paste in well and marinate for at least 1 hour.
Toast the coconut in a little oil in a frying pan until light brown, let it cool, then blend it with half the onions into a paste.
In a heavy-based saucepan, fry the remaining onion in the rest of the oil for about 2 minutes until light brown.
Add the remaining chillies and the ground spices, fry for a few seconds, then add the marinated chicken and fry for about 3 minutes.
Stir in the coconut paste and salt, add as much water as you want for the sauce, bring to the boil and simmer covered for about 25 minutes until the chicken is tender.