Heat the oil in a medium pot over medium heat. Add the onion and fry until soft and transparent then add the ginger and garlic and fry another 30 seconds to a minute, or until soft.
Add the curry powder and cayenne, if using, and fry, stirring constantly, for 30 seconds to release the aromas.
Add the carrots, potatoes, lentils and vegetable stock. Raise the heat to bring it to the boil then cover and reduce the heat to minimum.
Allow to simmer, covered, very gently until the lentils are tender – about 30 minutes. Check on it from time to time to ensure the lentils are submerged. Add more stock or water to keep them submerged if necessary.
Once tender add the frozen spinach, coconut milk and salt. Raise the heat to medium and allow to cook for another couple of minutes until hot.