Preheat your oven to 350°F (175°C) and line a muffin tin with paper liners.
In a large bowl, sift together the flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
In another bowl, whisk the brown sugar, granulated sugar, and vegetable oil until well combined.
Add the eggs to the wet mixture and mix until smooth.
Gradually incorporate the dry ingredients into the wet mixture, stirring until just combined.
Fold in the grated carrots and walnuts, if using.
Divide the batter evenly among the muffin cups, filling each about 2/3 full.
Bake for 20-25 minutes or until a toothpick inserted in the center comes out clean.
Allow the muffins to cool in the tin for 5 minutes, then transfer them to a wire rack to cool completely.
Enjoy your freshly baked carrot muffins!