Files
blossom/implementations/hashtree/README.md
T
hzrd149andClaude Opus 5 c0b479b86c Document differences from the source proposals
Adds changes-from-source-proposals.md summarizing how this specification
set diverges from PRs #104-#107, and links it from the README's Source
Material section, which previously compressed the entire delta into a
single sentence about excluded compatibility forms.

Calls out the wire-breaking changes separately: the versioned key grew
from 32 to 33 bytes, nhash TLV type 5 grew with it, the blossom: URI
encryption parameters were removed, three legacy read-paths were dropped,
and the replaceable-event tie-break reversed. Notes that the MessagePack
wire format itself is unchanged, with all manifest test vectors carrying
over byte-identical.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015UJK2viVichZctCtyz9zWu
2026-09-09 15:15:04 -05:00

3.4 KiB

Hashtree Specifications

Status of This Document

These documents define an experimental, client-side protocol for representing files and directories as content-addressed trees stored on Blossom servers. They are not Blossom Upgrade Documents (BUDs) and are not part of the official Blossom specification.

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, NOT RECOMMENDED, MAY, and OPTIONAL in these documents are to be interpreted as described in BCP 14 when, and only when, they appear in all capitals.

Specifications

The documents are ordered by dependency:

  1. Hashtree Manifest Format defines the canonical MessagePack node and link encoding shared by all manifests.
  2. Directory Manifests defines named directory entries and path traversal.
  3. Chunked File Manifests defines fixed-size file chunking and recursive file nodes.
  4. Directory Fanout defines scalable, typed index nodes for large directories.
  5. Hashtree Encryption defines the optional encryption layer and its suites.
  6. Hashtree References defines mutable and immutable references to objects and paths in a Hashtree.

Protocol Model

A Hashtree is unencrypted by default. Blossom servers store every blob, chunk, and manifest, encrypted or not, as an ordinary blob addressed by the SHA-256 hash of its stored bytes. Hashtree clients construct, optionally encrypt, fetch, validate, decode, and traverse the tree. No Hashtree-specific server behavior is required.

htree reference
      |
      v
root manifest (file, directory, or directory fanout)
      |
      +-- manifest links
      |      +-- raw Blossom blobs
      |      +-- encrypted Blossom blobs
      |      +-- child manifests
      |
      +-- path traversal and file assembly

Source Material

This specification set consolidates and revises the following reviewed proposals:

Proposal Imported revision Content
PR #104 ef6c7fb4435530556fb32345eec010505bda017a Content Hash Key encryption, revised into the optional encryption layer
PR #105 1b2f140b0d3fd06a907b159d7628e1d007588da3 MessagePack directory manifests
PR #106 1848f77c4a25b70d10a3963d66ba1c8aba1e4f2c Chunked files and directory fanout
PR #107 018f3e32227cf8fd1fba8dff2d39d6e3370d2d52 Hashtree references

The old draft compatibility forms from those proposals are intentionally excluded. This specification set defines only typed directory fanout nodes, Nostr kind 30064 mutable roots, and TLV-encoded nhash identifiers.

Changes from the Source Proposals summarizes how this specification set differs from those revisions, including the changes that break compatibility with implementations built against them.

Identifier Status

The htree URI scheme, nhash human-readable prefix, media types, and Nostr kind 30064 are experimental assignments. Implementations MUST NOT assume that they are registered by IANA or the Nostr protocol registry.