Mandy Aftel, a Berkeley, California-based perfumist, is rarely at a loss for words when describing ambergris, one of the coveted ingredients she uses in her fragrances. “It’s beyond comprehension how beautiful it is,” she says. “It’s transformative. There’s a shimmering quality to it. It reflects light with its smell. It’s like an olfactory gemstone.” It’s a generous description for something that’s essentially dried whale dung.

Aftel isn’t just an eccentric with weird tastes. Ambergris, a waxy excretion formed in the intestines of sperm whales (thanks to their inability to digest squid beaks), is one of the most sought-after substances in the world, almost as valuable as gold. (Ambergris sells for roughly $20 a gram, slightly less than gold at $30 a gram.) For the last thousand-plus years, ambergris has been credited with everything from a cure for pestilence to, according to 10th century Muslim trader Ibn Hawqal, an aphrodisiac. In the 1851 whaling novel Moby-Dick, Herman Melville claimed that ambergris, “an essence found in the inglorious bowels of a sick whale,” was “largely used in perfumery, in pastiles, precious candles, hair powders, and pomatum.” More recently, it’s been used in overpriced delicacies — like the $4700 mince pie created last month for charity by U.K. food designer Andrew Stellitano — and even more overpriced perfumes — in 2005, a 200-year old fragrance originally made for Marie Antoinette, which featured ambergris as a main ingredient, was reproduced in limited quantities for just $11,000 a bottle.

Ambergris has made the occasional beachcomber rich, as it did just a few years ago when 40 kilograms of ambergris was discovered on the North Island of New Zealand, rumored to net $400,000 for the yucky finders. Adrienne Beuse, the owner of New Zealand-based Ambergris Essentials Ltd., an international trader of raw ambergris, claims that it’s one of the few recession-proof commodities. “If I have the supply,” she says. “I’ll always be able to sell it.” Marketing is unnecessary, as she does a brisk business almost entirely with word-of-mouth. The moment she has ambergris in stock, she says, she has buyers knocking on her door.

Despite (or perhaps because of) the money involved, it’s also an industry shrouded in secrecy. Chris Kemp, a neuroscientist from Grand Rapids, Michigan, spent years investigating the ambergris trade, documented in his upcoming book Floating Gold: A Natural (and Unnatural) History of Ambergris (published by the University of Chicago Press in May 2012). “If you believe what you read in the media,” he says, “you’d think ambergris is something that people just find by accident.” But that’s only half the story, he claims, and the truth is far more clandestine and, yes, dangerous. “There’s a whole underground network of full time collectors and dealers trying to make their fortune in ambergris,” he claims. “They know the beaches and the precise weather conditions necessary for ambergris to wash up on the shore.” And when whale poop gold is on the line, he says, “it can get violent.”

How violent? Occasionally they’ve tried to kill each other. Several years ago, Ross Sherman, a longtime ambergris collector in New Zealand, was hit by a car on Baylys Beach, driven by one of his main competitors, John James Vodanovich. Sherman fought back with a PVC pipe and escaped with minor injuries. A court case soon followed, in which neither man denied many details of the hit-and-run incident other than what they were both actually doing at the beach. According to the New Zealand Herald, Sherman was purportedly “kite-fishing” and Vodanovich was identified as a “self-employed seaweed gatherer.”

Beuse, who employs what she calls “dedicated collectors and beach combers” to supply her with ambergris, isn’t surprised by the territorial aggression. “There aren’t too many professions where you could go to work and stumble upon $30,000 one morning,” she says. “It doesn’t happen every day, but it does happen.” To outsiders, it may seem like easy money — ambergris can wash ashore anywhere there are sperm whales, which is pretty much every ocean shoreline — but identifying ambergris is often an exercise in futility. Genuine ambergris, depending on how long it’s been in the ocean, can be white, gray, or black. According to Kemp, who has been studying and searching for ambergris since 2008, some truly strange things have been mistaken for ambergris, like dog feces, rotting seagulls, industrial waste, old whale blubber, eroded rubber, and at least one decomposed sheep carcass. Many ambergris hunters don’t even know which whale orifice it comes from. “Despite what most people think, it’s not vomit,” Kemp says. “That’s one of the biggest misnomers about ambergris. Unfortunately, it comes out the other end.”

The easiest way to identify ambergris is by smell. Young ambergris, straight out of the whale, has an odor that’s often described as “scented cow dung.” But after floating in the salty ocean for decades or more, it can take on a very different odor, described as reminiscent of tobacco, Brazil nuts, a fern copse, or the wood in old churches, among many other comparisons. “The problem with trying to describe the smell of ambergris,” says Kemp, “is that it really only smells like ambergris.” When used in perfumes, it’s rarely the dominant scent. Ambergris is more often used as a fixative and exultant. “It doesn’t really change the note or scent with it’s own fragrance,” says Douglas Stewart, a perfume chemist at Scentsual Antiquities, a supply house based in Salt Lake City, Utah that sells ambergris to perfumers. “Rather, it alters the quality of the existing notes and makes them bigger, deeper and more expansive than they can ever be on their own.”

Comparisons to the California gold rush of the nineteenth century aren’t just hyperbole. The chances of finding ambergris on an ocean beach are about as good as panning for gold in a mountain creek. Beuse says there’s an inherent tension in making your living from ambergris because so much of it is out of your control. “You’re dealing in a product that’s totally dependent on natural supply,” she says. “It doesn’t matter if there’s a greater demand this year or next year, we can’t produce another 10,000 units. We might like the whales to produce another 10,000 units, but there’s nothing we can do about it.” Even if it is produced, there’s no guarantee that any of the ambergris will actually be found.

And then, of course, there’s the small problem that ambergris might technically be against the law.

