@lemmaoracle/spec 0.0.31 → 0.0.32

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.
@@ -0,0 +1,2662 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Lemma v2 API",
5
+ "version": "0.2.0",
6
+ "description": "REST surface derived from the Lemma v2 whitepaper SDK interface (§3, §4). v0.2 adds the 4 Bazaar Discovery Layer products under /v1/suites/* (see x-bazaar extension)."
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "https://api.lemma.frame00.com",
11
+ "description": "Production (Base mainnet)"
12
+ },
13
+ {
14
+ "url": "http://localhost:8787",
15
+ "description": "Local development"
16
+ }
17
+ ],
18
+ "security": [
19
+ {
20
+ "ApiKeyAuth": []
21
+ }
22
+ ],
23
+ "paths": {
24
+ "/v1/health": {
25
+ "get": {
26
+ "security": [],
27
+ "responses": {
28
+ "200": {
29
+ "description": "OK",
30
+ "content": {
31
+ "application/json": {
32
+ "schema": {
33
+ "type": "object",
34
+ "properties": {
35
+ "ok": {
36
+ "type": "boolean"
37
+ }
38
+ },
39
+ "required": [
40
+ "ok"
41
+ ]
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "/v1/schemas": {
50
+ "post": {
51
+ "requestBody": {
52
+ "required": true,
53
+ "content": {
54
+ "application/json": {
55
+ "schema": {
56
+ "$ref": "#/components/schemas/SchemaMeta"
57
+ }
58
+ }
59
+ }
60
+ },
61
+ "responses": {
62
+ "200": {
63
+ "description": "Registered",
64
+ "content": {
65
+ "application/json": {
66
+ "schema": {
67
+ "$ref": "#/components/schemas/SchemaMeta"
68
+ }
69
+ }
70
+ }
71
+ },
72
+ "400": {
73
+ "description": "Bad Request",
74
+ "content": {
75
+ "application/json": {
76
+ "schema": {
77
+ "$ref": "#/components/schemas/ErrorResponse"
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
84
+ },
85
+ "/v1/schemas/{id}": {
86
+ "get": {
87
+ "security": [],
88
+ "parameters": [
89
+ {
90
+ "name": "id",
91
+ "in": "path",
92
+ "required": true,
93
+ "schema": {
94
+ "type": "string"
95
+ }
96
+ }
97
+ ],
98
+ "responses": {
99
+ "200": {
100
+ "description": "Found",
101
+ "content": {
102
+ "application/json": {
103
+ "schema": {
104
+ "$ref": "#/components/schemas/SchemaMeta"
105
+ }
106
+ }
107
+ }
108
+ },
109
+ "404": {
110
+ "description": "Not Found",
111
+ "content": {
112
+ "application/json": {
113
+ "schema": {
114
+ "$ref": "#/components/schemas/ErrorResponse"
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ },
122
+ "/v1/circuits": {
123
+ "post": {
124
+ "requestBody": {
125
+ "required": true,
126
+ "content": {
127
+ "application/json": {
128
+ "schema": {
129
+ "$ref": "#/components/schemas/CircuitMeta"
130
+ }
131
+ }
132
+ }
133
+ },
134
+ "responses": {
135
+ "200": {
136
+ "description": "Registered",
137
+ "content": {
138
+ "application/json": {
139
+ "schema": {
140
+ "$ref": "#/components/schemas/CircuitMeta"
141
+ }
142
+ }
143
+ }
144
+ },
145
+ "400": {
146
+ "description": "Bad Request",
147
+ "content": {
148
+ "application/json": {
149
+ "schema": {
150
+ "$ref": "#/components/schemas/ErrorResponse"
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ },
158
+ "/v1/circuits/{circuitId}": {
159
+ "get": {
160
+ "security": [],
161
+ "parameters": [
162
+ {
163
+ "name": "circuitId",
164
+ "in": "path",
165
+ "required": true,
166
+ "schema": {
167
+ "type": "string"
168
+ }
169
+ }
170
+ ],
171
+ "responses": {
172
+ "200": {
173
+ "description": "Found",
174
+ "content": {
175
+ "application/json": {
176
+ "schema": {
177
+ "$ref": "#/components/schemas/CircuitMeta"
178
+ }
179
+ }
180
+ }
181
+ },
182
+ "404": {
183
+ "description": "Not Found",
184
+ "content": {
185
+ "application/json": {
186
+ "schema": {
187
+ "$ref": "#/components/schemas/ErrorResponse"
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }
194
+ },
195
+ "/v1/doc-generators": {
196
+ "post": {
197
+ "requestBody": {
198
+ "required": true,
199
+ "content": {
200
+ "application/json": {
201
+ "schema": {
202
+ "$ref": "#/components/schemas/GeneratorMeta"
203
+ }
204
+ }
205
+ }
206
+ },
207
+ "responses": {
208
+ "200": {
209
+ "description": "Registered",
210
+ "content": {
211
+ "application/json": {
212
+ "schema": {
213
+ "$ref": "#/components/schemas/GeneratorMeta"
214
+ }
215
+ }
216
+ }
217
+ },
218
+ "400": {
219
+ "description": "Bad Request",
220
+ "content": {
221
+ "application/json": {
222
+ "schema": {
223
+ "$ref": "#/components/schemas/ErrorResponse"
224
+ }
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
230
+ },
231
+ "/v1/doc-generators/{generatorId}": {
232
+ "get": {
233
+ "security": [],
234
+ "parameters": [
235
+ {
236
+ "name": "generatorId",
237
+ "in": "path",
238
+ "required": true,
239
+ "schema": {
240
+ "type": "string"
241
+ }
242
+ }
243
+ ],
244
+ "responses": {
245
+ "200": {
246
+ "description": "Found",
247
+ "content": {
248
+ "application/json": {
249
+ "schema": {
250
+ "$ref": "#/components/schemas/GeneratorMeta"
251
+ }
252
+ }
253
+ }
254
+ },
255
+ "404": {
256
+ "description": "Not Found",
257
+ "content": {
258
+ "application/json": {
259
+ "schema": {
260
+ "$ref": "#/components/schemas/ErrorResponse"
261
+ }
262
+ }
263
+ }
264
+ }
265
+ }
266
+ }
267
+ },
268
+ "/v1/documents": {
269
+ "post": {
270
+ "requestBody": {
271
+ "required": true,
272
+ "content": {
273
+ "application/json": {
274
+ "schema": {
275
+ "$ref": "#/components/schemas/RegisterDocumentRequest"
276
+ }
277
+ }
278
+ }
279
+ },
280
+ "responses": {
281
+ "200": {
282
+ "description": "Registered",
283
+ "content": {
284
+ "application/json": {
285
+ "schema": {
286
+ "$ref": "#/components/schemas/RegisterDocumentResponse"
287
+ }
288
+ }
289
+ }
290
+ },
291
+ "400": {
292
+ "description": "Bad Request",
293
+ "content": {
294
+ "application/json": {
295
+ "schema": {
296
+ "$ref": "#/components/schemas/ErrorResponse"
297
+ }
298
+ }
299
+ }
300
+ }
301
+ }
302
+ }
303
+ },
304
+ "/v1/proofs": {
305
+ "post": {
306
+ "requestBody": {
307
+ "required": true,
308
+ "content": {
309
+ "application/json": {
310
+ "schema": {
311
+ "$ref": "#/components/schemas/SubmitProofRequest"
312
+ }
313
+ }
314
+ }
315
+ },
316
+ "responses": {
317
+ "200": {
318
+ "description": "Submitted",
319
+ "content": {
320
+ "application/json": {
321
+ "schema": {
322
+ "$ref": "#/components/schemas/SubmitProofResponse"
323
+ }
324
+ }
325
+ }
326
+ },
327
+ "400": {
328
+ "description": "Bad Request",
329
+ "content": {
330
+ "application/json": {
331
+ "schema": {
332
+ "$ref": "#/components/schemas/ErrorResponse"
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ },
340
+ "/v1/verified-attributes/query": {
341
+ "post": {
342
+ "requestBody": {
343
+ "required": true,
344
+ "content": {
345
+ "application/json": {
346
+ "schema": {
347
+ "$ref": "#/components/schemas/VerifiedAttributesQueryRequest"
348
+ }
349
+ }
350
+ }
351
+ },
352
+ "responses": {
353
+ "200": {
354
+ "description": "Results",
355
+ "content": {
356
+ "application/json": {
357
+ "schema": {
358
+ "$ref": "#/components/schemas/VerifiedAttributesQueryResponse"
359
+ }
360
+ }
361
+ }
362
+ },
363
+ "400": {
364
+ "description": "Bad Request",
365
+ "content": {
366
+ "application/json": {
367
+ "schema": {
368
+ "$ref": "#/components/schemas/ErrorResponse"
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+ },
376
+ "/v1/suites/identity/issue": {
377
+ "post": {
378
+ "operationId": "issueAgentIdentity",
379
+ "summary": "Agent Identity Issuance — issue a W3C VC v2 credential with Poseidon Merkle inclusion proof",
380
+ "description": "For AI agents that need to issue verifiable identity credentials to other agents or services, this endpoint mints a W3C VC v2 credential with Poseidon Merkle inclusion proof and Groth16 zero-knowledge verification.",
381
+ "tags": [
382
+ "bazaar",
383
+ "infrastructure",
384
+ "agent-identity"
385
+ ],
386
+ "x-bazaar": {
387
+ "discoverable": true,
388
+ "schema": "agent-identity-authority-v1",
389
+ "category": "Infrastructure",
390
+ "subTags": [
391
+ "agent-identity",
392
+ "zk-proof",
393
+ "did",
394
+ "kya",
395
+ "verifiable-credentials"
396
+ ],
397
+ "price": {
398
+ "amount": "0.05",
399
+ "currency": "USDC",
400
+ "network": "base"
401
+ }
402
+ },
403
+ "x-lemma-circuit": {
404
+ "id": "agent-identity-v1",
405
+ "location": "packages/agent/circuits/agent-identity-valid.circom",
406
+ "proofSystem": "Groth16"
407
+ },
408
+ "x-lemma-facilitator-requirement": "CDP",
409
+ "requestBody": {
410
+ "required": true,
411
+ "content": {
412
+ "application/json": {
413
+ "schema": {
414
+ "$ref": "#/components/schemas/product-a-input"
415
+ }
416
+ }
417
+ }
418
+ },
419
+ "responses": {
420
+ "200": {
421
+ "description": "Credential issued, anchored, and ready for downstream verification",
422
+ "headers": {
423
+ "X-Lemma-Bazaar-Schema": {
424
+ "schema": {
425
+ "type": "string",
426
+ "const": "agent-identity-authority-v1"
427
+ }
428
+ },
429
+ "X-Lemma-Bazaar-Category": {
430
+ "schema": {
431
+ "type": "string",
432
+ "const": "Infrastructure"
433
+ }
434
+ },
435
+ "EXTENSION-RESPONSES": {
436
+ "schema": {
437
+ "type": "string"
438
+ },
439
+ "description": "CDP facilitator processing status (status=accepted|processing|rejected). Returned only when settled via the CDP facilitator with discoverable: true."
440
+ }
441
+ },
442
+ "content": {
443
+ "application/json": {
444
+ "schema": {
445
+ "$ref": "#/components/schemas/product-a-output"
446
+ }
447
+ }
448
+ }
449
+ },
450
+ "400": {
451
+ "description": "Validation error",
452
+ "content": {
453
+ "application/json": {
454
+ "schema": {
455
+ "$ref": "#/components/schemas/canonical-error"
456
+ }
457
+ }
458
+ }
459
+ },
460
+ "401": {
461
+ "description": "Authentication failure",
462
+ "content": {
463
+ "application/json": {
464
+ "schema": {
465
+ "$ref": "#/components/schemas/canonical-error"
466
+ }
467
+ }
468
+ }
469
+ },
470
+ "402": {
471
+ "description": "Payment required (x402 challenge)",
472
+ "headers": {
473
+ "X-PAYMENT-RESPONSE": {
474
+ "schema": {
475
+ "type": "string"
476
+ },
477
+ "description": "x402 payment challenge envelope."
478
+ }
479
+ },
480
+ "content": {
481
+ "application/json": {
482
+ "schema": {
483
+ "type": "object",
484
+ "additionalProperties": true,
485
+ "description": "x402 challenge body. See @x402/core spec for shape."
486
+ }
487
+ }
488
+ }
489
+ },
490
+ "404": {
491
+ "description": "Subject prerequisite missing",
492
+ "content": {
493
+ "application/json": {
494
+ "schema": {
495
+ "$ref": "#/components/schemas/canonical-error"
496
+ }
497
+ }
498
+ }
499
+ },
500
+ "500": {
501
+ "description": "Internal error",
502
+ "content": {
503
+ "application/json": {
504
+ "schema": {
505
+ "$ref": "#/components/schemas/canonical-error"
506
+ }
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
512
+ },
513
+ "/v1/suites/inference/attest": {
514
+ "post": {
515
+ "operationId": "attestInference",
516
+ "summary": "Inference Attestation API — Groth16 attestation that a given model produced a given output",
517
+ "description": "For AI agents and companies running their own inference (Bedrock, OpenAI, Anthropic, Ollama), this endpoint generates a Groth16 zero-knowledge attestation that proves which model produced which output, anchored on Base mainnet. Lemma never sees raw data.",
518
+ "tags": [
519
+ "bazaar",
520
+ "inference"
521
+ ],
522
+ "x-bazaar": {
523
+ "discoverable": true,
524
+ "schema": "inference-attestation-v1",
525
+ "category": "Inference",
526
+ "subTags": [
527
+ "verifiable-ai",
528
+ "audit-trail",
529
+ "zk-proof",
530
+ "provenance",
531
+ "inference-attestation",
532
+ "claim-check",
533
+ "model-tampering-detection"
534
+ ],
535
+ "price": {
536
+ "amount": "0.07",
537
+ "currency": "USDC",
538
+ "network": "base"
539
+ }
540
+ },
541
+ "x-lemma-circuit": {
542
+ "id": "attestation-commitment-v1",
543
+ "location": "packages/attestation/circuits/",
544
+ "proofSystem": "Groth16"
545
+ },
546
+ "x-lemma-facilitator-requirement": "CDP",
547
+ "requestBody": {
548
+ "required": true,
549
+ "content": {
550
+ "application/json": {
551
+ "schema": {
552
+ "$ref": "#/components/schemas/product-b-input"
553
+ }
554
+ }
555
+ }
556
+ },
557
+ "responses": {
558
+ "200": {
559
+ "description": "Attestation generated, anchored, and ready for downstream verification",
560
+ "headers": {
561
+ "X-Lemma-Bazaar-Schema": {
562
+ "schema": {
563
+ "type": "string",
564
+ "const": "inference-attestation-v1"
565
+ }
566
+ },
567
+ "X-Lemma-Bazaar-Category": {
568
+ "schema": {
569
+ "type": "string",
570
+ "const": "Inference"
571
+ }
572
+ },
573
+ "X-Lemma-Attestation": {
574
+ "schema": {
575
+ "type": "string"
576
+ },
577
+ "description": "Compact attestation reference (id;verify=URL;circuit=name)."
578
+ },
579
+ "X-Lemma-Attestation-Status": {
580
+ "schema": {
581
+ "type": "string",
582
+ "enum": [
583
+ "anchored",
584
+ "deferred"
585
+ ]
586
+ }
587
+ },
588
+ "EXTENSION-RESPONSES": {
589
+ "schema": {
590
+ "type": "string"
591
+ },
592
+ "description": "CDP facilitator processing status."
593
+ }
594
+ },
595
+ "content": {
596
+ "application/json": {
597
+ "schema": {
598
+ "$ref": "#/components/schemas/product-b-output"
599
+ }
600
+ }
601
+ }
602
+ },
603
+ "400": {
604
+ "description": "Validation error / timestamp skew",
605
+ "content": {
606
+ "application/json": {
607
+ "schema": {
608
+ "$ref": "#/components/schemas/canonical-error"
609
+ }
610
+ }
611
+ }
612
+ },
613
+ "401": {
614
+ "description": "Authentication failure",
615
+ "content": {
616
+ "application/json": {
617
+ "schema": {
618
+ "$ref": "#/components/schemas/canonical-error"
619
+ }
620
+ }
621
+ }
622
+ },
623
+ "402": {
624
+ "description": "Payment required (x402 challenge)",
625
+ "headers": {
626
+ "X-PAYMENT-RESPONSE": {
627
+ "schema": {
628
+ "type": "string"
629
+ }
630
+ }
631
+ },
632
+ "content": {
633
+ "application/json": {
634
+ "schema": {
635
+ "type": "object",
636
+ "additionalProperties": true
637
+ }
638
+ }
639
+ }
640
+ },
641
+ "500": {
642
+ "description": "Internal error",
643
+ "content": {
644
+ "application/json": {
645
+ "schema": {
646
+ "$ref": "#/components/schemas/canonical-error"
647
+ }
648
+ }
649
+ }
650
+ }
651
+ }
652
+ }
653
+ },
654
+ "/v1/suites/compliance/bundle": {
655
+ "post": {
656
+ "operationId": "issueComplianceBundle",
657
+ "summary": "Compliance Attestation Bundle (Basic) — BBS+ selective-disclosure proof for 2-3 standard attributes",
658
+ "description": "For AI agents that need to present compliance claims (KYC status, jurisdiction, sanctions clearance) to gated endpoints without revealing underlying data, this Basic bundle returns a BBS+ selective-disclosure proof for 2-3 standard attributes per call.",
659
+ "tags": [
660
+ "bazaar",
661
+ "infrastructure",
662
+ "compliance"
663
+ ],
664
+ "x-bazaar": {
665
+ "discoverable": true,
666
+ "schema": "compliance-bundle-v1",
667
+ "category": "Infrastructure",
668
+ "subTags": [
669
+ "compliance",
670
+ "mica",
671
+ "kyc",
672
+ "bbs",
673
+ "selective-disclosure",
674
+ "regulatory"
675
+ ],
676
+ "price": {
677
+ "amount": "0.08",
678
+ "currency": "USDC",
679
+ "network": "base"
680
+ }
681
+ },
682
+ "x-lemma-circuit": {
683
+ "id": "bbs-bls12-381",
684
+ "proofSystem": "BBS+",
685
+ "library": "@lemmaoracle/sdk (noble-curves backend)"
686
+ },
687
+ "x-lemma-facilitator-requirement": "CDP",
688
+ "requestBody": {
689
+ "required": true,
690
+ "content": {
691
+ "application/json": {
692
+ "schema": {
693
+ "$ref": "#/components/schemas/product-c-input"
694
+ }
695
+ }
696
+ }
697
+ },
698
+ "responses": {
699
+ "200": {
700
+ "description": "Bundle generated with the requested disclosure mode",
701
+ "headers": {
702
+ "X-Lemma-Bazaar-Schema": {
703
+ "schema": {
704
+ "type": "string",
705
+ "const": "compliance-bundle-v1"
706
+ }
707
+ },
708
+ "X-Lemma-Bazaar-Category": {
709
+ "schema": {
710
+ "type": "string",
711
+ "const": "Infrastructure"
712
+ }
713
+ },
714
+ "EXTENSION-RESPONSES": {
715
+ "schema": {
716
+ "type": "string"
717
+ },
718
+ "description": "CDP facilitator processing status."
719
+ }
720
+ },
721
+ "content": {
722
+ "application/json": {
723
+ "schema": {
724
+ "$ref": "#/components/schemas/product-c-output"
725
+ }
726
+ }
727
+ }
728
+ },
729
+ "400": {
730
+ "description": "Validation / unsupported attribute (Basic plan)",
731
+ "content": {
732
+ "application/json": {
733
+ "schema": {
734
+ "$ref": "#/components/schemas/canonical-error"
735
+ }
736
+ }
737
+ }
738
+ },
739
+ "401": {
740
+ "description": "Authentication failure",
741
+ "content": {
742
+ "application/json": {
743
+ "schema": {
744
+ "$ref": "#/components/schemas/canonical-error"
745
+ }
746
+ }
747
+ }
748
+ },
749
+ "402": {
750
+ "description": "Payment required (x402 challenge)",
751
+ "headers": {
752
+ "X-PAYMENT-RESPONSE": {
753
+ "schema": {
754
+ "type": "string"
755
+ }
756
+ }
757
+ },
758
+ "content": {
759
+ "application/json": {
760
+ "schema": {
761
+ "type": "object",
762
+ "additionalProperties": true
763
+ }
764
+ }
765
+ }
766
+ },
767
+ "404": {
768
+ "description": "Subject onboarding missing",
769
+ "content": {
770
+ "application/json": {
771
+ "schema": {
772
+ "$ref": "#/components/schemas/canonical-error"
773
+ }
774
+ }
775
+ }
776
+ },
777
+ "500": {
778
+ "description": "Internal error",
779
+ "content": {
780
+ "application/json": {
781
+ "schema": {
782
+ "$ref": "#/components/schemas/canonical-error"
783
+ }
784
+ }
785
+ }
786
+ }
787
+ }
788
+ }
789
+ },
790
+ "/v1/suites/auth/challenge": {
791
+ "get": {
792
+ "operationId": "issueAuthChallenge",
793
+ "summary": "ZK Proof Sign-in challenge — issue a single-use nonce (free, no x402)",
794
+ "description": "Companion to /v1/suites/auth/proof. Returns a fresh 60-second single-use nonce that the client uses when generating the Groth16 sign-in proof. Free — payment is only required for the proof submission itself.",
795
+ "tags": [
796
+ "bazaar",
797
+ "infrastructure",
798
+ "auth"
799
+ ],
800
+ "responses": {
801
+ "200": {
802
+ "description": "Nonce issued",
803
+ "headers": {
804
+ "Cache-Control": {
805
+ "schema": {
806
+ "type": "string",
807
+ "const": "no-store"
808
+ }
809
+ }
810
+ },
811
+ "content": {
812
+ "application/json": {
813
+ "schema": {
814
+ "type": "object",
815
+ "additionalProperties": false,
816
+ "required": [
817
+ "nonce",
818
+ "expires_at"
819
+ ],
820
+ "properties": {
821
+ "nonce": {
822
+ "type": "string",
823
+ "pattern": "^[0-9a-f]{32}$"
824
+ },
825
+ "expires_at": {
826
+ "type": "string",
827
+ "format": "date-time"
828
+ }
829
+ }
830
+ }
831
+ }
832
+ }
833
+ },
834
+ "500": {
835
+ "description": "Internal error",
836
+ "content": {
837
+ "application/json": {
838
+ "schema": {
839
+ "$ref": "#/components/schemas/canonical-error"
840
+ }
841
+ }
842
+ }
843
+ }
844
+ }
845
+ }
846
+ },
847
+ "/v1/suites/auth/proof": {
848
+ "post": {
849
+ "operationId": "verifyAuthProof",
850
+ "summary": "ZK Proof-as-Auth (Sign-in) — verify Groth16 proof of API key possession, mint short-lived JWT",
851
+ "description": "For AI agents that need to call authenticated APIs without ever holding the API key — beyond the reach of prompt injection or context leaks — this endpoint accepts a Groth16 zero-knowledge proof of API key possession and returns a short-lived JWT.",
852
+ "tags": [
853
+ "bazaar",
854
+ "infrastructure",
855
+ "auth"
856
+ ],
857
+ "x-bazaar": {
858
+ "discoverable": true,
859
+ "schema": "seal-identity-v1",
860
+ "category": "Infrastructure",
861
+ "subTags": [
862
+ "auth",
863
+ "zk-proof",
864
+ "sign-in",
865
+ "proof-as-auth",
866
+ "credential-free",
867
+ "passwordless",
868
+ "api-key",
869
+ "prompt-injection-defense"
870
+ ],
871
+ "price": {
872
+ "amount": "0.02",
873
+ "currency": "USDC",
874
+ "network": "base"
875
+ }
876
+ },
877
+ "x-lemma-circuit": {
878
+ "id": "seal-identity-v1",
879
+ "location": "packages/seal/circuits/",
880
+ "proofSystem": "Groth16"
881
+ },
882
+ "x-lemma-facilitator-requirement": "CDP",
883
+ "requestBody": {
884
+ "required": true,
885
+ "content": {
886
+ "application/json": {
887
+ "schema": {
888
+ "$ref": "#/components/schemas/product-d-input"
889
+ }
890
+ }
891
+ }
892
+ },
893
+ "responses": {
894
+ "200": {
895
+ "description": "Proof verified, JWT minted",
896
+ "headers": {
897
+ "X-Lemma-Bazaar-Schema": {
898
+ "schema": {
899
+ "type": "string",
900
+ "const": "seal-identity-v1"
901
+ }
902
+ },
903
+ "X-Lemma-Bazaar-Category": {
904
+ "schema": {
905
+ "type": "string",
906
+ "const": "Infrastructure"
907
+ }
908
+ },
909
+ "EXTENSION-RESPONSES": {
910
+ "schema": {
911
+ "type": "string"
912
+ },
913
+ "description": "CDP facilitator processing status."
914
+ }
915
+ },
916
+ "content": {
917
+ "application/json": {
918
+ "schema": {
919
+ "$ref": "#/components/schemas/product-d-output"
920
+ }
921
+ }
922
+ }
923
+ },
924
+ "400": {
925
+ "description": "Validation error",
926
+ "content": {
927
+ "application/json": {
928
+ "schema": {
929
+ "$ref": "#/components/schemas/canonical-error"
930
+ }
931
+ }
932
+ }
933
+ },
934
+ "401": {
935
+ "description": "Nonce expired / proof verification failed",
936
+ "content": {
937
+ "application/json": {
938
+ "schema": {
939
+ "$ref": "#/components/schemas/canonical-error"
940
+ }
941
+ }
942
+ }
943
+ },
944
+ "402": {
945
+ "description": "Payment required (x402 challenge)",
946
+ "headers": {
947
+ "X-PAYMENT-RESPONSE": {
948
+ "schema": {
949
+ "type": "string"
950
+ }
951
+ }
952
+ },
953
+ "content": {
954
+ "application/json": {
955
+ "schema": {
956
+ "type": "object",
957
+ "additionalProperties": true
958
+ }
959
+ }
960
+ }
961
+ },
962
+ "500": {
963
+ "description": "Internal error",
964
+ "content": {
965
+ "application/json": {
966
+ "schema": {
967
+ "$ref": "#/components/schemas/canonical-error"
968
+ }
969
+ }
970
+ }
971
+ }
972
+ }
973
+ }
974
+ }
975
+ },
976
+ "components": {
977
+ "securitySchemes": {
978
+ "ApiKeyAuth": {
979
+ "type": "apiKey",
980
+ "in": "header",
981
+ "name": "x-api-key"
982
+ }
983
+ },
984
+ "schemas": {
985
+ "ErrorResponse": {
986
+ "type": "object",
987
+ "properties": {
988
+ "error": {
989
+ "type": "string"
990
+ }
991
+ },
992
+ "required": [
993
+ "error"
994
+ ],
995
+ "additionalProperties": false
996
+ },
997
+ "SchemaMeta": {
998
+ "type": "object",
999
+ "properties": {
1000
+ "id": {
1001
+ "type": "string"
1002
+ },
1003
+ "description": {
1004
+ "type": "string"
1005
+ }
1006
+ },
1007
+ "required": [
1008
+ "id"
1009
+ ],
1010
+ "additionalProperties": true
1011
+ },
1012
+ "CircuitArtifactLocation": {
1013
+ "type": "object",
1014
+ "properties": {
1015
+ "type": {
1016
+ "type": "string",
1017
+ "enum": [
1018
+ "ipfs",
1019
+ "https"
1020
+ ]
1021
+ },
1022
+ "wasm": {
1023
+ "type": "string"
1024
+ },
1025
+ "zkey": {
1026
+ "type": "string"
1027
+ }
1028
+ },
1029
+ "required": [
1030
+ "type",
1031
+ "wasm",
1032
+ "zkey"
1033
+ ],
1034
+ "additionalProperties": false
1035
+ },
1036
+ "CircuitMeta": {
1037
+ "type": "object",
1038
+ "properties": {
1039
+ "circuitId": {
1040
+ "type": "string"
1041
+ },
1042
+ "schema": {
1043
+ "type": "string"
1044
+ },
1045
+ "description": {
1046
+ "type": "string"
1047
+ },
1048
+ "inputs": {
1049
+ "type": "array",
1050
+ "items": {
1051
+ "type": "string"
1052
+ }
1053
+ },
1054
+ "verifier": {
1055
+ "type": "object",
1056
+ "properties": {
1057
+ "type": {
1058
+ "type": "string",
1059
+ "enum": [
1060
+ "onchain",
1061
+ "offchain"
1062
+ ]
1063
+ },
1064
+ "address": {
1065
+ "type": "string"
1066
+ },
1067
+ "chainId": {
1068
+ "type": "integer"
1069
+ }
1070
+ },
1071
+ "required": [
1072
+ "type"
1073
+ ],
1074
+ "additionalProperties": true
1075
+ },
1076
+ "artifact": {
1077
+ "type": "object",
1078
+ "properties": {
1079
+ "location": {
1080
+ "$ref": "#/components/schemas/CircuitArtifactLocation"
1081
+ }
1082
+ },
1083
+ "required": [
1084
+ "location"
1085
+ ],
1086
+ "additionalProperties": false
1087
+ }
1088
+ },
1089
+ "required": [
1090
+ "circuitId",
1091
+ "schema"
1092
+ ],
1093
+ "additionalProperties": true
1094
+ },
1095
+ "GeneratorMeta": {
1096
+ "type": "object",
1097
+ "properties": {
1098
+ "generatorId": {
1099
+ "type": "string"
1100
+ },
1101
+ "schema": {
1102
+ "type": "string"
1103
+ },
1104
+ "description": {
1105
+ "type": "string"
1106
+ },
1107
+ "language": {
1108
+ "type": "string"
1109
+ },
1110
+ "source": {
1111
+ "type": "object",
1112
+ "properties": {
1113
+ "type": {
1114
+ "type": "string",
1115
+ "enum": [
1116
+ "url"
1117
+ ]
1118
+ },
1119
+ "uri": {
1120
+ "type": "string"
1121
+ }
1122
+ },
1123
+ "required": [
1124
+ "type",
1125
+ "uri"
1126
+ ],
1127
+ "additionalProperties": false
1128
+ },
1129
+ "inputsSpec": {
1130
+ "type": "object",
1131
+ "additionalProperties": true
1132
+ },
1133
+ "outputsSpec": {
1134
+ "type": "object",
1135
+ "additionalProperties": true
1136
+ }
1137
+ },
1138
+ "required": [
1139
+ "generatorId",
1140
+ "schema"
1141
+ ],
1142
+ "additionalProperties": true
1143
+ },
1144
+ "DocumentCommitments": {
1145
+ "type": "object",
1146
+ "properties": {
1147
+ "scheme": {
1148
+ "type": "string",
1149
+ "enum": [
1150
+ "poseidon",
1151
+ "poseidon2",
1152
+ "rescue-prime",
1153
+ "sha256-placeholder"
1154
+ ]
1155
+ },
1156
+ "root": {
1157
+ "type": "string"
1158
+ },
1159
+ "leaves": {
1160
+ "type": "array",
1161
+ "items": {
1162
+ "type": "string"
1163
+ }
1164
+ },
1165
+ "randomness": {
1166
+ "type": "string"
1167
+ }
1168
+ },
1169
+ "required": [
1170
+ "scheme",
1171
+ "root",
1172
+ "leaves",
1173
+ "randomness"
1174
+ ],
1175
+ "additionalProperties": false
1176
+ },
1177
+ "Revocation": {
1178
+ "type": "object",
1179
+ "properties": {
1180
+ "scheme": {
1181
+ "type": "string"
1182
+ },
1183
+ "root": {
1184
+ "type": "string"
1185
+ }
1186
+ },
1187
+ "required": [
1188
+ "root"
1189
+ ],
1190
+ "additionalProperties": true
1191
+ },
1192
+ "IssuerSignature": {
1193
+ "type": "object",
1194
+ "properties": {
1195
+ "format": {
1196
+ "type": "string",
1197
+ "enum": [
1198
+ "bbs+",
1199
+ "opaque"
1200
+ ]
1201
+ },
1202
+ "payload": {
1203
+ "type": "string"
1204
+ },
1205
+ "issuerId": {
1206
+ "type": "string"
1207
+ }
1208
+ },
1209
+ "required": [
1210
+ "format",
1211
+ "payload",
1212
+ "issuerId"
1213
+ ],
1214
+ "additionalProperties": false
1215
+ },
1216
+ "OnchainHook": {
1217
+ "type": "object",
1218
+ "properties": {
1219
+ "chainId": {
1220
+ "type": "integer"
1221
+ },
1222
+ "address": {
1223
+ "type": "string"
1224
+ },
1225
+ "method": {
1226
+ "type": "string"
1227
+ },
1228
+ "mode": {
1229
+ "type": "string",
1230
+ "enum": [
1231
+ "after-registry"
1232
+ ]
1233
+ },
1234
+ "payload": {
1235
+ "type": "string",
1236
+ "enum": [
1237
+ "registry-public-inputs"
1238
+ ]
1239
+ }
1240
+ },
1241
+ "required": [
1242
+ "chainId",
1243
+ "address",
1244
+ "method"
1245
+ ],
1246
+ "additionalProperties": true
1247
+ },
1248
+ "RegisterDocumentRequest": {
1249
+ "type": "object",
1250
+ "properties": {
1251
+ "schema": {
1252
+ "type": "string"
1253
+ },
1254
+ "docHash": {
1255
+ "type": "string"
1256
+ },
1257
+ "cid": {
1258
+ "type": "string"
1259
+ },
1260
+ "issuerId": {
1261
+ "type": "string",
1262
+ "description": "Issuer identifier (DID, address, or any string). Hashed to bytes32 via keccak256 for on-chain storage."
1263
+ },
1264
+ "subjectId": {
1265
+ "type": "string",
1266
+ "description": "Subject/holder identifier (DID, address, or any string). Hashed to bytes32 via keccak256 for on-chain storage."
1267
+ },
1268
+ "commitments": {
1269
+ "$ref": "#/components/schemas/DocumentCommitments"
1270
+ },
1271
+ "revocation": {
1272
+ "$ref": "#/components/schemas/Revocation"
1273
+ },
1274
+ "signature": {
1275
+ "$ref": "#/components/schemas/IssuerSignature"
1276
+ },
1277
+ "hooks": {
1278
+ "type": "array",
1279
+ "items": {
1280
+ "$ref": "#/components/schemas/OnchainHook"
1281
+ }
1282
+ }
1283
+ },
1284
+ "required": [
1285
+ "schema",
1286
+ "docHash",
1287
+ "cid",
1288
+ "issuerId",
1289
+ "subjectId",
1290
+ "commitments",
1291
+ "revocation"
1292
+ ],
1293
+ "additionalProperties": false
1294
+ },
1295
+ "RegisterDocumentResponse": {
1296
+ "type": "object",
1297
+ "properties": {
1298
+ "status": {
1299
+ "type": "string",
1300
+ "enum": [
1301
+ "registered"
1302
+ ]
1303
+ },
1304
+ "docHash": {
1305
+ "type": "string"
1306
+ }
1307
+ },
1308
+ "required": [
1309
+ "status",
1310
+ "docHash"
1311
+ ],
1312
+ "additionalProperties": true
1313
+ },
1314
+ "SelectiveDisclosure": {
1315
+ "type": "object",
1316
+ "properties": {
1317
+ "format": {
1318
+ "type": "string",
1319
+ "enum": [
1320
+ "bbs+",
1321
+ "opaque"
1322
+ ]
1323
+ },
1324
+ "attributes": {
1325
+ "type": "object",
1326
+ "additionalProperties": true
1327
+ },
1328
+ "proof": {
1329
+ "type": "string"
1330
+ }
1331
+ },
1332
+ "required": [
1333
+ "format",
1334
+ "attributes",
1335
+ "proof"
1336
+ ],
1337
+ "additionalProperties": false
1338
+ },
1339
+ "SubmitProofRequest": {
1340
+ "type": "object",
1341
+ "properties": {
1342
+ "docHash": {
1343
+ "type": "string"
1344
+ },
1345
+ "circuitId": {
1346
+ "type": "string"
1347
+ },
1348
+ "proof": {
1349
+ "type": "string"
1350
+ },
1351
+ "inputs": {
1352
+ "type": "array",
1353
+ "items": {
1354
+ "type": "string"
1355
+ }
1356
+ },
1357
+ "disclosure": {
1358
+ "$ref": "#/components/schemas/SelectiveDisclosure"
1359
+ },
1360
+ "onchain": {
1361
+ "type": "boolean"
1362
+ }
1363
+ },
1364
+ "required": [
1365
+ "docHash",
1366
+ "circuitId",
1367
+ "proof",
1368
+ "inputs"
1369
+ ],
1370
+ "additionalProperties": false
1371
+ },
1372
+ "SubmitProofResponse": {
1373
+ "type": "object",
1374
+ "properties": {
1375
+ "status": {
1376
+ "type": "string",
1377
+ "enum": [
1378
+ "received",
1379
+ "verified",
1380
+ "onchain-verified",
1381
+ "rejected"
1382
+ ]
1383
+ },
1384
+ "verificationId": {
1385
+ "type": "string"
1386
+ }
1387
+ },
1388
+ "required": [
1389
+ "status",
1390
+ "verificationId"
1391
+ ],
1392
+ "additionalProperties": true
1393
+ },
1394
+ "VerifiedAttributesQueryRequest": {
1395
+ "type": "object",
1396
+ "properties": {
1397
+ "docHash": {
1398
+ "type": "string",
1399
+ "description": "Filter by specific document hash (optional)."
1400
+ },
1401
+ "attributes": {
1402
+ "type": "array",
1403
+ "items": {
1404
+ "type": "object",
1405
+ "properties": {
1406
+ "name": {
1407
+ "type": "string"
1408
+ },
1409
+ "operator": {
1410
+ "type": "string",
1411
+ "enum": [
1412
+ "eq",
1413
+ "neq",
1414
+ "gt",
1415
+ "gte",
1416
+ "lt",
1417
+ "lte",
1418
+ "in",
1419
+ "contains"
1420
+ ]
1421
+ },
1422
+ "value": {}
1423
+ },
1424
+ "required": [
1425
+ "name",
1426
+ "value"
1427
+ ],
1428
+ "additionalProperties": false
1429
+ }
1430
+ },
1431
+ "proof": {
1432
+ "type": "object",
1433
+ "properties": {
1434
+ "required": {
1435
+ "type": "boolean"
1436
+ },
1437
+ "type": {
1438
+ "type": "string",
1439
+ "enum": [
1440
+ "zk-snark",
1441
+ "opaque"
1442
+ ]
1443
+ }
1444
+ },
1445
+ "required": [
1446
+ "required"
1447
+ ],
1448
+ "additionalProperties": true
1449
+ },
1450
+ "targets": {
1451
+ "type": "object",
1452
+ "properties": {
1453
+ "schemas": {
1454
+ "type": "array",
1455
+ "items": {
1456
+ "type": "string"
1457
+ }
1458
+ },
1459
+ "chainIds": {
1460
+ "type": "array",
1461
+ "items": {
1462
+ "type": "integer"
1463
+ }
1464
+ }
1465
+ },
1466
+ "additionalProperties": true
1467
+ },
1468
+ "disclosure": {
1469
+ "type": "object",
1470
+ "description": "Opt-in disclosure access. Provide a ZK proof satisfying any condition attached to stored disclosures. Without this field, disclosures are never returned (privacy-by-default).",
1471
+ "properties": {
1472
+ "proof": {
1473
+ "type": "string"
1474
+ },
1475
+ "inputs": {
1476
+ "type": "array",
1477
+ "items": {
1478
+ "type": "string"
1479
+ }
1480
+ }
1481
+ },
1482
+ "required": [
1483
+ "proof",
1484
+ "inputs"
1485
+ ],
1486
+ "additionalProperties": false
1487
+ },
1488
+ "limit": {
1489
+ "type": "integer",
1490
+ "minimum": 1,
1491
+ "maximum": 200,
1492
+ "description": "Maximum number of results per page (1–200, default 50)."
1493
+ },
1494
+ "offset": {
1495
+ "type": "integer",
1496
+ "minimum": 0,
1497
+ "description": "Number of results to skip for pagination (default 0)."
1498
+ }
1499
+ },
1500
+ "required": [
1501
+ "attributes"
1502
+ ],
1503
+ "additionalProperties": false
1504
+ },
1505
+ "VerifiedAttributesQueryResponseItem": {
1506
+ "type": "object",
1507
+ "properties": {
1508
+ "docHash": {
1509
+ "type": "string"
1510
+ },
1511
+ "schema": {
1512
+ "type": "string"
1513
+ },
1514
+ "issuerId": {
1515
+ "type": "string"
1516
+ },
1517
+ "subjectId": {
1518
+ "type": "string"
1519
+ },
1520
+ "attributes": {
1521
+ "type": "object",
1522
+ "additionalProperties": true
1523
+ },
1524
+ "proof": {
1525
+ "type": "object",
1526
+ "properties": {
1527
+ "status": {
1528
+ "type": "string"
1529
+ },
1530
+ "circuitId": {
1531
+ "type": "string"
1532
+ }
1533
+ },
1534
+ "additionalProperties": true
1535
+ },
1536
+ "disclosure": {
1537
+ "$ref": "#/components/schemas/SelectiveDisclosure"
1538
+ }
1539
+ },
1540
+ "required": [
1541
+ "docHash",
1542
+ "schema",
1543
+ "issuerId",
1544
+ "subjectId",
1545
+ "attributes"
1546
+ ],
1547
+ "additionalProperties": true
1548
+ },
1549
+ "VerifiedAttributesQueryResponse": {
1550
+ "type": "object",
1551
+ "properties": {
1552
+ "results": {
1553
+ "type": "array",
1554
+ "items": {
1555
+ "$ref": "#/components/schemas/VerifiedAttributesQueryResponseItem"
1556
+ }
1557
+ }
1558
+ },
1559
+ "required": [
1560
+ "results"
1561
+ ],
1562
+ "additionalProperties": false
1563
+ },
1564
+ "product-a-input": {
1565
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1566
+ "$id": "https://schemas.lemma.frame00.com/suites/product-a-input.json",
1567
+ "title": "Agent Identity Issuance Request",
1568
+ "description": "⚠️ OUTDATED: This spec's proof model (Merkle tree) diverges from the current agent-identity.circom circuit (flat Poseidon6 commitment + issuer MAC). The circuit is the source of truth.",
1569
+ "type": "object",
1570
+ "additionalProperties": false,
1571
+ "required": [
1572
+ "agentId",
1573
+ "controllerId",
1574
+ "roles",
1575
+ "spendLimit",
1576
+ "expiresAt"
1577
+ ],
1578
+ "properties": {
1579
+ "agentId": {
1580
+ "type": "string",
1581
+ "format": "uri",
1582
+ "pattern": "^did:[a-z0-9]+:.+$",
1583
+ "description": "DID of the agent being credentialed (subject). Example: did:key:z6Mk...",
1584
+ "examples": [
1585
+ "did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSrUaYS9XVjqJzgRfBjK"
1586
+ ]
1587
+ },
1588
+ "subjectId": {
1589
+ "type": "string",
1590
+ "format": "uri",
1591
+ "description": "DID of the underlying real-world subject (organization, user) the agent acts on behalf of. Optional but recommended for KYA traceability."
1592
+ },
1593
+ "controllerId": {
1594
+ "type": "string",
1595
+ "format": "uri",
1596
+ "pattern": "^did:[a-z0-9]+:.+$",
1597
+ "description": "DID of the controller who can revoke this credential. Typically the issuer's operations key."
1598
+ },
1599
+ "orgId": {
1600
+ "type": "string",
1601
+ "description": "Organization identifier (free-form, e.g. company registration number, LEI). Used in cross-credential reconciliation."
1602
+ },
1603
+ "roles": {
1604
+ "type": "array",
1605
+ "minItems": 1,
1606
+ "maxItems": 16,
1607
+ "items": {
1608
+ "type": "string",
1609
+ "enum": [
1610
+ "trader",
1611
+ "buyer",
1612
+ "publisher",
1613
+ "auditor",
1614
+ "reader",
1615
+ "writer",
1616
+ "custodian",
1617
+ "validator",
1618
+ "compliance-officer",
1619
+ "developer",
1620
+ "operator",
1621
+ "support"
1622
+ ]
1623
+ },
1624
+ "description": "Roles assigned to this agent. Each role implies a baseline scope set; explicit scopes below override."
1625
+ },
1626
+ "scopes": {
1627
+ "type": "array",
1628
+ "items": {
1629
+ "type": "string",
1630
+ "pattern": "^[a-z0-9_:.-]+$"
1631
+ },
1632
+ "description": "Fine-grained capability scopes (e.g. 'payments:send', 'data:read:financial'). Optional override over roles."
1633
+ },
1634
+ "permissions": {
1635
+ "type": "object",
1636
+ "additionalProperties": false,
1637
+ "description": "Boolean permission map for binary capabilities. MVP supports a fixed set; custom permissions are V2.",
1638
+ "properties": {
1639
+ "can_settle_x402": {
1640
+ "type": "boolean",
1641
+ "description": "Authorize the agent to settle x402 micropayments."
1642
+ },
1643
+ "can_request_attestation": {
1644
+ "type": "boolean",
1645
+ "description": "Authorize the agent to request a Lemma attestation bundle (product C)."
1646
+ },
1647
+ "can_issue_subordinate": {
1648
+ "type": "boolean",
1649
+ "description": "Authorize the agent to issue subordinate agent credentials."
1650
+ },
1651
+ "can_sign_in": {
1652
+ "type": "boolean",
1653
+ "description": "Authorize the agent to perform ZK Proof Sign-in (product D)."
1654
+ },
1655
+ "can_invoke_inference": {
1656
+ "type": "boolean",
1657
+ "description": "Authorize the agent to invoke proof-anchored inference (product B)."
1658
+ }
1659
+ }
1660
+ },
1661
+ "spendLimit": {
1662
+ "type": "object",
1663
+ "required": [
1664
+ "amount",
1665
+ "currency",
1666
+ "window"
1667
+ ],
1668
+ "additionalProperties": false,
1669
+ "properties": {
1670
+ "amount": {
1671
+ "type": "string",
1672
+ "pattern": "^[0-9]+(\\.[0-9]+)?$",
1673
+ "description": "Maximum spend within window. String to preserve precision (USDC has 6 decimals)."
1674
+ },
1675
+ "currency": {
1676
+ "type": "string",
1677
+ "enum": [
1678
+ "USDC"
1679
+ ],
1680
+ "description": "Settlement currency. MVP supports USDC only on Base mainnet. USDT/EURC are planned for V2 — passing them returns INVALID_CURRENCY in MVP."
1681
+ },
1682
+ "window": {
1683
+ "type": "string",
1684
+ "enum": [
1685
+ "per-call",
1686
+ "daily",
1687
+ "weekly",
1688
+ "monthly"
1689
+ ],
1690
+ "description": "Spend limit window."
1691
+ }
1692
+ },
1693
+ "description": "Financial guard rail enforced at attestation-verification time by consuming services."
1694
+ },
1695
+ "paymentPolicy": {
1696
+ "type": "string",
1697
+ "enum": [
1698
+ "prepaid"
1699
+ ],
1700
+ "default": "prepaid",
1701
+ "description": "How the agent's payments are funded. MVP supports prepaid only. 'postpaid' and 'subscription' are V2 — passing them returns POLICY_NOT_SUPPORTED in MVP."
1702
+ },
1703
+ "issuedAt": {
1704
+ "type": "string",
1705
+ "format": "date-time",
1706
+ "description": "Issuance timestamp. If omitted, Lemma uses server time."
1707
+ },
1708
+ "expiresAt": {
1709
+ "type": "string",
1710
+ "format": "date-time",
1711
+ "description": "Expiration timestamp. Maximum 1 year from issuance per MVP policy."
1712
+ },
1713
+ "sourceSystem": {
1714
+ "type": "string",
1715
+ "description": "Free-form identifier of the system that originated the issuance (e.g. 'aws-bedrock-agentcore', 'custom-pipeline-v2'). Stored for provenance only."
1716
+ },
1717
+ "chainContext": {
1718
+ "type": "object",
1719
+ "additionalProperties": false,
1720
+ "properties": {
1721
+ "chainId": {
1722
+ "type": "integer",
1723
+ "enum": [
1724
+ 8453
1725
+ ],
1726
+ "description": "Base mainnet only in MVP."
1727
+ },
1728
+ "rpcUrl": {
1729
+ "type": "string",
1730
+ "format": "uri",
1731
+ "description": "Optional RPC endpoint reference for verifier reconciliation."
1732
+ }
1733
+ }
1734
+ }
1735
+ }
1736
+ },
1737
+ "product-a-output": {
1738
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1739
+ "$id": "https://schemas.lemma.frame00.com/suites/product-a-output.json",
1740
+ "title": "Agent Identity Issuance Response",
1741
+ "description": "⚠️ OUTDATED: This spec does not reflect the current agent-identity.circom circuit, which uses a flat Poseidon6 commitment (5 sub-hashes + salt) with issuer MAC verification instead of the Merkle-tree model described here. The circuit is the source of truth; this schema is retained for API-compatibility reference only and should not be used to derive circuit inputs.",
1742
+ "type": "object",
1743
+ "additionalProperties": false,
1744
+ "required": [
1745
+ "credentialId",
1746
+ "credential",
1747
+ "proof",
1748
+ "verifyUrl",
1749
+ "issuedAt",
1750
+ "expiresAt",
1751
+ "settlement",
1752
+ "requestId"
1753
+ ],
1754
+ "properties": {
1755
+ "credentialId": {
1756
+ "type": "string",
1757
+ "format": "uri",
1758
+ "description": "Permanent identifier of the issued credential (URN form: urn:lemma:cred:<uuid>)."
1759
+ },
1760
+ "credential": {
1761
+ "type": "object",
1762
+ "required": [
1763
+ "@context",
1764
+ "type",
1765
+ "issuer",
1766
+ "validFrom",
1767
+ "validUntil",
1768
+ "credentialSubject"
1769
+ ],
1770
+ "description": "W3C Verifiable Credentials v2 envelope. Subject = agentId, claims = roles+scopes+permissions+spendLimit.",
1771
+ "properties": {
1772
+ "@context": {
1773
+ "type": "array",
1774
+ "items": {
1775
+ "type": "string",
1776
+ "format": "uri"
1777
+ },
1778
+ "description": "JSON-LD contexts. Always includes 'https://www.w3.org/ns/credentials/v2' + Lemma schema context."
1779
+ },
1780
+ "type": {
1781
+ "type": "array",
1782
+ "items": {
1783
+ "type": "string"
1784
+ },
1785
+ "description": "VC types. Always ['VerifiableCredential', 'AgentIdentityCredential']."
1786
+ },
1787
+ "issuer": {
1788
+ "type": "string",
1789
+ "format": "uri",
1790
+ "description": "DID of Lemma's issuer (e.g. did:web:lemma.frame00.com)."
1791
+ },
1792
+ "validFrom": {
1793
+ "type": "string",
1794
+ "format": "date-time"
1795
+ },
1796
+ "validUntil": {
1797
+ "type": "string",
1798
+ "format": "date-time"
1799
+ },
1800
+ "credentialSubject": {
1801
+ "type": "object",
1802
+ "required": [
1803
+ "id",
1804
+ "roles",
1805
+ "spendLimit"
1806
+ ],
1807
+ "additionalProperties": false,
1808
+ "properties": {
1809
+ "id": {
1810
+ "type": "string",
1811
+ "format": "uri",
1812
+ "description": "Subject DID (= agentId in request)."
1813
+ },
1814
+ "controller": {
1815
+ "type": "string",
1816
+ "format": "uri"
1817
+ },
1818
+ "orgId": {
1819
+ "type": "string"
1820
+ },
1821
+ "roles": {
1822
+ "type": "array",
1823
+ "items": {
1824
+ "type": "string"
1825
+ }
1826
+ },
1827
+ "scopes": {
1828
+ "type": "array",
1829
+ "items": {
1830
+ "type": "string"
1831
+ }
1832
+ },
1833
+ "permissions": {
1834
+ "type": "object"
1835
+ },
1836
+ "spendLimit": {
1837
+ "type": "object"
1838
+ }
1839
+ }
1840
+ }
1841
+ }
1842
+ },
1843
+ "proof": {
1844
+ "type": "object",
1845
+ "required": [
1846
+ "type",
1847
+ "merkle",
1848
+ "circuitId"
1849
+ ],
1850
+ "additionalProperties": false,
1851
+ "properties": {
1852
+ "type": {
1853
+ "type": "string",
1854
+ "const": "LemmaAgentIdentityProof2026"
1855
+ },
1856
+ "merkle": {
1857
+ "type": "object",
1858
+ "required": [
1859
+ "commitmentRoot",
1860
+ "leafIndex",
1861
+ "subjectIdHash"
1862
+ ],
1863
+ "additionalProperties": false,
1864
+ "properties": {
1865
+ "commitmentRoot": {
1866
+ "type": "string",
1867
+ "pattern": "^0x[0-9a-fA-F]{64}$",
1868
+ "description": "Public Poseidon Merkle root after inserting this credential's leaves (5 attributes)."
1869
+ },
1870
+ "leafIndex": {
1871
+ "type": "integer",
1872
+ "description": "Index of this credential's leaves in the Merkle tree (nLevels=20)."
1873
+ },
1874
+ "subjectIdHash": {
1875
+ "type": "string",
1876
+ "pattern": "^0x[0-9a-fA-F]{64}$",
1877
+ "description": "Poseidon hash of the subject DID."
1878
+ }
1879
+ }
1880
+ },
1881
+ "merkleProofUrl": {
1882
+ "type": "string",
1883
+ "format": "uri",
1884
+ "description": "One-time holder-only URL to retrieve the full Merkle inclusion proof."
1885
+ },
1886
+ "circuitId": {
1887
+ "type": "string",
1888
+ "const": "agent-identity-v1"
1889
+ },
1890
+ "verifierContract": {
1891
+ "type": "string",
1892
+ "pattern": "^0x[0-9a-fA-F]{40}$",
1893
+ "description": "Address of the Solidity Groth16 verifier on Base mainnet."
1894
+ }
1895
+ }
1896
+ },
1897
+ "verifyUrl": {
1898
+ "type": "string",
1899
+ "format": "uri",
1900
+ "description": "Public verification URL: https://verify.lemma.frame00.com/credential/<uuid>."
1901
+ },
1902
+ "issuedAt": {
1903
+ "type": "string",
1904
+ "format": "date-time"
1905
+ },
1906
+ "expiresAt": {
1907
+ "type": "string",
1908
+ "format": "date-time"
1909
+ },
1910
+ "settlement": {
1911
+ "type": "object",
1912
+ "required": [
1913
+ "txHash",
1914
+ "amount",
1915
+ "currency",
1916
+ "facilitator"
1917
+ ],
1918
+ "additionalProperties": false,
1919
+ "properties": {
1920
+ "txHash": {
1921
+ "type": "string",
1922
+ "pattern": "^0x[0-9a-fA-F]{64}$"
1923
+ },
1924
+ "amount": {
1925
+ "type": "string",
1926
+ "const": "0.05"
1927
+ },
1928
+ "currency": {
1929
+ "type": "string",
1930
+ "const": "USDC"
1931
+ },
1932
+ "facilitator": {
1933
+ "type": "string",
1934
+ "format": "uri"
1935
+ }
1936
+ }
1937
+ },
1938
+ "requestId": {
1939
+ "type": "string",
1940
+ "pattern": "^req_[0-9a-z]+$",
1941
+ "description": "Server-assigned request identifier for log correlation."
1942
+ }
1943
+ }
1944
+ },
1945
+ "canonical-error": {
1946
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1947
+ "$id": "https://schemas.lemma.frame00.com/bazaar/canonical-error.json",
1948
+ "title": "Lemma canonical error envelope",
1949
+ "description": "Shared error envelope returned by all Bazaar product endpoints (A/B/C/D) and all internal Lemma APIs.",
1950
+ "type": "object",
1951
+ "additionalProperties": false,
1952
+ "required": [
1953
+ "error",
1954
+ "requestId"
1955
+ ],
1956
+ "properties": {
1957
+ "error": {
1958
+ "type": "object",
1959
+ "additionalProperties": false,
1960
+ "required": [
1961
+ "code",
1962
+ "message"
1963
+ ],
1964
+ "properties": {
1965
+ "code": {
1966
+ "type": "string",
1967
+ "pattern": "^[A-Z][A-Z0-9_]+$",
1968
+ "description": "Machine-readable upper-snake-case error code, e.g. VALIDATION_ERROR, NONCE_EXPIRED_OR_REUSED."
1969
+ },
1970
+ "message": {
1971
+ "type": "string",
1972
+ "description": "Human-readable, action-oriented message. Should suggest the next step the caller can take."
1973
+ },
1974
+ "field": {
1975
+ "type": "string",
1976
+ "description": "Optional JSON Pointer (e.g. '/disclosure_policy/range_predicates/0/predicate') or field name pointing at the offending input."
1977
+ },
1978
+ "docs": {
1979
+ "type": "string",
1980
+ "format": "uri",
1981
+ "description": "Optional deep link to the Lemma docs section for this error."
1982
+ }
1983
+ }
1984
+ },
1985
+ "requestId": {
1986
+ "type": "string",
1987
+ "pattern": "^req_[0-9a-z]+$",
1988
+ "description": "Server-assigned request identifier for log correlation."
1989
+ }
1990
+ }
1991
+ },
1992
+ "product-b-input": {
1993
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1994
+ "$id": "https://schemas.lemma.frame00.com/suites/product-b-input.json",
1995
+ "title": "Inference Attestation Request",
1996
+ "type": "object",
1997
+ "additionalProperties": false,
1998
+ "required": [
1999
+ "model_digest",
2000
+ "input_hash",
2001
+ "output_hash",
2002
+ "timestamp"
2003
+ ],
2004
+ "properties": {
2005
+ "model_digest": {
2006
+ "type": "string",
2007
+ "pattern": "^0x[0-9a-fA-F]{64}$",
2008
+ "description": "SHA-256 hash of a canonical model identifier (e.g. provider:model_name:version)."
2009
+ },
2010
+ "input_hash": {
2011
+ "type": "string",
2012
+ "pattern": "^0x[0-9a-fA-F]{64}$",
2013
+ "description": "SHA-256 hash of the canonicalised inference input. Raw input is NEVER sent to Lemma."
2014
+ },
2015
+ "output_hash": {
2016
+ "type": "string",
2017
+ "pattern": "^0x[0-9a-fA-F]{64}$",
2018
+ "description": "SHA-256 hash of the canonicalised inference output. Raw output is NEVER sent to Lemma."
2019
+ },
2020
+ "timestamp": {
2021
+ "type": "integer",
2022
+ "description": "Unix epoch seconds. Must be within ±300s of Lemma's server time (replay protection)."
2023
+ },
2024
+ "nonce": {
2025
+ "type": "string",
2026
+ "pattern": "^[0-9a-fA-F]{32}$",
2027
+ "description": "Optional 16-byte client nonce (hex) for additional replay protection."
2028
+ },
2029
+ "claim_metadata": {
2030
+ "type": "object",
2031
+ "additionalProperties": false,
2032
+ "description": "Optional metadata bound into the proof commitment as a hash; never stored in the clear.",
2033
+ "properties": {
2034
+ "agentId": {
2035
+ "type": "string",
2036
+ "format": "uri",
2037
+ "description": "Calling agent's DID. Recommended for full audit trail; combine with product A credential."
2038
+ },
2039
+ "purpose": {
2040
+ "type": "string",
2041
+ "maxLength": 256,
2042
+ "description": "Human-readable purpose label. Hashed before commitment."
2043
+ },
2044
+ "tags": {
2045
+ "type": "array",
2046
+ "items": {
2047
+ "type": "string",
2048
+ "pattern": "^[a-z0-9_:-]+$"
2049
+ },
2050
+ "maxItems": 16,
2051
+ "description": "Free-form tags for downstream filtering (hashed)."
2052
+ },
2053
+ "provider": {
2054
+ "type": "string",
2055
+ "description": "Free-form provider identifier. Hashed before commitment."
2056
+ }
2057
+ }
2058
+ }
2059
+ }
2060
+ },
2061
+ "product-b-output": {
2062
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2063
+ "$id": "https://schemas.lemma.frame00.com/suites/product-b-output.json",
2064
+ "title": "Inference Attestation Response",
2065
+ "type": "object",
2066
+ "additionalProperties": false,
2067
+ "required": [
2068
+ "attestationId",
2069
+ "proof",
2070
+ "verifyUrl",
2071
+ "anchoredAt",
2072
+ "settlement",
2073
+ "requestId"
2074
+ ],
2075
+ "properties": {
2076
+ "attestationId": {
2077
+ "type": "string",
2078
+ "format": "uri",
2079
+ "description": "URN of the attestation record (urn:lemma:attestation:<uuid>)."
2080
+ },
2081
+ "proof": {
2082
+ "type": "object",
2083
+ "required": [
2084
+ "type",
2085
+ "status",
2086
+ "circuitId"
2087
+ ],
2088
+ "additionalProperties": false,
2089
+ "properties": {
2090
+ "type": {
2091
+ "type": "string",
2092
+ "const": "LemmaInferenceAttestation2026"
2093
+ },
2094
+ "status": {
2095
+ "type": "string",
2096
+ "enum": [
2097
+ "anchored",
2098
+ "deferred"
2099
+ ],
2100
+ "description": "'anchored' = proof generated and submitted synchronously. 'deferred' = settled but queued; use pollUrl."
2101
+ },
2102
+ "commitment": {
2103
+ "type": [
2104
+ "string",
2105
+ "null"
2106
+ ],
2107
+ "pattern": "^0x[0-9a-fA-F]{64}$",
2108
+ "description": "Poseidon5 commitment. null when status=deferred."
2109
+ },
2110
+ "groth16": {
2111
+ "type": [
2112
+ "object",
2113
+ "null"
2114
+ ],
2115
+ "description": "Groth16 proof tuple. null when status=deferred."
2116
+ },
2117
+ "circuitId": {
2118
+ "type": "string",
2119
+ "const": "attestation-commitment-v1"
2120
+ },
2121
+ "verifierContract": {
2122
+ "type": "string",
2123
+ "pattern": "^0x[0-9a-fA-F]{40}$"
2124
+ },
2125
+ "pollUrl": {
2126
+ "type": "string",
2127
+ "format": "uri",
2128
+ "description": "Polling URL when status=deferred."
2129
+ }
2130
+ }
2131
+ },
2132
+ "verifyUrl": {
2133
+ "type": "string",
2134
+ "format": "uri",
2135
+ "description": "Public verification URL: https://verify.lemma.frame00.com/attestation/<uuid>."
2136
+ },
2137
+ "anchoredAt": {
2138
+ "type": [
2139
+ "string",
2140
+ "null"
2141
+ ],
2142
+ "format": "date-time",
2143
+ "description": "Time the attestation was anchored on-chain. null when status=deferred."
2144
+ },
2145
+ "settlement": {
2146
+ "type": "object",
2147
+ "required": [
2148
+ "txHash",
2149
+ "amount",
2150
+ "currency",
2151
+ "facilitator"
2152
+ ],
2153
+ "additionalProperties": false,
2154
+ "properties": {
2155
+ "txHash": {
2156
+ "type": "string",
2157
+ "pattern": "^0x[0-9a-fA-F]{64}$"
2158
+ },
2159
+ "amount": {
2160
+ "type": "string",
2161
+ "const": "0.07"
2162
+ },
2163
+ "currency": {
2164
+ "type": "string",
2165
+ "const": "USDC"
2166
+ },
2167
+ "facilitator": {
2168
+ "type": "string",
2169
+ "format": "uri"
2170
+ }
2171
+ }
2172
+ },
2173
+ "requestId": {
2174
+ "type": "string",
2175
+ "pattern": "^req_[0-9a-z]+$",
2176
+ "description": "Server-assigned request identifier for log correlation."
2177
+ }
2178
+ }
2179
+ },
2180
+ "product-c-input": {
2181
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2182
+ "$id": "https://schemas.lemma.frame00.com/suites/product-c-input.json",
2183
+ "title": "Compliance Attestation Bundle Request (Basic MVP)",
2184
+ "type": "object",
2185
+ "additionalProperties": false,
2186
+ "required": [
2187
+ "subject_did",
2188
+ "requested_attributes",
2189
+ "disclosure_policy"
2190
+ ],
2191
+ "properties": {
2192
+ "subject_did": {
2193
+ "type": "string",
2194
+ "format": "uri",
2195
+ "pattern": "^did:[a-z0-9]+:.+$",
2196
+ "description": "DID of the subject. Must have a prior Lemma attestation set; otherwise INSUFFICIENT_ATTRIBUTES error."
2197
+ },
2198
+ "requested_attributes": {
2199
+ "type": "array",
2200
+ "minItems": 1,
2201
+ "maxItems": 3,
2202
+ "items": {
2203
+ "type": "string",
2204
+ "enum": [
2205
+ "kyc_status",
2206
+ "jurisdiction",
2207
+ "sanctions_check"
2208
+ ]
2209
+ },
2210
+ "description": "MVP Basic supports up to 3 attributes. The full 8-attribute Pro set ships in V2 at $0.20/bundle. Requesting unsupported attributes returns ATTRIBUTE_NOT_IN_BASIC_PLAN."
2211
+ },
2212
+ "disclosure_policy": {
2213
+ "type": "object",
2214
+ "additionalProperties": false,
2215
+ "required": [
2216
+ "mode"
2217
+ ],
2218
+ "properties": {
2219
+ "mode": {
2220
+ "type": "string",
2221
+ "enum": [
2222
+ "full",
2223
+ "selective",
2224
+ "range_only"
2225
+ ],
2226
+ "description": "full = reveal all values; selective = reveal only fields in reveal_fields; range_only = prove range without revealing values."
2227
+ },
2228
+ "reveal_fields": {
2229
+ "type": "array",
2230
+ "items": {
2231
+ "type": "string"
2232
+ },
2233
+ "description": "Required when mode='selective'. Subset of requested_attributes."
2234
+ },
2235
+ "range_predicates": {
2236
+ "type": "array",
2237
+ "items": {
2238
+ "type": "object",
2239
+ "additionalProperties": false,
2240
+ "required": [
2241
+ "field",
2242
+ "predicate",
2243
+ "value"
2244
+ ],
2245
+ "properties": {
2246
+ "field": {
2247
+ "type": "string"
2248
+ },
2249
+ "predicate": {
2250
+ "type": "string",
2251
+ "enum": [
2252
+ ">=",
2253
+ "<=",
2254
+ "=="
2255
+ ],
2256
+ "description": "BBS+ range proof supports only inclusive bounds and equality. Strict inequalities (>, <) are not supported."
2257
+ },
2258
+ "value": {
2259
+ "type": [
2260
+ "string",
2261
+ "number"
2262
+ ]
2263
+ }
2264
+ }
2265
+ },
2266
+ "description": "Required when mode='range_only'."
2267
+ }
2268
+ }
2269
+ },
2270
+ "verifier_context": {
2271
+ "type": "object",
2272
+ "additionalProperties": false,
2273
+ "description": "Optional metadata about the verifying party. Bound into the proof for replay protection.",
2274
+ "properties": {
2275
+ "verifier_did": {
2276
+ "type": "string",
2277
+ "format": "uri"
2278
+ },
2279
+ "nonce": {
2280
+ "type": "string",
2281
+ "minLength": 16,
2282
+ "maxLength": 64
2283
+ },
2284
+ "purpose": {
2285
+ "type": "string",
2286
+ "maxLength": 256
2287
+ }
2288
+ }
2289
+ },
2290
+ "expires_in_seconds": {
2291
+ "type": "integer",
2292
+ "minimum": 60,
2293
+ "maximum": 86400,
2294
+ "default": 3600,
2295
+ "description": "How long the issued bundle remains valid. Default 1 hour; max 24 hours in MVP."
2296
+ }
2297
+ }
2298
+ },
2299
+ "product-c-output": {
2300
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2301
+ "$id": "https://schemas.lemma.frame00.com/suites/product-c-output.json",
2302
+ "title": "Compliance Attestation Bundle Response (Basic MVP)",
2303
+ "type": "object",
2304
+ "additionalProperties": false,
2305
+ "required": [
2306
+ "bundleId",
2307
+ "bbs_proof",
2308
+ "revealed_claims",
2309
+ "verifyUrl",
2310
+ "issuedAt",
2311
+ "expiresAt",
2312
+ "settlement",
2313
+ "requestId"
2314
+ ],
2315
+ "properties": {
2316
+ "bundleId": {
2317
+ "type": "string",
2318
+ "format": "uri",
2319
+ "description": "URN of the bundle (urn:lemma:bundle:<uuid>)."
2320
+ },
2321
+ "bbs_proof": {
2322
+ "type": "object",
2323
+ "required": [
2324
+ "type",
2325
+ "proof",
2326
+ "publicKey",
2327
+ "issuerDid"
2328
+ ],
2329
+ "additionalProperties": false,
2330
+ "properties": {
2331
+ "type": {
2332
+ "type": "string",
2333
+ "const": "BbsBlsSignatureProof2025"
2334
+ },
2335
+ "proof": {
2336
+ "type": "string",
2337
+ "description": "Base64url-encoded BBS+ selective disclosure proof."
2338
+ },
2339
+ "publicKey": {
2340
+ "type": "string",
2341
+ "description": "BLS12-381 G2 public key (base64url)."
2342
+ },
2343
+ "issuerDid": {
2344
+ "type": "string",
2345
+ "format": "uri",
2346
+ "description": "DID of Lemma's attestation issuer."
2347
+ }
2348
+ }
2349
+ },
2350
+ "revealed_claims": {
2351
+ "type": "object",
2352
+ "additionalProperties": false,
2353
+ "description": "Claims actually revealed per disclosure_policy (mode='full' or 'selective'). MVP Basic supports only 3 keys. Hidden claims appear as null. Empty when mode='range_only'.",
2354
+ "properties": {
2355
+ "kyc_status": {
2356
+ "type": [
2357
+ "string",
2358
+ "null"
2359
+ ],
2360
+ "enum": [
2361
+ "verified",
2362
+ "pending",
2363
+ "rejected",
2364
+ null
2365
+ ]
2366
+ },
2367
+ "jurisdiction": {
2368
+ "type": [
2369
+ "string",
2370
+ "null"
2371
+ ],
2372
+ "description": "ISO 3166-1 alpha-2 country code."
2373
+ },
2374
+ "sanctions_check": {
2375
+ "type": [
2376
+ "string",
2377
+ "null"
2378
+ ],
2379
+ "enum": [
2380
+ "clear",
2381
+ "flagged",
2382
+ "pending",
2383
+ null
2384
+ ]
2385
+ }
2386
+ }
2387
+ },
2388
+ "range_results": {
2389
+ "type": "array",
2390
+ "description": "Range predicate verification results. Present only when mode='range_only'.",
2391
+ "items": {
2392
+ "type": "object",
2393
+ "additionalProperties": false,
2394
+ "required": [
2395
+ "field",
2396
+ "predicate",
2397
+ "value",
2398
+ "result"
2399
+ ],
2400
+ "properties": {
2401
+ "field": {
2402
+ "type": "string"
2403
+ },
2404
+ "predicate": {
2405
+ "type": "string",
2406
+ "enum": [
2407
+ ">=",
2408
+ "<=",
2409
+ "=="
2410
+ ]
2411
+ },
2412
+ "value": {
2413
+ "type": [
2414
+ "string",
2415
+ "number"
2416
+ ]
2417
+ },
2418
+ "result": {
2419
+ "type": "boolean"
2420
+ }
2421
+ }
2422
+ }
2423
+ },
2424
+ "verifyUrl": {
2425
+ "type": "string",
2426
+ "format": "uri",
2427
+ "description": "Public verification URL: https://verify.lemma.frame00.com/bundle/<uuid>."
2428
+ },
2429
+ "issuedAt": {
2430
+ "type": "string",
2431
+ "format": "date-time"
2432
+ },
2433
+ "expiresAt": {
2434
+ "type": "string",
2435
+ "format": "date-time"
2436
+ },
2437
+ "settlement": {
2438
+ "type": "object",
2439
+ "required": [
2440
+ "txHash",
2441
+ "amount",
2442
+ "currency",
2443
+ "facilitator"
2444
+ ],
2445
+ "additionalProperties": false,
2446
+ "properties": {
2447
+ "txHash": {
2448
+ "type": "string",
2449
+ "pattern": "^0x[0-9a-fA-F]{64}$"
2450
+ },
2451
+ "amount": {
2452
+ "type": "string",
2453
+ "const": "0.08"
2454
+ },
2455
+ "currency": {
2456
+ "type": "string",
2457
+ "const": "USDC"
2458
+ },
2459
+ "facilitator": {
2460
+ "type": "string",
2461
+ "format": "uri"
2462
+ }
2463
+ }
2464
+ },
2465
+ "requestId": {
2466
+ "type": "string",
2467
+ "pattern": "^req_[0-9a-z]+$",
2468
+ "description": "Server-assigned request identifier for log correlation."
2469
+ }
2470
+ }
2471
+ },
2472
+ "product-d-input": {
2473
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2474
+ "$id": "https://schemas.lemma.frame00.com/suites/product-d-input.json",
2475
+ "title": "ZK Proof Sign-in Request",
2476
+ "type": "object",
2477
+ "additionalProperties": false,
2478
+ "required": [
2479
+ "api_key_commitment",
2480
+ "zk_proof",
2481
+ "nonce"
2482
+ ],
2483
+ "properties": {
2484
+ "api_key_commitment": {
2485
+ "type": "string",
2486
+ "pattern": "^0x[0-9a-fA-F]{64}$",
2487
+ "description": "Poseidon hash of the API key, computed client-side. The API key itself is never transmitted."
2488
+ },
2489
+ "zk_proof": {
2490
+ "type": "object",
2491
+ "required": [
2492
+ "pi_a",
2493
+ "pi_b",
2494
+ "pi_c",
2495
+ "publicSignals"
2496
+ ],
2497
+ "additionalProperties": false,
2498
+ "properties": {
2499
+ "pi_a": {
2500
+ "type": "array",
2501
+ "items": {
2502
+ "type": "string"
2503
+ }
2504
+ },
2505
+ "pi_b": {
2506
+ "type": "array",
2507
+ "items": {
2508
+ "type": "array",
2509
+ "items": {
2510
+ "type": "string"
2511
+ }
2512
+ }
2513
+ },
2514
+ "pi_c": {
2515
+ "type": "array",
2516
+ "items": {
2517
+ "type": "string"
2518
+ }
2519
+ },
2520
+ "publicSignals": {
2521
+ "type": "array",
2522
+ "items": {
2523
+ "type": "string"
2524
+ },
2525
+ "description": "Public signals: [api_key_commitment, nonce_hash, timestamp]."
2526
+ }
2527
+ },
2528
+ "description": "Groth16 proof generated with seal-identity-v1 circuit."
2529
+ },
2530
+ "nonce": {
2531
+ "type": "string",
2532
+ "minLength": 16,
2533
+ "maxLength": 64,
2534
+ "description": "Server-issued nonce from GET /v1/suites/auth/challenge. Single-use, expires in 60 seconds."
2535
+ },
2536
+ "client_metadata": {
2537
+ "type": "object",
2538
+ "additionalProperties": false,
2539
+ "description": "Optional client identification (binds to JWT for audit).",
2540
+ "properties": {
2541
+ "client_id": {
2542
+ "type": "string"
2543
+ },
2544
+ "platform": {
2545
+ "type": "string",
2546
+ "enum": [
2547
+ "web",
2548
+ "ios",
2549
+ "android",
2550
+ "cli",
2551
+ "server"
2552
+ ]
2553
+ },
2554
+ "subject_type": {
2555
+ "type": "string",
2556
+ "enum": [
2557
+ "human",
2558
+ "agent"
2559
+ ],
2560
+ "default": "agent",
2561
+ "description": "Whether the sign-in is performed by a human user or an autonomous agent."
2562
+ }
2563
+ }
2564
+ }
2565
+ }
2566
+ },
2567
+ "product-d-output": {
2568
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2569
+ "$id": "https://schemas.lemma.frame00.com/suites/product-d-output.json",
2570
+ "title": "ZK Proof Sign-in Response",
2571
+ "type": "object",
2572
+ "additionalProperties": false,
2573
+ "required": [
2574
+ "access_token",
2575
+ "token_type",
2576
+ "expires_in",
2577
+ "session_id",
2578
+ "proof_record",
2579
+ "settlement",
2580
+ "requestId"
2581
+ ],
2582
+ "properties": {
2583
+ "access_token": {
2584
+ "type": "string",
2585
+ "description": "Short-lived JWT (default TTL 15 minutes)."
2586
+ },
2587
+ "token_type": {
2588
+ "type": "string",
2589
+ "const": "Bearer"
2590
+ },
2591
+ "expires_in": {
2592
+ "type": "integer",
2593
+ "default": 900,
2594
+ "description": "Seconds until access_token expiry. Default 900 (15 minutes)."
2595
+ },
2596
+ "session_id": {
2597
+ "type": "string",
2598
+ "description": "Server-assigned session identifier for log correlation."
2599
+ },
2600
+ "proof_record": {
2601
+ "type": "object",
2602
+ "required": [
2603
+ "proofId",
2604
+ "verifyUrl",
2605
+ "anchoredAt"
2606
+ ],
2607
+ "additionalProperties": false,
2608
+ "properties": {
2609
+ "proofId": {
2610
+ "type": "string",
2611
+ "format": "uri",
2612
+ "description": "URN of the proof record (urn:lemma:auth:<uuid>)."
2613
+ },
2614
+ "verifyUrl": {
2615
+ "type": "string",
2616
+ "format": "uri",
2617
+ "description": "Public verification URL: https://verify.lemma.frame00.com/auth/<uuid>."
2618
+ },
2619
+ "anchoredAt": {
2620
+ "type": "string",
2621
+ "format": "date-time"
2622
+ }
2623
+ }
2624
+ },
2625
+ "settlement": {
2626
+ "type": "object",
2627
+ "required": [
2628
+ "txHash",
2629
+ "amount",
2630
+ "currency",
2631
+ "facilitator"
2632
+ ],
2633
+ "additionalProperties": false,
2634
+ "properties": {
2635
+ "txHash": {
2636
+ "type": "string",
2637
+ "pattern": "^0x[0-9a-fA-F]{64}$"
2638
+ },
2639
+ "amount": {
2640
+ "type": "string",
2641
+ "const": "0.02"
2642
+ },
2643
+ "currency": {
2644
+ "type": "string",
2645
+ "const": "USDC"
2646
+ },
2647
+ "facilitator": {
2648
+ "type": "string",
2649
+ "format": "uri"
2650
+ }
2651
+ }
2652
+ },
2653
+ "requestId": {
2654
+ "type": "string",
2655
+ "pattern": "^req_[0-9a-z]+$",
2656
+ "description": "Server-assigned request identifier."
2657
+ }
2658
+ }
2659
+ }
2660
+ }
2661
+ }
2662
+ }