Rumpelstiltskin is the eponymous character and antagonist of a fairy tale which originated in Germany (where he is known as Rumpelstilzchen). The tale was collected by the Brothers Grimm, who first published it in the 1812 edition of Children’s and Household Tales. It was subsequently revised in later editions.
In order to make himself appear more important, a miller lied to a king, telling him that his daughter could spin straw into gold. The king called for the girl, shut her in a tower room with straw and a spinning wheel, and demanded that she spin the straw into gold by morning, for three nights, or be executed (other versions have the king threatening to lock her up in a dungeon forever). She had given up all hope, when an impish creature appeared in the room and spun straw into gold for her in return for her necklace, then again the following night for her ring. On the third night, when she had nothing with which to reward him, the strange creature spun straw into gold for a promise that the girl’s first-born child would become his.