“Prohibition is about to pop. And the people that were here before, if they’re positioned intelligently, will reap a profit. I think we’re positioned really well,” Mr. Hartfield says.

In the 1920s and early 1930s, risk-takers who invested in alcohol while it was still underground hit the jackpot when it was legalized. Joseph Kennedy secured “medicinal liquor” permits during Prohibition and in the months before the anti-alcohol law was repealed in 1933 he secured the exclusive import rights to popular liquor brands like Dewar’s whisky and Gordon’s gin.

As states legalize marijuana, Mr. Hartfield is executing an Internet-age version of that strategy: He’s building and investing in some of the country’s leading marijuana-technology companies. He wants to do everything from providing pot-quality evaluations for the cannabis connoisseur to, eventually, selling the plant itself. “Marijuana is not going to be profitable to make in the long term, it’s going to be a dollar a gram. And so someone . . . needs to step in and make it profitable to grow,” he says. “I’m the best guy to do it.” …

He’s betting on it. And he has situated himself in the sweet spot of the conflicting legal regimes hanging over this rapidly expanding gray market.