Just two years after two friends cooked up the idea while they shared a joint, MassRoots, a social network for cannabis users, is now being publicly traded as a penny stock. The company's public offering follows 22-year-old co-founders Isaac Dietrich and Tyler Knight's successful battle with Apple's App Store to get their free app on smartphones in the 23 states where marijuana is legal.

MassRoots, headquartered in Denver, bills itself as the Instagram for cannabis users, by cannabis users. Its app allows its 275,000 semi-anonymous users to post pictures of themselves smoking marijuana without the potential repercussions of doing so on conventional social sites.

"The whole point is that we don't want our grandmothers to see us taking bong rips on Facebook," says Dietrich, who is also the CEO.

Dietrich skipped college to go into politics, working on getting Republican candidates elected to Congress in his home state of Virginia. But that night in April 2013, when he and Knight were smoking in Knight's apartment, he decided to go in a much different direction. The two realized all of their friends who used cannabis didn't post pictures of themselves partaking, but would if they had a safe environment to do so. "We need to start a social network," they agreed.

Knight dropped out of Old Dominion University, and Dietrich borrowed $17,000 on his credit cards to start the business. They also persuaded friends Hyler and Stewart Fortier to join, and over a three-month period got a buggy version of their app onto the App Store. After another two months, they had 6,500 users, which got them $150,000 in funding from the cannabis angel investor network ArcView Group.

By March 2014, they had hit their goal of 100,000 users and raised a $475,000 Series A round at a $5 million valuation from investors like Tripp Keber of edibles company Dixie Elixirs, and Emily Paxhia, co-founder of Poseidon Asset Management. Later that year they raised a $850,000 Series B round at a $25 million valuation, and filed their S-1.

MassRoots might sound like a company of twentysomething stoners who want only to take selfies with a blunt in their mouths, but the app is actually useful for businesses. "Currently, Google, Twitter, and Facebook ban most marijuana-related advertising. Dispensaries are solely relying on specific magazines and newspapers, so we are one of the only places businesses can access active smokers," Dietrich says. "Facebook and Instagram are deleting dispensary pages after they get too big. ...We're a great way for dispensaries to post updates and establish a following that will not one day disappear."

MassRoots allows companies to sponsor posts in users' news feeds, like other businesses do on Facebook. "We're not trying to recreate the wheel here. We're just trying to use methods proven in other industries and applying them to the cannabis industry," Dietrich says.

When regulations on online purchasing and delivery are established, MassRoots will add functionality to the app so users can go to a dispensary's profile, scroll through its menu, and place an order through the app.

MassRoots' rapid growth has not been without problems, however. Days before the company went public on April 9, the founders were told their bank would no longer provide them with services. After a scramble, Dietrich now has found a new bank that will accept the company's business. Below, find out what other obstacles the team had to overcome before going public.

Fight for your right to post selfies.

After the company filed its S-1, Apple pulled the app from the App Store and created a policy prohibiting all cannabis apps. To combat the policy, the co-founders, all of whom had worked on political campaigns, used what they had learned.

"As you have a community of hundreds of thousands of like-minded people, those people talk to each other and can be organized behind central goals to help move the industry forward. Our App Store campaign was kind of our first foray into activism and motivating our community to take action," Dietrich says.

Every day, MassRoots sent out messages to their users' feeds in the app with a call to action. The company would say, for example, that Apple's policy was violating free speech or was preventing people with medical conditions from learning more about their medication and communicating with fellow patients. Users then responded by sending out emails to Apple pertaining to the day's chosen issue.

Then MassRoots brought out the big guns--the National Cannabis Association and ArcView Group sent letters to Tim Cook on the company's behalf explaining how Apple's policies were stifling innovation in the cannabis industry. In February 2015, Apple reversed its policy and started accepting social cannabis apps again.

Changing laws.

With the 2016 presidential campaign on the horizon, marijuana will be a key issue. "We have eight states with legalization in some form on the ballot in 2016," Dietrich says. "We plan to help win every single one."

MassRoots plans to add a voter registration button to the app. If all states pass the ballot, ArcView's market research arm estimates, the industry could grow to $10.2 billion by 2018.

"It's a self-fulfilling prophecy--the more engaged our users are in the elections, the more likely it is that the measures will pass, which in turn will expand the market in which MassRoots is available and expand our revenue potential as more dispensaries come online," Dietrich explains.

Going corporate?

Dietrich says users need not worry that the app will be "going corporate." Sure, the company went public, he says, but it will also stay true to its mission of "connecting and empowering the cannabis community." One reassuring sign he points to is MassRoots' sponsorship of the 4/20 Rally in Civic Center Park in Denver. The company has helped organize 250,000 people to come together to celebrate the legalization of marijuana and watch hip-hop artists like Devin the Dude and Rick Ross perform.