How Backup Buddies works
Two people trade storage, not money. Each one's files are encrypted before they ever leave the device, so your buddy stores your data without being able to read it, and so do we.
Data flow
Everything below the dashed line is content Backup Buddies' own servers never touch. The only things that ever reach our server are account details, buddy pairings, and invite codes. Never file contents, never encryption keys.
Step by step
- You pair up. One of you generates an invite code tied to a pledged storage amount; the other redeems it. This creates a buddy pairing record in our database: just the two account IDs and the pledged size, nothing about your files.
- Your device gets a keypair. Each device generates its own Iroh node identity and encryption keys locally when it's set up. Private keys never leave the device and are never sent to our server.
- Files are encrypted before they leave your machine. Your files are split into chunks by their content, and each chunk is encrypted on your device with a key derived from your backup passphrase, then packed together with others into pack files. Each pack is named by its SHA-256 hash, so your buddy's device can check it arrived intact. Your buddy's device sees only these encrypted packs, never your file names, sizes or contents.
- Devices connect directly, peer-to-peer. Using the Iroh networking layer, your device and your buddy's device negotiate a direct QUIC connection (the same kind of NAT hole-punching BitTorrent and similar P2P tools use), and the encrypted blob transfers straight between you.
- If a direct connection isn't possible, a relay assists. Some network setups (strict corporate firewalls, certain carrier NATs) block direct hole-punching. When that happens, encrypted bytes are relayed through our self-hosted relay server, but the relay only ever moves already-encrypted ciphertext. It has no decryption key and cannot read, inspect, or reconstruct your files.
- Your buddy's device stores the ciphertext. It counts against their pledged storage and sits there, encrypted, until you need to restore it. They cannot decrypt it: they don't have your key.
- If your machine dies, you restore from your buddy. Set up the client on a new machine, add it as a device on the same account, and use the same backup passphrase. Your key is rebuilt from the passphrase plus your account, so that's all it takes. Lose the passphrase, and what your buddy holds can't be decrypted by anyone, including us.
What we can see vs. what we can't
We can see
- Your account email
- Who you're paired with
- How much storage you've pledged
- Invite codes and their status
- Aggregate relay bandwidth used (for billing, if you're on a metered plan)
We can never see
- Your files' contents
- Your encryption keys
- File names or folder structure (these never reach our servers)
- Anything your buddy's device stores on their disk
What your buddy can see
Your buddy's device stores your backup encrypted, so it can never read what's inside. Your files are split into chunks, encrypted and packed together into pack files, so your buddy sees only how many packs there are, how big each one is (so roughly how big your backup is) and when they change. It can't see how many files you have, their names or sizes, or your folders.
The technical stack
For anyone who wants the specifics:
- Transport: Iroh, a QUIC-based peer-to-peer networking library with built-in NAT hole-punching and relay fallback.
- Encryption: done entirely on your device, with the key derived from your passphrase via scrypt, salted with your account ID. The same passphrase gives a different key on every account, so nobody holding encrypted files can test one list of guessed passphrases against every user at once. Your buddy and our relay only ever handle encrypted data.
- Backup format: a restic-format repository built with rustic_core. Files are split into content-defined chunks, deduplicated, encrypted (AES-256-CTR with Poly1305-AES) and packed into ~32 MB pack files, with the key derived from the same passphrase. A renamed or moved file sends next to nothing, and an edit only the chunks it touched. Each pack is named by its SHA-256, which your buddy checks on arrival. Snapshots are kept every one for a day, hourly for two days and daily for 30 days.
- Relay: a self-hosted iroh-relay instance we operate, used only when a direct connection can't be established. It's a blind forwarder, not a storage point.
- Source code: all of it is open source, so you can read exactly what it does with your files: the program that runs on your machine (scanning, encryption, transfers) under GPL-3.0, and the server, site and deploy files under AGPL-3.0: github.com/mspencerl87/backup-buddies.
- Server: a small Node/Express API and Postgres database, holding only accounts, device identities (public node IDs, not keys), buddy pairings, and invite codes.