Skip to content

feat: root-comparing verify path + power-of-two leaf layout (VerifyRoot)#56

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-noether-hkgAV
Jun 18, 2026
Merged

feat: root-comparing verify path + power-of-two leaf layout (VerifyRoot)#56
hyperpolymath merged 1 commit into
mainfrom
claude/dazzling-noether-hkgAV

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Task 1 — root-comparing verify path + power-of-two leaf layout

The executable plumbing that the proven merkleRootVerifyHashSound licenses: build a Merkle tree from block hashes and compare roots, instead of per-ref hash checks. Verified with idris2 0.8.0, --build (--total): 28/28 modules, no warnings.

New module Ochrance.Filesystem.VerifyRoot (all total)

  • padToLength / nextPow2Exp / layoutLeaves — pad an arbitrary-length block-hash list to a power-of-two leaf Vect (filling with emptyHash); nextPow2Exp is fuel-bounded for totality.
  • verifyByRoot — build the padded tree, compare its root to the expected root (Bool).
  • verifyByRootHash — fully live: decode A2ML Hashes via hashToBytes, then root-verify (Maybe Bool).
  • fsBlockHashes / verifySnapshotRoot — the runtime path: verify an FSState against an FSSnapshot's committed rootHash.

This is engineering, not a proof: accept-on-match soundness is the already-proven merkleRootVerifyHashSound (modulo its named CollisionResistant / DecodeInjective boundaries and the primitive ==).

Note on Task 2 (Stage 4)

Stage 4 ("discharge CollisionResistant") is paused pending a design decision — full injectivity is unsatisfiable for a compressing combiner (pigeonhole), so it cannot be honestly proven. Raised with the author; not faked here.

Verification note

Repo CI is a static scan, not a full type-check — proved with a real bootstrapped compiler before pushing.

🤖 Generated with Claude Code


Generated by Claude Code

…VerifyRoot)

The executable plumbing that merkleRootVerifyHashSound licenses: build a Merkle tree
from block hashes and compare roots, instead of per-ref hash checks.

New module Ochrance.Filesystem.VerifyRoot (all total):
- padToLength / nextPow2Exp / layoutLeaves — pad an arbitrary-length block-hash list
  to a power-of-two leaf Vect (filling with emptyHash).
- verifyByRoot — build the padded tree and compare its root to the expected root.
- verifyByRootHash — fully live: decode A2ML Hashes via hashToBytes, then root-verify.
- fsBlockHashes / verifySnapshotRoot — the runtime path: verify an FSState against an
  FSSnapshot's committed rootHash.

Engineering, not a proof: accept-on-match soundness is the already-proven
merkleRootVerifyHashSound (modulo its named CollisionResistant / DecodeInjective
boundaries and the primitive ==).

Verified: idris2 0.8.0, --build (--total), 28/28 modules, no warnings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011z2t8zAxfcCNLJzU7YdpBQ
@hyperpolymath
hyperpolymath marked this pull request as ready for review June 18, 2026 11:50
@hyperpolymath
hyperpolymath merged commit 20864f0 into main Jun 18, 2026
19 checks passed
@hyperpolymath
hyperpolymath deleted the claude/dazzling-noether-hkgAV branch June 18, 2026 11:51
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.

2 participants