--- title: How it works nav: How it works output: how-it-works/index.html description: How Varsto works: your devices and your own storages, encrypted blocks in padded packs, keys and grants, signed records, the ledger that tracks every copy, sync, peer-to-peer transfer, sharing, Strongroom and the recovery kit, with the honest limits. ---
The technology behind Varsto, one mechanism at a time: how a file becomes encrypted blocks in padded packs, which keys exist, how the signed ledger keeps track of every copy, how devices sync and find each other, and what is not done yet.
Everything here is implemented in the source-available core (crates/varsto-core) and described with exact field layouts in the storage format. It is alpha software: formats may still change, and neither the design nor the code has been audited. The threat model and the failure model say what it does and does not defend against.


Varsto has two kinds of parts, and nothing of ours in between.
Every storage holds two kinds of object: packs, which are files of fixed sizes that hold encrypted blocks of file content, and small signed records: each device's file lists (manifests), its block maps, its ledger, and the records for devices, folders and policies. Every path has exactly one writer: a device writes only under its own id, and packs are named by the hash of their bytes and never overwritten. Storages therefore need no locks, and each one doubles as a mailbox: devices that are never online at the same time still converge, as long as they share one storage. Devices can also exchange blocks directly, on the LAN or across the internet.
There is no Varsto account and no server that holds your data. The only thing Varsto runs is an optional rendezvous service that helps devices find each other, and nothing depends on it. If the project stopped tomorrow, your installed devices would keep syncing through your storages.


fsck --verify and automatic verification check copies they cannot read.Where each block lies inside the packs is written in a block map, one per folder and writing device, which is encrypted under the folder's metadata key. A device that holds the folder key looks a block up in the map, reads that one range of the pack, and checks the block against its own hash. A storage, or a device without the folder key, sees pack ids and size classes only: not block names, block sizes, offsets or which pack belongs to which file.
Known trade-off: deterministic (convergent) encryption inside a folder means that two people who both hold the folder key can tell whether they have an identical file. Within a shared folder that stays true for one key epoch; removing a member gives the folder a new random key, so a removed member cannot recognise anything written afterwards.
Everything starts from one random 256-bit vault key, created on the first device and never derived from anything you type. It opens the vault's bookkeeping (device and folder names, settings, the ledger of packs) and no file content. The folders' content keys are separate.
keys.enc, encrypted under a key that Argon2id derives from the device passphrase. Changing the passphrase re-wraps that file and touches nothing in storage.Adding a device. A new device gets the vault key by pairing with a device you already have, or from the vault words of the recovery kit. That gives it the bookkeeping and no folders. For each folder it publishes a request, and an owner device must approve it by hand: the approval shows the device's name and a six-word fingerprint of its two public keys, which you compare with what the new device shows. Only then does an owner write the grant. The background service never approves anything on its own. Pairing is the one shortcut: you choose the folders on the offering device, whose screen shows the same fingerprint.
Removing a device starts a new key epoch: a new random vault key, sealed to each remaining device, and a new random key for every folder the device took part in, granted to the devices that stay. New records, packs and blocks use the new keys, and a chain of encrypted epoch records lets the new vault key open everything older. The removed device finds a signed revocation the next time it reaches a storage and stops; with a wipe order it also empties its folders and keys.
| Purpose | Algorithm | Notes |
|---|---|---|
| Content and metadata encryption | XChaCha20-Poly1305 (AEAD) | 256-bit keys, 192-bit nonces. Every ciphertext carries associated data that names what it is, so a storage cannot move an object into another role. |
| Hashing and key derivation | BLAKE3 (keyed hash and derive_key) | Chunk ids and file hashes are keyed. Every derived key carries a context string (e2ee-sync-format/3/<purpose>; the device fingerprint uses its own version-independent context). |
| Passphrase to key | Argon2id | At least 64 MiB, 3 passes; a random salt per device. The passphrase never leaves the device. |
| Signatures (records) | Ed25519 + ML-DSA-65, hybrid | Both signatures cover the same bytes and both must verify. A key with a post-quantum part never accepts an Ed25519-only signature. |
| Key exchange (grants, new epochs) | X25519 + ML-KEM-768, hybrid | Both shared secrets and the full transcript go into one key; a sealed secret stays private unless both algorithms are broken. |
| Peer connections | TLS 1.3, pinned certificates | Each device has its own certificate; its hash is in the device's signed peer record. |
| Security-key folders | FIDO2 hmac-secret | The security key derives a 32-byte secret from a credential and a per-folder salt after a touch. |
| Recovery kit | BIP-39 words, Shamir over GF(256) | Two sets of 24 words with checksum; optional 2-of-3 shares of the recovery words. |
Everything a device publishes except packs has one envelope: the kind of record, the vault, the folder it concerns, the device and a sequence number, the name of the key that opens it, the hash of the encrypted body, and the hybrid signature over all of that. The body is compressed, encrypted, and padded with random bytes to a multiple of 64 KiB (1 MiB for large ones), so a storage sees record sizes only in steps. A reader accepts a record only after one set of checks that is the same for every kind: the signature verifies against the writer's key, the writer's role in that folder allows this kind of record, the body opens, and the contents pass the limits. Anything else is counted as junk and ignored, which is why a viewer or a removed device cannot write something that counts, even though it holds a key.
The ledger is Varsto's bookkeeping. Every device keeps its own append-only log of facts about what it did, and no device ever writes into another one's log. The facts are small and concrete: "I wrote pack 5c1e to the storage I call box", "I downloaded 5c1e from box and its hash matched", "I published version 12 of this folder's file list".
Every device reads every other device's log through the storages and replays all of them into the same picture: which packs exist, where every copy is, who wrote it, who has checked it and when. Nothing in it is trusted for where it came from: each batch is signed by the device that made it, and a copy counts as verified only when a different device has checked it.
Without the ledger, a sync tool can only hope its copies exist. With it, Varsto can say how many copies of every pack there are, in which places, how recently each was checked, and which ones nobody has checked yet.
| Event | Meaning |
|---|---|
| Device enrolled | This device joined the vault, under this name. |
| Folder added | This device created a folder. |
| Pack stored | This device wrote a pack to a storage: pack id, size class and the storage. A claim, attested only by the writer. |
| Pack verified | This device downloaded the pack from a storage and its hash matched its name. Recorded by fsck --verify, automatic verification and full disk checks. |
| Pack dropped | This device deleted the pack from a storage, because nothing in it was needed any more or it was merged into a new pack. |
| Record published | This device published a file list or block map, with its sequence number and hash. The record counts only once a signed batch announces it. |
| Storage retired | A storage was removed from the vault: claims on it made before this event no longer count as copies. |
No file names and no content: packs are identified by their hashes, and the whole batch is encrypted anyway.


