It's the world's largest transportation market, one in which more people tap a smartphone for rides than any other country on the planet. Uber and Didi Chuxing have been  vying for dominion of China for years. And--who knew?--it had all been illegal.

Suddenly, China's transportation ministry is "scheduled to declare that online car-booking services can operate lawfully," according to prepared comments by the ministry viewed by Bloomberg News.

Bloomberg further reports:

That would put an official stamp of approval on the ride-sharing services that already cover hundreds of cities and transport millions of people daily. The government will now encourage private auto-sharing--including car-pooling--but require vehicles to install safety features such as security alarms and GPS. All drivers must register with local taxi regulators and cannot have criminal records, according to the document.

Previously-proposed regulations seemed more onerous. It was proposed that drivers and their vehicles must be commercially registered--and that local governments could cap the number of licenses available in their areas. These seem to have been erased.

The new regulations, as reported by Bloomberg, seem to clear the way for more innovation--and actually encourage new developments--in the sharing economy as a whole. It's good for both Uber and Didi--and smaller upstart players, such as Yidao Yongche, a Chinese e-commerce platform that lets users book a car, and which has been funded with $790 million in venture-capital investment.

Uber believes so much in rapid growth in China that it's admitted to losing $1 billion a year aiming toward that goal. And Didi recently got an infusion of $1 billion from Apple to continue its expansion--though it claims to already have more than 80 percent of the smartphone ride-hailing market.

May the best company win--legally.