Preheat the oven to 350°F (175°C) and line a muffin tin with paper liners.
In a large bowl, whisk together the flour, baking powder, baking soda, cinnamon, and salt.
In another bowl, mix the sugars, eggs, and vegetable oil until well combined.
Gradually combine the dry ingredients with the wet ingredients, stirring gently.
Fold in the grated carrots and nuts if using.
Spoon the batter into the prepared muffin tin, filling each cup about 2/3 full.
Bake for 20-25 minutes or until a toothpick comes out clean.
Remove from the oven and let cool in the tin for 5 minutes.
Transfer muffins to a wire rack to cool completely.
Serve warm or at room temperature.