Repository navigation
feat(ots): publishable anchor manifests with salted ledger ids - #54
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by 범후연이 · project thread
Why
OTS anchor manifests currently record each ledger's basename and absolute path. The
.otsproof 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 optionalid_map_path. With it, the manifest is format 2:pathand noledgername; each row hasledger_id = sha256(salt || basename)plus the samebytes/sha256/head_seal;out_dir(enforced);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.id_map_path, the output is unchanged (format 1). MCP tool signatures are unchanged.Tests
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 insideout_dir, locate after append in both formats).🤖 Generated with Claude Code