There was a merchant who had two young children. He lost all his wealth when his ships sank at sea, leaving him with only a field outside town. In his despair, a black dwarf appeared and offered him great riches in exchange for a promise: the merchant must give up the first thing that rubs against his leg when he returns home, in twelve years' time. The merchant, thinking it would be his dog, agreed.
Upon returning home, his young son, learning to walk, was the first to cling to his leg. The merchant was horrified but soon found a heap of money in his attic, restoring his fortune. As the twelfth year approached, his anxiety grew. He confessed the pact to his now-grown son. The brave son, blessed by a priest, faced the dwarf. After a dispute, it was decided the son would be set adrift in a small boat on a flowing stream.
The boat capsized but did not sink, carrying the boy safely to a distant, enchanted shore. There, he found a castle where a snake, actually an enchanted princess, awaited her deliverer. To break the spell, he had to endure three nights of torment by spectral black men without uttering a word. He succeeded, the princess was freed, and they married, making him King of the Golden Mountain.
They lived happily for eight years and had a son. The King longed to see his father. Despite the Queen's foreboding, she gave him a wishing-ring for the journey, making him promise not to use it to bring her and their son to him. Disguised as a shepherd, he visited his parents. When his father doubted his royal status, the King broke his promise in a moment of passion and used the ring to summon his family.
The Queen was angry at his broken word. Later, while the King slept on her lap, she stole the ring, took their child, and wished herself back to her kingdom, leaving behind only one of her slippers. Stranded, the King journeyed on. He met three giants arguing over their inheritance: a sword that could behead all but its wielder, an invisibility cloak, and seven-league boots. By cleverly testing them, he gained all three items.
Using the boots, he returned to the Golden Mountain to find his queen celebrating a wedding with another. Invisible thanks to the cloak, he disrupted the feast by stealing food and drink from her plate. Following the distressed Queen to her chamber, he revealed himself, confronted her betrayal, and declared the wedding over. When the gathered nobles mocked him, he used the magic sword to behead them all, reclaiming his throne as the true King of the Golden Mountain.