Heat the vegetable oil in a pan over medium heat. Add the massaman curry paste and cook for 1–2 minutes until fragrant.
Add half the coconut milk and cook for 2–3 minutes until slightly reduced and aromatic.
Add the chicken or tofu and stir to coat in the curry paste.
Add the onion, potato and bay leaves. Pour in the remaining coconut milk and bring to a gentle simmer.
Cook for 25–30 minutes until the chicken is tender and the potato is cooked through. If using tofu, simmer gently for 15–20 minutes.
Stir in the palm sugar, fish sauce and tamarind paste. Season with sea salt to taste.
Add the roasted peanuts and simmer for a further 5 minutes.
Serve with steamed rice.