BBC News, Antananarivo, Madagascar
Lauren Rakotondramara sits under the shade of a tree by the Ikopa river, chewing on a piece of sugar cane.
Panners pay for a permit to search for gold
"Before this new law, I was always afraid when I worked," he says. "But now I have my papers so no-one can cause me problems and I don't fear anybody."
Lauren lives in Antanimbary, a village 300 km to the west of the capital, Antananarivo, and the pilot site to test Madagascar's new mining laws.
He is a gold panner and has been for years, but until December 2006, when the 2005 Mining Code was finally implemented, his job was illegal.
He risked harassment from the police, could have his gold confiscated and often had to sell it for far less than it was worth.
"Under this new system," he says, "I can finally get a fair price for my gold."
Madagascar's new mining code aims to bring small-scale or artisanal miners inside the formal economy. If it proves a success in Antanimbary, it will become nationwide and possibly even a global model for "ethical", community based gold.
Under the new rules, every miner or panner must pay $1.5 (75p) for an annual permit, whilst gold collectors, who buy the gold to sell it on, must pay $50. This money goes directly to the mayor's office, where it will be used to fund local community projects.
Jean Denis Ramadimisaina is the mayor.
Permits are sold as part of efforts to make gold mining legal
Sitting in his office he looks rather pleased. It is not surprising. His budget has nearly tripled, to more than $7,000, since the permit scheme began last year.
"We want to make sure everyone involved in mining is doing it legally," he says. "With the money they pay I can develop the infrastructure of the village."
There is already a new school, four new wells and electric street lights as evidence of this new wealth. For a rural Malagasy community, Antanimbary is doing rather well.
"This is a stellar improvement for mining practice in Madagascar," says Tom Cushman, a mining consultant for the World Bank, who funds the education of local people on how the new system works.
"Other communities are starting to copy it without our help because they see it is making a difference.
"These people have been marginalised for years, but they are now stakeholders in the development of their own communities."
Despite the obvious improvements, there is a darker side to Antanimbary's economic boom. The community has relied on gold for decades, as the dry windswept hills that surround it are unsuitable for farming. But with better gold prices, more and more outsiders are arriving, many without a penny to there name.
Entering the mining shafts remains very dangerous
They have their travel, food and expenses paid by rich patrons, often with a hefty mark-up, and they must then mine for gold to repay, their debts. This can take years and the work is often difficult and dangerous.
Randriananarivo is 62, but he looks much older where he is sitting in the baking heat of the Ankady Be mine-site, a kilometre from Antanimbary.
"I had to become a miner because I had no money," he says. "I have been able to send money to my ten children and I receive a fair price for my gold, but I am still in debt to my patron. Everyone here is in debt. That is just the way life works here."
Randriananarivo works in a shaft mine, digging for sedimentary gold. The pit is 15 metres deep, it has no support and there is no ladder or lift, just holes cut into the side walls as crude steps.
The bottom of the pit is hot, wet and prone to flooding. Two out of 30 people died on this mine-site last year when shafts collapsed.
When asked whether his patron is concerned about mine safety, Randriananarivo laughs and shakes his head.
Then a supervisor approaches - perhaps angry that a journalist is been asking questions? Not so.
"Please," he says, looking nervous. "Please tell someone what life is like here. We are always worried about safety, but there is nothing we can do."
When asked about safety and debt, Jean-Jacques Rakotomavo, deputy mayor of Antanimbary, pauses from fanning himself and shrugs helplessly.
"We've only just started the formalisation," he says. "We haven't thought about safety yet. I do not think everything is right, but we are a developing country and this is the first step."
The benefits of this new system are clear. Better prices for gold, better facilities for the community.
But with the attraction of good wages - most of these miners make at least double the national average wage of a dollar a day - the risk of exploitation remains. Despite the problems however, allowing communities to fund their own development through gold-mining offers hope for some of Madagascar's rural poor.