-
-
Checked on this phone from Bitcoin bytes, not from the server's database.
-
The group's money sits in one pair of hands. The three numbers are sourced.
-
15,000 F locks 38,113 sats. Then Ibou taps Sign and send.
-
Coumba sees the recipient and the amount, then Approve.
-
Nobody empties the fund alone. The button is "Try the demo."
-
Paid. The transaction is in a block.
-
pnpm e2e, 10 checks, exit 0. The rate is a fixture, not a market price.
-
The same check in English and in French. Verified 19/19. Ibou + Coumba.
-
Bitcoin Core refuses one signature. Coumba's phone refuses a swapped recipient.
-
After the delay, Ibou and the assembly recover the due. That is intended.
-
Recover too early: Bitcoin Core waits 10 blocks. Blocked.
-
What this does not claim. Every row has its limit.
-
Ibou and Coumba, each on their own phone. 60,000 F. Regtest. The sats have no value.
-
A member link. No account and no key.
En bref (français)
Au Sénégal, les cotisations des dahiras, GIE, clubs et associations dorment souvent sur le compte Wave ou Orange Money d'une seule personne. Si elle part avec la caisse, les membres le découvrent trop tard.
Koinon est une caisse commune en bitcoin que personne ne peut vider seul.
- Pour le bureau : chaque dépense doit être approuvée par 2 responsables sur 3 (trésorier, secrétaire, président), chacun sur son propre téléphone. Ce n'est pas l'application qui bloque : c'est Bitcoin lui-même qui refuse un paiement avec une seule signature.
- Pour les membres : rien à installer, aucun compte. Un lien partagé sur WhatsApp montre les cotisations et les dépenses en francs CFA, vérifiées directement sur leur téléphone.
- Si un responsable disparaît : après un délai (environ 30 jours en production), un responsable et l'assemblée peuvent récupérer les fonds.
- Démo : https://102-68-84-31.sslip.io/app (réseau de test, sans argent réel). Interface en français et en anglais.
Inspiration
Across Senegal, dahiras, GIEs, sports clubs and neighbourhood associations collect monthly dues in CFA francs. Most of the time that money ends up in one place: the treasurer's Wave or Orange Money account.
It is convenient, and it is a single point of failure. One person holds the SIM and the PIN. One person can empty the pot. Members only see the balance when the treasurer chooses to show it, and they find out about a problem when it is already too late. Even an honest treasurer has no way to prove they are honest.
This is not a small habit:
- 43.5% of adults in Senegal save through informal groups or clubs (Global Findex 2025 / EFA Études).
- Senegal counts more than 2,500 national solidarity funds with over 80,000 members (APS, Feb 2025).
- Senegal accounts for 24.1% of e-money transaction volume in the UEMOA zone (BCEAO 2024). Yet every e-money account still belongs to one holder.
I wanted to keep what works (dues in francs, a bureau, a WhatsApp group) and remove the one thing that breaks: a single pair of hands on the money. Koinon replaces "trust the treasurer" with a rule that Bitcoin itself enforces.
What it does
Koinon is a shared Bitcoin treasury for an association. No treasurer, and not even our server, can move the money alone.
Before Koinon: members hand their dues to one treasurer, who holds the account, keeps the notebook and decides what members see.
With Koinon, one expense from start to finish:
- The fund. Members' dues sit in a Bitcoin address that belongs to nobody alone. The pot is shown in CFA francs.
- The request. Ibou, the treasurer, needs 15,000 F for the hall rental. He creates the request on his phone and signs it. The screen says: "1 of 2 approvals. No money has moved."
- One signature is not enough. If Ibou tries to pay alone, Bitcoin refuses the payment. Not our app, not our server: the Bitcoin network itself.
- The approval. Coumba, the secretary, receives the request on her own phone. She sees the recipient, the amount in francs and the exchange rate fixed at the time of the request, then approves. The payment goes through.
- A swapped recipient is caught. If anyone (even our server) changes who gets paid, Coumba's phone refuses to sign before any money moves.
- The member receipt. Any member opens a link from the WhatsApp group, with no account, app or wallet, and sees the dues and expenses in francs, including who approved each payment. Their own phone checks this from the Bitcoin data itself, not from our database.
- If an officer disappears. After a waiting period (about 30 days in production), one remaining officer plus a key held by the association's assembly can recover the fund. Trying earlier is refused by Bitcoin.
Who it's for: the bureau of any group that collects regular dues: a dahira, a GIE, a sports club, a neighbourhood or solidarity fund. Members don't need to understand Bitcoin to check that the money is safe.
Reach (an estimate, not traction): an association of 40 members paying monthly generates about 40 dues and a few approved spends each month. A first pilot with 10 associations would put about 400 members' savings under a rule no single person can break. The 2,500+ solidarity funds above show how many groups already work this way.
Why on-chain Bitcoin and not Lightning? An association's fund is meant to sit safely for months, not move in seconds. A Lightning node receiving for the fund would be a hot wallet that someone controls. Koinon locks the money directly in a Bitcoin script that nobody holds alone. Paying one due costs about 244 sats (about 96 F at the demo rate) in network fees. That fits monthly dues of 10,000–50,000 F, not micro-payments.
Try it: https://102-68-84-31.sslip.io/app shows two phones side by side (Ibou and Coumba) on a test network, with a seeded 60,000 F fund. Available in French and English.
How I built it
Koinon has four parts. The key design rule is that the server never holds a private key.
1. The rule, as a Bitcoin script (packages/core)
The fund is a P2WSH address built from this Miniscript policy:
or_d(multi(2,O1,O2,O3),and_v(v:pk(K),and_v(v:multi(1,O1,O2,O3),older(N))))
- Path A: any 2 of the 3 officers can spend at any time.
- Path B: 1 officer + the assembly key K, only after N blocks (
OP_CHECKSEQUENCEVERIFY). N is 10 on regtest and would be about 4,320 blocks (~30 days) in production.
Everything runs in the browser with proven libraries: bitcoinjs-lib, @bitcoinerlab/miniscript, @scure/bip39 and @scure/bip32 (keys derived on m/48'/1'/0'/2'). Each officer's phone builds and checks the PSBT against the original request: recipient, amount in francs and sats, change back to the fund, the fund's own inputs, and a fee cap. Then it signs locally.
2. Keys stay on the officer's phone The officer's seed never leaves the device. It is encrypted with AES-GCM, using a key from a WebAuthn passkey (PRF extension) where the browser supports it (Safari 18, Chrome on macOS and Android). Where it doesn't (for example Windows Hello), Koinon falls back to an explicit 8-digit PIN stretched with PBKDF2 (310,000 iterations).
3. Private requests over Nostr (packages/nostr)
Spend requests and approvals travel between officers as NIP-17 gift-wrapped messages, so the purpose of a payment is not visible in plain text on the relay. The messages carry no PSBT: each officer's phone rebuilds and checks the transaction itself.
4. A watch-only coordinator (apps/coordinator)
Fastify and SQLite (node:sqlite). It indexes the fund's coins, serves raw transactions for member proofs, and keeps a SHA-256 hash-chained audit log. It holds no mnemonic and no private key. It can propose a transaction, but it cannot make Bitcoin accept one signature.
The member proof page (/fonds/:id)
A member's phone downloads the raw Bitcoin transaction and checks it locally with @noble/hashes and @noble/curves: the link fingerprint, the audit chain, the fund's script and address, and the officers' signatures in the witness.
The web app (apps/web)
React 19, Vite 8, Tailwind CSS v4 and TanStack Query, in French and English, designed for mid-range phones. Pages are split so that members never download the signing code: the homepage is about 109 KB and the member page about 140 KB, while the officer signing bundle (about 228 KB gzipped) loads only on /app.
Deployment
Docker Compose runs Bitcoin Core 32.1 (regtest), a fixed test price, a Nostr relay, the coordinator, and Caddy serving HTTPS, /v1 and /relay from a single origin, so passkeys and WebSockets just work. Anyone can run the whole stack, with no Bitcoin Core install needed:
docker compose -f infra/docker-compose.yml up -d --build
GitHub Actions runs the same commands.
Challenges I ran into
- Proving the rule, not just showing it. A database row saying "2 approvals" proves nothing. I wired the real script against Bitcoin Core on regtest and show Bitcoin's actual refusals inside the demo: a one-signature spend is rejected, and an early recovery is rejected.
- A valid spend that failed. On my first regtest run, even a correct two-signature spend was rejected, because
OP_CHECKMULTISIGreads signatures in reverse stack order. I fixed the witness builder (packages/core/src/witness.ts) and documented the failure in the threat model. - Passkeys across devices. Safari, Android and Windows Hello handle the WebAuthn PRF extension differently. I added capability detection, so devices without PRF fall back cleanly to the PIN instead of showing broken prompts.
- Keeping the member page light. Bitcoin script and PSBT libraries are heavy. Splitting the signing code into
/appkeeps the page members open from WhatsApp small and fast on a slow connection. - Never inventing a price. When the live BTC price source timed out, the right behaviour was to refuse the spend (
RATE_UNAVAILABLE), not to guess. The demo uses a clearly labelled fixed rate instead.
Accomplishments that I'm proud of
- The rule is enforced by Bitcoin, not by my code. Bitcoin Core 32.1 rejects a one-signature spend and an early recovery, and accepts two signatures and a recovery after the delay. The transaction IDs are in the README.
- Members can verify without trusting anyone. From a WhatsApp link, a member's phone checks who signed each payment from the raw Bitcoin data, even if our server tried to lie.
- A complete, working stack on a live site. Bitcoin Core, relay, coordinator and web app run behind HTTPS at a public URL. One full expense (the 15,000 F hall rental) goes from request to refusal, approval, confirmation and member receipt on the hosted demo.
- Tested end to end: 43 unit tests (core 30, coordinator 11, Nostr 2), a regtest integration run with 10 checks (
pnpm e2e), and a Playwright walkthrough of the two-phone demo on 390×844 and 360×740 screens. - Built for a phone, in French and English, with a light member page.
What I learned
- Multisig alone does not serve an association. A bureau needs amounts in francs, an exchange rate frozen when the request is made, an approval screen a non-expert can read, and a receipt for the members who don't sign. The Bitcoin script is the foundation, and the product is everything around it.
- Being clear about limits builds trust. In a 2-of-3 fund, two officers who agree can spend together. That is the rule, not a bug, and saying so plainly is part of the design.
- Proof beats promises. Showing Bitcoin's own refusal is far more convincing than any message my app could display.
What's next for Koinon
- A pilot with one dahira or GIE in Dakar, measuring how long it takes to get the second approval, how many bad attempts are blocked, and how many members open their link.
- Paying dues from Wave or Orange Money. A local on-ramp (for example Banxaas) in front of the fund, so members pay in the mobile money they already use, while the two-signature rule keeps protecting the pot.
- Wolof voice and labels for members who don't read French.
- Mainnet after an independent audit of the script and the threat model, with a live BTC/XOF price and the full ~30-day recovery delay.
- Several funds for one bureau. Associations often run several pots (monthly dues, events, solidarity), and each can get its own protected fund.
Honest limits
- The demo runs on Bitcoin's test network (regtest). The sats have no value.
- The BTC/XOF rate in the demo is a fixed test value. Without a price, Koinon refuses to spend rather than guess.
- No association uses Koinon yet. The figures above are estimates and targets, not results.
- Two officers who agree can spend together. That is the rule, by design.
Built With
- bitcoin
- blockchain
- caddy
- compose
- core
- css
- docker
- fastify
- fintech
- miniscript
- nip-17
- node.js
- nostr
- opensource
- p2wsh
- psbt
- react
- script
- sqlite
- tailwind
- typescript
- webauthn


