You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crypto/FLOWMEMORY_CRYPTO_SPEC.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,9 +110,16 @@ artifactAvailabilityProofId
110
110
verifierModuleId
111
111
challengeId
112
112
finalityReceiptId
113
+
bridgeDepositId
114
+
bridgeCreditId
115
+
bridgeWithdrawalId
116
+
localAccountBalanceId
117
+
localSignerId
118
+
localSignerKeyId
113
119
hardwareSignalEnvelopeId
114
120
controlPlaneProvenanceResponseId
115
121
localSignatureEnvelope
122
+
localTransactionEnvelope
116
123
```
117
124
118
125
## Versioning Strategy
@@ -138,8 +145,10 @@ The current package implements:
138
145
- deterministic verifier reports
139
146
- verifier signature envelopes
140
147
- reorg-aware status handling
141
-
- FlowChain Local Alpha object identity for agent accounts, model passports, work receipts, artifact availability proofs, verifier modules, verifier reports, memory cells, challenges, finality receipts, hardware signal envelopes, and control-plane provenance responses
148
+
- FlowChain Local Alpha object identity for agent accounts, model passports, work receipts, artifact availability proofs, verifier modules, verifier reports, memory cells, challenges, finality receipts, bridge deposits, bridge credits, bridge withdrawals, local account balances, hardware signal envelopes, and control-plane provenance responses
142
149
- Local Alpha operator, agent, verifier, and hardware signature envelope payloads and validators for replay, wrong domain, missing signer, zero hash, malformed id, malformed dependency, bad parent/root, and wrong object type checks
150
+
- local transaction envelopes that bind domain, chain id, nonce, signer, payload hash, validity window, and signature while preserving `payload.tx` for devnet consumers
151
+
- encrypted local wallet/vault helpers for no-value test keys with public metadata import/export and rotation
143
152
- test vectors and cross-language conformance tests
144
153
145
154
The runnable package in `crypto/src/` currently implements the v0 hash utilities and tests them against fixtures in `crypto/fixtures/`.
@@ -151,7 +160,7 @@ MVP should remain verifier-attested for:
151
160
- storage provider claims
152
161
- model or worker behavior
153
162
- final status labels before proof systems exist
154
-
- local operator-vault policy; current fixture keys are deterministic no-value test keys and do not represent wallet custody, production account control, or transferable value
163
+
- local operator-vault policy; current fixture keys and local wallet keys are deterministic or generated no-value test keys and do not represent production wallet custody, production account control, or transferable value
The default vault and generated envelopes live under `crypto/.wallet/`, which is
53
+
ignored by git. Use `wallet:list`, `wallet:unlock`, `wallet:rotate`,
54
+
`wallet:export-public`, and `wallet:import-public` for public account metadata
55
+
and additional local accounts.
56
+
43
57
## Read Order
44
58
45
59
1.`FLOWMEMORY_CRYPTO_SPEC.md`
@@ -50,7 +64,7 @@ npm run validate:local-alpha
50
64
6.`FLOWCHAIN_LOCAL_ALPHA_OBJECTS.md`
51
65
7.`TEST_VECTORS.md`
52
66
53
-
Runnable fixtures live in `fixtures/`. `fixtures/vectors.json` contains the current 33 package-level vectors. `fixtures/local-alpha-objects.json` contains positive and negative Local Alpha object and signed-envelope fixtures. Supporting cross-language vectors live in `test-vectors/`.
67
+
Runnable fixtures live in `fixtures/`. `fixtures/vectors.json` contains the current 41 package-level vectors. `fixtures/local-alpha-objects.json` contains positive and negative Local Alpha object and signed-envelope fixtures. `fixtures/local-transaction-vectors.json` contains wallet-signed local transaction envelopes and negative transaction vectors. Supporting cross-language vectors live in `test-vectors/`.
54
68
55
69
Validate the current vector set with:
56
70
@@ -68,12 +82,14 @@ The Python validator is a cross-check for the FlowPulse aggregate vector. The pr
68
82
-`artifactRoot`: commitment to off-chain artifact bytes and metadata.
69
83
-`reportId`: deterministic identifier for a verifier report.
70
84
-`attestation`: signed worker or verifier envelope over a receipt, report, artifact, or root.
71
-
- Local Alpha object IDs: canonical IDs for `AgentAccount`, `ModelPassport`, `WorkReceipt`, `ArtifactAvailabilityProof`, `VerifierModule`, `VerifierReport`, `MemoryCell`, `Challenge`, `FinalityReceipt`, hardware signal envelopes, and control-plane provenance responses.
85
+
- Local Alpha object IDs: canonical IDs for `AgentAccount`, `ModelPassport`, `WorkReceipt`, `ArtifactAvailabilityProof`, `VerifierModule`, `VerifierReport`, `MemoryCell`, `Challenge`, `FinalityReceipt`, `BridgeDeposit`, `BridgeCredit`, `BridgeWithdrawal`, local account balances, hardware signal envelopes, and control-plane provenance responses.
72
86
- Local Alpha signature envelopes: local operator, agent, verifier, and hardware secp256k1 test signatures over typed object IDs. These are no-value local/test keys and are not wallet custody or production key-management claims.
87
+
- Local transaction envelopes: wallet-signed wrappers that bind domain separation, chain id, nonce, signer, payload hash, validity window, and signature while preserving `payload.tx` for devnet/control-plane consumers.
88
+
- Local wallet vault: AES-256-GCM encrypted local test-key storage with public metadata export. It is not a production wallet or custody system.
73
89
74
90
## Implemented Helpers
75
91
76
-
The package exports Keccak helpers, canonical JSON hashing, typed hash utilities, FlowPulse observation ids, cursor ids, report digests, receipt hashes, artifact/root commitments, work receipt ids, Local Alpha object ids, hardware signal envelope ids, Local Alpha signature envelope payloads, envelope validators, Merkle roots, worker/verifier signature payloads, verifier attestation envelope hashes, and local secp256k1 sign/verify helpers for tests.
92
+
The package exports Keccak helpers, canonical JSON hashing, typed hash utilities, FlowPulse observation ids, cursor ids, report digests, receipt hashes, artifact/root commitments, work receipt ids, Local Alpha object ids, bridge/account-balance ids, hardware signal envelope ids, Local Alpha signature envelope payloads, local transaction envelope payloads, wallet vault helpers, envelope validators, Merkle roots, worker/verifier signature payloads, verifier attestation envelope hashes, and local secp256k1 sign/verify helpers for tests.
77
93
78
94
The implementation is ESM JavaScript with `src/index.d.ts` declarations for TypeScript consumers.
79
95
@@ -99,6 +115,8 @@ Nearby Noesis/FlowChain RD crates under `E:\FlowMemory\github-research-sources\n
99
115
## Downstream Consumption
100
116
101
117
- Chain/devnet agents should use the object ID helpers as transaction/object keys and reject zero roots, malformed IDs, wrong object types, replayed signer sequences, and bad parent/root relationships before state updates.
118
+
- Chain/devnet agents can consume wallet-signed transaction envelopes by validating the envelope and then reading the existing devnet transaction object at `payload.tx`.
102
119
- Services and verifiers should use `validateLocalAlphaEnvelope` before accepting object documents from local transactions, API calls, hardware packets, or fixture imports.
120
+
- Control-plane agents should display only `flowchain.local_wallet_public_metadata.v0` account metadata and never vault ciphertext or private keys.
103
121
- Dashboard/workbench agents should display IDs, domains, signer roles, status labels, and validation errors from these fixtures without implying production proof security.
104
122
- Hardware agents should treat hardware signal envelopes as low-bandwidth authenticated control messages only; payloads remain off-chain and signal roots are commitments, not radio bandwidth or field-deployment claims.
-`fixtures/local-alpha-objects.json`: positive and negative fixtures for FlowChain Local Alpha object identity, signed-envelope validation, and schema validation.
13
-
-`fixtures/vectors.json`: 33 package-level vectors for domains, canonical JSON, observation ids, receipts, artifacts, Merkle roots, reports, attestations, cursors, identities, root commitments, work receipts, devnet block hashes, Local Alpha object ids, hardware signal envelopes, and local signature envelopes.
15
+
-`fixtures/local-transaction-vectors.json`: wallet-signed local transaction envelopes, public wallet metadata, and negative vectors for chain id, domain, signer, nonce replay, malformed roots, malformed bridge deposits, and changed object type.
16
+
-`fixtures/vectors.json`: 41 package-level vectors for domains, canonical JSON, observation ids, receipts, artifacts, Merkle roots, reports, attestations, cursors, identities, root commitments, work receipts, devnet block hashes, Local Alpha object ids, bridge/account objects, signer IDs, local transaction payloads, hardware signal envelopes, and local signature envelopes.
- duplicate Local Alpha object IDs should be rejected by fixture validation
117
121
- canonical JSON key order should not change the control-plane provenance response body hash
118
122
- replayed Local Alpha signer/domain/sequence tuples should be rejected
123
+
- replayed local transaction signer/domain/nonce tuples should be rejected
124
+
- wrong local transaction chain id, domain, and signer should be rejected
125
+
- malformed bridge deposits inside local transaction payloads should be rejected
119
126
- wrong signature domains should be rejected
120
127
- missing local operator/agent/verifier/hardware signer fields should be rejected
121
128
- each Local Alpha object envelope has a bad-signature invalid vector
122
129
- zero critical hashes, malformed object IDs, malformed dependency roots, bad parent/root relationships, and wrong object types should be rejected
123
130
- expired worker signature should be rejected by verifier policy
124
131
- reorged observation should not mutate into a verified report
125
132
126
-
The package tests cover the hash, schema, malformed hex, duplicate, type-string, canonical JSON, signed-envelope, replay, wrong-domain, missing-signer, bad-signature, zero-hash, malformed-dependency, bad-parent/root, and wrong-object-type checks. Expiry and reorg-to-report policy are verifier-service responsibilities because they require policy context, not just hash recomputation.
133
+
The package tests cover the hash, schema, malformed hex, duplicate, type-string, canonical JSON, signed-envelope, transaction-envelope, wallet public-metadata, replay, wrong-chain-id, wrong-domain, wrong-signer, missing-signer, bad-signature, zero-hash, malformed-dependency, malformed-root, malformed bridge-deposit, bad-parent/root, and wrong-object-type checks. Expiry and reorg-to-report policy are verifier-service responsibilities because they require policy context, not just hash recomputation.
0 commit comments