Spread the pecans or walnuts on a baking sheet in a single layer. Toast for 6-8 minutes at 350ºF, until fragrant and lightly golden. Let cool completely.
Finely chop the cooled nuts with a knife or pulse briefly in a food processor. They should be very fine, but not turn into a paste.
Make the dough:
In a large bowl, using a hand mixer on medium speed beat the softened vegan butter with the powdered sugar for 2-3 minutes, until light and fluffy.
Mix in the vanilla extract, almond extract if using, and salt.
Add the flour and mix on low speed just until a soft dough forms. The dough should look slightly crumbly but hold together when pressed.
Fold in the chopped nuts until evenly distributed.
Cover and refrigerate the dough for 30 minutes.
Bake the cookies:
Preheat the oven to 350°F (175°C) and line a baking sheet with parchment paper. Scoop about 1 tablespoon (15 grams) of dough and roll into smooth balls. Place them about 1 inch (2.5 centimeters) apart on the baking sheet.
Bake for 14-16 minutes, until the bottoms are lightly golden and the tops stay pale.
Let the cookies cool on the baking sheet for 5 minutes. While still warm, gently roll them in powdered sugar and transfer to a wire rack.
Once fully cooled, roll them again in powdered sugar for a thicker coat.
Notes
Room temperature: Store Mexican wedding cookies in an airtight container for up to 5 days.Freezer: Freeze baked cookies for up to 2 months. To freeze unbaked cookies, form the dough into balls, freeze on a baking sheet, then transfer to a zip-top bag. Freeze for up to 3 months and bake from frozen, adding a few extra minutes to the baking time.