When Hezekiah Allen grew medical marijuana for California's loosely regulated market in Humboldt County, the general rule of thumb: willful ignorance. "I would spend nine months working with the plants and then they'd go into a duffel bag into someone's trunk," says Allen. "I'd have no idea where they were going."

Allen would only sell to pot brokers and dispensaries who had paperwork proving they were legal, but he says it was easy for companies to pass off as legitimate in California's gray market, a loosely regulated underground economy. The less he knew about who he sold to, says Allen, now the executive director of the California Growers Association, the less liability he assumed.

That sort of casual looking the other way by cannabis small business owners came to an end on January 1, when California became the sixth state to roll out recreational marijuana sales. Following a slew of legalization in recent years--in states including Colorado, Washington, Oregon, Alaska, and Nevada--the country's largest marijuana market is finally legal after two decades of gray market existence. Now anyone with a valid identification card over 21 years old can buy pot at adult-use dispensaries, unleashing years of pent up excitement. 

But the California legal market is dwarfed by the state's black market and could act as a reality check on the euphoria cannabis businesses are feeling in the afterglow of legalization. According to Erick Eschker, an economics professor at Humboldt State University, about $5.5 billion of California's $7.8 billion in pot sales is generated from unlicensed and unregulated growers, distributors, and dispensaries. (The remaining $2.3 billion in sales come from the medical market.)

Lori Ajax, the head of the Bureau of Cannabis Control, California's marijuana regulatory organization, says that legalization is not a "magic button" that will instantly shrink the existing black market. Ajax says it will take years of enforcement to reduce the size of California's underground cannabis economy. 

One of the biggest challenges in converting black market businesses to legal ones is cost. Nat Buttrick, the co-founder and CEO of Madrone California, a licensed collective of small cannabis farmers, says many businesses are deciding not to get permits--which can cost between $5,000 and $120,000 a year depending on the size and scope of a business--because they don't have enough crops to justify the cost. Equally, if their current parcels of land are not zoned for marijuana growing under the new rules, they don't have the resources to move.

"I am blown away by how many brands I am familiar with when I go into a dispensary that won't be there anymore," says Buttrick of the new legal reality. "There are many manufacturers that I thought had permits that actually don't have permits and now many products will be banned."

The Bureau of Cannabis Control is trying to ease this transition by offering small businesses temporary licenses, which last four months, so they can get into the legal market and then apply for an annual license. Once companies get a temporary license, they have a six-month transition period to sell their products that don't meet the regulatory standards. (In the legal market, every product must be tested, but during the grace period untested products will be allowed to be sold if they are clearly labeled, says Ajax.)

Beyond permit costs, the even bigger inhibitor is the financial reality of being part of a regulated industry. Under U.S. tax code 280e, many marijuana companies pay effective tax rates as high as 60 percent. To be compliant in California, says Steve DeAngelo, executive director of Harborside, one of the nation's largest dispensaries, they have to also "pay for security measures, mandatory product testing, licensing fees, taxes, employee benefits." In other words, these costs make it harder for legal players to compete with a black market that is perpetually undercutting them.

Just take a look at a typical harvest season, says DeAngelo. Every October, a glut of product hits the market, causing prices to drop and customers to flock to illegal product. "Harborside loses about 20 percent of our customers because prices are cheaper in the black market," he says. Now this dynamic won't just be seasonal, but a daily reality.

Prices in California's new recreational legal market are expected to initially inflate, just like they did in the early days of regulated markets in Colorado, Washington, and Oregon. The Associated Press calculated that a batch of cannabis that sold for $35 in the medical market could cost $50 to $60 in the recreational market--a 70 percent increase. Part of the price increase is because a 15-percent state tax, plus an additional 7.5 percent city sales tax on each purchase. Eventually, as the legal market matures and supply and demand increase, prices will drop. According to Cy Scott, the founder of Headset, a marijuana data company, prices dropped in Washington's legal market from $50 to $15 for a gram of marijuana about 12 months after the first day of legal sales. 

An inevitable byproduct of all this is that legal dispensaries may not actually have enough product to sell, further exacerbating price increases. DeAngelo says if thousands of California marijuana growers and product manufacturers don't get licenses, there will be a damaging ripple effect. "You will see the pool of available material shrink by a factor of ten," he warns. "Manufacturers and extractors will become distressed, you will have a sharp reduction in supply to dispensaries and this will lead to price increases. Dispensaries that do not have a well-developed supply chain may find their shelves largely bare."

The best way out of this cycle, says BBC's Ajax, is for customers to recognize the value of purchasing regulated, lab-tested products--and eventually demand it.

So, how long will this take to happen? It depends on who you ask. Humboldt State's Eschker estimates that about half of the total black market sales in California will convert to legal sales in the recreational market in the next year. Others believe the black market won't disappear until national legalization, which was served a blow today when Attorney General Jeff Sessions rescinded an Obama-era policy that allowed the state-regulated marijuana markets to flourish.

But if California follows the pattern of other already legalized states, says John Hudak, deputy director of the Center for Effective Public Policy at the Brookings Institute, California's black market should be substantially smaller in five years. "There is suggestive evidence in Colorado and Washington," he says, "that the black market is decreasing."