enigma-memory 0.1.11 → 0.1.13
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.
- package/README.md +8 -0
- package/apps/cli/bin/enigma.mjs +362 -10
- package/deploy/SIMULATION.md +152 -0
- package/deploy/docker-compose.local-production-simulation.yml +237 -0
- package/deploy/docker-compose.production.example.yml +19 -0
- package/deploy/kms-mock.mjs +64 -0
- package/deploy/nginx.local-production-simulation.conf +33 -0
- package/deploy/siem-mock.mjs +50 -0
- package/docs/benchmark-attestation-network.md +488 -0
- package/docs/benchmark-reproducibility.md +19 -2
- package/docs/blockchain-only-mechanisms.md +388 -0
- package/docs/client-connectors.md +512 -0
- package/docs/demo-proof-network.md +275 -0
- package/docs/developer-ecosystem.md +47 -4
- package/docs/developer-proof-quickstart.md +325 -0
- package/docs/enigma-memory-ready-conformance.md +376 -0
- package/docs/enterprise-proof-control-plane.md +365 -0
- package/docs/install-anywhere.md +517 -0
- package/docs/market-category-narrative.md +398 -0
- package/docs/memory-drive-health-model.md +649 -0
- package/docs/memory-drive-strategy.md +458 -0
- package/docs/memory-passport-standard.md +445 -0
- package/docs/novelty-invention-candidates.md +161 -0
- package/docs/privacy-ledger-model.md +229 -0
- package/docs/proof-network-build-notes.md +240 -0
- package/docs/proof-network-claim-boundaries.md +318 -0
- package/docs/proof-network-dashboard-spec.md +773 -0
- package/docs/proof-network-glossary.md +27 -0
- package/docs/proof-network-launch-plan.md +421 -0
- package/docs/proof-network-operator-protocol.md +432 -0
- package/docs/proof-network-roadmap.md +431 -0
- package/docs/proof-network-test-plan.md +216 -0
- package/docs/proof-network-threat-model.md +373 -0
- package/docs/proof-network.md +257 -0
- package/docs/sdk-api.md +132 -10
- package/docs/solana-devnet-acceptance.md +226 -0
- package/docs/solana-proof-rail.md +453 -0
- package/examples/ci/github-actions.yml +6 -3
- package/examples/proof-network-anchor.json +37 -0
- package/examples/proof-network-attestation.json +35 -0
- package/examples/proof-network-grant.json +27 -0
- package/examples/proof-network-packet.json +71 -0
- package/package.json +42 -3
- package/packages/mcp-server/src/index.js +1 -1
- package/packages/proof-network/src/index.js +570 -0
- package/scripts/build-hosted-api-key-lifecycle.mjs +1 -1
- package/scripts/build-hosted-customer-lifecycle.mjs +1 -1
- package/scripts/build-installer-assets.mjs +1 -1
- package/scripts/build-proof-network-packet.mjs +213 -0
- package/scripts/run-standard-memory-benchmarks.mjs +1 -1
- package/scripts/simulate-production-env.mjs +210 -0
- package/scripts/verify-registry-install.mjs +1 -0
- package/scripts/wait-for-backend-ready.mjs +101 -0
- package/specs/goal-completion-audit-v1.schema.json +1 -0
- package/specs/proof-network-anchor-batch-v1.schema.json +125 -0
- package/specs/proof-network-benchmark-attestation-v1.schema.json +103 -0
- package/specs/proof-network-capability-grant-v1.schema.json +132 -0
- package/specs/proof-network-packet-v1.schema.json +171 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# Proof Network demo scripts
|
|
2
|
+
|
|
3
|
+
Use these scripts to show Enigma's Proof Network with a local package install. They create and verify public-safe JSON proof artifacts only. They do not submit Solana transactions, call hosted Enigma, call model providers, write client configs, or place raw memory on chain.
|
|
4
|
+
|
|
5
|
+
Requirements:
|
|
6
|
+
|
|
7
|
+
- Node.js `>=24`
|
|
8
|
+
- `enigma-memory` available through npm or a local package install
|
|
9
|
+
- No provider credentials for the three default demos
|
|
10
|
+
|
|
11
|
+
Run the commands from a writable demo directory after installing the package, for example `npm install -g enigma-memory`. For a one-off public npm run, prefix each `enigma` command with `npx --yes --package enigma-memory`. From a source checkout, replace `enigma` with `node apps/cli/bin/enigma.mjs`.
|
|
12
|
+
|
|
13
|
+
Public-safety rule: proof artifacts may contain hashes, roots, refs, counts, timestamps, public authority refs, signatures, and boolean claim boundaries. They must not contain raw memory, prompts, transcripts, completions, embeddings, ACL bodies, tenant names, private keys, API keys, seed phrases, or provider responses.
|
|
14
|
+
|
|
15
|
+
## Demo 1 — public npm test-drive + proof anchor plan
|
|
16
|
+
|
|
17
|
+
Goal: run the public local test drive, then produce a Solana-ready anchor batch that commits only opaque roots and refs. The batch is a transaction plan, not a submitted transaction.
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
node -e "require('node:fs').mkdirSync('.enigma/proof-network',{recursive:true})"
|
|
21
|
+
|
|
22
|
+
enigma test-drive \
|
|
23
|
+
--out-dir .enigma/proof-network/test-drive \
|
|
24
|
+
--overwrite
|
|
25
|
+
|
|
26
|
+
enigma chain anchor \
|
|
27
|
+
--root sha256:1111111111111111111111111111111111111111111111111111111111111111 \
|
|
28
|
+
--root sha256:2222222222222222222222222222222222222222222222222222222222222222 \
|
|
29
|
+
--root sha256:3333333333333333333333333333333333333333333333333333333333333333 \
|
|
30
|
+
--ref npm-test-drive:bundle-root:v1 \
|
|
31
|
+
--ref npm-test-drive:receipt-root:v1 \
|
|
32
|
+
--ref npm-test-drive:context-root:v1 \
|
|
33
|
+
--authority did:web:enigma.example#local-demo \
|
|
34
|
+
--batch-ref proof-network-demo-anchor-001 \
|
|
35
|
+
--out .enigma/proof-network/anchor-batch.json
|
|
36
|
+
|
|
37
|
+
enigma chain verify \
|
|
38
|
+
--file .enigma/proof-network/anchor-batch.json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Expected public-safe output shape from `chain anchor`:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"ok": true,
|
|
46
|
+
"artifact_type": "enigma.proof_network.anchor_batch.v1",
|
|
47
|
+
"transaction_submitted": false,
|
|
48
|
+
"raw_memory_on_chain": false,
|
|
49
|
+
"batch_ref": "proof-network-demo-anchor-001",
|
|
50
|
+
"roots": [
|
|
51
|
+
"sha256:1111111111111111111111111111111111111111111111111111111111111111",
|
|
52
|
+
"sha256:2222222222222222222222222222222222222222222222222222222222222222",
|
|
53
|
+
"sha256:3333333333333333333333333333333333333333333333333333333333333333"
|
|
54
|
+
],
|
|
55
|
+
"refs": [
|
|
56
|
+
"npm-test-drive:bundle-root:v1",
|
|
57
|
+
"npm-test-drive:receipt-root:v1",
|
|
58
|
+
"npm-test-drive:context-root:v1"
|
|
59
|
+
],
|
|
60
|
+
"solana_ready": true,
|
|
61
|
+
"claim_boundaries": {
|
|
62
|
+
"provider_calls": false,
|
|
63
|
+
"hosted_enigma_calls": false,
|
|
64
|
+
"transaction_submitted": false,
|
|
65
|
+
"raw_memory_on_chain": false
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Expected public-safe output shape from `chain verify`:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"ok": true,
|
|
75
|
+
"artifact_type": "enigma.proof_network.anchor_batch.v1",
|
|
76
|
+
"valid": true,
|
|
77
|
+
"transaction_submitted": false,
|
|
78
|
+
"raw_memory_on_chain": false,
|
|
79
|
+
"private_payload_detected": false
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Presenter notes:
|
|
84
|
+
|
|
85
|
+
1. The test drive proves local Enigma-controlled state only.
|
|
86
|
+
2. The anchor batch is Solana-ready because it is an opaque commitment payload, but it is not a transaction and it is not submitted.
|
|
87
|
+
3. Replace the demo roots with roots emitted by your own local Enigma run when presenting a real local artifact. Do not paste memory text, prompts, embeddings, provider responses, or tenant/customer names into `--root`, `--ref`, or `--authority`.
|
|
88
|
+
|
|
89
|
+
## Demo 2 — cross-model memory receipt demo
|
|
90
|
+
|
|
91
|
+
Goal: show one local Enigma bundle producing public receipt summaries for multiple model/client profiles, then issue a scoped capability grant and revocation for one public subject ref. No model provider is contacted.
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
node -e "require('node:fs').mkdirSync('.enigma/proof-network',{recursive:true})"
|
|
95
|
+
|
|
96
|
+
enigma test-drive \
|
|
97
|
+
--out-dir .enigma/proof-network/cross-model \
|
|
98
|
+
--overwrite
|
|
99
|
+
|
|
100
|
+
enigma demo cross-model \
|
|
101
|
+
--bundle .enigma/proof-network/cross-model/bundle.json \
|
|
102
|
+
--out .enigma/proof-network/cross-model-report.json
|
|
103
|
+
|
|
104
|
+
enigma chain grant \
|
|
105
|
+
--subject agent:claude-desktop:local-demo \
|
|
106
|
+
--capability memory.context.read \
|
|
107
|
+
--scope context-pack:cross-model-demo:v1 \
|
|
108
|
+
--expires-at 2026-12-31T00:00:00.000Z \
|
|
109
|
+
--grant-ref proof-network-demo-grant-001 \
|
|
110
|
+
--out .enigma/proof-network/capability-grant.json
|
|
111
|
+
|
|
112
|
+
enigma chain revoke \
|
|
113
|
+
--grant-hash sha256:4444444444444444444444444444444444444444444444444444444444444444 \
|
|
114
|
+
--reason demo-complete \
|
|
115
|
+
--revocation-ref proof-network-demo-revocation-001 \
|
|
116
|
+
--out .enigma/proof-network/capability-revocation.json
|
|
117
|
+
|
|
118
|
+
enigma chain verify \
|
|
119
|
+
--file .enigma/proof-network/capability-grant.json
|
|
120
|
+
|
|
121
|
+
enigma chain verify \
|
|
122
|
+
--file .enigma/proof-network/capability-revocation.json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Expected public-safe output shape from `demo cross-model`:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"ok": true,
|
|
130
|
+
"demo": "cross-model-memory",
|
|
131
|
+
"provider_calls": false,
|
|
132
|
+
"raw_memory_included": false,
|
|
133
|
+
"profiles": [
|
|
134
|
+
{
|
|
135
|
+
"client": "claude-desktop",
|
|
136
|
+
"context_pack_hash": "sha256:...",
|
|
137
|
+
"receipt_refs": ["receipt:..."]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"client": "cursor",
|
|
141
|
+
"context_pack_hash": "sha256:...",
|
|
142
|
+
"receipt_refs": ["receipt:..."]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"client": "kimi-code",
|
|
146
|
+
"context_pack_hash": "sha256:...",
|
|
147
|
+
"receipt_refs": ["receipt:..."]
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Expected public-safe output shape from `chain grant`:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"ok": true,
|
|
158
|
+
"artifact_type": "enigma.proof_network.capability_grant.v1",
|
|
159
|
+
"transaction_submitted": false,
|
|
160
|
+
"raw_memory_on_chain": false,
|
|
161
|
+
"subject": "agent:claude-desktop:local-demo",
|
|
162
|
+
"capability": "memory.context.read",
|
|
163
|
+
"scope": "context-pack:cross-model-demo:v1",
|
|
164
|
+
"expires_at": "2026-12-31T00:00:00.000Z",
|
|
165
|
+
"grant_ref": "proof-network-demo-grant-001",
|
|
166
|
+
"private_payload_detected": false
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Expected public-safe output shape from `chain revoke`:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"ok": true,
|
|
175
|
+
"artifact_type": "enigma.proof_network.capability_revocation.v1",
|
|
176
|
+
"transaction_submitted": false,
|
|
177
|
+
"raw_memory_on_chain": false,
|
|
178
|
+
"grant_hash": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
|
|
179
|
+
"reason": "demo-complete",
|
|
180
|
+
"revocation_ref": "proof-network-demo-revocation-001",
|
|
181
|
+
"private_payload_detected": false
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Presenter notes:
|
|
186
|
+
|
|
187
|
+
1. The cross-model report is a receipt demo, not proof that a provider remembered or forgot anything.
|
|
188
|
+
2. Capability grants are public authorization receipts. Scopes must be public refs, not ACL JSON, tenant names, or private policy bodies.
|
|
189
|
+
3. Revocations should point to grant hashes or nullifiers. Do not include the original private grant context.
|
|
190
|
+
|
|
191
|
+
## Demo 3 — benchmark attestation demo
|
|
192
|
+
|
|
193
|
+
Goal: turn a benchmark report hash or local report file into a public benchmark attestation. This demo uses deterministic refs and scores only; the proof artifact does not include dataset rows, questions, answers, prompts, completions, provider responses, or credentials.
|
|
194
|
+
|
|
195
|
+
Package-only path with a precomputed public report hash:
|
|
196
|
+
|
|
197
|
+
```sh
|
|
198
|
+
node -e "require('node:fs').mkdirSync('.enigma/proof-network',{recursive:true})"
|
|
199
|
+
|
|
200
|
+
enigma chain attest \
|
|
201
|
+
--report-hash sha256:5555555555555555555555555555555555555555555555555555555555555555 \
|
|
202
|
+
--dataset-ref enigma-fixture:deterministic-local:v1 \
|
|
203
|
+
--runner-ref enigma-memory:local-benchmark-runner:v1 \
|
|
204
|
+
--package-ref npm:enigma-memory@0.1.13 \
|
|
205
|
+
--score recall_at_5=1 \
|
|
206
|
+
--score p95_latency_ms=14 \
|
|
207
|
+
--out .enigma/proof-network/benchmark-attestation.json
|
|
208
|
+
|
|
209
|
+
enigma chain verify \
|
|
210
|
+
--file .enigma/proof-network/benchmark-attestation.json
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Source-checkout path when you have a local benchmark report file:
|
|
214
|
+
|
|
215
|
+
```sh
|
|
216
|
+
node scripts/run-memory-benchmarks.mjs
|
|
217
|
+
|
|
218
|
+
enigma chain attest \
|
|
219
|
+
--report-file .enigma/benchmarks/report.json \
|
|
220
|
+
--dataset-ref enigma-fixture:deterministic-local:v1 \
|
|
221
|
+
--runner-ref enigma-memory:scripts/run-memory-benchmarks.mjs \
|
|
222
|
+
--package-ref npm:enigma-memory@0.1.13 \
|
|
223
|
+
--score recall_at_5=1 \
|
|
224
|
+
--score p95_latency_ms=14 \
|
|
225
|
+
--out .enigma/proof-network/benchmark-attestation.json
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Expected public-safe output shape from `chain attest`:
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"ok": true,
|
|
233
|
+
"artifact_type": "enigma.proof_network.benchmark_attestation.v1",
|
|
234
|
+
"transaction_submitted": false,
|
|
235
|
+
"raw_memory_on_chain": false,
|
|
236
|
+
"report_hash": "sha256:5555555555555555555555555555555555555555555555555555555555555555",
|
|
237
|
+
"dataset_ref": "enigma-fixture:deterministic-local:v1",
|
|
238
|
+
"runner_ref": "enigma-memory:local-benchmark-runner:v1",
|
|
239
|
+
"package_ref": "npm:enigma-memory@0.1.13",
|
|
240
|
+
"scores": {
|
|
241
|
+
"recall_at_5": 1,
|
|
242
|
+
"p95_latency_ms": 14
|
|
243
|
+
},
|
|
244
|
+
"private_payload_detected": false
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Optional full-answer benchmark note: a separate full-answer benchmark runner may require provider credentials for the model being evaluated. Keep those credentials in local environment variables or a secret manager only. The public proof artifact should still contain only `report_hash`, `dataset_ref`, `runner_ref`, `package_ref`, scores, roots, refs, signatures, and claim boundaries. Never include provider requests, provider responses, prompts, answers, dataset rows, account ids, API keys, tenant names, or raw memory in the attestation.
|
|
249
|
+
|
|
250
|
+
Presenter notes:
|
|
251
|
+
|
|
252
|
+
1. A benchmark attestation proves that a named report hash, dataset ref, runner ref, package ref, and score set were committed together.
|
|
253
|
+
2. It is not a leaderboard claim unless the named benchmark protocol, dataset access, runner, scoring rules, and comparison set are independently published and reproducible.
|
|
254
|
+
3. `chain verify` validates the artifact shape and public-safety boundaries; it does not rerun the benchmark.
|
|
255
|
+
|
|
256
|
+
## Close the demo
|
|
257
|
+
|
|
258
|
+
Verify every generated artifact before sharing it:
|
|
259
|
+
|
|
260
|
+
```sh
|
|
261
|
+
enigma chain verify --file .enigma/proof-network/anchor-batch.json
|
|
262
|
+
enigma chain verify --file .enigma/proof-network/capability-grant.json
|
|
263
|
+
enigma chain verify --file .enigma/proof-network/capability-revocation.json
|
|
264
|
+
enigma chain verify --file .enigma/proof-network/benchmark-attestation.json
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Safe closing claim: Enigma can create local, public-safe proof-network artifacts that are ready for chain anchoring without exposing memory contents or submitting a transaction.
|
|
268
|
+
|
|
269
|
+
Unsafe claims to avoid:
|
|
270
|
+
|
|
271
|
+
- "A Solana transaction was submitted" unless you separately submitted one outside these local planning commands.
|
|
272
|
+
- "Raw memory is on chain"; that should never be true for these demos.
|
|
273
|
+
- "Providers deleted or forgot the memory."
|
|
274
|
+
- "Provider-native memory is canonical."
|
|
275
|
+
- "Benchmark leadership is proven" unless a reproducible comparison protocol and artifacts are published.
|
|
@@ -67,12 +67,12 @@ The example app prints ids, counts, roots, and verification status only. It does
|
|
|
67
67
|
|
|
68
68
|
## CLI and CI loop
|
|
69
69
|
|
|
70
|
-
The CI example installs Node 24, installs
|
|
70
|
+
The CI example installs Node 24, installs `enigma-memory` into a disposable npm project, exposes the package benchmark script, then runs:
|
|
71
71
|
|
|
72
72
|
```sh
|
|
73
|
-
npx
|
|
74
|
-
npx
|
|
75
|
-
npx
|
|
73
|
+
npx enigma test-drive --overwrite
|
|
74
|
+
npx enigma setup --overwrite
|
|
75
|
+
npx enigma doctor
|
|
76
76
|
npm run benchmark:memory-suite -- --out benchmark-report.json
|
|
77
77
|
```
|
|
78
78
|
|
|
@@ -90,6 +90,49 @@ Those commands produce a dataset manifest with source URLs, byte sizes, and SHA-
|
|
|
90
90
|
|
|
91
91
|
Use the workflow as a template in a consumer repository. It is intentionally limited to install/import/doctor smoke coverage, local proof generation, and deterministic local benchmark evidence by default; it does not publish packages, deploy infrastructure, contact hosted Enigma cloud, call external memory providers, or download official benchmark datasets unless you intentionally enable `run_standard_benchmark` for a manual workflow run.
|
|
92
92
|
|
|
93
|
+
## Proof Network developer loop
|
|
94
|
+
|
|
95
|
+
The proof-network path gives integrators a public, privacy-preserving adoption track before any chain transaction or hosted integration exists. The adoption ladder is intentionally simple:
|
|
96
|
+
|
|
97
|
+
1. Install or invoke the npm package.
|
|
98
|
+
2. Run the local test drive to produce safe roots/receipts/counts.
|
|
99
|
+
3. Generate proof-network chain artifacts from public-safe inputs.
|
|
100
|
+
4. Verify those artifacts locally.
|
|
101
|
+
5. Wire the same artifact contract into a connector, benchmark dashboard, or conformance test.
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
npx --yes --package enigma-memory enigma test-drive --overwrite
|
|
105
|
+
npx --yes --package enigma-memory enigma chain anchor --root sha256:8f8f... --root sha256:9a9a... --ref demo-local-vault --authority demo-public-authority --batch-ref demo-anchor-batch --out .enigma/proof-anchor-batch.json
|
|
106
|
+
npx --yes --package enigma-memory enigma chain grant --subject did:example:agent --capability memory.read --scope demo-scope --resource-ref sha256:8f8f... --policy-hash sha256:7e7e... --expires-at 2026-07-01T00:00:00Z --grant-ref demo-grant --out .enigma/proof-capability-grant.json
|
|
107
|
+
npx --yes --package enigma-memory enigma chain revoke --grant-hash sha256:6d6d... --reason scope-ended --revocation-ref demo-revocation --out .enigma/proof-capability-revocation.json
|
|
108
|
+
npx --yes --package enigma-memory enigma chain attest --report-file benchmark-report.json --dataset-ref sha256:5c5c... --runner-ref enigma-standard-runner --package-ref enigma-memory@0.1.13 --score accuracy=0.92 --out .enigma/proof-benchmark-attestation.json
|
|
109
|
+
npx --yes --package enigma-memory enigma chain verify --file .enigma/proof-anchor-batch.json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
`enigma chain anchor`, `grant`, `revoke`, `attest`, and `verify` are local planning commands. They create or validate opaque JSON proof-network artifacts for Solana-ready anchoring, but they do not create accounts, sign with private keys, submit transactions, deploy programs, or call RPC providers. Generated chain artifacts must keep `transaction_submitted:false` and `raw_memory_on_chain:false`; if an example needs a memory reference, use a public-safe commitment or receipt root rather than raw memory, prompts, transcripts, completions, embeddings, ACL bodies, tenant names, provider responses, private keys, seed phrases, or credentials.
|
|
113
|
+
|
|
114
|
+
Use proof artifacts as the common exchange format for developer integrations:
|
|
115
|
+
|
|
116
|
+
- **NPM test-drive adopters:** run the test drive, create an anchor batch from local roots/refs, verify the artifact, and attach the JSON to a pull request, demo, or release note without exposing private memory.
|
|
117
|
+
- **Chain artifact builders:** treat `anchor_batch`, `capability_grant`, `capability_revocation`, `benchmark_attestation`, and `packet` as the supported public artifact types. Anchors carry roots/refs/counts for later settlement; grants carry subject, capability, scope, resource refs, policy hashes, and expiry; revocations carry grant hashes and nullifiers; attestations carry report hashes plus dataset, runner, package, and score refs.
|
|
118
|
+
- **Conformance program partners:** build fixtures that accept valid proof-network artifacts and reject artifacts that leak private payload keys or values, omit the false transaction flags, use raw ACL or tenant bodies, or mix raw memory with public chain payloads. A connector should pass conformance before it claims proof-network support.
|
|
119
|
+
- **Benchmark attestation contributors:** hash the benchmark report or pass the report file, then bind it to dataset, runner, and package refs. The attestation makes benchmark evidence portable, but benchmark claims still depend on the benchmark guide's dataset, scoring, and comparison boundaries.
|
|
120
|
+
- **Connector authors:** wallet, agent, MCP, CI, and dashboard connectors can verify packets, display opaque Solana-ready roots, enforce grants before retrieval, publish revocation/nullifier artifacts when access ends, and keep private bundles off-chain while sharing verifiable commitments.
|
|
121
|
+
|
|
122
|
+
Conformance should stay narrow and testable. A proof-network connector is ready for public examples when it can:
|
|
123
|
+
|
|
124
|
+
1. accept every supported proof-network artifact shape and return a deterministic validation result;
|
|
125
|
+
2. reject any artifact containing private-looking field names or values before display, upload, signing, or indexing;
|
|
126
|
+
3. preserve `transaction_submitted:false` unless a separate reviewed settlement path actually submits a transaction;
|
|
127
|
+
4. preserve `raw_memory_on_chain:false` for every chain-facing artifact;
|
|
128
|
+
5. enforce capability grant subject, capability, scope, resource-ref, policy-hash, and expiry constraints before retrieval;
|
|
129
|
+
6. accept capability revocations/nullifiers and stop treating revoked grants as usable;
|
|
130
|
+
7. bind benchmark attestations to report hashes/files plus dataset, runner, and package refs without importing the raw benchmark corpus or private model output.
|
|
131
|
+
|
|
132
|
+
Good first connector projects are deliberately small: a CLI verifier that fails CI on leaked private payloads, a wallet preview that shows only roots/scopes/expiry/nullifiers, an MCP middleware that blocks retrieval without a live grant, a benchmark dashboard that accepts attestation JSON beside a report hash, and a Solana explorer plugin that labels opaque anchor batches without claiming transaction submission.
|
|
133
|
+
|
|
134
|
+
This path is intentionally copyable: npm install, run a local test drive, generate proof artifacts, verify them, then wire the same public-safe contract into a connector or conformance test. Do not position it as live settlement, provider deletion proof, compliance certification, or benchmark leadership without the separate evidence those claims require.
|
|
135
|
+
|
|
93
136
|
## MCP client loop
|
|
94
137
|
|
|
95
138
|
The same installed package can be used by Claude Desktop, Cursor, Kimi Code, or any generic MCP client. Run `enigma test-drive --overwrite` first if you want a zero-credential local proof before touching real client configs. The smooth setup path is `enigma setup --client auto --overwrite` to plan detected clients, then `enigma setup --connect-installed --overwrite` only when you explicitly want setup to write installed/config-present client configs. Manual snippets remain useful when a client needs a copied entry; replace the bundle path with the local path from your setup output, and restart the client.
|
|
@@ -0,0 +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.
|