Aaron Shamo was a bitcoin millionaire. The 28-year-old former Eagle Scout was an early convert to cryptocurrency, a digital form of money that exists independently of any country or central bank. He began hunting for — or "mining" — bitcoin soon after it was created in 2009, while he was still a student at Utah Valley University. He stockpiled bitcoin even as he worked at outposts of Apple and eBay in Utah over the next few years. And when the crypto craze erupted on Wall Street last year, Shamo appeared to have placed an expert bet. The value of his holdings shot from about $767,000 to at least $10 million over the course of a year. But Shamo was not an investor or day trader. Instead, federal authorities say he built his wealth by harnessing the dark side of digital currency — using it to fund a vast underground marketplace of illegal activity. Shamo is accused of trafficking the deadly opioid fentanyl and financing the operation with bitcoin. Law enforcement uncovered more than 500 bitcoin after raiding his house in 2016. Shamo is now in prison awaiting trial, and prosecutors said they are investigating 28 fatal overdoses in connection with his alleged drug ring. "They were entrepreneurs," his attorney, Greg Skordas, said of Shamo and five friends charged in the case. "They were looking for ways to make money, to do things, to be creative. They are alleged to have gotten into a very dark hole."

Mugshot of Aaron Shamo. Source: Salt Lake County Sheriff's Office

Authorities say Shamo is part of a new generation of criminals who buy and sell drugs online — and cover their tracks with cryptocurrencies. They've turned the internet into one of the main arteries for fentanyl traveling into the United States, according to officials. Nearly 20,000 people died after overdosing on fentanyl in 2016, data from the Center for Disease Control shows, contributing to one of the worst drug epidemics in a generation. "You can order illicit opioids right online and have them delivered right to the comfort of your living room," said Greg Nevano, deputy assistant director of Homeland Security Investigations.

'The currency of choice for these drug traffickers'

The e-mail from the fentanyl dealer arrived with an important message for potential buyers. "We have switched to bitcoin payments only. Now you will enjoy a 10 percent less price tag on all products," it read. The dealer added, "Good part is that paying by bitcoin you can order as much as you like with no limit." The message was sent to undercover investigators working for a Senate committee led by Ohio Republican Rob Portman, whose state is suffering from one of the highest rates of fentanyl overdose deaths in the country. It was part of a yearlong inquiry into the international supply chain that funnels fentanyl from China to homes across America. The name of the dealer was redacted. The committee's report, released early this year, tracked activity on six websites offering fentanyl, including 300 potential users and seven overdose deaths connected with the sales. In each case, the sites listed bitcoin as the preferred method of payment. "Because it's anonymous, it's the currency of choice for these drug traffickers," Portman said.

Sen. Rob Portman Karen James Sloan | CNBC

Bitcoin used to be a currency for computer geeks. Invented in 2009 — exactly by whom remains shrouded in mystery — it was designed to be a truly free-market currency, without any company, country or central bank controlling its value or supply. Each bitcoin exists only as a virtual token, and all transactions are recorded in an open public ledger known as the blockchain. Yet while bitcoin transactions are public, bitcoin ownership is not. Each token is stored in a digital wallet identified only by a string of numbers and letters. Users do not always have to provide personal information to sign up for a wallet. The anonymity of bitcoin and similar cryptocurrencies has made them popular on the so-called dark web, an encrypted layer of the internet where criminals conduct their business freely. Authorities have been playing cat-and-mouse with dark web marketplaces for years. The Silk Road, which was taken down in 2013, featured listings not only for drugs, but also for hackers, malware and forged documents. Last fall, the Justice Department shut down AlphaBay, another illicit marketplace, collecting $48 million from about 144,000 seized bitcoins.

Fentanyl for sale via the dark web. Karen James Sloan | CNBC

Marijuana, ecstasy and cocaine make up the majority of the drugs sold on the dark web, according to Nicolas Christin, a computer science professor at Carnegie Mellon University. But the rapid rise of fentanyl — and the subsequent spike in overdose deaths — have transformed the long-running war on online drugs sales into a full-blown crisis. "That's where we have to, obviously, try to up our game and be as savvy — if not more savvy — than the criminal enterprise involved in this," said Homeland Security's Nevano.

A low-tech loophole at the post office

Shamo allegedly ordered his fentanyl from China, where authorities believe the purest — and deadliest — form of the drug is manufactured. A fine white powder, fentanyl is easy to ship and is 50 to 100 times more powerful than morphine. Just a few flakes can be fatal. One of the primary ports of entry is the sprawling U.S. mail facility at JFK Airport in New York. About a million packages arrive daily from overseas. Customs and Border Patrol officers must search suspicious packages largely by hand, with the help of an X-ray machine or drug-sniffing dogs. In fiscal year 2016, CBP found seven shipments of fentanyl at the airport. Last year, the number jumped to 86. In the first few months of fiscal 2018, seizures soared to 146. "As long as we keep finding stuff, we know it's still out there," said Frank Russo, CBP's port director at the airport. Authorities say the high-tech criminals using cryptocurrencies to buy drugs online are exploiting a low-tech loophole in the international mail system to ship them to America. The U.S. Postal Service is is not required to collect information on who is sending the package or what's in it — information that private carriers such as FedEx and UPS must provide. USPS spokesman Dave Partenheimer said the agency receives so-called advanced electronic data for about 40 percent of packages. He also pointed out that the office's international seizures of opioids, including fentanyl, jumped 375 percent from fiscal years 2016 to 2017. The agency said it is working with foreign governments to improve data collection.

