Tontine Lightning

Inspiration

Rotating savings groups, commonly known as tontines, are an important way for communities, families and small groups to save money together. Members contribute a fixed amount regularly, and each member takes turns receiving the pooled savings.

But these systems often depend on one person to collect, manage and distribute everyone's contributions. This introduces risks such as delayed payouts, mismanagement and even the possibility of someone disappearing with the money.

We wanted to explore a different approach: what if the rules, rather than a person, controlled the money?

That idea inspired Tontine Lightning, a prototype that combines traditional rotating savings groups with Bitcoin and the Lightning Network.

What We Built

Tontine Lightning allows members to create savings groups, join existing groups and contribute towards a shared pot. Once all members have paid their contributions, the system automatically triggers the payout to the designated recipient.

We built the experience around simple WhatsApp-style commands, making the system familiar and accessible without requiring members to navigate complicated interfaces.

Bitcoin provides an open payment network, while Lightning enables faster, lower-cost payments suitable for frequent contributions. We use LNbits for wallet and payment integration.

The prototype also includes a web simulator and a mock payment mode, allowing us to demonstrate and test the complete savings cycle without requiring real transactions.

How We Built It

We used Python and FastAPI to build the backend and implement the tontine engine, which handles group creation, membership, contributions, balance validation and automatic payouts.

SQLite manages group state and the transaction ledger, while LNbits provides the integration with Bitcoin Lightning wallets, invoices and payments.

We also developed a WhatsApp Cloud API webhook scaffold for messaging interactions.

An important design decision was separating the tontine rules from the payment implementation. This allowed us to switch between a simulated ledger and real Lightning payments without changing the core savings logic.

Challenges and What We Learned

One of our biggest challenges was handling financial transactions reliably. We had to consider duplicate payment requests, balance validation, membership checks and making sure a contribution could not accidentally be counted twice.

We also encountered an important design challenge around trust. Although automating payouts removes the need for a human pot-holder, our current implementation is still custodial. Members must still trust the application operator with the funds.

This helped us understand that automation alone does not eliminate trust. Security, custody, payment verification and dispute resolution are equally important when building financial applications.

Through this project, we gained practical experience with Bitcoin Lightning, LNbits, wallet integration, payment flows and designing systems around financial transactions.

What's Next?

We want to move beyond the prototype by introducing stronger authentication, encrypted key management, contribution deadlines, missed-payment handling and testnet pilots.

We're also exploring non-custodial approaches that would give members greater control over their funds.

Ultimately, our goal is to make collective saving easier to coordinate, more transparent and less dependent on any single individual.

Tontine Lightning: Rules, not a pot-holder.

Built With

Share this project:

Updates

Submission history