When whales eat things that are indigestible like the beaks of squid or clamshells, their bodies create a sticky goo to coat the foreign objects, protecting the whale’s inner organs. The whales can regurgitate or defecate out pieces that are as big as 50 pounds, and the larger pieces tend to come out of the whale’s mouth. Ancient Egyptians are said to have burned ambergris–which melts at a high temperature–as incense, and during the Middle Ages the mysterious substance was said to ward off the Black Death.

Sperm whales are endangered and gathering their upchuck is difficult.

Around the world ambergris has been used as an aphrodisiac, medicine, and perfume ingredient, and it’s nearly worth its weight in gold (gold sells for about $30 an ounce, the whale vomit for $20 an ounce). Natural ambergris has a funky marine odor when it’s newly produced from either end of the whale (marine biologists compare it to cow dung) but takes on a musky, earthy smell when it ages. Ambergris hunters span the globe, from Cape Cod to New Zealand, scouring beaches to look for a hunk of floating whale-wax. That’s because today it’s most commonly encountered in perfume, as a fixative, retaining fragrance onto skin for a long period of time.

The problem, of course, is that sperm whales are endangered and gathering their upchuck is difficult. That has pushed scientists to come up with a synthetic alternative to whale vomit. A synthetic replacement called Ambrox is derived from balsam fir trees and has mixed results–making Ambrox in the lab typically creates only about 30% usable material, and 70% by-product.

Help could be on the way, though. Researchers at the University of British Columbia have come up with a way to trick yeast into producing a synthetic replacement chemical, called cis-abienol. Their results were published in the Journal of Biological Chemistry earlier this year. The researchers say that by creating the synthetic substitute in yeast, it could cut down on sperm whale poaching and bring a more sustainable product on the market.

One marine biologist has estimated that ambergris is even more precious than previously thought, occurring in only one out of every 100 sperm whales. Why so few? The biologist explains that sperm whales have four stomachs, and most of the food can be found in the first two; by the time the food reaches the last one, it is supposed to be liquid. But in some whales, a faulty system may pass indigestible material onward to the intestine, where they compact into a ball and are covered by ambergris. In his research, the biologist describes the smell as akin to Brazil nuts. Now that scent may be created in a more sustainable way.