Scenario

Core Concepts

Understand the fundamentals.

The vocabulary you need to read the rest of the docs.

Convergent encryption

Every block is encrypted with its vault's key (AES-256-GCM) under a nonce derived deterministically from its own plaintext (HMAC-SHA256). Property: identical input → identical ciphertext within a vault → automatic deduplication + retransmission safety. Two vaults use different keys, so the same file in both does not deduplicate.

The trade-off: an attacker who already has a candidate plaintext can verify whether you've stored it. For most threat models (your photos, your documents) that's fine; for "is this person storing X" attacks specifically you'd want random-nonce mode (planned, not shipped).

Replication factor

Each vault has a replication factor, N. The mesh keeps trying to land each block on at least N nodes whose copies count, through the replication cycle every node runs on its own view of who holds what. RF is achieved per-block, not per-vault — small files don't pay the cost of large ones.

RF belongs to the vault, not to a node: it is a statement about how safe the data should be, made by whoever owns it. The value travels with the catalog, so every node that holds the vault reads the same number — including nodes with no key, which have no other way to learn it. If two people set it, the later setting wins. It is chosen when the vault is created — 3 unless you pick another, 2 for a chat room — and changed in the vault's settings or with meshhold vault replication-factor; never in config.yaml, where a vault declared by hand goes by the vault's own factor like any vault joined by key.

A copy counts when it is held by a node whose device type is Always online or Backup server, heard from lately and reachable. A phone's copy helps seed but doesn't count.

Device type

What this machine is to the rest of the mesh: one choice per device, set in Profile → Settings → Device type, with meshhold settings --device-type, or with node.device_type in config.yaml. It is the operator's call, local to the box, and agreed with nobody.

Device type What it does
Always online (always-online, a desktop's and a server's default) Its copies count toward each vault's replication factor, and it takes copies until every vault has enough.
Backup server (backup-server) Like always online, and it keeps every block it is given, RF met or not — including those of vaults it holds without the key. The backup box.
Sometimes online (sometimes-online, a phone's and a tablet's default) A device that comes and goes: its copies never count and it keeps nothing for others, but it still hands out what it has.

A backup server still honours a vault's replication factor of 0 — that is the owner saying "don't replicate this", not the operator saying "I have room". The device type replaced two older settings, node.reliable and node.storage_role; a config.yaml that still has them is read as the device type they add up to, and meshhold config lint names them.

Folders and sync directions

A node may attach a folder to a vault: its own directory where the vault's files appear as ordinary files. Four switches on that folder — each node sets its own, and they never replicate — say what crosses between the folder and the vault:

Switch When on
send_files — Send files A file added or edited here goes to the vault.
receive_files — Receive files Files from other nodes are written into the folder.
send_deletions — Send deletions A file gone from the folder is deleted in the vault. A rename is a new file plus a deletion.
receive_deletions — Receive deletions A file another node deleted is removed from the folder.

All four are on by default. Receive covers only what other nodes do; a change made here — by hand, or through this node's app, WebDAV, S3 or a mount — follows the Send switches alone. A switch turned on acts from that moment and never replays the past. A phone's camera folder with only Send files on uploads its photos and keeps nothing else; a folder with Receive deletions off keeps what other devices delete.

  • Full copy. A folder that receives files keeps every file of the vault, whatever the replication factor says. A folder joined with Receive files on writes nothing until somebody presses Start on the vault's tile (meshhold vault start), which says first how much it will write.
  • Sync all now — the button in the vault's file list, meshhold vault sync — is one full pass over the folder under its switches: receive the files missing here, apply the vault's deletions, old ones included, then send what is new here. It never sends an old deletion made here.
  • Kept copies. When another node's change removes or replaces a file in this node's folder, the previous bytes move into the folder's hidden .meshhold/kept/ instead of being unlinked. They count as history and restore from any node.
  • Keep period (keep_period_days, 30 by default, per node and per vault) — how long this node keeps its kept copies and the bytes of a deleted file. Inside it nothing on this node reclaims them: block GC, a trimming history policy, a full disk.
  • Listed only (listed_only) — a folder whose files are entered in the vault by name, size and date without being read, so nothing in it can be replicated until it is read.
  • An unreachable folder — missing, unmounted, or without the device's permission — is skipped: nothing is sent or received for it, and a folder that vanished is never read as every file deleted.

Capacity pooling

A vault's usable space is the sum of the free disk of every node willing to hold it, not one node's. Holding needs no key: a holder verifies a content hash, stores ciphertext and serves the same bytes back, so a €5/month VPS counts toward the pool exactly like your NAS does. Upload through a node that's full and the new file's blocks are placed on a peer that holds the vault and has room (chosen by free space); that peer becomes the holder. A peer holds the vault as a member, or as a keyless holder a member synced it with. You get "out of space" only when the whole reachable mesh is full. The node you wrote through still lists and serves the file — it fetches the blocks from the holder on demand.

This pools capacity across files. And when a single file is too big for any one node, it's sharded: split into contiguous runs of blocks that are placed on different nodes, so one object can exceed any single disk as long as the mesh holds it collectively. Small files that fit on one node aren't sharded — sharding kicks in only when nothing else fits. Reads gather each shard's blocks from whichever node holds them, transparently. Tune the shard size with node.shard_size_bytes (default 1 GiB; set negative to disable and fall back to "out of space" for oversize files).

