(CNN) When California voters approved Proposition 64 in November 2016, they OK'd more than the legalization of recreational marijuana. They authorized allowing people to petition the judicial system to have their old pot convictions expunged.

A bill -- passed Wednesday by the state Senate and now awaiting Gov. Jerry Brown's signature -- provides a framework to make such expungements possible.

The legislation, called AB 1793 , requires the state Department of Justice to scour California's crime records and find past cannabis convictions that are eligible to be expunged, as well as felony pot-related convictions that, under Prop 64, should be downgraded to misdemeanors.

That information is then passed on to county prosecutors, who have until July 1, 2020, to review and determine whether expunging or downgrading a conviction is appropriate. The bill says prosecutors can challenge the action if the person who would benefit from it "does not meet the eligibility requirements or presents an unreasonable risk to public safety."

There are more than 218,000 convictions that could be eligible to either be wiped out or downgraded, according to an estimate from the state justice department.

Read More