Collect Small Blocks from chests and silver or white Slimes and travel east from the castle cross the river. Then if you head north and use the Wire Rod to cross the river back to the west you will find a small cave. Go inside and talk to the NPC on the throne and you will be able to exchange the indicated number of Small Blocks for the corresponding sword.
When you encounter a Spelunker during gameplay in From mode that is trapped in an area at the top-left corner of the map use the flame wand on the stump to the right of him to free him. Doing this will allow you to select Spelunker mode when starting either a new game or a new game +.