Nearly 20 years after voters approved the medical use of marijuana in California, the state’s cannabis trade is a wild west of legitimate enterprises, outlaws and erratic enforcement, caused in large part by a patchwork of inconsistent laws covering the $2bn-a-year industry.

Legislators are seeking to bring law and order to the business. Three bills – two in the state assembly and one in the senate – are competing to create a framework that would codify how medical marijuana is grown and sold in California, including whether local municipalities or the state itself would have ultimate control and what environmental and health measures should be addressed.

“There are no rules or regulations in California,” said Senator Mike McGuire, who represents an area in the northern part of the state where it is estimated that 60% of marijuana in the US is grown. “For two decades now, the Golden State has allowed the cannabis industry to grow unchecked.”

McGuire has put forward the Medical Marijuana Public Safety and Environmental Protection Act (SB 643), a bill that focuses on the environmental impact of growing. He says illegal grows are deforesting government lands, polluting waterways and affecting the health of those who use medical marijuana. One provision of his bill requires all cannabis to be certified organic by 2022, to eliminate polluted runoff into state waterways and make marijuana safer to use.

The bill also addresses the illegal use of water to irrigate cannabis crops. California is stricken by drought and a single marijuana plant requires six gallons of water a day, McGuire said. He estimated that 100,000 such plants are being grown in Humboldt County alone.

McGuire’s bill also provides a mix of local and statewide regulation. The bill has no sponsors other than its author. McGuire said this was to allow it to fairly represent all sides of the issue. The two bills currently winding through the assembly, meanwhile, pit growers against law enforcement and city governments.

Many growers and sellers, including the California Cannabis Industry Association and the Emerald Growers Association (EGA), a trade group of farmers in northern California, support Assembly Bill 34, written by assembly members Rob Bonta and Reginald Jones-Sawyer.

It would create a “strong regulatory regime” that would “help the industry come out of the shadows and increase safety and the quality of the product”, said Bonta, whose team met more than 30 stakeholders during the crafting of the proposal.

His bill would give greater power to state agencies including the Alcoholic Beverage Control, the state department of public health and the department of food and agriculture, but would leave room for local ordinances as well.

“It’s the single most thoughtful, innovative bill on the subject California has ever seen,” said Hezekiah Allen, executive director of EGA.

Competing with that bill is AB 266, authored by assembly member Ken Cooley. Cooley’s plan, sponsored by the California Police Chiefs Association and the League of California Cities, would place power in the hands of local authorities while including some state oversight.

“The major component of AB 266 is local control,” said David Bejarano, head of the California Police Chiefs Association. “We understand that some cities currently have bans so we need to respect that local control and authority.”

Under AB 266, a single state agency would issue licenses to sellers and growers, though local municipalities would create their own ordinances for cultivation and sale and handle the majority of enforcement.

Growers like Allen are against the measure, pointing out that industries such as viniculture and hard alcohol require the regulation of multiple state agencies due to their complexity. “No other multibillion-dollar industry is regulated by one department,” he said.

He added that many growers feel AB 266 comes from a “law enforcement, urban perspective” and that “it is fundamentally challenging for [growers], having spent several decades on the other side of the war on drugs, to work with the police chiefs as a bill sponsor”.

Cooley, however, said he was open to collaboration. “You’re going to be hard pressed to find a member who is more open to finding a reasonable center than me. I really work to be collaborative,” he said.

McGuire’s bill, SB 643, has cleared two senate committees and now moves on to the appropriations committee. Both AB 266 and AB 34 passed the same legislative hurdle this week, clearing the committee on business and professions, and were referred to the appropriations committee. They will be heard in the coming weeks.

California is moving closer to considering legalization for recreational use. At least four ballot initiatives have been filed for the 2016 election and one candidate for governor in 2018, Gavin Newsom, has signaled his support. The outcome of the move for legislation on medical marijuana regulation will probably affect how recreational use is handled, if voters pass one of the initiatives.

“I do think it will affect how recreational marijuana unfolds,” said Cooley. “I believe that the whole civic conversation would be greatly aided with some measures in place for medical use.”

Legislators say laws are needed now to prevent federal interference. The federal government has issued guidelines that pull back on enforcement in states that have adequate protocols in place, but California’s lax laws are problematic. Just this week, an illegal grower was killed in parklands near Sacramento, when state game wardens raided the operation.

“The US Justice Department has made it crystal clear to states that allow medical marijuana that you must have a robust system of regulation and enforcement or face federal involvement,” said McGuire.

“We’re 20 years late in bringing this legislation forward.”