Place the gammon, onion, carrots, bay leaves and peppercorns into a large pot and cover with cold water. Bring to a boil, skimming off any scum, then reduce the heat and leave to simmer gently for 1 hour 45 minutes. You might have to top it up with water from time to time to make sure the meat is fully covered. Once cooked, leave to cool in the liquid for 1 hour 30 minutes. Reserve the cooking liquid.
Combine the miso paste and maple syrup in a small saucepan with 175ml reserved cooking liquid and boil until thickened and reduced.
Preheat the oven to 190°C/gas mark 5. Once the gammon has cooled, peel away the rind, leaving the fat underneath. Score the fat into small diamonds, about 1cm wide, then brush with a third of the glaze. Cook in the oven for 45 minutes, brushing it with another third of remaining glaze halfway through.
Once the time is up, remove from the oven and brush with the remaining glaze. Leave to rest for 20 minutes, then enjoy warm or cold.