It was taught: One may not write upon these stones [of the breastplate] with ink, because it is said, "engravings of a signet" (Exodus 28:11), and one may not score them with a chisel, because it is said, "in their fullness" (Exodus 28:20) [they must lose nothing of their substance]. Rather, one writes upon them with ink and shows them the shamir from the outside, and they split open of their own accord, like a fig that splits in the summer days and loses nothing, and like a valley that cracks in the rainy season and loses nothing. Our Rabbis taught: This shamir, its creation is like that of a barley grain, and it was created during the seven days of Creation, and no hard thing can stand before it. With what do they keep it? They wrap it in sponges of wool and place it in a leaden tube full of bran and barley.
The Shamir Worm That Splits the Priestly Breastplate Stones
Yalkut Shimoni on Torah 379:4
(שמות כח י-יא) תַּנְיָא. אֲבָנִים הַלָּלוּ אֵין כּוֹתְבִין עֲלֵיהֶן בִּדְיוֹ, [מִשּׁוּם שֶׁנֶּאֱמַר פִתּוּחֵי חוֹתָם], וְאֵין מְסַרְטִין עֲלֵיהֶן בְּאִיזְמֵל, מִשּׁוּם שֶׁנֶּאֱמַר (להלן פסוק כ) בְּמִלּוֹאֹתָם, אֶלָּא כּוֹתֵב עֲלֵיהֶם בִּדְיוֹ וּמַרְאֶה לָהֶם שָׁמִיר מִבַּחוּץ, וְהֵן נִבְקָעוֹת מֵאֲלֵיהֶן, כִּתְאֵנָה שֶׁנִּבְקַעַת לִימוֹת הַחַמָּה וְאֵינָהּ חֲסֵרָה כְּלוּם, וּכְבִקְעָה זוֹ, שֶׁנִּבְקַעַת בִּימוֹת הַגְּשָׁמִים וְאֵינָהּ חֲסֵרָה כְּלוּם. תָּנוּ רַבָּנָן. שָׁמִיר זֶה בְּרִיָּתוֹ כִּשְׂעוֹרָה, וּמִשִּׁבְעַת יְמֵי בְּרֵאשִׁית נִבְרָא, וְאֵין כָּל דָּבָר קָשֶׁה יָכוֹל לַעֲמֹד לְפָנָיו. בַּמֶּה מְשַׁמְּרִין אוֹתוֹ, בִּסְפוֹגִין שֶׁל צֶמֶר וּמַנִּיחִין אוֹתוֹ בְּאוֹטְנִי שֶׁל אֲבָר מְלֵאָה סֻבִּין וּשְׂעוֹרִין.