To make the burnt chilli paste, heat the oil in a frying pan over a moderate heat and fry the onion until softened. Remove and set aside.
Add the chillies to the pan and fry until blackened. Set aside.
Add the garlic and fry until golden.
Grind the dried prawns, half of the fried chillies, the onion and garlic together with a pestle and mortar, to create a coarse paste. Add the mixture to the pan with the fish sauce, tamarind water and sugar. Heat gently for a few minutes, stirring constantly, and then set aside.
Heat the groundnut oil in a wok and fry the sliced garlic until brown. Add the chicken and fry for a couple of minutes on each side to seal.
Crumble the remaining fried chillies into the wok and add 2 tablespoons of the burnt chilli paste, then the fish sauce, water, sugar and sliced chilli. Fry over a high heat.
Add the basil leaves, kaffir lime leaves and cashew nuts and fry for another minute. Garnish with red chilli and basil and serve with plain boiled rice.