With the war against the 41 years of Muammar Qaddafi's capricious and tyrannical rule approaches its end. Now is the time to ensure that Libya's vast oil resources are never again the tool for oppressing its people.
The first priority for the economy is to restore oil production. War damage to facilities needs to be assessed, minefields cleared, and blocked pipelines restored. Oil exports are crucial for funding the transitional government and getting the economy back on its feet.
Most analysts are pessimistic, suggesting three to four years to return to pre-war levels of 1.6 million barrels per day (bpd). Yet if reasonable security can be restored, repair could be faster: Kuwait's oil output recovered from Saddam Hussein's far more devastating scorched earth policy within two years.
Indeed, Abdel Jalil Mayouf, the information manager at the state-owned Arabian Gulf Oil, which operates large fields in the eastern Sirte Basin, told Al Jazeera that some 250,000 bpd of production could restart three weeks after facilities are secured.
Libya's 46 billion barrels of reserves are about half of the UAE's, and the biggest in Africa. Its light, low-sulphur oil is more valuable than the mere quantity suggests.
Ambitious plans were laid in the mid-2000s to produce about 3 million bpd, which would make it Africa's largest producer and match its record output of 1970, at the time of Col Qaddafi's coup. This target ran into bureaucratic deadlock, but could be revived. With a population similar to the UAE's, there is no reason why Libya could not become comparably wealthy, with the right policies.
Existing contracts with foreign oil companies are mostly favourable for Libya and, unless egregious corruption is uncovered, should be retained to ensure operations and investment continue smoothly.
The national oil company should be streamlined and its strategic, regulatory and operational functions separated. Later, a minority share could be sold or allocated to the public, giving the commercial oversight of other successful state firms such as Norway's Statoil and Brazil's Petrobras.
Even allowing for falling oil prices, within a couple of years Libya's new government could easily be dealing with US$50 billion (Dh183.64bn) of oil earnings annually. Some $7,500 per Libyan will be available to build the wealthy, democratic nation that Col Qaddafi failed to create, with the essentials of infrastructure, education, health care and efficient, honest governance.
Article 8 of the new government's draft constitutional charter calls for "fair distribution of national wealth among citizens". Instead of wasteful and environmentally damaging cheap subsidised fuel, a share of oil earnings could be given directly to every citizen. A version of this "direct dividend", advocated by Paul Collier, the Oxford University economist, and John West, the campaigner, among others, exists in Alaska.
The government would then raise its funds via taxation like most governments worldwide, hence making politicians accountable to their electorate. This avoids crony handouts of oil cash, white elephant projects or arguments between regions as to their allocation.
One of the few good Qaddafi-era policies was the accumulation of excess oil money in a sovereign wealth fund. The Libyan Investment Authority lost billions on the shady deals and poor investments of Qaddafi's second son, Saif Al Islam, with Goldman Sachs and others. But a professionally managed fund can buffer the inevitable ups and downs of the oil markets, avoid overheating of the economy and excessive currency appreciation, and make provision for future generations.
Although tarnished by his association with Col Qaddafi's regime, Shokri Ghanem, the former oil minister, had some wise words in a January interview with the consultancy McKinsey, just before the revolution. He noted that "people see … apparent contradictions. You invite foreign companies into your country and employ almost two million foreigners, yet 300,000 Libyans have no job."
In Libya, as in other revolutionary Arab countries, the government should not become an employment agency. For a large share of the population to be dependent on the state's patronage opens the door to renewed autocracy. Government's role is to set the rules and conditions under which private businesses can create meaningful jobs.
Libya must also learn from the experience of other oil-producing countries and build a diversified economy. Its strategic and trade position links the Maghreb with the Mashreq countries, and the Mediterranean with central Africa.
Tourism, a great creator of employment, also has striking potential for Libya: 1,770km of unspoilt coastline, adjacent to Europe; fabulous Roman ruins at Leptis Magna and Sabratha; ancient desert oases and cities such as Ghadames; and spectacular desert and volcanic scenery in the Sahara.
The job is daunting; too many states have failed to use their hydrocarbon wealth for their people's benefit. With the help of experts from resource-rich success stories such as Norway, Brazil, Chile, Malaysia, Qatar and the UAE, Libyans need to make a clean break with the years of tyranny and craft an authentically Libyan solution.
Robin Mills is an energy economist based in Dubai and the author of The Myth of the Oil Crisis and Capturing Carbon