One day the miller told the king that his daughter can spin gold out of straw. The king asked for the girl to be brought before him.
The king led the girl to a chamber with a heap of straw and gave her a spinning wheel. He said that all of this must be spun into gold before morning as you love your life.
A little man came in and wanted something in return for spinning the gold into straw for her so the girl gave him her necklace. When the king came he was pleased and gave her a bigger pile. the little man came in again and made it into gold. The king came in once again and said that she may be the queen. The little man said he wants the first child in return.
At the birth of the child she was sitting and playing with her baby and forgot about the misfortune so the little man said "I will give you three days and if during that time you guess my name you shall keep the child. The queen lay awake all night and tried to think of all the weird names she could think of.
When the little man came the queen began with all the names she could remember but to all of them the little man said, "Madam, that is not my name." Then the next day she began again but still she was incorrect. The 3rd day 1 of her messengers said he heard a little dwarf sing and dance around a fire singing, "Rumpelstiltskin is my name!"
The same day the nurse stood with the child in her hands ready to be give up the child but when the queen said "Could your name be Rumpelstiltskin?" He became very mad and walked out and everyone had a great day.