enigma-memory 0.1.13 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +36 -17
  2. package/apps/cli/bin/enigma.mjs +320 -42
  3. package/deploy/docker-compose.local-production-simulation.yml +10 -11
  4. package/docs/benchmark-attestation-network.md +487 -487
  5. package/docs/benchmark-reproducibility.md +10 -9
  6. package/docs/demo-proof-network.md +275 -275
  7. package/docs/developer-ecosystem.md +223 -223
  8. package/docs/developer-proof-quickstart.md +325 -325
  9. package/docs/enigma-memory-ready-conformance.md +376 -376
  10. package/docs/hosted-cloud-product.md +10 -0
  11. package/docs/install-anywhere.md +34 -17
  12. package/docs/installers-and-desktop.md +9 -7
  13. package/docs/proof-network-build-notes.md +240 -240
  14. package/docs/proof-network.md +257 -257
  15. package/docs/sdk-api.md +324 -324
  16. package/docs/solana-devnet-acceptance.md +48 -0
  17. package/docs/solana-proof-rail.md +453 -453
  18. package/examples/ci/github-actions.yml +6 -8
  19. package/package.json +8 -1
  20. package/packages/mcp-server/src/index.js +1 -1
  21. package/packages/passport/src/index.js +9 -5
  22. package/scripts/build-benchmark-proof-release.mjs +391 -0
  23. package/scripts/build-goal-completion-audit.mjs +11 -5
  24. package/scripts/build-hosted-api-key-lifecycle.mjs +1 -1
  25. package/scripts/build-hosted-customer-lifecycle.mjs +1 -1
  26. package/scripts/build-installer-assets.mjs +126 -10
  27. package/scripts/build-production-handoff-packet.mjs +7 -6
  28. package/scripts/build-production-unblocker.mjs +409 -0
  29. package/scripts/build-proof-network-packet.mjs +1 -1
  30. package/scripts/release-audit.mjs +71 -2
  31. package/scripts/run-standard-memory-benchmarks.mjs +1 -1
  32. package/scripts/wait-for-backend-ready.mjs +4 -2