A Customs and Border Patrol agent and dog search mail packages for opioids. Karen James Sloan | CNBC

In the meantime, law enforcement officials argue that lack of information makes it easy for fentanyl to slip through the system hidden in everything from teddy bears to fake pregnancy test kits — and makes it difficult to track down suspicious packages and identify repeat offenders. Shamo used the fentanyl he purchased from China to manufacture fake oxycodone tablets, according to court documents. He allegedly sold some on the dark web, and Shamo turned to the U.S. mail to ship pills to buyers from North Carolina to New York, court documents show. "The mailman ends up being the drug carrier," Russo said. "Not because he wants to be, but because that's just the way it's going."

'Cryptocurrencies do not kill people'

The first things police seized when they raided Shamo's home and stash house were bags of cash, gold bars, a Ford pickup and a BMW. It took another year for his bitcoin to show up in court paper. "It's really been a process that we've never dealt with before," said Skordas, Shamo's attorney. "I'm old enough to remember when we did everything with cash." In Washington, lawmakers and federal authorities believe stopping the flow of fentanyl means cracking down on cryptocurrencies as well. A bipartisan bill from Sens. Chuck Grassley, R-Iowa, and Dianne Feinstein, D-Calif., would create new language explicitly requiring digital currencies to comply with laws against money laundering. Attorney General Jeff Sessions has called the use of bitcoin on the dark web "a big problem." Earlier this year, he launched a task force targeting fentanyl sales over the internet. "It will help us make more arrests of those selling these deadly substances online as well as shut down the marketplaces that these drug dealers use — and ultimately help us reduce addiction and overdoses in this community and across the nation," Sessions said in January during a speech in Pennsylvania. But crypto advocates argue that digital currencies are getting unnecessarily swept up in the rush to find a solution. "Cryptocurrencies do not kill people. Opiates are killing tens of thousands of people a year," said Perianne Boring, president of the Chamber of Digital Commerce. "Blaming bitcoin for this crisis would make as much sense as blaming the internet or cars that drug traffickers have to use." Bitcoin users are not anonymous, industry groups say. They're "pseudononymous": Buying bitcoin requires real money. Many users convert that cash through cryptocurrency exchangers that collect personal information. And they have to change their bitcoin back to real money once they're ready to spend it. That's where law enforcement can swoop in. "One of the things we look for are pressure points," said a Justice Department official, who requested anonymity to protect ongoing investigations. "At some point, bitcoin is only as good as where you can spend it. You look at where the currency enters the mainstream financial system in order to get spent."

Karen James Sloan | CNBC

U.S. cryptocurrency exchangers are also subject to federal reporting requirements and laws against money laundering. Boring's organization launched a working group of more than two dozen companies called the Blockchain Alliance to help authorities combat crime. An industry analysis released this year by the Foundation for Defense of Democracies, a foreign policy think tank, found less than 1 percent of bitcoin is used for illegal purposes. However, the report also found that almost all of the illicit activity came from transactions on the dark web. It detailed the ways criminals can avoid regulated currency exchangers, such as using foreign converters or "mixing" sites that allow users to swap bitcoin. Meanwhile, new cryptocurrencies, such as monero, are growing in popularity — and they're even harder to trace. "Better privacy may be a critical feature for legal cryptocurrency use to grow, but this must be balanced with the need for law enforcement to be able to trace transactions in some circumstances," the report concludes. Some crypto companies are urging the industry to take a harder look at its own practices. Canadian-based Einstein Exchange maintains a physical headquarters where customers can convert their digital currency in person. They verify all of their customers' personal information and are pushing for the creation of an international black list of bad actors. "We care because our loved ones, our relatives — people we know — their relatives are also dying from fentanyl overdoses," Einstein Exchange CEO Michael Gokturk said. "We want to play our part."

Millions of dollars in limbo

When Aaron Shamo was arrested in 2016, his bitcoins were worth about $750 each. The price skyrocketed while he sat in jail to a high of more than $19,000 each — earning Shamo about $10 million, at least on paper. That's when Uncle Sam intervened. "The government was, first of all, nervous that they would disappear," said Skordas. "And second, they were anxious to liquidate them when the market was so incredibly high." Typically, the federal government waits until after a conviction to liquidate a defendant's assets. But when authorities asked to auction off Shamo's bitcoins before his trial, Skordas said his client agreed to foster goodwill.

Fentanyl seized at a postal facility. Karen James Sloan | CNBC