Blend the shallots, garlic, turmeric, ginger, candlenuts, coriander, and cumin with 1/4 cup (60 ml) water until smooth.
Heat the oil in a large pot over medium heat. Add the spice paste and cook, stirring often, for 4–5 minutes until fragrant, darker, and the oil starts to separate.
Add the water, chicken, lemongrass, lime leaves, and bay leaves (if using). Bring to a boil, skim any foam, then reduce to a gentle simmer. Cook for 30 minutes, until the chicken is tender.
Lift out the chicken. When cool enough to handle, shred the meat and discard the skin and bones. Season the broth with salt, sugar, and pepper, and taste — it should be savory and aromatic, not bland.
To serve, divide the noodles among bowls. Top with shredded chicken, bean sprouts, tomato, and a halved egg. Ladle the hot broth over everything.
Finish with green onions and fried shallots. Serve with lime wedges and sambal so everyone can adjust their own bowl.