|
| 1 | +# FlowChain Local Alpha Object Identity |
| 2 | + |
| 3 | +Status: local/test V0. |
| 4 | + |
| 5 | +This document defines the canonical cryptographic IDs for the FlowChain Local |
| 6 | +Alpha object model. These IDs are the crypto package boundary that devnet, |
| 7 | +control-plane, API, verifier, and dashboard agents should consume. Do not invent |
| 8 | +alternate hash formats for these objects. |
| 9 | + |
| 10 | +## RD Crypto Boundary |
| 11 | + |
| 12 | +The user noted that the RD library is for cryptography. I inspected this |
| 13 | +workspace and nearby `E:\FlowMemory` research paths. |
| 14 | + |
| 15 | +No RD-named cryptography library exists inside this worktree. The current |
| 16 | +authoritative FlowMemory crypto package is: |
| 17 | + |
| 18 | +```text |
| 19 | +E:\FlowMemory\flowmemory-crypto\crypto |
| 20 | +``` |
| 21 | + |
| 22 | +Nearby research/RD crypto sources do exist: |
| 23 | + |
| 24 | +```text |
| 25 | +E:\FlowMemory\github-research-sources\noesis-l1\crates\noesis-crypto |
| 26 | +E:\FlowMemory\github-research-sources\noesis-l1\crates\noesis-zk |
| 27 | +E:\FlowMemory\github-research-sources\noesis-l1\crates\flowchain-pw |
| 28 | +E:\FlowMemory\github-research-sources\FlowMemory-2026-05-11\projects\noesis-l1\crates\noesis-crypto |
| 29 | +``` |
| 30 | + |
| 31 | +Those crates are useful RD references for object vocabulary, future proof |
| 32 | +interfaces, and Process-Witness research. They are not consumed directly by this |
| 33 | +package because the current `noesis-crypto` crate uses SHA-256 prototype object |
| 34 | +hashes, and `noesis-zk` explicitly marks production proof systems and |
| 35 | +commitment schemes as scaffolded. FlowChain Local Alpha IDs use the existing |
| 36 | +FlowMemory rule: |
| 37 | + |
| 38 | +```text |
| 39 | +keccak256(abi.encode(TYPEHASH, field_1, field_2, ...)) |
| 40 | +TYPEHASH = keccak256(bytes(type_string)) |
| 41 | +``` |
| 42 | + |
| 43 | +FlowChain should consume the nearby RD libraries as research inputs only until a |
| 44 | +separate compatibility issue accepts a cross-language adapter and vectors that |
| 45 | +match the Keccak typed hashes in this package. |
| 46 | + |
| 47 | +## Object IDs |
| 48 | + |
| 49 | +All object IDs are bytes32 Keccak typed hashes. Variable-length names, policy |
| 50 | +documents, manifests, source code, response bodies, and dependency sets must be |
| 51 | +pre-hashed before entering the typed object. |
| 52 | + |
| 53 | +| Object | ID field | Type string key | Domain string key | Helper | |
| 54 | +| --- | --- | --- | --- | --- | |
| 55 | +| AgentAccount | `agentId` | `agentAccountV0` | `agentAccountId` | `agentAccountId` | |
| 56 | +| ModelPassport | `modelId` | `modelPassportV0` | `modelPassportId` | `modelPassportId` | |
| 57 | +| WorkReceipt | `workReceiptId` | `workReceiptV0` | `workReceiptId` | `workReceiptId` | |
| 58 | +| ArtifactAvailabilityProof | `proofId` | `artifactAvailabilityProofV0` | `artifactAvailabilityProofId` | `artifactAvailabilityProofId` | |
| 59 | +| VerifierModule | `moduleId` | `verifierModuleV0` | `verifierModuleId` | `verifierModuleId` | |
| 60 | +| VerifierReport | `reportId` | `verifierReportV0` | `verifierReportDigest` | `verifierReportHash` | |
| 61 | +| MemoryCell | `memoryCellId` | `memoryCellV0` | `memoryCellId` | `memoryCellId` | |
| 62 | +| Challenge | `challengeId` | `challengeV0` | `challengeId` | `challengeId` | |
| 63 | +| FinalityReceipt | `finalityReceiptId` | `finalityReceiptV0` | `finalityReceiptId` | `finalityReceiptId` | |
| 64 | +| HardwareSignalEnvelope | `hardwareSignalEnvelopeId` | `hardwareSignalEnvelopeV0` | `hardwareSignalEnvelopeId` | `hardwareSignalEnvelopeId` | |
| 65 | +| Control-plane provenance response | `provenanceResponseId` | `controlPlaneProvenanceResponseV0` | `controlPlaneProvenanceResponseId` | `controlPlaneProvenanceResponseId` | |
| 66 | + |
| 67 | +`WorkReceipt` and `VerifierReport` intentionally reuse the existing |
| 68 | +FlowMemory V0 domains, `flowmemory.v0.work.receipt-id` and |
| 69 | +`flowmemory.v0.verifier.report-digest`. The other Local Alpha object domains |
| 70 | +use `flowchain.local-alpha.v0.*`. This keeps the local testnet vocabulary |
| 71 | +compatible with the existing receipt/report package instead of creating a |
| 72 | +second receipt/report identity system. |
| 73 | + |
| 74 | +`LocalSignatureEnvelope` uses `localSignatureEnvelopeV0` and |
| 75 | +`localSignatureEnvelopeHash`. It signs the object ID, object schema hash, |
| 76 | +domain separator, signer ID, signer key ID, signer role, sequence, validity |
| 77 | +window, and nonce. The signing digest is the local EIP-712 style digest over |
| 78 | +that struct hash and the object domain separator. |
| 79 | + |
| 80 | +Runnable definitions live in `crypto/src/objects.js`. |
| 81 | + |
| 82 | +Canonical object fixtures live in: |
| 83 | + |
| 84 | +```text |
| 85 | +crypto/fixtures/local-alpha-objects.json |
| 86 | +``` |
| 87 | + |
| 88 | +Package-level vectors are pinned in: |
| 89 | + |
| 90 | +```text |
| 91 | +crypto/fixtures/vectors.json |
| 92 | +``` |
| 93 | + |
| 94 | +The Local Alpha JSON Schemas live in: |
| 95 | + |
| 96 | +```text |
| 97 | +schemas/flowmemory/agent-account.schema.json |
| 98 | +schemas/flowmemory/model-passport.schema.json |
| 99 | +schemas/flowmemory/work-receipt.schema.json |
| 100 | +schemas/flowmemory/memory-cell.schema.json |
| 101 | +schemas/flowmemory/artifact-availability-proof.schema.json |
| 102 | +schemas/flowmemory/verifier-module.schema.json |
| 103 | +schemas/flowmemory/verifier-report.schema.json |
| 104 | +schemas/flowmemory/challenge.schema.json |
| 105 | +schemas/flowmemory/finality-receipt.schema.json |
| 106 | +schemas/flowmemory/hardware-signal-envelope.schema.json |
| 107 | +schemas/flowmemory/local-signature-envelope.schema.json |
| 108 | +schemas/flowmemory/control-plane-provenance-response.schema.json |
| 109 | +``` |
| 110 | + |
| 111 | +## Local Signature Envelope Rules |
| 112 | + |
| 113 | +Local Alpha accepts four signer roles: |
| 114 | + |
| 115 | +| Role | Intended signer | Boundary | |
| 116 | +| --- | --- | --- | |
| 117 | +| `operator` | local operator process or operator-vault adapter | No value-bearing wallet claim. The fixture keys are deterministic no-value test keys. | |
| 118 | +| `agent` | registered `AgentAccount` local key | Signs local work receipts, memory cells, challenges, or agent-scoped provenance. | |
| 119 | +| `verifier` | local verifier module/report signer | Signs verifier modules, verifier reports, and finality receipts as testnet statements, not trustless proofs. | |
| 120 | +| `hardware` | FlowRouter or simulator device key | Signs low-bandwidth control envelopes only. Heavy payloads remain off-chain. | |
| 121 | + |
| 122 | +Envelope validation requires: |
| 123 | + |
| 124 | +- `objectSchema`, `objectType`, and `objectTypeHash` match the document schema. |
| 125 | +- `objectId` matches the recomputed document ID. |
| 126 | +- `domain` and `domainSeparator` match the canonical object domain. |
| 127 | +- `signerId`, `signerKeyId`, `publicKey`, and `signature` are present. |
| 128 | +- signer role is allowed for the object type. |
| 129 | +- `envelopeId` and `signingDigest` recompute from the envelope fields. |
| 130 | +- the secp256k1 signature verifies against the signing digest and public key. |
| 131 | +- the caller supplies replay context and rejects repeated signer/domain/sequence tuples. |
| 132 | +- critical object hashes are nonzero, dependency roots are well-formed, parent/root relationships are coherent, and the object type is not swapped. |
| 133 | + |
| 134 | +The fixture validator covers invalid vectors for replay, wrong domain, missing |
| 135 | +signer, bad signature, zero hash, malformed ID, malformed dependency, bad |
| 136 | +parent/root, and wrong object type. Every Local Alpha object envelope also has a |
| 137 | +valid fixture and a bad-signature invalid fixture. |
| 138 | + |
| 139 | +## Consumer Rules |
| 140 | + |
| 141 | +Chain/devnet: |
| 142 | + |
| 143 | +- Use these IDs as local transaction/object keys. |
| 144 | +- Reject malformed IDs, zero critical roots, bad parent/root transitions, |
| 145 | + wrong object types, and replayed signer/domain/sequence tuples before state |
| 146 | + mutation. |
| 147 | +- Do not treat signatures as production wallet custody or value-bearing |
| 148 | + authorization. |
| 149 | + |
| 150 | +Services/control plane: |
| 151 | + |
| 152 | +- Import the crypto package or reproduce the type strings and vectors exactly. |
| 153 | +- Run `validateLocalAlphaEnvelope` before accepting local object documents from |
| 154 | + transactions, APIs, fixtures, or hardware packets. |
| 155 | +- Store validation errors explicitly instead of silently coercing objects. |
| 156 | + |
| 157 | +Dashboard/workbench: |
| 158 | + |
| 159 | +- Display object IDs, domains, signer role, status label, and validation errors. |
| 160 | +- Show verifier reports and finality receipts as local/test statements unless a |
| 161 | + later proof/enforcement path is accepted. |
| 162 | + |
| 163 | +Hardware: |
| 164 | + |
| 165 | +- Use `HardwareSignalEnvelope` for compact control signals only. |
| 166 | +- Treat LoRa and Meshtastic fields as low-bandwidth control provenance, not as |
| 167 | + artifact transport or internet replacement. |
| 168 | +- Keep raw hardware payloads off-chain and bind them through `signalRoot`. |
| 169 | + |
| 170 | +## What V0 Proves |
| 171 | + |
| 172 | +V0 proves deterministic identity and tamper-evident binding for the typed fields |
| 173 | +included in each object ID. If any included field changes, the ID changes. |
| 174 | + |
| 175 | +V0 also proves: |
| 176 | + |
| 177 | +- field-order compatibility with the FlowMemory Keccak ABI typed-hash rule; |
| 178 | +- domain/type-string separation for each object class; |
| 179 | +- malformed hex rejection for bytes32/address fields; |
| 180 | +- canonical JSON stability for pre-hashed control-plane response bodies; |
| 181 | +- duplicate ID detection in fixture validation; |
| 182 | +- explicit finality and challenge state labels for local/test consumers. |
| 183 | + |
| 184 | +## What V0 Does Not Prove |
| 185 | + |
| 186 | +V0 does not prove that an AI model output is correct, that a verifier is honest, |
| 187 | +that storage remains available forever, that hidden dependencies are complete, |
| 188 | +or that a challenge outcome is economically secure. |
| 189 | + |
| 190 | +V0 does not implement production proof circuits, GPU proofs, verifier |
| 191 | +economics, encrypted compute, production consensus, or a public L1. The object |
| 192 | +IDs are stable commitments and provenance handles, not a trustless proof system. |
| 193 | + |
| 194 | +## Explicit RD Gates |
| 195 | + |
| 196 | +These tracks are gated and must not be treated as implemented by this package: |
| 197 | + |
| 198 | +- Process-Witness: research input only until public inputs, witness format, |
| 199 | + replay policy, privacy boundaries, and cross-language vectors are accepted. |
| 200 | +- SEAL/dependency privacy: attach through `dependencyRoot` and challenge roots |
| 201 | + only until dependency atom schemas, disclosure policy, and verifier checks are |
| 202 | + accepted. |
| 203 | +- Synthetic Non-Amplification: no claims until there is a formal rule, fixture |
| 204 | + corpus, verifier module, and dashboard/status vocabulary. |
| 205 | +- Advanced encrypted compute: no runtime or security claim until threat model, |
| 206 | + key lifecycle, leakage policy, and deterministic verifier boundary exist. |
| 207 | +- GPU proofs: no proof claim until proof system, public inputs, cost model, |
| 208 | + verifier module, and reproducible local vectors exist. |
| 209 | +- Audited production proof systems: no audit or production-readiness claim until |
| 210 | + a named audit artifact, issue/decision record, and enforcement path are merged. |
| 211 | + |
| 212 | +## Dependency And SEAL Mapping |
| 213 | + |
| 214 | +The Local Alpha object model leaves a forward-compatible slot for future SEAL or |
| 215 | +dependency-atom work: |
| 216 | + |
| 217 | +- `MemoryCell.dependencyRoot` commits to the dependency atoms or dependency |
| 218 | + certificate set that a memory update relies on. |
| 219 | +- `ControlPlaneProvenanceResponse.dependencyRoot` lets an API response cite the |
| 220 | + same dependency state without embedding private dependency atoms. |
| 221 | +- `Challenge.challengeType = dependency_omission` gives omitted-dependency |
| 222 | + challenges a canonical local/test object ID. |
| 223 | +- `VerifierModule.supportedChallengeTypesRoot` and `supportedModesRoot` can |
| 224 | + commit to future verifier support for SEAL, dependency separation, or |
| 225 | + completeness checks. |
| 226 | +- `FinalityReceipt.challengeRoot` keeps finality downgradeable if a later |
| 227 | + dependency challenge succeeds. |
| 228 | + |
| 229 | +Future SEAL objects should hash their own public inputs into roots and attach |
| 230 | +through these fields. They should not mutate the V0 object ID type strings. |
| 231 | + |
| 232 | +## Future Proof-Carrying Receipts |
| 233 | + |
| 234 | +Proof-carrying receipts can be added without breaking V0 IDs by treating proofs |
| 235 | +as new linked objects rather than new bytes inside existing ID preimages. |
| 236 | + |
| 237 | +The stable path is: |
| 238 | + |
| 239 | +1. Keep V0 IDs unchanged. |
| 240 | +2. Define a new proof object with its own schema, type string, public inputs, |
| 241 | + proof system id, verifier module id, and proof artifact commitment. |
| 242 | +3. Link that proof object to `receiptId`, `reportId`, `challengeId`, |
| 243 | + `finalityReceiptId`, or `dependencyRoot`. |
| 244 | +4. If a breaking receipt hash is needed later, create a V1 type string instead |
| 245 | + of changing V0. |
| 246 | + |
| 247 | +This lets Local Alpha dashboards and APIs rely on V0 IDs while future proof |
| 248 | +systems attach stronger evidence as additional commitments. |
0 commit comments