Ask anybody with a vested interested in ambergris about its legality and you’re likely to get a different answer every time. Chandler Burr, the curator of the Department of Olfactory Art at the Museum of Arts and Design in New York City, claims there is “an unofficial ban on using anything from an animal,” so most perfume houses use synthetic ambergris compounds like Ambrox. “Nobody uses natural ambergris anymore,” he insists. Dominique Dubrana, a Frenchman living in Italy who sells original scents and perfume ingredients on his website, profumo.it, has a very different take. “I am selling ambergris,” he says in response to Burr. “And it is not illegal except in Australia.” Derek Brown, a cocktail blogger and co-owner of Washington D.C.’s posh Columbia Room bar, which occasionally serves drinks with ambergris, is fairly certain that the laws regarding ambergris “are ambiguous. My understanding is that sperm whale products are banned but there’s a loop hole. Waste products are fair game.” Michael Payne at the National Marine Fisheries Service, a U.S. federal agency in Silver Spring, Maryland, says that the Endangered Species Act of 1973 is far from ambiguous. “It’s illegal to possess ambergris in any form, for any reason,” he says, which includes not only commercial use, but something as seemingly innocent as picking up a rock of ambergris on the beach. “I wouldn’t recommend it,” Payne says. However, there isn’t a lot of precedent for prosecution. “I know we’ve issued warning letters,” Payne says. “It was probably a very long time ago. It hasn’t been since 1990.”

It explains why top perfume houses, either based in or with a large market in the United States, have either stopped using ambergris as an ingredient or stopped talking about it. Chanel No. 5, one of the most successful and legendary perfumes in the world, rumored to bring in sales of $100 million annually, may have once contained ambergris or still does, depending on who you ask. Tilar Maze, the author of The Secret of Chanel No. 5: The Intimate History of the World’s Most Famous Perfume, says that “historically Chanel No. 5 certainly did use ambergris.” The original formula leaked in the 1930s, she says, and “the copies I have seen include ambergris or ambrein — the essential scent element of ambergris — as an ingredient.” Not so, says Philip Kraft, a German chemist who creates scents for Givaudan, a Swiss manufacturer of fragrances. “There never was any ambergris in Chanel No. 5,” he says. “Not in the formula from 1921, nor in the one of today. There’s even no ambrox (the ambergris synthetic) in No. 5.” A representative from Chanel declined to comment for this story.

Kemp, while researching his book on ambergris, spoke with a French trader named Bernard Perrin who told a very different story. When asked if he sold ambergris to established perfumeries like Chanel, he responded, according to Kemp’s account in Floating Gold, with “Indirectly, yes. These people, they have their own in-between men. It’s a bit complicated, but we have sold; in France we are selling through an agent. You know, to sell to Chanel, Guerlain, you need a special contact. They will buy ten or twenty kilos at a time, but they are very selective. They will buy top quality, and they will choose from the stock you have.” When Kemp tried to contact him a second time, Perrin was suddenly tight-lipped and unresponsive. Kemp suspects that Perrin regretted talking to him at all. “He was probably asking himself, ‘Did I say too much?’” (We contacted Perrin for confirmation and he insisted “I do not sell any ambergris to Chanel and Guerlain.” He also complained that because of the rising backlash against ambergris, perfumery houses globally are beginning to ban animal items. “The future world will bring vegetarian perfumes smelling of carrots or potatoes,” he says.)

One industry insider, the vice president of fragrance ingredients for a supplier of raw perfume materials based in Oakland, New Jersey was willing to speak on the record, only to realize in hindsight that maybe it was a mistake. (He’d been “instructed,” he told us, that we were not welcome to use his name or the company’s name.) Prior to his change of heart, he admitted that “Ambergris is something that I source and provide to perfumers. But we have a limited availability.” He couldn’t take his ambergris to a company like L’oreal or Estee Lauder, he said, because “I wouldn’t be able to supply them with the volume they need.” Later in our conversation, he began to backpedal. “To be honest with you, if we sell… we hardly sell any ambergris. That’s not something that we try to develop as a steady business. It’s highly unreliable.” And then, a few minutes later, a full 180 degree turn. “We don’t offer ambergris at all,” he said definitively.

Perfume companies, with their intricate fabric of deniability, are hardly the only market for ambergris. Adam Stanhope of Kingston, Massachusetts, an importer of Chinese medicinal herbs, says he’s involved in a complicated sale of ambergris he’s only seen in photos. Several years ago, after authoring the Wikipedia article about Ambrein (the chief constituent of ambergris), he was contacted by a “representative” of a village in the Solomon Islands. “They’d accumulated quite a bit of ambergris,” Stanhope says. And they needed his help selling it to brokers in Singapore who would in turn sell it to Gulf Arab states like Dubai. “I’m not entirely sure what they’re using it for,” he says. “I think it ultimately ends up being part of an aphrodisiac. But is it also a fragrance? Is it something that’s consumed? I have no idea.” The only thing he is certain about is his percentage of the profits, which he won’t reveal. “It’s an amazing price for something that washes up on the beach,” he says.

Anybody outside the ambergris trade, and even a few of those within it, may never get a full picture of how the industry works. Mandy Aftel, when talking about ambergris and perfume makers, uses variations on the word “mystery” no less than a dozen times. “There is a lot of mystery to it,” she explains. “It’s mysterious in a lot of ways. It’s very… mysterious.” And she doesn’t always paint a flattering portrait of her colleagues. “Be careful who you talk to,” she says, after asking who else had been contacted for this story. “Some of them are nuts.”

(This story originally appeared, in a slightly different form, in the January 13th, 2012 issue of Bloomberg Businessweek.)