Events are collected into batches, typically one per sync rather than one per file. A batch carries the device id, a sequence number (1, 2, 3, ...), the hash of the device's previous batch, a logical clock, its creation time, the newest batches of other devices it has seen, and the events. A batch is a signed record like any other:
ledger/<device>/<sequence>, never overwritten.A reader accepts a batch only when both signatures verify against the device's public key in the device registry and its previous-hash matches. The post-quantum signature costs about 3.3 KB, which is why events travel in batches: the ledger grows by a few kilobytes per sync, not per file.
Every storage is a mailbox. After a device commits a batch it uploads every batch of its own that a storage lacks; on every pull it lists the ledger on each hot storage, takes the batches it has not seen, checks them, decrypts them and keeps a local copy. Because each storage carries the whole ledger, a laptop that syncs at night and a phone that syncs in the morning see the same history without ever meeting. Nobody orders anything centrally: a logical (Lamport) clock orders changes, not the wall clock. Untrusted replicas and the people you share a folder with write ledgers too, sealed under keys that open only their part: a replica's claims name packs, not files, and a member's claims cover only the shared folder.
Replaying all batches gives each device the same view: for every pack, its id and size class, the storages that claim a copy and which device claimed it, and which devices verified it there and when. It also knows the newest file list and block map of each device for each folder, the devices and folders that exist, and which storages are retired. Storage names are local to each device ("box" here, "primary" there), so every storage carries a random identity, and devices match each other's claims by it. Which block is in which pack is not in the ledger; it is in the folder's block map, which only holders of the folder key can read.
fsck. Compares the ledger with what the storages actually list: claims without a pack, packs that no block map lists, blocks with no copy anywhere.A block is deleted only when nothing refers to it, and no single device decides that alone. A device that finds a block that no current file, trash entry, version or snapshot uses writes a dead mark for it in its next block map. Nothing is deleted yet. The mark is settled once every device that can write to the folder has signed a batch acknowledging that it has seen the mark. Only then may a device delete, and only if it still finds no reference. A device that re-added the same file before it saw the mark announced its file list before it acknowledged the mark, so the collector sees the reference first and writes an undead mark instead. A pack is deleted when every block in it is collectable. A hot pack that is more than half dead is rewritten into new packs; cold storages are never rewritten and keep a pack until its minimum storage time has passed. A pack that no block map mentions is removed after seven days. The price is that cleanup waits for every writing device: one that never syncs again holds back collection in its folders until you remove it.
Because each device numbers and chains its own batches, history cannot be rewritten quietly. Two different batches with the same device and sequence number, or a batch whose previous-hash does not match, are a fork: every device that sees one marks that device as forked, and fsck reports it. The usual cause is a device restored from an old backup or a cloned disk, which would carry on from a sequence number its newer self has already used. When a device finds batches under its own identity that it never wrote, it fences itself: it stops signing and pushing until it is enrolled again as a new device, so two diverging copies of one identity never both write history.
A storage that serves an older but valid part of the ledger cannot be caught by signatures alone. Varsto uses the other devices for this. Devices publish the newest batch they hold of every device and, when they meet, exchange signed proofs of batches they have seen. If a storage keeps showing less than a device has proved to exist, and the device that wrote the batch said it uploaded it there, the warning reads: storage X may be withholding or rolled back: it shows ledger batches of D up to n, but a peer proved m. It appears after two pulls in a row, so one slow answer does not cause it, and it clears when the storage catches up. It judges only storages a device has confirmed uploading to, and a vault with one device has nothing to compare against.
The ledger says where packs are; manifests say what the files are. After a change a device publishes a new manifest for a folder: every path with its size, modification time, content hash, block list and a version vector (for each device, the clock of its last change), and whether this device holds all of the file's blocks. It is encrypted under the folder's metadata key and announced in the ledger. To keep this small, most manifests are a delta that lists only the paths that changed since the previous one. A full base is written first and then again after at most 1024 deltas, or earlier when the deltas have grown to about a sixteenth of the base. A device that joins reads the newest base and the deltas after it; block maps work the same way. Other devices fetch the manifests they have not seen and merge path by path:
name.conflict-<device>-<clock>.ext, so both devices converge without another round.Deleted files go to a trash, never removed outright, and replaced versions go to a version history. Both are signed records of the same base and delta kind, so every device agrees on what is in them and when they expire. Backups keep read-only snapshots, each stored as a difference against a base, so that expiring one never breaks another. The background service watches your folders and syncs within seconds of a change. Selective folders show every file but keep placeholders for those you have not fetched, and fetch a file when you open it.
Devices also exchange blocks directly. A device that needs a block looks up the pack and range in its block map, asks its peers first and the storages second, and spreads consecutive blocks over the peers that answer. The receiver checks the block against its own hash like a block from any storage.
https://varsto.net/rv by default, or your own), under a random-looking tag that only the devices of one vault can compute, and fetches the others' records every few minutes. The service keeps them in memory for two days and never sees a vault id, a device id, a name or a key. Pairing a new device across networks works the same way: the code or the scanned link finds the offer there. Without it, the LAN, direct addresses, your own devices as relays and the storages work as before. It is controlled with varsto p2p rendezvous set <url>, on, --off and status, or on the Peers page, and VARSTO_RENDEZVOUS=off turns it off for one process. A pairing link carries an rv= token (and rvu= when the service is not the default), which is how a device on another network finds the offer; the pairing step itself can go through the relay when no address answers.Tested on localhost, on the maintainer's own networks and on a three-device rig across NATs. Two symmetric NATs cannot be punched and fall back to a relay: one reachable device in the vault (a home server, a VPS, a forwarded port) or the rendezvous service; sockets are IPv4 only.
How fast. Benchmarks measures downloads between Paris, Amsterdam and Warsaw, peer to peer against an S3 bucket, with the method, the numbers and what is still slow.
Transport and the local interface. Packs and records are ciphertext before they leave the device, so transport adds no second layer for its own sake. S3 is spoken over HTTPS with Signature Version 4, rclone remotes use rclone's own configuration, and the S3 secret is kept in an encrypted file. The desktop interface is served only on 127.0.0.1, every request carries a per-session token, the Host header is checked, and the page runs under a strict Content Security Policy.
| Party | Sees | Cannot see |
|---|---|---|
| A storage provider (bucket, NAS, disk, rclone remote) | Pack ids and size classes (256 KiB to 64 MiB), when packs appear and go, record sizes in steps of 64 KiB or more, how often you write and read, your device count from the number of ledger directories, and which folder ids exist. | File names, contents, folder names, file counts, where a block starts or ends, which blocks belong to which file, the hash of your plaintext. |
| A device with only the vault key (the vault words, not yet approved for any folder) | What a storage sees, plus device names, folder names and settings, which storage holds which pack, and peer addresses. It can verify and copy packs. | Any file list, block map, trash, snapshot or block, and where a block lies in a pack. |
| An untrusted replica (a friend's NAS) | Pack ids and sizes, and that packs verify against their names. It signs its own claims under a replica-only key. | Any content, name or file list; it never receives a folder key or the vault key. |
| A peer on the LAN or the internet | Another device of your vault, so what any of your devices knows. It asks for blocks after proving it is the device whose certificate your records name. | Anything without that certificate: a stranger gets no block, and the LAN beacon does not name the vault. An eavesdropper sees nothing readable on the wire (TLS 1.3). |
| The rendezvous service (varsto.net, or your own) | Random-looking tags (one per vault) and slots (one per device), the size and age of the sealed records, your devices' IP addresses and ports, which of them belong to one vault, when they talk to each other, and how many bytes a relayed connection carries. | Your vault id, device ids, device names, any key, the addresses inside the records, file names and content. A relayed connection is TLS 1.3 between your devices. It keeps nothing on disk, logs no tags or addresses, and has no accounts. |
| Someone you share a folder with | That folder: every file in it, and your devices' signed claims about it. | Any other folder, the vault key, your device registry. |
| A thief with your unlocked laptop | Everything a normal folder holds while the device is unlocked. | Strongroom folders without your security key; nothing written after you remove the device from another one, except in folders shared with other people. |
To share a folder with another person, whose devices are not in your vault, their device first makes a request code. The code holds the device's name and its two public keys (signing and key exchange), and it can travel over any channel. Your device shows six words derived from the code. You read them to each other over a call or in person; a code swapped on its way shows other words, and you add the person only after they match.
Adding the person is two records: the folder record that lists their device as an editor or viewer (never owner) with its public keys, and a grant, which is the folder key sealed to that device's key-exchange key with both X25519 and ML-KEM-768. Only that device can open the grant, and it opens one folder. Because the person has no access to your registry, the grant also carries the folder's directory: its name, creator and participants. Your devices and theirs then write their claims for that folder in batches sealed under a key derived from the folder key, so both sides see each other's claims for that folder and nothing else. Your vault key is never shared.
Roles are enforced by every reader, not by who holds the key: a viewer holds the folder key and can read, but its records are refused everywhere. Removing a member gives the folder a new random key. Your devices and the members who stay receive it as new grants, everything written from then on is under it, and the removed member's later changes are ignored. What they already received stays readable to them; a key cannot be recalled.


A Strongroom folder's key is never at rest. At creation the security key makes a credential, then produces a 32-byte secret from it and a random per-folder salt (FIDO2 hmac-secret). Varsto wraps the folder key under that secret and stores only the credential id, the salt and the wrapped key. Unlocking repeats the touch and keeps the key in memory for a window (15 minutes by default), then forgets it. There is no path to the folder key without the physical key: not through the passphrase, the vault key or a stolen backup, and no grant or recovery copy of it is written. Backup security keys get their own wrap of the same folder key. Converting an existing folder gives it a new id and key, re-encrypts it and deletes the old ciphertext; re-keying a Strongroom does the same with a new key wrapped for every enrolled security key, for when a key may have been kept by someone.


The device passphrase goes through Argon2id to unlock keys.enc; the background app can keep it in the operating system's keychain so the service unlocks itself after login. Losing a passphrase loses that device's copy of the keys, not the vault: another device, or the recovery kit, enrols a new one.
The recovery kit has two sets of 24 BIP-39 words (a miscopied word is caught by the checksum). The vault words are the vault key: with them alone a new device sees the vault's bookkeeping (device and folder names, where packs are) and no content. The recovery words open the recovery escrow of every folder key: alone they open nothing, and together with the vault words they bring back every folder. If you ask, the recovery words are also split into three Shamir shares of which any two rebuild them while one alone reveals nothing. Varsto warns you until every folder has its escrow copy. There is no account, no reset and no copy held by us: the kit is how you carry the responsibility. Print a new kit after removing a device, because the old vault words hold the old key; the recovery words do not change, so existing escrow copies stay valid.
Field-level details, byte layouts and version rules: storage format, key hierarchy, ledger signing notes, security principles, failure model.