Solomon's shamir

In the Gemara, the shamir ( šāmīr) is a worm or a substance that had the power to cut through or disintegrate stone, iron and diamond. King Solomon is said to have used it in the building of the first Temple in Jerusalem in place of cutting tools. For the construction of the Temple in Jerusalem, which promoted peace, it was inappropriate to use tools that could also cause war and bloodshed.

Referenced throughout the Talmud and midrashim, the Shamir was reputed to have existed in the time of Moses as one of the ten wonders created on the eve of the first Shabbat just before God finished creation. Moses reputedly used the Shamir to engrave the stones of the priestly breastplate of the High Priest of Israel.

The Temple
King Solomon, aware of the existence of the Shamir but unaware of its location, commissioned a search that turned up a "grain of Shamir the size of a barleycorn." Solomon's artisans reputedly used the Shamir in the construction of the Temple. The material to be worked, whether stone, wood or metal, was affected by being "shown to the Shamir." Following this line of logic (anything that can be 'shown' something must have eyes to see), early Rabbinical scholars described the Shamir almost as a living being. Other early sources, however, describe it as a green stone. This is supported by contemporary scholars who believe that the Shamir was emery, a blue-green stone mined as an abrasive powder for thousands of years. The word emery comes from, which likely shares the same root as the Semitic shamir.

For storage, the Shamir was meant to have been always wrapped in wool and stored in a container made of lead; any other vessel would burst and disintegrate under the Shamir's gaze. The Shamir was said to have been either lost or had lost its potency (along with the "dripping of the honeycomb") by the time of the destruction of the First Temple during the 587 BCE Siege of Jerusalem.

Asmodeus
According to the Asmodeus legend from the Mishnah, the location of the Shamir was told to King Solomon by Asmodeus, who Solomon captured. The Shamir was under the care of a bird, who had been granted it by Rahab, the angel of the sea. Solomon then sent his trusted aide Benaiah on a quest to retrieve it.

Gemstones
King Solomon also used the Shamir to engrave gemstones. He also used the blood of the Shamir worm to make carved jewels with a mystical seal or design. According to an interview with George Frederick Kunz, an expert in gemstone and jewelry lore, this led to the belief that gemstones so engraved would have magical virtues, and they often also ended up with their own powers or guardian angel associated with either the gem or the precisely engraved gemstones.

In Islam
The Quran mentions a creature thought to be the Shamir, when pointing out the ignorance of the jinn who worked for Solomon concerning the occult, and emphasizing that all knowledge rests only with God:

"And when We decreed death for him, nothing showed his death to them save a creeping creature of the earth which gnawed away his staff. And when he fell, the jinn saw clearly how, if they had known the Unseen, they would not have continued in despised toil.Saba' 34:14"

According to commentators such as ibn Abbas, when Solomon died his body remained leaning on his staff for a long time, nearly a year, until "a creature of the earth, which was a kind of worm," gnawed through the stick weakening it and the body fell to the ground. It was then that the jinn knew that he had died a long time before and until then they were working hard thinking he was supervising them. It also became clear to humans who divined and engaged in occult activities or spirit-consulting, or worshiped the jinn, that they do not possess knowledge of the occult.

In popular culture

 * Leonard Tushnet's story "The Worm Shamir", published in the December 1968 issue of Fantasy & Science Fiction, retells the legend in modern, quasi-scientific terms.
 * In The Secret Saturdays, shamir are centipede-like creatures V. V. Argost uses to clean and repair his mansion.