In a remote village Bangladeshi village called Shikarpur, until recently, few people had electricity. But a new system is beginning to connect the village’s handful of solar-powered homes with neighbors who can’t afford to own panels themselves. In the peer-to-peer system, neighbors can sell extra electricity to each other.

“The aim is to create efficient and dynamic local energy markets that empower households and encourage solar entrepreneurism,” says Sebastian Groh, managing director of Solshare, the startup making the technology now in use in Bangladesh.

The startup launched when the founders realized that Bangladesh had a growing number of home solar panels–a government program in 2014 aimed to double the number of home systems–and those solar panels were generating more power in the middle of the day than residents could use and store in small batteries. Around 30% of the energy may be wasted. At the same time, when someone living off the grid in Bangladesh wants to charge a mobile phone, they can pay as much as 100 times more for the electricity than someone living on the grid in a city. Neighbors were already beginning to informally rent out power by running cables to their neighbors houses, watching how long someone used a light bulb at night, and asking for payment the next morning.

The new technology installs power meters and solar charge controllers in the homes of people who want to sell or buy power, along with cabling to connect them, and uses software to create a bottom-up version of a smart grid. When extra electricity is available, the software redirects it where it’s needed, and tracks usage so that neighbors can pay each other through a commonly-used mobile payment app on their phones.

“The villagers see the results of their trading almost in real-time in the mobile money wallets and can buy their groceries with the money just earned through their solar systems,” says Groh.

When families buy the hardware, they can make micropayments at a rate similar to what they would have spent in the past to buy kerosene for lighting. It’s a system that the startup says can grow quickly, as it works with organizations that have already installed 5 million small home solar systems in Bangladeshi villages. In one project, with the local social enterprise Grameen Shakti, the company plans to create 100 tiny grids over the next 18 months. The “nanogrids” could eventually connect with the national grid and continue to provide power when the national grid goes down.

Groh, who calls the system the Airbnb of the energy world, says that the same technology could be used elsewhere as power becomes increasingly decentralized. Competitors have already tested small peer-to-peer trading systems for solar power in New York City and cities in Australia. But while those working in bigger cities are working at small scales, Solshare may be able to grow much more quickly as it works with thousands of homes in less-regulated rural Bangladesh, and soon also in India. As that technology helps rural areas leapfrog traditional power grids, it can also be tested and brought back to the developed world. “The algorithms used to exchange electricity in villages of Bangladesh will be the same algorithms, with machine learning empowered, in Bangkok, Singapore, Frankfurt, or New York,” Groh told judges at an MIT IDE Inclusive Innovation Challenge event. The company is now a finalist for the challenge’s $1 million prize. Solshare also announced an investment round of $1.66 million on September 28, led by Silicon Valley-based Innogy New Ventures LLC.