docs: Authenticated trie integration spec — Phase 1B state-proof endpoint#119
Open
ottobot-ai wants to merge 1 commit intoscasplte2:mainfrom
Open
docs: Authenticated trie integration spec — Phase 1B state-proof endpoint#119ottobot-ai wants to merge 1 commit intoscasplte2:mainfrom
ottobot-ai wants to merge 1 commit intoscasplte2:mainfrom
Conversation
…oint
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)
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
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