@@ -1,325 +1,325 @@
1
- # Developer proof quickstart
2
-
3
- This quickstart shows how to create, inspect, and verify Enigma Proof Network artifacts from a developer workstation. The product boundary is intentionally narrow: Enigma is the private memory controller for AI, and Solana is an optional proof, permission, and settlement rail that should carry hashes, roots, and opaque refs only.
4
-
5
- Use the commands as local proof-artifact exercises. They do not submit Solana transactions, call Solana RPC, call model providers, create hosted Enigma resources, or put raw memory on-chain.
6
-
7
- ## 0. Public-safety rule
8
-
9
- Before running any command, decide what is safe to publish.
10
-
11
- Allowed in proof artifacts:
12
-
13
- - SHA-256 hashes and Merkle roots;
14
- - opaque refs such as `memory-batch:demo:v1`, `agent:demo-reviewer`, or `dataset:public-fixture:v1`;
15
- - counts, timestamps, local artifact ids, and public authority refs;
16
- - booleans such as `transaction_submitted:false` and `raw_memory_on_chain:false`.
17
-
18
- Never place these in a proof artifact, command flag, JSON example, issue comment, gist, explorer memo, or packet:
19
-
20
- - raw memory, prompts, transcripts, completions, embeddings, dataset rows, or provider responses;
21
- - tenant names, customer names, private file paths, ACL bodies, policy documents, or internal ticket text;
22
- - API keys, bearer tokens, private keys, seed phrases, mnemonics, passwords, or signed provider payloads.
23
-
24
- ## 1. Install and run the local test-drive
25
-
26
- Start in an empty working directory or a scratch directory inside your project. For a one-off test-drive, `npx --package` downloads and runs the CLI without editing your project dependencies:
27
-
28
- ```sh
29
- mkdir -p .enigma/proof-quickstart
30
-
31
- npx --yes --package enigma-memory enigma test-drive \
32
- --out-dir .enigma/proof-quickstart/test-drive \
33
- --overwrite
34
- ```
35
-
36
- For a project-local install, add the package first and then run the same CLI:
37
-
38
- ```sh
39
- npm install enigma-memory
40
- npx enigma test-drive \
41
- --out-dir .enigma/proof-quickstart/test-drive \
42
- --overwrite
43
- ```
44
-
45
- The test drive creates local Enigma demo artifacts. Treat full local bundles as private until reviewed. For a proof-network flow, publish only reviewed hashes, roots, refs, and verifier output.
46
-
47
- If you are working from a source checkout instead of npm, run the CLI directly from the package checkout:
48
-
49
- ```sh
50
- cd enigma
51
- node apps/cli/bin/enigma.mjs test-drive \
52
- --out-dir ../.enigma/proof-quickstart/test-drive \
53
- --overwrite
54
- ```
55
-
56
- ## 2. Create a Solana-ready anchor batch
57
-
58
- An anchor batch commits to memory-related roots without publishing memory. It is a local transaction plan, not a submitted transaction.
59
-
60
- ```sh
61
- npx --yes --package enigma-memory enigma chain anchor \
62
- --root sha256:1111111111111111111111111111111111111111111111111111111111111111 \
63
- --root sha256:2222222222222222222222222222222222222222222222222222222222222222 \
64
- --root sha256:3333333333333333333333333333333333333333333333333333333333333333 \
65
- --ref memory-batch:quickstart:v1 \
66
- --ref receipt-root:quickstart:v1 \
67
- --ref policy-root:quickstart:v1 \
68
- --batch-ref anchor:quickstart:001 \
69
- --out .enigma/proof-quickstart/anchor-batch.json
70
- ```
71
-
72
- The chain should eventually see only the opaque root or payload reference an operator chooses to submit. The JSON file remains the local artifact of record for developer verification.
73
-
74
- Verify it:
75
-
76
- ```sh
77
- npx --yes --package enigma-memory enigma chain verify \
78
- --file .enigma/proof-quickstart/anchor-batch.json
79
- ```
80
-
81
- ## 3. Create a scoped capability grant
82
-
83
- A grant records that a public subject ref is allowed to use a specific memory capability for a public-safe scope until an expiry time. It is not a live auth mutation by itself.
84
-
85
- ```sh
86
- npx --yes --package enigma-memory enigma chain grant \
87
- --subject agent:demo-reviewer \
88
- --capability memory.receipt_summary.read \
89
- --scope proof.summary \
90
- --resource-ref sha256:1111111111111111111111111111111111111111111111111111111111111111 \
91
- --policy-hash sha256:4444444444444444444444444444444444444444444444444444444444444444 \
92
- --expires-at 2026-12-31T00:00:00.000Z \
93
- --grant-ref grant:quickstart:001 \
94
- --out .enigma/proof-quickstart/capability-grant.json
95
- ```
96
-
97
- Verify it:
98
-
99
- ```sh
100
- npx --yes --package enigma-memory enigma chain verify \
101
- --file .enigma/proof-quickstart/capability-grant.json
102
- ```
103
-
104
- Good grant inputs are intentionally boring:
105
-
106
- - `--subject` is an opaque agent, app, wallet, or reviewer ref;
107
- - `--capability` is a small action name, not a paragraph of policy;
108
- - `--scope` is a public scope token, not raw ACL JSON;
109
- - `--resource-ref` and `--policy-hash` are hashes or public refs, not the underlying resource or policy body;
110
- - `--expires-at` is explicit so grants are not permanent by default.
111
-
112
- ## 4. Revoke the grant
113
-
114
- A revocation records that a prior grant hash is no longer accepted for the relevant scope. It does not prove that a model, provider, cache, export, or third-party system forgot data.
115
-
116
- ```sh
117
- npx --yes --package enigma-memory enigma chain revoke \
118
- --grant-hash sha256:5555555555555555555555555555555555555555555555555555555555555555 \
119
- --reason scope-ended \
120
- --revocation-ref revocation:quickstart:001 \
121
- --out .enigma/proof-quickstart/capability-revocation.json
122
- ```
123
-
124
- Verify it:
125
-
126
- ```sh
127
- npx --yes --package enigma-memory enigma chain verify \
128
- --file .enigma/proof-quickstart/capability-revocation.json
129
- ```
130
-
131
- Use the real `capability_grant_hash` or `grant_hash` from your reviewed grant artifact when leaving demo mode. Do not paste the original private policy, subject name, customer name, or private grant context into the revocation.
132
-
133
- ## 5. Create a benchmark attestation
134
-
135
- A benchmark attestation binds a public report hash to dataset, runner, package, and metric refs. It should not contain raw benchmark rows, questions, answers, prompts, completions, provider responses, or private dataset paths.
136
-
137
- With a precomputed report hash:
138
-
139
- ```sh
140
- npx --yes --package enigma-memory enigma chain attest \
141
- --report-hash sha256:6666666666666666666666666666666666666666666666666666666666666666 \
142
- --dataset-ref dataset:quickstart-public-fixture:v1 \
143
- --runner-ref runner:enigma-local:v1 \
144
- --package-ref npm:enigma-memory@0.1.13 \
145
- --score recall_at_5=1 \
146
- --score p95_latency_ms=14 \
147
- --out .enigma/proof-quickstart/benchmark-attestation.json
148
- ```
149
-
150
- With a reviewed local report file:
151
-
152
- ```sh
153
- npx --yes --package enigma-memory enigma chain attest \
154
- --report-file .enigma/proof-quickstart/reviewed-benchmark-report.json \
155
- --dataset-ref dataset:quickstart-public-fixture:v1 \
156
- --runner-ref runner:enigma-local:v1 \
157
- --package-ref npm:enigma-memory@0.1.13 \
158
- --score recall_at_5=1 \
159
- --score p95_latency_ms=14 \
160
- --out .enigma/proof-quickstart/benchmark-attestation.json
161
- ```
162
-
163
- Verify it:
164
-
165
- ```sh
166
- npx --yes --package enigma-memory enigma chain verify \
167
- --file .enigma/proof-quickstart/benchmark-attestation.json
168
- ```
169
-
170
- The safe claim is that the attestation binds a report hash and public refs to a local proof artifact. It is not evidence of comparative benchmark rank, legal/compliance status, provider behavior, model state, or customer production deployment.
171
-
172
- ## 6. Inspect the JSON before sharing
173
-
174
- First, verify every artifact locally:
175
-
176
- ```sh
177
- for file in .enigma/proof-quickstart/*.json; do
178
- npx --yes --package enigma-memory enigma chain verify --file "$file"
179
- done
180
- ```
181
-
182
- Then inspect only public-safe fields. With `jq`:
183
-
184
- ```sh
185
- jq '{schema, transaction_submitted, raw_memory_on_chain, anchor_batch_hash, capability_grant_hash, capability_revocation_hash, benchmark_attestation_hash}' \
186
- .enigma/proof-quickstart/anchor-batch.json
187
- ```
188
-
189
- Without `jq`, use Node:
190
-
191
- ```sh
192
- node -e "const fs=require('node:fs'); const p=process.argv[1]; const x=JSON.parse(fs.readFileSync(p,'utf8')); const keys=['schema','transaction_submitted','raw_memory_on_chain','anchor_batch_hash','capability_grant_hash','capability_revocation_hash','benchmark_attestation_hash']; console.log(JSON.stringify(Object.fromEntries(keys.filter(k=>k in x).map(k=>[k,x[k]])), null, 2));" \
193
- .enigma/proof-quickstart/anchor-batch.json
194
- ```
195
-
196
- Checklist before publishing or sending an artifact:
197
-
198
- - `schema` starts with `enigma.proof_network.`;
199
- - `transaction_submitted` is `false` unless a separate operator-controlled submission artifact exists;
200
- - `raw_memory_on_chain` is `false`;
201
- - roots and hashes use `sha256:<64 lowercase hex characters>`;
202
- - refs are opaque and public-safe;
203
- - no field names include private payload concepts such as `prompt`, `text`, `content`, `transcript`, `embedding`, `acl`, `secret`, `api_key`, `private_key`, `tenant_name`, or `customer_name`;
204
- - verifier output returns `ok:true` for the artifact type you intend to share.
205
-
206
- A quick secret-name scan can catch obvious mistakes before review:
207
-
208
- ```sh
209
- node -e "const fs=require('node:fs'); const bad=/(raw|plaintext|prompt|message|text|content|transcript|completion|embedding|acl|provider_response|credential|api_key|secret|password|private_key|seed|mnemonic|tenant_name|customer_name)/i; const allowed=new Set(['raw_memory_on_chain','transaction_submitted']); for (const p of process.argv.slice(1)) { const x=JSON.parse(fs.readFileSync(p,'utf8')); const hits=[]; (function walk(v,path){ if (v && typeof v==='object') for (const [k,c] of Object.entries(v)) { if (!allowed.has(k) && bad.test(k)) hits.push(path?path+'.'+k:k); walk(c,path?path+'.'+k:k); } })(x,''); console.log(JSON.stringify({file:p, suspicious_keys:hits}, null, 2)); }" \
210
- .enigma/proof-quickstart/*.json
211
- ```
212
-
213
- This scan is only a convenience. Human review still matters because a safe-looking key can hold unsafe content.
214
-
215
- ## 7. SDK examples
216
-
217
- Use the SDK when your app wants to create proof artifacts in process and then decide separately where to write, review, or publish them. Builders and validators are local functions; they do not submit transactions or call providers.
218
-
219
- ### Anchor batch
220
-
221
- ```js
222
- import {
223
- createProofNetworkAnchorBatch,
224
- validateProofNetworkAnchorBatch,
225
- } from 'enigma-memory/proof-network';
226
-
227
- const anchorBatch = createProofNetworkAnchorBatch({
228
- anchor_ref: 'anchor:quickstart:001',
229
- roots: [
230
- 'sha256:1111111111111111111111111111111111111111111111111111111111111111',
231
- 'sha256:2222222222222222222222222222222222222222222222222222222222222222',
232
- ],
233
- });
234
-
235
- const anchorCheck = validateProofNetworkAnchorBatch(anchorBatch);
236
- if (!anchorCheck.ok) throw new Error(anchorCheck.errors.join('; '));
237
- ```
238
-
239
- ### Capability grant and revocation
240
-
241
- ```js
242
- import {
243
- createCapabilityGrant,
244
- validateCapabilityGrant,
245
- createCapabilityRevocation,
246
- validateCapabilityRevocation,
247
- } from 'enigma-memory/proof-network';
248
-
249
- const grant = createCapabilityGrant({
250
- grant_ref: 'grant:quickstart:001',
251
- issuer_ref: 'issuer:quickstart-controller',
252
- subject_ref: 'agent:demo-reviewer',
253
- scope: 'proof.summary',
254
- resource_roots: [
255
- 'sha256:1111111111111111111111111111111111111111111111111111111111111111',
256
- ],
257
- expires_at: '2026-12-31T00:00:00.000Z',
258
- });
259
-
260
- const grantCheck = validateCapabilityGrant(grant);
261
- if (!grantCheck.ok) throw new Error(grantCheck.errors.join('; '));
262
-
263
- const revocation = createCapabilityRevocation({
264
- grant_hash: grant.capability_grant_hash,
265
- reason_ref: 'reason:scope-ended',
266
- revocation_ref: 'revocation:quickstart:001',
267
- });
268
-
269
- const revocationCheck = validateCapabilityRevocation(revocation);
270
- if (!revocationCheck.ok) throw new Error(revocationCheck.errors.join('; '));
271
- ```
272
-
273
- ### Benchmark attestation
274
-
275
- ```js
276
- import {
277
- createBenchmarkAttestation,
278
- validateBenchmarkAttestation,
279
- } from 'enigma-memory/proof-network';
280
-
281
- const attestation = createBenchmarkAttestation({
282
- report_hash: 'sha256:6666666666666666666666666666666666666666666666666666666666666666',
283
- dataset_ref: 'dataset:quickstart-public-fixture:v1',
284
- runner_ref: 'runner:enigma-local:v1',
285
- package_ref: 'npm:enigma-memory@0.1.13',
286
- sample_count: 12,
287
- run_count: 1,
288
- });
289
-
290
- const attestationCheck = validateBenchmarkAttestation(attestation);
291
- if (!attestationCheck.ok) throw new Error(attestationCheck.errors.join('; '));
292
- ```
293
-
294
- ### Proof packet
295
-
296
- ```js
297
- import {
298
- createProofNetworkPacket,
299
- validateProofNetworkPacket,
300
- } from 'enigma-memory/proof-network';
301
-
302
- const packet = createProofNetworkPacket({
303
- packet_ref: 'packet:quickstart:001',
304
- artifacts: [anchorBatch, grant, revocation, attestation],
305
- });
306
-
307
- const packetCheck = validateProofNetworkPacket(packet);
308
- if (!packetCheck.ok) throw new Error(packetCheck.errors.join('; '));
309
- ```
310
-
311
- Share the packet only after reviewing every nested artifact with the same public-safety checklist.
312
-
313
- ## 8. What to say about the artifact
314
-
315
- Safe wording:
316
-
317
- > This proof artifact locally verifies as an Enigma Proof Network artifact. It contains hashes, roots, refs, counts, and boundary booleans only. It is suitable for review or optional operator-controlled anchoring without exposing raw memory.
318
-
319
- Do not say the artifact proves any of the following without separate reviewed evidence:
320
-
321
- - a Solana transaction was submitted;
322
- - raw memory was deleted from every provider or downstream system;
323
- - a model forgot data;
324
- - hosted customer operation exists;
325
- - legal/compliance status, audit certification, comparative benchmark leadership, financial return, or production deployment.
1
+ # Developer proof quickstart
2
+
3
+ This quickstart shows how to create, inspect, and verify Enigma Proof Network artifacts from a developer workstation. The product boundary is intentionally narrow: Enigma is the private memory controller for AI, and Solana is an optional proof, permission, and settlement rail that should carry hashes, roots, and opaque refs only.
4
+
5
+ Use the commands as local proof-artifact exercises. They do not submit Solana transactions, call Solana RPC, call model providers, create hosted Enigma resources, or put raw memory on-chain.
6
+
7
+ ## 0. Public-safety rule
8
+
9
+ Before running any command, decide what is safe to publish.
10
+
11
+ Allowed in proof artifacts:
12
+
13
+ - SHA-256 hashes and Merkle roots;
14
+ - opaque refs such as `memory-batch:demo:v1`, `agent:demo-reviewer`, or `dataset:public-fixture:v1`;
15
+ - counts, timestamps, local artifact ids, and public authority refs;
16
+ - booleans such as `transaction_submitted:false` and `raw_memory_on_chain:false`.
17
+
18
+ Never place these in a proof artifact, command flag, JSON example, issue comment, gist, explorer memo, or packet:
19
+
20
+ - raw memory, prompts, transcripts, completions, embeddings, dataset rows, or provider responses;
21
+ - tenant names, customer names, private file paths, ACL bodies, policy documents, or internal ticket text;
22
+ - API keys, bearer tokens, private keys, seed phrases, mnemonics, passwords, or signed provider payloads.
23
+
24
+ ## 1. Install and run the local test-drive
25
+
26
+ Start in an empty working directory or a scratch directory inside your project. For a one-off test-drive, `npx --package` downloads and runs the CLI without editing your project dependencies:
27
+
28
+ ```sh
29
+ mkdir -p .enigma/proof-quickstart
30
+
31
+ npx --yes --package enigma-memory enigma test-drive \
32
+ --out-dir .enigma/proof-quickstart/test-drive \
33
+ --overwrite
34
+ ```
35
+
36
+ For a project-local install, add the package first and then run the same CLI:
37
+
38
+ ```sh
39
+ npm install enigma-memory
40
+ npx enigma test-drive \
41
+ --out-dir .enigma/proof-quickstart/test-drive \
42
+ --overwrite
43
+ ```
44
+
45
+ The test drive creates local Enigma demo artifacts. Treat full local bundles as private until reviewed. For a proof-network flow, publish only reviewed hashes, roots, refs, and verifier output.
46
+
47
+ If you are working from a source checkout instead of npm, run the CLI directly from the package checkout:
48
+
49
+ ```sh
50
+ cd enigma
51
+ node apps/cli/bin/enigma.mjs test-drive \
52
+ --out-dir ../.enigma/proof-quickstart/test-drive \
53
+ --overwrite
54
+ ```
55
+
56
+ ## 2. Create a Solana-ready anchor batch
57
+
58
+ An anchor batch commits to memory-related roots without publishing memory. It is a local transaction plan, not a submitted transaction.
59
+
60
+ ```sh
61
+ npx --yes --package enigma-memory enigma chain anchor \
62
+ --root sha256:1111111111111111111111111111111111111111111111111111111111111111 \
63
+ --root sha256:2222222222222222222222222222222222222222222222222222222222222222 \
64
+ --root sha256:3333333333333333333333333333333333333333333333333333333333333333 \
65
+ --ref memory-batch:quickstart:v1 \
66
+ --ref receipt-root:quickstart:v1 \
67
+ --ref policy-root:quickstart:v1 \
68
+ --batch-ref anchor:quickstart:001 \
69
+ --out .enigma/proof-quickstart/anchor-batch.json
70
+ ```
71
+
72
+ The chain should eventually see only the opaque root or payload reference an operator chooses to submit. The JSON file remains the local artifact of record for developer verification.
73
+
74
+ Verify it:
75
+
76
+ ```sh
77
+ npx --yes --package enigma-memory enigma chain verify \
78
+ --file .enigma/proof-quickstart/anchor-batch.json
79
+ ```
80
+
81
+ ## 3. Create a scoped capability grant
82
+
83
+ A grant records that a public subject ref is allowed to use a specific memory capability for a public-safe scope until an expiry time. It is not a live auth mutation by itself.
84
+
85
+ ```sh
86
+ npx --yes --package enigma-memory enigma chain grant \
87
+ --subject agent:demo-reviewer \
88
+ --capability memory.receipt_summary.read \
89
+ --scope proof.summary \
90
+ --resource-ref sha256:1111111111111111111111111111111111111111111111111111111111111111 \
91
+ --policy-hash sha256:4444444444444444444444444444444444444444444444444444444444444444 \
92
+ --expires-at 2026-12-31T00:00:00.000Z \
93
+ --grant-ref grant:quickstart:001 \
94
+ --out .enigma/proof-quickstart/capability-grant.json
95
+ ```
96
+
97
+ Verify it:
98
+
99
+ ```sh
100
+ npx --yes --package enigma-memory enigma chain verify \
101
+ --file .enigma/proof-quickstart/capability-grant.json
102
+ ```
103
+
104
+ Good grant inputs are intentionally boring:
105
+
106
+ - `--subject` is an opaque agent, app, wallet, or reviewer ref;
107
+ - `--capability` is a small action name, not a paragraph of policy;
108
+ - `--scope` is a public scope token, not raw ACL JSON;
109
+ - `--resource-ref` and `--policy-hash` are hashes or public refs, not the underlying resource or policy body;
110
+ - `--expires-at` is explicit so grants are not permanent by default.
111
+
112
+ ## 4. Revoke the grant
113
+
114
+ A revocation records that a prior grant hash is no longer accepted for the relevant scope. It does not prove that a model, provider, cache, export, or third-party system forgot data.
115
+
116
+ ```sh
117
+ npx --yes --package enigma-memory enigma chain revoke \
118
+ --grant-hash sha256:5555555555555555555555555555555555555555555555555555555555555555 \
119
+ --reason scope-ended \
120
+ --revocation-ref revocation:quickstart:001 \
121
+ --out .enigma/proof-quickstart/capability-revocation.json
122
+ ```
123
+
124
+ Verify it:
125
+
126
+ ```sh
127
+ npx --yes --package enigma-memory enigma chain verify \
128
+ --file .enigma/proof-quickstart/capability-revocation.json
129
+ ```
130
+
131
+ Use the real `capability_grant_hash` or `grant_hash` from your reviewed grant artifact when leaving demo mode. Do not paste the original private policy, subject name, customer name, or private grant context into the revocation.
132
+
133
+ ## 5. Create a benchmark attestation
134
+
135
+ A benchmark attestation binds a public report hash to dataset, runner, package, and metric refs. It should not contain raw benchmark rows, questions, answers, prompts, completions, provider responses, or private dataset paths.
136
+
137
+ With a precomputed report hash:
138
+
139
+ ```sh
140
+ npx --yes --package enigma-memory enigma chain attest \
141
+ --report-hash sha256:6666666666666666666666666666666666666666666666666666666666666666 \
142
+ --dataset-ref dataset:quickstart-public-fixture:v1 \
143
+ --runner-ref runner:enigma-local:v1 \
144
+ --package-ref npm:enigma-memory@0.1.14 \
145
+ --score recall_at_5=1 \
146
+ --score p95_latency_ms=14 \
147
+ --out .enigma/proof-quickstart/benchmark-attestation.json
148
+ ```
149
+
150
+ With a reviewed local report file:
151
+
152
+ ```sh
153
+ npx --yes --package enigma-memory enigma chain attest \
154
+ --report-file .enigma/proof-quickstart/reviewed-benchmark-report.json \
155
+ --dataset-ref dataset:quickstart-public-fixture:v1 \
156
+ --runner-ref runner:enigma-local:v1 \
157
+ --package-ref npm:enigma-memory@0.1.14 \
158
+ --score recall_at_5=1 \
159
+ --score p95_latency_ms=14 \
160
+ --out .enigma/proof-quickstart/benchmark-attestation.json
161
+ ```
162
+
163
+ Verify it:
164
+
165
+ ```sh
166
+ npx --yes --package enigma-memory enigma chain verify \
167
+ --file .enigma/proof-quickstart/benchmark-attestation.json
168
+ ```
169
+
170
+ The safe claim is that the attestation binds a report hash and public refs to a local proof artifact. It is not evidence of comparative benchmark rank, legal/compliance status, provider behavior, model state, or customer production deployment.
171
+
172
+ ## 6. Inspect the JSON before sharing
173
+
174
+ First, verify every artifact locally:
175
+
176
+ ```sh
177
+ for file in .enigma/proof-quickstart/*.json; do
178
+ npx --yes --package enigma-memory enigma chain verify --file "$file"
179
+ done
180
+ ```
181
+
182
+ Then inspect only public-safe fields. With `jq`:
183
+
184
+ ```sh
185
+ jq '{schema, transaction_submitted, raw_memory_on_chain, anchor_batch_hash, capability_grant_hash, capability_revocation_hash, benchmark_attestation_hash}' \
186
+ .enigma/proof-quickstart/anchor-batch.json
187
+ ```
188
+
189
+ Without `jq`, use Node:
190
+
191
+ ```sh
192
+ node -e "const fs=require('node:fs'); const p=process.argv[1]; const x=JSON.parse(fs.readFileSync(p,'utf8')); const keys=['schema','transaction_submitted','raw_memory_on_chain','anchor_batch_hash','capability_grant_hash','capability_revocation_hash','benchmark_attestation_hash']; console.log(JSON.stringify(Object.fromEntries(keys.filter(k=>k in x).map(k=>[k,x[k]])), null, 2));" \
193
+ .enigma/proof-quickstart/anchor-batch.json
194
+ ```
195
+
196
+ Checklist before publishing or sending an artifact:
197
+
198
+ - `schema` starts with `enigma.proof_network.`;
199
+ - `transaction_submitted` is `false` unless a separate operator-controlled submission artifact exists;
200
+ - `raw_memory_on_chain` is `false`;
201
+ - roots and hashes use `sha256:<64 lowercase hex characters>`;
202
+ - refs are opaque and public-safe;
203
+ - no field names include private payload concepts such as `prompt`, `text`, `content`, `transcript`, `embedding`, `acl`, `secret`, `api_key`, `private_key`, `tenant_name`, or `customer_name`;
204
+ - verifier output returns `ok:true` for the artifact type you intend to share.
205
+
206
+ A quick secret-name scan can catch obvious mistakes before review:
207
+
208
+ ```sh
209
+ node -e "const fs=require('node:fs'); const bad=/(raw|plaintext|prompt|message|text|content|transcript|completion|embedding|acl|provider_response|credential|api_key|secret|password|private_key|seed|mnemonic|tenant_name|customer_name)/i; const allowed=new Set(['raw_memory_on_chain','transaction_submitted']); for (const p of process.argv.slice(1)) { const x=JSON.parse(fs.readFileSync(p,'utf8')); const hits=[]; (function walk(v,path){ if (v && typeof v==='object') for (const [k,c] of Object.entries(v)) { if (!allowed.has(k) && bad.test(k)) hits.push(path?path+'.'+k:k); walk(c,path?path+'.'+k:k); } })(x,''); console.log(JSON.stringify({file:p, suspicious_keys:hits}, null, 2)); }" \
210
+ .enigma/proof-quickstart/*.json
211
+ ```
212
+
213
+ This scan is only a convenience. Human review still matters because a safe-looking key can hold unsafe content.
214
+
215
+ ## 7. SDK examples
216
+
217
+ Use the SDK when your app wants to create proof artifacts in process and then decide separately where to write, review, or publish them. Builders and validators are local functions; they do not submit transactions or call providers.
218
+
219
+ ### Anchor batch
220
+
221
+ ```js
222
+ import {
223
+ createProofNetworkAnchorBatch,
224
+ validateProofNetworkAnchorBatch,
225
+ } from 'enigma-memory/proof-network';
226
+
227
+ const anchorBatch = createProofNetworkAnchorBatch({
228
+ anchor_ref: 'anchor:quickstart:001',
229
+ roots: [
230
+ 'sha256:1111111111111111111111111111111111111111111111111111111111111111',
231
+ 'sha256:2222222222222222222222222222222222222222222222222222222222222222',
232
+ ],
233
+ });
234
+
235
+ const anchorCheck = validateProofNetworkAnchorBatch(anchorBatch);
236
+ if (!anchorCheck.ok) throw new Error(anchorCheck.errors.join('; '));
237
+ ```
238
+
239
+ ### Capability grant and revocation
240
+
241
+ ```js
242
+ import {
243
+ createCapabilityGrant,
244
+ validateCapabilityGrant,
245
+ createCapabilityRevocation,
246
+ validateCapabilityRevocation,
247
+ } from 'enigma-memory/proof-network';
248
+
249
+ const grant = createCapabilityGrant({
250
+ grant_ref: 'grant:quickstart:001',
251
+ issuer_ref: 'issuer:quickstart-controller',
252
+ subject_ref: 'agent:demo-reviewer',
253
+ scope: 'proof.summary',
254
+ resource_roots: [
255
+ 'sha256:1111111111111111111111111111111111111111111111111111111111111111',
256
+ ],
257
+ expires_at: '2026-12-31T00:00:00.000Z',
258
+ });
259
+
260
+ const grantCheck = validateCapabilityGrant(grant);
261
+ if (!grantCheck.ok) throw new Error(grantCheck.errors.join('; '));
262
+
263
+ const revocation = createCapabilityRevocation({
264
+ grant_hash: grant.capability_grant_hash,
265
+ reason_ref: 'reason:scope-ended',
266
+ revocation_ref: 'revocation:quickstart:001',
267
+ });
268
+
269
+ const revocationCheck = validateCapabilityRevocation(revocation);
270
+ if (!revocationCheck.ok) throw new Error(revocationCheck.errors.join('; '));
271
+ ```
272
+
273
+ ### Benchmark attestation
274
+
275
+ ```js
276
+ import {
277
+ createBenchmarkAttestation,
278
+ validateBenchmarkAttestation,
279
+ } from 'enigma-memory/proof-network';
280
+
281
+ const attestation = createBenchmarkAttestation({
282
+ report_hash: 'sha256:6666666666666666666666666666666666666666666666666666666666666666',
283
+ dataset_ref: 'dataset:quickstart-public-fixture:v1',
284
+ runner_ref: 'runner:enigma-local:v1',
285
+ package_ref: 'npm:enigma-memory@0.1.14',
286
+ sample_count: 12,
287
+ run_count: 1,
288
+ });
289
+
290
+ const attestationCheck = validateBenchmarkAttestation(attestation);
291
+ if (!attestationCheck.ok) throw new Error(attestationCheck.errors.join('; '));
292
+ ```
293
+
294
+ ### Proof packet
295
+
296
+ ```js
297
+ import {
298
+ createProofNetworkPacket,
299
+ validateProofNetworkPacket,
300
+ } from 'enigma-memory/proof-network';
301
+
302
+ const packet = createProofNetworkPacket({
303
+ packet_ref: 'packet:quickstart:001',
304
+ artifacts: [anchorBatch, grant, revocation, attestation],
305
+ });
306
+
307
+ const packetCheck = validateProofNetworkPacket(packet);
308
+ if (!packetCheck.ok) throw new Error(packetCheck.errors.join('; '));
309
+ ```
310
+
311
+ Share the packet only after reviewing every nested artifact with the same public-safety checklist.
312
+
313
+ ## 8. What to say about the artifact
314
+
315
+ Safe wording:
316
+
317
+ > This proof artifact locally verifies as an Enigma Proof Network artifact. It contains hashes, roots, refs, counts, and boundary booleans only. It is suitable for review or optional operator-controlled anchoring without exposing raw memory.
318
+
319
+ Do not say the artifact proves any of the following without separate reviewed evidence:
320
+
321
+ - a Solana transaction was submitted;
322
+ - raw memory was deleted from every provider or downstream system;
323
+ - a model forgot data;
324
+ - hosted customer operation exists;
325
+ - legal/compliance status, audit certification, comparative benchmark leadership, financial return, or production deployment.