@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.
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/openapi.lemma.v2.bundled.json +2662 -0
- package/openapi.lemma.v2.json +243 -4
- package/package.json +13 -4
- package/schemas/_headers +12 -0
- package/schemas/bazaar/canonical-error.json +41 -0
- package/schemas/suites/bazaar-extension-metadata.json +61 -0
- package/schemas/suites/product-a-input.json +127 -0
- package/schemas/suites/product-a-output.json +113 -0
- package/schemas/suites/product-b-input.json +61 -0
- package/schemas/suites/product-b-output.json +66 -0
- package/schemas/suites/product-c-input.json +78 -0
- package/schemas/suites/product-c-output.json +74 -0
- package/schemas/suites/product-d-input.json +52 -0
- package/schemas/suites/product-d-output.json +50 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/product-a-output.json",
|
|
4
|
+
"title": "Agent Identity Issuance Response",
|
|
5
|
+
"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.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["credentialId", "credential", "proof", "verifyUrl", "issuedAt", "expiresAt", "settlement", "requestId"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"credentialId": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"format": "uri",
|
|
13
|
+
"description": "Permanent identifier of the issued credential (URN form: urn:lemma:cred:<uuid>)."
|
|
14
|
+
},
|
|
15
|
+
"credential": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"required": ["@context", "type", "issuer", "validFrom", "validUntil", "credentialSubject"],
|
|
18
|
+
"description": "W3C Verifiable Credentials v2 envelope. Subject = agentId, claims = roles+scopes+permissions+spendLimit.",
|
|
19
|
+
"properties": {
|
|
20
|
+
"@context": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": { "type": "string", "format": "uri" },
|
|
23
|
+
"description": "JSON-LD contexts. Always includes 'https://www.w3.org/ns/credentials/v2' + Lemma schema context."
|
|
24
|
+
},
|
|
25
|
+
"type": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": { "type": "string" },
|
|
28
|
+
"description": "VC types. Always ['VerifiableCredential', 'AgentIdentityCredential']."
|
|
29
|
+
},
|
|
30
|
+
"issuer": { "type": "string", "format": "uri", "description": "DID of Lemma's issuer (e.g. did:web:lemma.frame00.com)." },
|
|
31
|
+
"validFrom": { "type": "string", "format": "date-time" },
|
|
32
|
+
"validUntil": { "type": "string", "format": "date-time" },
|
|
33
|
+
"credentialSubject": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"required": ["id", "roles", "spendLimit"],
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"properties": {
|
|
38
|
+
"id": { "type": "string", "format": "uri", "description": "Subject DID (= agentId in request)." },
|
|
39
|
+
"controller": { "type": "string", "format": "uri" },
|
|
40
|
+
"orgId": { "type": "string" },
|
|
41
|
+
"roles": { "type": "array", "items": { "type": "string" } },
|
|
42
|
+
"scopes": { "type": "array", "items": { "type": "string" } },
|
|
43
|
+
"permissions": { "type": "object" },
|
|
44
|
+
"spendLimit": { "type": "object" }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"proof": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"required": ["type", "merkle", "circuitId"],
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"properties": {
|
|
54
|
+
"type": { "type": "string", "const": "LemmaAgentIdentityProof2026" },
|
|
55
|
+
"merkle": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": ["commitmentRoot", "leafIndex", "subjectIdHash"],
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"properties": {
|
|
60
|
+
"commitmentRoot": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"pattern": "^0x[0-9a-fA-F]{64}$",
|
|
63
|
+
"description": "Public Poseidon Merkle root after inserting this credential's leaves (5 attributes)."
|
|
64
|
+
},
|
|
65
|
+
"leafIndex": {
|
|
66
|
+
"type": "integer",
|
|
67
|
+
"description": "Index of this credential's leaves in the Merkle tree (nLevels=20)."
|
|
68
|
+
},
|
|
69
|
+
"subjectIdHash": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"pattern": "^0x[0-9a-fA-F]{64}$",
|
|
72
|
+
"description": "Poseidon hash of the subject DID."
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"merkleProofUrl": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"format": "uri",
|
|
79
|
+
"description": "One-time holder-only URL to retrieve the full Merkle inclusion proof."
|
|
80
|
+
},
|
|
81
|
+
"circuitId": { "type": "string", "const": "agent-identity-v1" },
|
|
82
|
+
"verifierContract": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"pattern": "^0x[0-9a-fA-F]{40}$",
|
|
85
|
+
"description": "Address of the Solidity Groth16 verifier on Base mainnet."
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"verifyUrl": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"format": "uri",
|
|
92
|
+
"description": "Public verification URL: https://verify.lemma.frame00.com/credential/<uuid>."
|
|
93
|
+
},
|
|
94
|
+
"issuedAt": { "type": "string", "format": "date-time" },
|
|
95
|
+
"expiresAt": { "type": "string", "format": "date-time" },
|
|
96
|
+
"settlement": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"required": ["txHash", "amount", "currency", "facilitator"],
|
|
99
|
+
"additionalProperties": false,
|
|
100
|
+
"properties": {
|
|
101
|
+
"txHash": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" },
|
|
102
|
+
"amount": { "type": "string", "const": "0.05" },
|
|
103
|
+
"currency": { "type": "string", "const": "USDC" },
|
|
104
|
+
"facilitator": { "type": "string", "format": "uri" }
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"requestId": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"pattern": "^req_[0-9a-z]+$",
|
|
110
|
+
"description": "Server-assigned request identifier for log correlation."
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/product-b-input.json",
|
|
4
|
+
"title": "Inference Attestation Request",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["model_digest", "input_hash", "output_hash", "timestamp"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"model_digest": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^0x[0-9a-fA-F]{64}$",
|
|
12
|
+
"description": "SHA-256 hash of a canonical model identifier (e.g. provider:model_name:version)."
|
|
13
|
+
},
|
|
14
|
+
"input_hash": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"pattern": "^0x[0-9a-fA-F]{64}$",
|
|
17
|
+
"description": "SHA-256 hash of the canonicalised inference input. Raw input is NEVER sent to Lemma."
|
|
18
|
+
},
|
|
19
|
+
"output_hash": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"pattern": "^0x[0-9a-fA-F]{64}$",
|
|
22
|
+
"description": "SHA-256 hash of the canonicalised inference output. Raw output is NEVER sent to Lemma."
|
|
23
|
+
},
|
|
24
|
+
"timestamp": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"description": "Unix epoch seconds. Must be within ±300s of Lemma's server time (replay protection)."
|
|
27
|
+
},
|
|
28
|
+
"nonce": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"pattern": "^[0-9a-fA-F]{32}$",
|
|
31
|
+
"description": "Optional 16-byte client nonce (hex) for additional replay protection."
|
|
32
|
+
},
|
|
33
|
+
"claim_metadata": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"description": "Optional metadata bound into the proof commitment as a hash; never stored in the clear.",
|
|
37
|
+
"properties": {
|
|
38
|
+
"agentId": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"format": "uri",
|
|
41
|
+
"description": "Calling agent's DID. Recommended for full audit trail; combine with product A credential."
|
|
42
|
+
},
|
|
43
|
+
"purpose": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"maxLength": 256,
|
|
46
|
+
"description": "Human-readable purpose label. Hashed before commitment."
|
|
47
|
+
},
|
|
48
|
+
"tags": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": { "type": "string", "pattern": "^[a-z0-9_:-]+$" },
|
|
51
|
+
"maxItems": 16,
|
|
52
|
+
"description": "Free-form tags for downstream filtering (hashed)."
|
|
53
|
+
},
|
|
54
|
+
"provider": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Free-form provider identifier. Hashed before commitment."
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/product-b-output.json",
|
|
4
|
+
"title": "Inference Attestation Response",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["attestationId", "proof", "verifyUrl", "anchoredAt", "settlement", "requestId"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"attestationId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri",
|
|
12
|
+
"description": "URN of the attestation record (urn:lemma:attestation:<uuid>)."
|
|
13
|
+
},
|
|
14
|
+
"proof": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": ["type", "status", "circuitId"],
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"type": { "type": "string", "const": "LemmaInferenceAttestation2026" },
|
|
20
|
+
"status": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"enum": ["anchored", "deferred"],
|
|
23
|
+
"description": "'anchored' = proof generated and submitted synchronously. 'deferred' = settled but queued; use pollUrl."
|
|
24
|
+
},
|
|
25
|
+
"commitment": {
|
|
26
|
+
"type": ["string", "null"],
|
|
27
|
+
"pattern": "^0x[0-9a-fA-F]{64}$",
|
|
28
|
+
"description": "Poseidon5 commitment. null when status=deferred."
|
|
29
|
+
},
|
|
30
|
+
"groth16": {
|
|
31
|
+
"type": ["object", "null"],
|
|
32
|
+
"description": "Groth16 proof tuple. null when status=deferred."
|
|
33
|
+
},
|
|
34
|
+
"circuitId": { "type": "string", "const": "attestation-commitment-v1" },
|
|
35
|
+
"verifierContract": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" },
|
|
36
|
+
"pollUrl": { "type": "string", "format": "uri", "description": "Polling URL when status=deferred." }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"verifyUrl": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri",
|
|
42
|
+
"description": "Public verification URL: https://verify.lemma.frame00.com/attestation/<uuid>."
|
|
43
|
+
},
|
|
44
|
+
"anchoredAt": {
|
|
45
|
+
"type": ["string", "null"],
|
|
46
|
+
"format": "date-time",
|
|
47
|
+
"description": "Time the attestation was anchored on-chain. null when status=deferred."
|
|
48
|
+
},
|
|
49
|
+
"settlement": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"required": ["txHash", "amount", "currency", "facilitator"],
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"properties": {
|
|
54
|
+
"txHash": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" },
|
|
55
|
+
"amount": { "type": "string", "const": "0.07" },
|
|
56
|
+
"currency": { "type": "string", "const": "USDC" },
|
|
57
|
+
"facilitator": { "type": "string", "format": "uri" }
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"requestId": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"pattern": "^req_[0-9a-z]+$",
|
|
63
|
+
"description": "Server-assigned request identifier for log correlation."
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/product-c-input.json",
|
|
4
|
+
"title": "Compliance Attestation Bundle Request (Basic MVP)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["subject_did", "requested_attributes", "disclosure_policy"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"subject_did": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri",
|
|
12
|
+
"pattern": "^did:[a-z0-9]+:.+$",
|
|
13
|
+
"description": "DID of the subject. Must have a prior Lemma attestation set; otherwise INSUFFICIENT_ATTRIBUTES error."
|
|
14
|
+
},
|
|
15
|
+
"requested_attributes": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"minItems": 1,
|
|
18
|
+
"maxItems": 3,
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["kyc_status", "jurisdiction", "sanctions_check"]
|
|
22
|
+
},
|
|
23
|
+
"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."
|
|
24
|
+
},
|
|
25
|
+
"disclosure_policy": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["mode"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"mode": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"enum": ["full", "selective", "range_only"],
|
|
33
|
+
"description": "full = reveal all values; selective = reveal only fields in reveal_fields; range_only = prove range without revealing values."
|
|
34
|
+
},
|
|
35
|
+
"reveal_fields": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": { "type": "string" },
|
|
38
|
+
"description": "Required when mode='selective'. Subset of requested_attributes."
|
|
39
|
+
},
|
|
40
|
+
"range_predicates": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"items": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"required": ["field", "predicate", "value"],
|
|
46
|
+
"properties": {
|
|
47
|
+
"field": { "type": "string" },
|
|
48
|
+
"predicate": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"enum": [">=", "<=", "=="],
|
|
51
|
+
"description": "BBS+ range proof supports only inclusive bounds and equality. Strict inequalities (>, <) are not supported."
|
|
52
|
+
},
|
|
53
|
+
"value": { "type": ["string", "number"] }
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"description": "Required when mode='range_only'."
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"verifier_context": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"description": "Optional metadata about the verifying party. Bound into the proof for replay protection.",
|
|
64
|
+
"properties": {
|
|
65
|
+
"verifier_did": { "type": "string", "format": "uri" },
|
|
66
|
+
"nonce": { "type": "string", "minLength": 16, "maxLength": 64 },
|
|
67
|
+
"purpose": { "type": "string", "maxLength": 256 }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"expires_in_seconds": {
|
|
71
|
+
"type": "integer",
|
|
72
|
+
"minimum": 60,
|
|
73
|
+
"maximum": 86400,
|
|
74
|
+
"default": 3600,
|
|
75
|
+
"description": "How long the issued bundle remains valid. Default 1 hour; max 24 hours in MVP."
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/product-c-output.json",
|
|
4
|
+
"title": "Compliance Attestation Bundle Response (Basic MVP)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["bundleId", "bbs_proof", "revealed_claims", "verifyUrl", "issuedAt", "expiresAt", "settlement", "requestId"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"bundleId": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri",
|
|
12
|
+
"description": "URN of the bundle (urn:lemma:bundle:<uuid>)."
|
|
13
|
+
},
|
|
14
|
+
"bbs_proof": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": ["type", "proof", "publicKey", "issuerDid"],
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"type": { "type": "string", "const": "BbsBlsSignatureProof2025" },
|
|
20
|
+
"proof": { "type": "string", "description": "Base64url-encoded BBS+ selective disclosure proof." },
|
|
21
|
+
"publicKey": { "type": "string", "description": "BLS12-381 G2 public key (base64url)." },
|
|
22
|
+
"issuerDid": { "type": "string", "format": "uri", "description": "DID of Lemma's attestation issuer." }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"revealed_claims": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"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'.",
|
|
29
|
+
"properties": {
|
|
30
|
+
"kyc_status": { "type": ["string", "null"], "enum": ["verified", "pending", "rejected", null] },
|
|
31
|
+
"jurisdiction": { "type": ["string", "null"], "description": "ISO 3166-1 alpha-2 country code." },
|
|
32
|
+
"sanctions_check": { "type": ["string", "null"], "enum": ["clear", "flagged", "pending", null] }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"range_results": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"description": "Range predicate verification results. Present only when mode='range_only'.",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["field", "predicate", "value", "result"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"field": { "type": "string" },
|
|
44
|
+
"predicate": { "type": "string", "enum": [">=", "<=", "=="] },
|
|
45
|
+
"value": { "type": ["string", "number"] },
|
|
46
|
+
"result": { "type": "boolean" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"verifyUrl": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"format": "uri",
|
|
53
|
+
"description": "Public verification URL: https://verify.lemma.frame00.com/bundle/<uuid>."
|
|
54
|
+
},
|
|
55
|
+
"issuedAt": { "type": "string", "format": "date-time" },
|
|
56
|
+
"expiresAt": { "type": "string", "format": "date-time" },
|
|
57
|
+
"settlement": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"required": ["txHash", "amount", "currency", "facilitator"],
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"properties": {
|
|
62
|
+
"txHash": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" },
|
|
63
|
+
"amount": { "type": "string", "const": "0.08" },
|
|
64
|
+
"currency": { "type": "string", "const": "USDC" },
|
|
65
|
+
"facilitator": { "type": "string", "format": "uri" }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"requestId": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"pattern": "^req_[0-9a-z]+$",
|
|
71
|
+
"description": "Server-assigned request identifier for log correlation."
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/product-d-input.json",
|
|
4
|
+
"title": "ZK Proof Sign-in Request",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["api_key_commitment", "zk_proof", "nonce"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"api_key_commitment": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"pattern": "^0x[0-9a-fA-F]{64}$",
|
|
12
|
+
"description": "Poseidon hash of the API key, computed client-side. The API key itself is never transmitted."
|
|
13
|
+
},
|
|
14
|
+
"zk_proof": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": ["pi_a", "pi_b", "pi_c", "publicSignals"],
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"pi_a": { "type": "array", "items": { "type": "string" } },
|
|
20
|
+
"pi_b": { "type": "array", "items": { "type": "array", "items": { "type": "string" } } },
|
|
21
|
+
"pi_c": { "type": "array", "items": { "type": "string" } },
|
|
22
|
+
"publicSignals": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": { "type": "string" },
|
|
25
|
+
"description": "Public signals: [api_key_commitment, nonce_hash, timestamp]."
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"description": "Groth16 proof generated with seal-identity-v1 circuit."
|
|
29
|
+
},
|
|
30
|
+
"nonce": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 16,
|
|
33
|
+
"maxLength": 64,
|
|
34
|
+
"description": "Server-issued nonce from GET /v1/suites/auth/challenge. Single-use, expires in 60 seconds."
|
|
35
|
+
},
|
|
36
|
+
"client_metadata": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"description": "Optional client identification (binds to JWT for audit).",
|
|
40
|
+
"properties": {
|
|
41
|
+
"client_id": { "type": "string" },
|
|
42
|
+
"platform": { "type": "string", "enum": ["web", "ios", "android", "cli", "server"] },
|
|
43
|
+
"subject_type": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"enum": ["human", "agent"],
|
|
46
|
+
"default": "agent",
|
|
47
|
+
"description": "Whether the sign-in is performed by a human user or an autonomous agent."
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.lemma.frame00.com/suites/product-d-output.json",
|
|
4
|
+
"title": "ZK Proof Sign-in Response",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["access_token", "token_type", "expires_in", "session_id", "proof_record", "settlement", "requestId"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"access_token": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Short-lived JWT (default TTL 15 minutes)."
|
|
12
|
+
},
|
|
13
|
+
"token_type": { "type": "string", "const": "Bearer" },
|
|
14
|
+
"expires_in": {
|
|
15
|
+
"type": "integer",
|
|
16
|
+
"default": 900,
|
|
17
|
+
"description": "Seconds until access_token expiry. Default 900 (15 minutes)."
|
|
18
|
+
},
|
|
19
|
+
"session_id": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Server-assigned session identifier for log correlation."
|
|
22
|
+
},
|
|
23
|
+
"proof_record": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"required": ["proofId", "verifyUrl", "anchoredAt"],
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"properties": {
|
|
28
|
+
"proofId": { "type": "string", "format": "uri", "description": "URN of the proof record (urn:lemma:auth:<uuid>)." },
|
|
29
|
+
"verifyUrl": { "type": "string", "format": "uri", "description": "Public verification URL: https://verify.lemma.frame00.com/auth/<uuid>." },
|
|
30
|
+
"anchoredAt": { "type": "string", "format": "date-time" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"settlement": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"required": ["txHash", "amount", "currency", "facilitator"],
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"properties": {
|
|
38
|
+
"txHash": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" },
|
|
39
|
+
"amount": { "type": "string", "const": "0.02" },
|
|
40
|
+
"currency": { "type": "string", "const": "USDC" },
|
|
41
|
+
"facilitator": { "type": "string", "format": "uri" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"requestId": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"pattern": "^req_[0-9a-z]+$",
|
|
47
|
+
"description": "Server-assigned request identifier."
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|