A stored file answers 2 separate questions. Who may touch it, and where do its bytes sit? hAppBucket gives each answer its own home, and that split is the whole design.

The rules live in a Holochain cell, a private signed log on a node the owner runs, where every change is signed by the owner's Ed25519 key. The bytes live as encrypted chunks in a plain object store: the owner's Cloudflare R2 bucket, or a disk on the owner's server. We call this arrangement Mode B, and it is the primary mode for anything measured in GB.

The cell holds a compact index while storage holds sealed chunks

Each side of the split carries what it is good at.

WhatWhere it lives
Bucket settings: policy, versioning, retentionHolochain cell
1 manifest per objectHolochain cell
Access grants and revocationsHolochain cell
The wrapped key for each objectHolochain cell
File contents, as 4 MiB encrypted chunksYour R2 bucket or your disk

A manifest is a small private entry describing 1 object: its bucket and key name, size, content type, a SHA-256 of the plaintext, a BLAKE3 root, a reference to where the chunks sit, and the object's data key in wrapped form. Wrapped means the key is itself encrypted, so it opens only inside the owner's runtime.

Manifests are tiny next to the files they describe. The design target is a cell of roughly 20–50 MB even when the bucket holds more than 100 GB. A node that small wakes from a cold start in about 5 to 6 s, the figure we measured on Cloudflare Containers for compact state.

Every write passes through the cell. A PUT, a DELETE or a finished multipart upload goes ahead only under a valid capability grant, Holochain's built-in permission record, tagged happbucket-s3. Revoking that grant closes the S3 key that depends on it.

Each 4 MiB chunk is sealed with its own key and tag

Before any byte leaves the gateway, the file is cut into 4 MiB chunks, and each chunk is encrypted with AES-256-GCM. GCM is an authenticated mode: along with the ciphertext it produces a short tag that changes if a single bit of the chunk is altered.

Each chunk gets its own subkey, derived with HKDF-SHA256 from the object's key and the chunk's position in the file, plus its own nonce. The on-disk format is named HBK1.

Independent chunks give 2 properties at once. Any chunk decrypts alone, with no need for the chunks before it. And any chunk proves its own integrity: a flipped bit fails the tag check and the read stops with an error.

A range read touches only the chunks it crosses

Video players, PDF viewers and backup tools rarely want a whole file. They send an HTTP Range header and expect status 206 with exactly those bytes.

Because every chunk stands alone, the arithmetic is simple. Take a 1 GiB recording, stored as 256 chunks. A player asks for the bytes from 40 MiB to 50 MiB. That span crosses chunks 10, 11 and 12, so the gateway fetches those 3, checks 3 tags, decrypts 12 MiB and returns the 10 MiB requested. The other 253 chunks stay where they are.

Range: 40 MiB to 50 MiB 9 10 11 12 13 14 3 chunks fetched, verified, decrypted 253 of 256 chunks untouched
Chunk numbers start at 0, so chunk 10 begins at byte 40 MiB of the file.

In the planned Cloudflare package, this read path runs at the edge. A Worker keeps a short-lived cache of manifests and live grants, pulls the matching chunks straight from R2, and answers while the Holochain container stays asleep. The target for such a read is about 50–100 ms. That number is a design target for the next milestone; the chunk codec, the range logic and a local-disk driver are built and pass 13 tests today, as the build status shows.

Deleting an object frees its space at once

An append-only chain keeps history forever, which is exactly what an audit trail wants and exactly what a 4 GB video should avoid. The split lets each side behave correctly.

A DELETE retires the object's manifest in the cell. The signed history of what existed, and when it was removed, stays intact. The gateway then drops its reference to the object's chunks, and chunks with 0 remaining references are removed from R2 or disk. The storage bill and the free-space counter reflect the deletion straight away.

Compare the alternative described in the first article of this series: inside the chain, deleting a file freed 0 bytes.

The storage operator sees ciphertext and holds 0 keys

The object store receives opaque 4 MiB blobs under content-derived names. It holds the bulk of the data and the least of the power: with no wrapped key and no grant, a chunk is noise, and with a single altered bit, a chunk fails its tag.

The owner's side holds the opposite: a small cell, a keystore, and every rule. The signing key stays in lair, Holochain's keystore, on a node the owner runs. The envelope key that wraps object keys stays in the owner's runtime. Moving the chunks from R2 to a home server, or the reverse, changes a storage location and leaves custody where it was.

A smaller mode keeps everything on the chain

Some vaults are small and want 0 external storage: configuration bundles, a few key documents. Mode A is designed for them. It keeps each object as private chain entries of up to 1 MiB and is recommended for vaults under 500 MiB in total, where the chain's own economics suit small, precious data. Both modes are designed to sit behind the same S3 endpoint, and How it works compares them side by side.

Granis Personal on Holochain is the first workspace we plan to run on Mode B, and the pattern is open for any hApp, as Holochain apps are called, that stores files.