Most money apps start with a sign-up screen. Ours doesn't. Amunta is a ledger for expenses, debts and invoices that works from the first launch with no email, no password and no account, and keeps its database on the phone.
That raised an engineering problem early on: debts involve two people. If I lend you money, I want the record to appear in your ledger too, without either of us typing it twice. How do you sync records between two people when there is no account system to hang identities on, and you don't want the server to read anything?
This post walks through the design we shipped in Flutter, what the server can and cannot see, and the trade-offs we accepted.
1. Identity is a key pair, not an account
On first launch the app generates two key pairs and keeps the private halves in the platform's secure storage (flutter_secure_storage):
- an X25519 pair, used to derive shared encryption keys with other people;
- an Ed25519 pair, used to sign data that travels by QR code.
The public X25519 key is what other people need to reach you. There is no username to look up and no directory of users.
2. Linking two people
Two users "link" once, typically by scanning a QR code in person (or by sharing a short network ID). The QR carries the public key and is signed with Ed25519, so the receiving phone can check it wasn't altered.
After linking, each phone stores the other's public key next to the contact. From then on, any transaction or invoice one person records for the other can be sent automatically, and it arrives reversed on the other side: a loan I give becomes a loan you received, a sale becomes a purchase, with the same items, amounts and date.
3. The encryption scheme
Every payload is encrypted on the sender's phone before it leaves:
- X25519 ECDH between my private key and your public key gives a shared secret.
- HKDF-SHA256 derives a 256-bit key from that secret.
-
AES-256-GCM encrypts the payload; the wire format is just
{iv, ct, tag}.
All of this uses the cryptography Dart package. Because both sides can derive the same key independently, nothing secret is ever exchanged over the network.
4. A relay that forgets
Phones are not always online at the same time, so we need a mailbox. Ours is a small store-and-forward relay written in PHP. Its job is deliberately narrow:
- it receives an opaque encrypted blob addressed to a recipient;
- it hands that blob to the recipient's phone when it asks;
- it deletes the blob as soon as the receiving phone acknowledges it processed it;
- anything never delivered expires after 24 hours.
The relay never holds a key, so it can't read amounts, names or descriptions. It isn't a database of anyone's finances; at any moment it only holds messages still in transit.
5. When there's no internet at all
Our main market has expensive, unreliable mobile data, so the network path can't be the only path. A single transaction can also move between two phones by QR code, entirely offline. The QR is signed, not encrypted: it's meant to be scanned face to face, and the signature lets the receiver verify the source and integrity, check that the currency matches, and refuse duplicates.
6. When a change needs both people's consent
Plain sync is fine for most records, but debts are sensitive: you don't want someone silently editing what you owe them. So there is a stricter mode (we call it A-Link+): any operation that creates or changes a debt must be accepted by the other person before it counts, can only be cancelled within 24 hours, and debt balances are compared on both phones so they can't drift apart. Cash entries and gifts skip this, because they don't create an obligation.
7. Trade-offs we accepted
No design is free. Being honest about ours:
- No forward secrecy. Keys are long-lived per device, not rotated per message. If a private key leaked, past captured blobs could be decrypted. Given that the relay deletes blobs on delivery, we judged this acceptable for now, but it's the first thing we'd improve.
- Metadata is visible to the relay. It can't read content, but it does see which routing identifiers exchange messages and when.
- Losing the phone means losing the keys. With no account, there's no "reset password". That's why the app offers encrypted backups, locally or to the user's own Google Drive.
- Key verification is on the user. Linking in person by QR is the safe path; sharing a network ID remotely trusts the channel you shared it on.
8. What we learned
Removing accounts removes a lot: no password resets, no breach of a user table, no email to verify. But it moves complexity onto the device: identity, backup and recovery all become the app's job. For a ledger where the data is personal and the users often have limited connectivity, that trade felt right.
The app is called Amunta (with a separate edition for small shops), available on Android and iOS in 13 languages, built by a small team in Nouakchott, Mauritania. If you have thoughts on the design, especially on adding forward secrecy without breaking offline use, I'd love to hear them in the comments.
Top comments (0)