On an early September morning, six weeks before Canada would become the first Group of Seven country to legalize recreational marijuana, construction workers in Edmonton, Alta., were rushing to convert a former Dairy Queen into an “experiential” cannabis store. Municipal rules dictate that the storefront can’t sell pot because it’s too close to another outlet, but Alcanna Inc., a liquor and cannabis retailer that’s 25 per cent owned by Aurora Cannabis Inc., has gotten creative. They envisioned a “safe space” where people—high or sober—can learn about cannabis, do yoga, and maybe even join a knitting class.

Legalization is the result of an impromptu comment by Justin Trudeau at a 2013 rally. He pointed out a sign calling for decriminalization and took it a step further, catching some members of his own party off guard. “I’m actually not in favor of decriminalizing cannabis, I’m in favor of legalizing it. Tax and regulate,” Trudeau, then leader of the Liberal Party, told the cheering crowd in British Columbia.

Medical marijuana has been legal in Canada since 2001, but legal recreational use took longer to catch on. Attempts to decriminalize possession died in the early 2000s, but public attitudes were changing. In an April 2017 poll by Forum Research Inc., 53 per cent of Canadians agreed that marijuana should be legal in the country. Last year, Trudeau’s government introduced legislation to allow recreational use, and on Oct. 17, Canada will join Uruguay as one of only two countries in the world to legalize pot nationally.

Canada is the undisputed front-runner in the global cannabis industry, estimated to reach $32 billion in consumer spending by 2022, according to Arcview Market Research and BDS Analytics. This is in large part because marijuana remains federally illegal in the U.S., restricting banks, investors, and stock exchanges from participating in the sector. In an echo of Prohibition, when Canadian companies such as Seagram Co. flourished, Canada’s stock exchanges have become the go-to for American cannabis companies. The country’s investment bankers do most of the industry’s deals, and Canada has developed some of the most advanced technology and the largest growing operations. Today, the country boasts about 135 publicly traded companies with a combined market value of more than $60 billion (US$46.1 billon), including dozens of U.S.-focused producers that can’t legally list in their home country.

“We’re the godfather of legal cannabis,” says Cam Battley, chief corporate officer at Aurora Cannabis. “This is a very unusual situation in that you’re going to see a handful of leading Canadian companies define the birth of a global industry.”

In August, Canopy Growth Corp., the second-largest cannabis company with a market value of more than $14 billion announced the industry’s biggest deal yet, with a $3.8 billion investment from Corona beer maker Constellation Brands Inc., initiating a stock rally across the sector. Canopy is already the biggest licensed producer in Canada, with 4.3 million square feet of growing space and more than a third of the country’s disclosed supply contracts for recreational pot. It plans to enter the U.S. market as soon as cannabis becomes federally legal, Chief Executive Bruce Linton has said.

Investment bankers at smaller Canadian firms have ridden the wave of investor mania that’s generated comparisons to the dot-com bubble. Canaccord Genuity Group Inc., which made its name in the mining and energy sectors, now says cannabis is its largest Canadian business. “If you’re looking for federal buy-in and federal support, Canada is really the only place to be,” says Graham Saunders, head of origination at Canaccord.

WEIGH IN Would you switch jobs for an opportunity in the cannabis industry? Results Total Results: 0

Back in Edmonton, Alcanna was carefully designing and constructing their stores to comply with a long list of federal, provincial, and municipal regulations. These dictate that stores selling marijuana require frosted windows and product vaults, evoking the days when beer was hidden in backrooms; sales staff aren’t allowed to promote products as having medical benefits or inducing certain feelings. Small jars of cannabis will be permitted on the floor for customers to sniff, but their contents must then be disposed of in kitty litter, so no one can dig the samples out of the garbage and smoke them.

This cautious approach to legalization may set the course for the rest of the world. “The regulation is tough, it’s protective to the industry,” says former Mexican President Vicente Fox, who sits on the board of Vancouver-based cannabis company Khiron Life Sciences Corp. “Canada is leading the world on this paradigmatic change, taking this plant away from the bad hombres and putting it in the hands of the good men, the authorities, the regulators.”

The challenge for Canada will be maintaining its early-mover advantage. The country that brought the world BlackBerry knows what it’s like to lose a global leader. If the U.S. government legalizes marijuana, Canada’s stock exchanges and banks will have to contend with bigger, more prestigious competitors and a market with 10 times the population. “The only way it’s going to last is intellectual property,” says Linton. Canopy has filed 39 applications for patents on cannabis-derived drugs to treat everything from insomnia to canine anxiety. “The moat is going to be how many patents can you create and validate and control before the rest of the world gets there?”

Cannabis Canada is BNN Bloomberg’s in-depth series exploring the stunning formation of the entirely new – and controversial – Canadian recreational marijuana industry. Read more from the special series here and subscribe to our Cannabis Canada newsletter to have the latest marijuana news delivered directly to your inbox every day.