-
-
Create a tontine
-
Enter your Lightning address
-
Join the group
-
Public proofs on Nostr
-
All contributions are collected
-
The next round starts automatically
-
A verifiable random draw
-
The group is ready
-
The first round begins
-
Group space and invitation link
-
The Lightning invoice
-
The contribution is received
-
The payment crosses the Lightning Network
## Inspiration In Senegal, tontines are how many people save: a group pays in every month, and each member receives the pot in turn. But everything rests on trust. One person holds the money, nobody is sure who paid on time, and when there is a disagreement, it is one person's word against another's. We wanted to keep the tontine as people already know it, and make every payment verifiable.
What it does
Tontine Lightning runs a tontine on the Bitcoin Lightning Network:
- The organiser creates a tontine (amount in FCFA, number of members) and shares an invitation link.
- The order of payout is drawn at random, visible to everyone.
- Each member pays their contribution by scanning a Lightning QR code. The amount is converted from FCFA to sats at the current rate.
- Each payment is checked against the Lightning node before it is counted.
- When everyone has paid, the pot is paid out automatically to that round's beneficiary.
- A signed, anonymous proof of each payment is published on Nostr, so the history survives even if our server goes down.
Late fees, default status and exclusion follow the group's rules, and every member can see who has paid.
How we built it
- Engine and API (Python, FastAPI): the tontine rules, FCFA to sats conversion, per-member access tokens, an event log, and SQLite or PostgreSQL storage.
- Lightning (LNbits on LND): invoices, payouts, and a bridge that re-checks every payment with the node before confirming it to the engine.
- Nostr registry (nostr-sdk): signed proofs published to several relays, with no names or phone numbers.
- Mobile-first web app (React, TypeScript, Vite).
- The full demo runs with one command in Docker on a local Bitcoin test network (regtest): bitcoind, two LND nodes, LNbits, the bridge, the API and the web app.
Challenges we ran into
- A payment claim is not proof. We first accepted a valid preimage as proof of payment. A teammate found that for incoming invoices, the server already knows the preimage. We now ask the Lightning node whether the money actually arrived.
- Bitcoin volatility. A tontine must pay out what members put in. Contributions are set in FCFA, and invoices are valid for one hour, then recalculated at the current rate.
- Never paying twice. Payouts are idempotent: a failed payout can be retried safely.
- Privacy on a public network. Proofs on Nostr are anonymised, so nobody can link them to a person.
What we learned
How Lightning invoices, preimages and payment hashes really work, how to run a full regtest network, and how to publish verifiable data on Nostr. Above all, we learned to be honest about limits: a limit we explain builds more trust than one the jury discovers.
What's next
- Direct payment to the beneficiary, so the app never holds the money and there is no price risk while the pot waits.
- Tests with real sats, in small amounts.
- A simple wallet guide (Phoenix, Wallet of Satoshi), and Wave as a bridge for members who do not have a Bitcoin wallet yet.
- Later: a dollar stablecoin (USDT) on Lightning to remove price swings.
Built With
- bitcoin
- docker
- fastapi
- lightning-network
- lnbits
- lnd
- nginx
- nostr
- postgresql
- pytest
- python
- react
- sqlite
- typescript
- vite