Skip to content

feat(ots): publishable anchor manifests with salted ledger ids - #54

Merged
bhyi4 merged 1 commit into
mainfrom
feat/manifest-redacted-ledger-names
Nov 23, 2026
Merged

bhyi4 merged 1 commit into
mainfrom
feat/manifest-redacted-ledger-names

Conversation

@bhyi4

@bhyi4 bhyi4 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Requested by 범후연이 · project thread

Why

OTS anchor manifests currently record each ledger's basename and absolute path. The .ots proof is bound to the manifest bytes, so these fields cannot be redacted after the fact without breaking the proof. That makes the manifests unpublishable whenever ledger names or server paths are private.

What

  • build_manifest() / stamp() take an optional id_map_path. With it, the manifest is format 2:
    • no path and no ledger name; each row has ledger_id = sha256(salt || basename) plus the same bytes / sha256 / head_seal;
    • a per-ledger random 16-byte salt is kept in a private JSON map (mode 0600, atomic write), which must be outside out_dir (enforced);
    • salts are stable across runs, so a ledger keeps its id day to day; disclosing one ledger's salt does not reveal the others.
  • locate_ledger(manifest, ledger_file, name=None, salt_hex=None) finds the pinning row in either format, including for a later, appended copy of the ledger (byte-prefix sha256 match), and optionally checks a disclosed name + salt.
  • Without id_map_path, the output is unchanged (format 1). MCP tool signatures are unchanged.

Tests

  • New tests/test_ots_manifest_redaction.py (5 tests: format 1 unchanged, no names or paths in format 2, stable ids with distinct salts, map refused inside out_dir, locate after append in both formats).
  • Full suite locally: 131 passed, 1 skipped.

🤖 Generated with Claude Code

build_manifest()/stamp() accept id_map_path. When given, the manifest
(format 2) carries no filesystem paths and names each ledger only by
sha256(salt || basename), with a per-ledger random salt kept in a private
map that must live outside the published output directory. Salts are
stable so a ledger keeps its id across days; disclosing one ledger's
salt reveals nothing about the others. Default format 1 is unchanged.

locate_ledger() finds the row pinning a ledger file in either format,
including later appended copies (byte-prefix match), and can check a
disclosed name + salt against a format-2 id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bhyi4 bhyi4 self-assigned this Nov 23, 2026
@bhyi4
bhyi4 merged commit 8abf9bd into main Nov 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant