docs: authenticated trie integration spec — Phase 1B state-proof API#119
Merged
scasplte2 merged 2 commits intoJun 12, 2026
Merged
Conversation
ottobot-ai
added a commit
that referenced
this pull request
Feb 26, 2026
- Add 17 Scala test cases covering: * StateRoot generation from stateData fields * MetagraphStateRoot integration with fiber states * ML0 state proof endpoint (GET /v1/state-machines/:fiberId/state-proof) * Two-level MPT proof chain validation * RFC 8785 canonicalization and error handling - Tests follow TDD methodology: all tests fail with 'Feature not implemented' errors - Based on authenticated-trie-integration-spec.md (PR #119) - Ready for implementation phase after spec review approval
12310c5 to
fc4f628
Compare
Collaborator
Author
🤖 Quality Score: 80/100PR Agent Review — Tier 1 Gate
Fixes applied: Shortened commit header (73→70 chars), lowercased PR title Score 80/100 meets threshold (80+). Promoting to human review. CC: @scasplte2 for final review. |
fc4f628 to
af03de9
Compare
Collaborator
Author
|
🔄 Resolved merge conflict and rebased onto main. Conflict resolved: |
af393ab to
59fd400
Compare
12310c5 to
201d3d1
Compare
Collaborator
Author
|
🔄 Resolved 1 conflict (blank line in docker-entrypoint.sh) and rebased onto main. |
629defd to
005a8d7
Compare
Spec for Design card 699fa07f. Covers:
- ML0 GET /v1/state-machines/{fiberId}/state-proof?field=X endpoint
- Two-level MPT proof chain (field → stateRoot → metagraphStateRoot)
- TypeScript verifyStateProof() client implementation (~30 lines)
- RFC 8785 canonicalization notes for cross-language verifiers
- 22 TDD tests in 5 groups (17 Scala + 5 TypeScript)
- 10 acceptance criteria
- Phase 1B blocked on PR scasplte2#117 merge
Depends on PR scasplte2#117 (feat/metagraph-phase1-state-roots)
As of tessellation 4.0.0-rc.10: - DAG L0 (GL0): REQUIRES rollback hash as positional argument - Currency L0 (ML0/CL0): Does NOT require hash (auto-detects from storage) - Data L1: Does NOT require hash The old entrypoint assumed all layers needed the hash for run-rollback, causing ML0/CL0 restarts to fail with 'Unexpected argument' error.
005a8d7 to
5030f6f
Compare
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.
Summary
Specification for Design: Authenticated trie integration for OttoChain state (Trello card 699fa07f).
Covers the full design for Phase 1B: exposing MPT inclusion proofs so clients can trustlessly verify fiber state without downloading the full
CalculatedState.What This Spec Covers
Phase 1B:
GET /v1/state-machines/{fiberId}/state-proof?field={field}Depends on PR #117 (adds
stateRootper-fiber andmetagraphStateRoottoCalculatedState).stateRoot→ metagraph-levelmetagraphStateRoot(same value returned byhashCalculatedState)StatelessMerklePatriciaProducer(recomputes trie fromstateDataon each request, <5ms for typical 5-leaf fiber)GET /fiber/:fiberId/state-proof→ ML0 transparent pass-throughverifyStateProof(proof, root)~30 lines usingcrypto.subtleAPI Contract
TDD Tests
22 tests in 5 groups:
MerklePatriciaVerifier(5 tests)Files:
modules/l0/src/test/scala/xyz/kd5ujc/metagraph_l0/StateProofRouteSuite.scala+ottochain-sdk/src/__tests__/state-proof-verifier.test.tsOpen Questions for James
?fields=balance,ownerin Phase 1B or defer?Acceptance Criteria
See spec for all 10 ACs. Key ones:
MerklePatriciaVerifiermetagraphStateRootequalshashCalculatedStateoutputverifyStateProof()passes cross-language testsRelated