docs: Constellation metagraph integration analysis + Phase 1 MPT spec#107
Open
ottobot-ai wants to merge 1 commit intoscasplte2:mainfrom
Open
docs: Constellation metagraph integration analysis + Phase 1 MPT spec#107ottobot-ai wants to merge 1 commit intoscasplte2:mainfrom
ottobot-ai wants to merge 1 commit intoscasplte2:mainfrom
Conversation
Validates the asset model integration approach and specs Phase 1 MPT state commitment implementation. All primitives confirmed in production. Key findings: - Wire format: OttochainMessage extends DataUpdate — no Tessellation changes - hashCalculatedState pathway already wired to L0 anchoring - MPT fully implemented in metakit — zero new dependencies - ML0 rejection handling works for any new AssetUpdate variants Phase 1 implementation: - Add stateRoot to StateMachineFiberRecord - Add metagraphStateRoot to CalculatedState - computeFiberStateRoot in FiberCombiner (MerklePatriciaProducer.inMemory) - Override hashCalculatedState with MPT root - GET /state-proof/:fiberId ML0 route for inclusion proofs 15 TDD tests in 5 groups defined. Open questions (non-blocking for Phase 1): - OQ-1: TokenUnlock semantics (Phase 2 reward emission) - OQ-2: GlobalSnapshotInfo contents (Phase 3 cross-metagraph) - OQ-3: Proto migration timing coordination Refs: Trello 6996301a, docs/proposals/state-commitment-mpt.md
ottobot-ai
added a commit
to ottobot-ai/ottochain
that referenced
this pull request
Feb 26, 2026
…StateRoot via MPT Add cryptographic state commitment infrastructure for Constellation metagraph integration (Phase 1). ## Schema Changes ### StateMachineFiberRecord (Records.scala) - Add `stateRoot: Option[Hash] = None` - Computed from per-fiber stateData fields via MerklePatriciaProducer.stateless - Key: UTF-8 hex of field name, Value: JSON-encoded field value - Backward compatible: defaults to None, existing snapshots decode cleanly ### CalculatedState (CalculatedState.scala) - Add `metagraphStateRoot: Option[Hash] = None` - Computed per snapshot from all fiber stateRoots (fiberId → stateRoot MPT) - Backward compatible: defaults to None ## FiberCombiner changes - `computeStateRoot` helper: builds MPT from MapValue stateData fields - `createStateMachineFiber`: computes initial stateRoot from initialData - `handleCommittedOutcome`: recomputes stateRoot for all updated fibers ## ML0Service changes - `computeMetagraphStateRoot`: MPT of all (fiberId → fiberStateRoot) pairs - `combine`: applies metagraphStateRoot computation after all updates - `hashCalculatedState`: uses metagraphStateRoot when present, falls back to computeDigest ## Tests - MetagraphIntegrationSuite: 15 passing tests across 5 groups - Group 1: StateMachineFiberRecord.stateRoot field (3 tests) - Group 2: CalculatedState.metagraphStateRoot field (3 tests) - Group 3: Schema consistency (3 tests) - Group 4: hashCalculatedState conditional logic (3 tests) - Group 5: State proof API readiness preconditions (3 tests) - All 252 shared-data tests pass Closes Trello card: 6996301a4dba20da34b4fc9e Depends on spec: PR scasplte2#107 (docs/metagraph-integration-analysis)
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
Validates the Constellation metagraph integration approach and specifies Phase 1 implementation (MPT state commitment).
Trello: Analysis: Validate Constellation metagraph integration approach (6996301a)
Validation Results — All GREEN
OttochainMessage extends DataUpdatewire formathashCalculatedState→ L0 commitment pathwayonGlobalSnapshotPullhook (Phase 3)Phase 1 Spec (Implementation-Ready)
Scope: Add MPT state roots to OttoChain, enabling cryptographic proof of fiber state without full state download.
Changes:
StateMachineFiberRecord+stateRoot: HashfieldCalculatedState+metagraphStateRoot: HashfieldFiberCombiner:computeFiberStateRootviaMerklePatriciaProducer.inMemorycomputeMetagraphStateRootaggregates all fiber rootsML0Service.hashCalculatedState→ returnsstate.metagraphStateRootGET /state-proof/:fiberId— inclusion proof endpoint15 TDD tests defined in 5 groups (fiber roots, metagraph root, hashCalculatedState, proof API, backward compatibility).
Open Questions (Non-Blocking for Phase 1)
GlobalSnapshotInfofield contents for Phase 3stateRootbe added to proto (card 699621e1) at same time?5-Type Trie Mapping Clarification
Tokenized-streams protocol dimensions (Permissions/Relationships/Activities/Assets/Group) map to
stateDatafields inside fibers, not separate metagraph-level tries. One per-fiber MPT covers all dimensions. No structural changes to the metagraph data model needed.Refs:
docs/proposals/state-commitment-mpt.md(6-phase proposal, Phase 1 is this card)