Only blocks-mode vaults pool — a vault with a storage_path keeps its plaintext locally as the source of truth, so its writes stay on that node. Tune placement with node.placement_mode (local-first default, or balanced to spread every file across the mesh from the start).

Block cache

A node fetches blocks it doesn't hold all the time — serving a file whose bytes were placed on a peer, streaming from a vault it keeps nothing of, answering for someone behind NAT. node.cache_bytes gives those blocks somewhere to land so the next read doesn't go back to the holder. On by default, at a twentieth of the free space and at most 1 GiB on a phone or 4 GiB elsewhere; a negative value turns it off.

It is a separate store with a separate ceiling, and both halves of that matter:

  • A cached block is never counted as a copy and never announced. A node that advertised one would evict it by LRU and leave the mesh believing a copy exists.
  • A block the node holds for real is never also cached — that would budget the same bytes twice and let a cache eviction delete a replica.
  • Under disk pressure the cache is dropped whole, before any replica is considered. A cached block is a guess about the future; a replica is a promise. One shared ceiling would eventually produce a node that refused a copy because its cache was full.

Blocks are content-addressed ciphertext, so the cache needs no vault key and a hit is verified by hashing — a wrong or corrupted block is caught rather than served. Admission is "second time asked, not first", which is what stops a bulk transfer of hundreds of thousands of one-shot blocks from flushing everything worth keeping.

The hit rate is on the settings panel, and worth actually looking at: a cache pays off only when the same block passes the same node more than once, and on a mesh where readers reach holders directly it may not. It also tells whoever runs the node which blocks are popular — not linkable across vaults, since different keys make unrelated bytes, but the access pattern of the vault whose traffic it carries is visible to it.

Trusted vs. untrusted

Trust = "does this node have the vault key". Untrusted nodes happily store ciphertext blocks and participate in replication; they never see plaintext. This is what lets a €5/month VPS be redundancy without needing to trust the provider.

Trust answers what a node may read, and nothing else. It does not gate holding, being routed a file, or counting toward RF. A node does not even need the vault in its config: it can hold the vault as a keyless holder (below). Whether it does is its device type's and its space for others' answer, not the key's: a Sometimes online device never does.

Keyless holders and space for others

An Always online node or a Backup server holds the vaults and rooms of its network's members on its own, without their keys, so members that are rarely online together still exchange their changes through it.

  • How it starts. When a member of the same network syncs a vault or a room with the node, the node takes it on in that session. Nobody configures a holder per vault, and a block pushed to it alone never makes a node hold a vault.
  • What it keeps. The blocks, every version and the library (ratings, play counts, previews, scan verdicts), none of which it can read, and it hands them on to the other members. Its copies count toward the replication factor.
  • The month. Every session with a member refreshes it. After a month in which no member synced with it — a session with another keyless holder does not count — it drops everything of that vault or room, blocks included. A member coming back brings it back.
  • Space for others (node.space_for_others, Profile → Settings → Space for others, meshhold settings --space-for-others): the percentage of the node's whole space it lends. By default all of it on a Backup server, half on an Always online node, none on a Sometimes online one. The node's own vaults come first and may push the others out; when the share fills, the vault or room no member has synced with for longest is dropped whole. At 0 the node holds nothing for others.
  • Given the key, a keyless holder becomes a member and reads what it held.

Vaults, blocks, hash-chains

  • Vault = a name + a key + a policy (RF, storage path, type).
  • Block = a chunk of ciphertext addressed by SHA-256. Sizes: ≤ 512 KiB for small files, 4 MiB for large.
  • Hash-chain versioning = each new version of a file carries a parent_hash pointer to the previous version. Same file edited on two nodes simultaneously → the mesh detects the fork on the next sync session. Always online nodes, backup servers, keyless holders and any node whose folder sends files keep a vault's whole list of versions; a phone keeps each file's current one and its own, and fetches the rest of a file's history when you open it. Whether old versions stay restorable is a per-node decision: a folder-backed node keeps them with keep_history: true (storing real ciphertext blocks alongside the plaintext), bounded by a history_retention policy (keep all / last N versions / last N days / staggered Syncthing-style thinning). A deleted file's last version is kept for the node's keep period under every policy. So a phone can stream files, a laptop hold a plain copy, and a NAS keep the deep history — all of the same vault.
  • Ignore rules = the folder scanner skips junk and VCS files by default (dotfiles, Thumbs.db, editor scratch) and honours per-vault gitignore-style patterns via ignore_globs or a .holdignore file in the folder.

Mesh topology + gossip

There is no central directory. Every node holds its own view of the mesh, built from two protocols: /meshhold/hello/1.0, the first exchange on every new connection, which brings back the other nodes the peer knows, and /meshhold/topo/2.0, through which every node's signed presence floods to the rest. Any node you have seen can be your bootstrap on the next reconnect.

Three encryption layers

  1. Swarm key — 256-bit shared secret; without it, a node can't finish a handshake with any member, on any transport.
  2. Per-connection session key — fresh on every connection and forward-secret: TLS 1.3 on QUIC, a Noise handshake with ChaCha20-Poly1305 on TCP and the masquerades.
  3. Per-vault / chat / tunnel content key — independently shareable; one capability doesn't unlock another.

See the diagram on the home page for the visual.