From Zelda Legends Wiki
The gilded sword is the most powerful sword in Majora's Mask that can be used with the B button. It is obtained by having your sword reforged at the Mountain Smithy along with the Gold Powder you get from winning the Goron Race. The reforging takes all three days. The Gilded Sword is second in power only to the Great Fairy's Sword, obtained by reconstituting the Stone Tower Great Fairy.