nattviken

hZtorrent — erasure-coded distribution of restic archives

restic encrypts, deduplicates and can be trusted. What it does not do is spread the result across many locations that fail independently. hZtorrent takes a restic archive — already encrypted, so nothing here ever sees plaintext — cuts it into fixed bands, Reed-Solomon codes each group into 20 shards and spreads them. Any 10 of the 20 shards are enough to restore everything.

Guarantees

Measured

valuewhy
shardsany 10 of 20 restore allhalf the shards hold all the information
band32 MiBreplacing a lost shard takes about 6 minutes on a 7.9 Mbit/s uplink; 256 MiB was measured and rejected at 25 minutes
shards reused between generations86 %, on every runthe band order is kept from the previous generation, so new data does not shift old bands
Reed-Solomon, hand-written194 MiB/s on 16 coresa 6 GB vault encodes in about 30 seconds, so every run can afford a whole new generation

The shard reuse took two fixes to get right. restic names its files by content hash, so a new file landed in a random position and shifted every band after it: one run reused 60 of 80 shards, the next none at all. With insertion order kept between generations, it is 86 % every time.

Honest about its limits

A swarm of friends shares an internet provider, a country and a Christmas holiday, so durability figures that assume independent failures would be lying. hZtorrent is an addition to the real offsite copy, never the plan. It also does not encrypt again: restic already did, and a second layer would only add a second key to lose.

The project is at an early stage. The code lives locally and is not published.

← All projects