King Solomon wanted to build the Temple from unhewn stone. The Torah forbade iron tools on the altar, and Solomon, meticulous as always, extended the prohibition to the whole sanctuary. But stone will not split without a tool.
The only solution was the Shamir, a tiny worm that could cut stone by gaze alone. The Shamir was said to be in the possession of Ashmedai, the king of the demons.
Solomon sent his general Benayahu ben Yehoyada with a chain engraved with the Shem ha-Meforash, the Ineffable Name. And with Solomon's signet ring, along with wool and skins full of wine. Benayahu located Ashmedai's daily drinking well. He dug a lower well, drained the original, and refilled it with wine. Ashmedai, thirsty, drank without noticing the switch. When he passed out, Benayahu bound him with the Name-engraved chain.
On the road back, Ashmedai behaved strangely. He tore up trees. He bent sideways to avoid a widow's hut. He helped a blind man and redirected a lost child. He wept at a wedding feast. He laughed at a man ordering boots meant to last seven years. He laughed at a fortune-teller performing tricks.
Brought before Solomon, Ashmedai waited three days to be received. Then he hurled a four-cubit cane at Solomon's feet. "When you die," he said, "that is the whole space you will occupy. But now the whole world cannot satisfy you."
Solomon asked how to obtain the Shamir. Ashmedai explained it had been entrusted to a certain wild bird. Solomon's men found the nest, covered it with a glass bell, and when the bird returned she dropped the Shamir onto the glass to split it open. Startled by a sudden noise, she flew off without it.
Later Ashmedai explained his behavior on the road. The blind man he helped was a pious man whose reward needed to be delivered in this world. The child would grow into a sinner whose credit needed to be paid out while he was still innocent. He wept at the wedding because the bridegroom would die within three days, and the bride would wait thirteen years for yibum, for her young brother-in-law to come of age. He laughed at the man ordering seven-year boots because the man would not live seven days. He laughed at the fortune-teller because the fortune-teller was sitting on a buried treasure and did not know it.
While the Temple was being built, Solomon grew curious. He removed Ashmedai's chain and handed him the signet ring, just to see some marvelous thing. Ashmedai swallowed the ring, unfurled wings that touched earth and heaven, and flung Solomon four hundred miles away. The king wandered, begging for bread, saying: I, Kohelet, was king in Jerusalem (Ecclesiastes 1:12).
Meanwhile Ashmedai, taking Solomon's shape, sat on the throne. The sages grew suspicious. They asked the queens to examine his feet. He always came to them in shoes. And demons have chicken-feet that cannot be disguised. When the real Solomon finally returned to Jerusalem and was given back the signet ring and the chain, Ashmedai vanished.
Gittin 68 and Gaster's Exempla #114 preserve this long adventure. The wisest king in the world built the Temple only by borrowing tools from the king of the demons, and learned along the way that his own throne could be stolen the moment he forgot who he was.
King Solomon wished to build a temple with unhewn stone, as he was not allowed to use iron, that being forbidden by law. So he tried to obtain Shamir which he was told was in the possession of Ashmedai, the king of the demons. He sent Ben Aya his general with a chain, upon which was engraved the name of God, and also with his seal, some wool, and skins full of wine. Ben Aya sunk a well below that from which Ashmedai used to drink and a higher one next to it. He then drained the water into the lower well and filled the empty wrell with the wine from the upper one. Ashmedai, tempted, drank of it. When he was overcome Ben Aya bound him with the chain and led him to Solomon. On the way the prisoner uprooted some trees, broke down a house and hurt himself rather than touch the hut of a widow, He also helped a blind man and a child on the way. He wept at a feast and laughed at a man who ordered boots to last seven years, and again at a conjuror playing his
8o
tricks. He was kept waiting three days by King Solomon and when he was brought before him he threw at his feet a cane four cubits long saying “When thou diest that is the whole space thou shalt occupy, whilst now thou art not satisfied with the whole world. ” King Solomon said that he only wanted his assistance to obtain the Shamir. Ashmedai advised him how to obtain it, saying it had been handed over to a special wild bird. Upon his advice they covered the nest with a glass bell and the bird brought the Shamir and placed it over the bell that it might split it. Frightened by the noise of King Solomon’s messengers, he dropped the Shamir which was picked up by them and brought to the king. Ashmedai then explained the reason of his strange behaviour on the way to King Solomon. He helped the blind man because he was a pious man and he knew that he would be rewarded for it; he helped the young boy because he knew that he would be a great sinner and it was therefore desirable that he should obtain the reward for these two actions during his life time. He cried at the feast because the bridegroom would die within three days and the bride would have to wait 13 years for her brother-in-law to grow up to be her Yibom; he laughed because the man who ordered boots to last 7 years would not live seven days and he laughed at the conjuror who told the fortunes of the people because he did not know that he himself was sitting on a treasure. Whilst the Temple was being built Ashmedai was brought to King Solomon, who took off the chain and gave him his ring, in order to show him, as he said, some marvellous things. Ashmedai swallowed the ring and spread out his wings, the one touching the earth and the other the heavens, and threw the king a distance of 400 miles, who then wandered about saying, “I am Qoheleth who was king in Jerusalem.” The sages, perturbed, wished to get at the truth and they asked Ben Aya whether he had recently been summoned by the King, since Ashmedai had taken his place (assuming the form of King Solomon). They asked the women to examine the feet of Ashmedai
— 8 1
and were told that he always came in shoes, and they asked other similar questions because they were doubtful as to the genuineness of King Solomon’s being on the throne. So they gave King Solomon, who had reached Jerusalem, the ring and the chain with the divine Name upon them at the sight of which Ashmedai disappeared.