@zkproofport-app/sdk 0.2.11 → 0.2.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 +79 -3
- package/dist/ProofportSDK.d.ts +31 -0
- package/dist/circuits.d.ts +158 -0
- package/dist/circuits.esm.js +170 -0
- package/dist/circuits.esm.js.map +1 -0
- package/dist/circuits.js +180 -0
- package/dist/circuits.js.map +1 -0
- package/dist/circuits.mjs +170 -0
- package/dist/circuits.mjs.map +1 -0
- package/dist/constants.d.ts +8 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +443 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +452 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +443 -6
- package/dist/index.mjs.map +1 -1
- package/dist/offChainVerifier.d.ts +73 -0
- package/dist/types.d.ts +10 -2
- package/package.json +15 -4
package/dist/circuits.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Canonical ZKProofport circuit identifiers.
|
|
5
|
+
*
|
|
6
|
+
* This module is the single source of truth for circuit IDs. Every other layer
|
|
7
|
+
* — the mobile app, the demo, the relay, server-side provers — reads its list
|
|
8
|
+
* from here instead of keeping a private copy that silently drifts.
|
|
9
|
+
*
|
|
10
|
+
* It has **no imports and no dependencies**, so it can be pulled in on its own:
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { CIRCUIT_IDS, isCircuitId } from '@zkproofport-app/sdk/circuits';
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* The same names are also re-exported from the package root
|
|
17
|
+
* (`@zkproofport-app/sdk`) for callers that already import the SDK.
|
|
18
|
+
*
|
|
19
|
+
* ## Identifiers are canonical and case-sensitive
|
|
20
|
+
*
|
|
21
|
+
* Each ID is the circuit's `name` in its `Nargo.toml`, verbatim. The format is
|
|
22
|
+
* lowercase with underscores. Hyphenated spellings (`coinbase-kyc`,
|
|
23
|
+
* `mdl-kr-age`) are directory or UI route names in other repositories — they
|
|
24
|
+
* are **not** circuit IDs, and passing one produces a nullifier mismatch or a
|
|
25
|
+
* failed on-chain lookup rather than a clear error.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Canonical circuit identifiers, keyed by a stable constant name.
|
|
29
|
+
*
|
|
30
|
+
* Prefer these constants over string literals so a rename is a compile error
|
|
31
|
+
* rather than a runtime surprise.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* import { CIRCUIT_IDS } from '@zkproofport-app/sdk/circuits';
|
|
36
|
+
*
|
|
37
|
+
* const relay = await sdk.createRelayRequest(CIRCUIT_IDS.COINBASE_ATTESTATION, {
|
|
38
|
+
* scope: 'myapp.com',
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
const CIRCUIT_IDS = Object.freeze({
|
|
43
|
+
/** Coinbase KYC attestation. Officially supported. */
|
|
44
|
+
COINBASE_ATTESTATION: 'coinbase_attestation',
|
|
45
|
+
/** Coinbase country attestation (inclusion / exclusion). Officially supported. */
|
|
46
|
+
COINBASE_COUNTRY_ATTESTATION: 'coinbase_country_attestation',
|
|
47
|
+
/** OIDC email-domain attestation. Officially supported. */
|
|
48
|
+
OIDC_DOMAIN_ATTESTATION: 'oidc_domain_attestation',
|
|
49
|
+
/** GIWA attestation. Planned — not officially supported yet. */
|
|
50
|
+
GIWA_ATTESTATION: 'giwa_attestation',
|
|
51
|
+
/** Korea Mobile ID ownership. Planned — not officially supported yet. */
|
|
52
|
+
MDL_KR_OWNERSHIP: 'mdl_kr_ownership',
|
|
53
|
+
/** Korea Mobile ID age threshold. Planned — not officially supported yet. */
|
|
54
|
+
MDL_KR_AGE: 'mdl_kr_age',
|
|
55
|
+
/** Korea Mobile ID si/do region. Planned — not officially supported yet. */
|
|
56
|
+
MDL_KR_REGION: 'mdl_kr_region',
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Support status for every circuit.
|
|
60
|
+
*
|
|
61
|
+
* The record is exhaustive over {@link CircuitId}: adding an identifier without
|
|
62
|
+
* giving it a status is a compile error, so this list cannot drift from
|
|
63
|
+
* {@link CIRCUIT_IDS}.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* import { CIRCUIT_SUPPORT_STATUS } from '@zkproofport-app/sdk/circuits';
|
|
68
|
+
*
|
|
69
|
+
* CIRCUIT_SUPPORT_STATUS.coinbase_attestation; // 'supported'
|
|
70
|
+
* CIRCUIT_SUPPORT_STATUS.mdl_kr_age; // 'planned'
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
const CIRCUIT_SUPPORT_STATUS = Object.freeze({
|
|
74
|
+
coinbase_attestation: 'supported',
|
|
75
|
+
coinbase_country_attestation: 'supported',
|
|
76
|
+
oidc_domain_attestation: 'supported',
|
|
77
|
+
giwa_attestation: 'planned',
|
|
78
|
+
mdl_kr_ownership: 'planned',
|
|
79
|
+
mdl_kr_age: 'planned',
|
|
80
|
+
mdl_kr_region: 'planned',
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* Where each circuit's verification key lives inside the `zkproofport/circuits`
|
|
84
|
+
* repository, relative to its root.
|
|
85
|
+
*
|
|
86
|
+
* Off-chain verification needs the verification key and nothing else — no
|
|
87
|
+
* circuit bytecode, no witness. The key is public by nature: it is what anyone
|
|
88
|
+
* checking a proof must already have, and the Solidity verifiers deployed
|
|
89
|
+
* on-chain embed the same key.
|
|
90
|
+
*
|
|
91
|
+
* Exhaustive over {@link CircuitId} on purpose. A new circuit whose key path is
|
|
92
|
+
* not listed here fails to compile rather than failing at verification time,
|
|
93
|
+
* where the only symptom would be a proof that cannot be checked.
|
|
94
|
+
*/
|
|
95
|
+
const CIRCUIT_VK_PATHS = Object.freeze({
|
|
96
|
+
coinbase_attestation: 'coinbase-attestation/target/vk',
|
|
97
|
+
coinbase_country_attestation: 'coinbase-country-attestation/target/vk',
|
|
98
|
+
oidc_domain_attestation: 'oidc-domain-attestation/target/vk',
|
|
99
|
+
giwa_attestation: 'giwa-attestation/target/vk',
|
|
100
|
+
mdl_kr_ownership: 'mdl/kr-ownership/target/vk',
|
|
101
|
+
mdl_kr_age: 'mdl/kr-age/target/vk',
|
|
102
|
+
mdl_kr_region: 'mdl/kr-region/target/vk',
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Every canonical circuit identifier, in declaration order.
|
|
106
|
+
*
|
|
107
|
+
* Includes circuits that are still `planned`. Use {@link SUPPORTED_CIRCUIT_IDS}
|
|
108
|
+
* when you only want the ones that are officially supported today.
|
|
109
|
+
*/
|
|
110
|
+
const ALL_CIRCUIT_IDS = Object.freeze(Object.values(CIRCUIT_IDS));
|
|
111
|
+
/**
|
|
112
|
+
* Circuits that are officially supported today: the two Coinbase circuits and
|
|
113
|
+
* OIDC domain attestation.
|
|
114
|
+
*
|
|
115
|
+
* Derived from {@link CIRCUIT_SUPPORT_STATUS}, so it cannot fall out of sync.
|
|
116
|
+
*/
|
|
117
|
+
const SUPPORTED_CIRCUIT_IDS = Object.freeze(ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'supported'));
|
|
118
|
+
/**
|
|
119
|
+
* Circuits whose identifiers are reserved but which are not officially
|
|
120
|
+
* supported yet: GIWA attestation and the three Korea Mobile ID circuits.
|
|
121
|
+
*
|
|
122
|
+
* Derived from {@link CIRCUIT_SUPPORT_STATUS}, so it cannot fall out of sync.
|
|
123
|
+
*/
|
|
124
|
+
const PLANNED_CIRCUIT_IDS = Object.freeze(ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'planned'));
|
|
125
|
+
/**
|
|
126
|
+
* Narrows an unknown value to a canonical circuit identifier.
|
|
127
|
+
*
|
|
128
|
+
* Returns `false` for hyphenated route names such as `'coinbase-kyc'`, which
|
|
129
|
+
* are not circuit IDs.
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```typescript
|
|
133
|
+
* isCircuitId('coinbase_attestation'); // true
|
|
134
|
+
* isCircuitId('coinbase-kyc'); // false
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
function isCircuitId(value) {
|
|
138
|
+
return typeof value === 'string' && ALL_CIRCUIT_IDS.includes(value);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Narrows an unknown value to a circuit identifier that is officially supported
|
|
142
|
+
* today. Planned circuits return `false`.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* isSupportedCircuitId('oidc_domain_attestation'); // true
|
|
147
|
+
* isSupportedCircuitId('mdl_kr_age'); // false — planned
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
function isSupportedCircuitId(value) {
|
|
151
|
+
return isCircuitId(value) && CIRCUIT_SUPPORT_STATUS[value] === 'supported';
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Returns the support status of a circuit.
|
|
155
|
+
*
|
|
156
|
+
* @param circuit - A canonical circuit identifier.
|
|
157
|
+
* @throws Error when the value is not a canonical circuit identifier.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```typescript
|
|
161
|
+
* getCircuitSupportStatus('giwa_attestation'); // 'planned'
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
function getCircuitSupportStatus(circuit) {
|
|
165
|
+
if (!isCircuitId(circuit)) {
|
|
166
|
+
throw new Error(`Unknown circuit '${String(circuit)}'. Expected one of: ${ALL_CIRCUIT_IDS.join(', ')}`);
|
|
167
|
+
}
|
|
168
|
+
return CIRCUIT_SUPPORT_STATUS[circuit];
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
exports.ALL_CIRCUIT_IDS = ALL_CIRCUIT_IDS;
|
|
172
|
+
exports.CIRCUIT_IDS = CIRCUIT_IDS;
|
|
173
|
+
exports.CIRCUIT_SUPPORT_STATUS = CIRCUIT_SUPPORT_STATUS;
|
|
174
|
+
exports.CIRCUIT_VK_PATHS = CIRCUIT_VK_PATHS;
|
|
175
|
+
exports.PLANNED_CIRCUIT_IDS = PLANNED_CIRCUIT_IDS;
|
|
176
|
+
exports.SUPPORTED_CIRCUIT_IDS = SUPPORTED_CIRCUIT_IDS;
|
|
177
|
+
exports.getCircuitSupportStatus = getCircuitSupportStatus;
|
|
178
|
+
exports.isCircuitId = isCircuitId;
|
|
179
|
+
exports.isSupportedCircuitId = isSupportedCircuitId;
|
|
180
|
+
//# sourceMappingURL=circuits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuits.js","sources":["../src/circuits.ts"],"sourcesContent":["/**\n * Canonical ZKProofport circuit identifiers.\n *\n * This module is the single source of truth for circuit IDs. Every other layer\n * — the mobile app, the demo, the relay, server-side provers — reads its list\n * from here instead of keeping a private copy that silently drifts.\n *\n * It has **no imports and no dependencies**, so it can be pulled in on its own:\n *\n * ```typescript\n * import { CIRCUIT_IDS, isCircuitId } from '@zkproofport-app/sdk/circuits';\n * ```\n *\n * The same names are also re-exported from the package root\n * (`@zkproofport-app/sdk`) for callers that already import the SDK.\n *\n * ## Identifiers are canonical and case-sensitive\n *\n * Each ID is the circuit's `name` in its `Nargo.toml`, verbatim. The format is\n * lowercase with underscores. Hyphenated spellings (`coinbase-kyc`,\n * `mdl-kr-age`) are directory or UI route names in other repositories — they\n * are **not** circuit IDs, and passing one produces a nullifier mismatch or a\n * failed on-chain lookup rather than a clear error.\n */\n\n/**\n * Whether a circuit is officially supported today or still on the roadmap.\n *\n * - `supported` — generally available. Safe to build a product on.\n * - `planned` — the identifier is reserved and the circuit exists, but it is\n * not officially supported yet. Availability, inputs and public-input layout\n * may change without a major version bump.\n */\nexport type CircuitSupportStatus = 'supported' | 'planned';\n\n/**\n * Canonical circuit identifiers, keyed by a stable constant name.\n *\n * Prefer these constants over string literals so a rename is a compile error\n * rather than a runtime surprise.\n *\n * @example\n * ```typescript\n * import { CIRCUIT_IDS } from '@zkproofport-app/sdk/circuits';\n *\n * const relay = await sdk.createRelayRequest(CIRCUIT_IDS.COINBASE_ATTESTATION, {\n * scope: 'myapp.com',\n * });\n * ```\n */\nexport const CIRCUIT_IDS = Object.freeze({\n /** Coinbase KYC attestation. Officially supported. */\n COINBASE_ATTESTATION: 'coinbase_attestation',\n /** Coinbase country attestation (inclusion / exclusion). Officially supported. */\n COINBASE_COUNTRY_ATTESTATION: 'coinbase_country_attestation',\n /** OIDC email-domain attestation. Officially supported. */\n OIDC_DOMAIN_ATTESTATION: 'oidc_domain_attestation',\n /** GIWA attestation. Planned — not officially supported yet. */\n GIWA_ATTESTATION: 'giwa_attestation',\n /** Korea Mobile ID ownership. Planned — not officially supported yet. */\n MDL_KR_OWNERSHIP: 'mdl_kr_ownership',\n /** Korea Mobile ID age threshold. Planned — not officially supported yet. */\n MDL_KR_AGE: 'mdl_kr_age',\n /** Korea Mobile ID si/do region. Planned — not officially supported yet. */\n MDL_KR_REGION: 'mdl_kr_region',\n} as const);\n\n/**\n * Union of every canonical circuit identifier.\n *\n * `CircuitType` (exported from the package root) is an alias of this type — the\n * two names refer to the same union, and this module is where it is defined.\n */\nexport type CircuitId = (typeof CIRCUIT_IDS)[keyof typeof CIRCUIT_IDS];\n\n/**\n * Support status for every circuit.\n *\n * The record is exhaustive over {@link CircuitId}: adding an identifier without\n * giving it a status is a compile error, so this list cannot drift from\n * {@link CIRCUIT_IDS}.\n *\n * @example\n * ```typescript\n * import { CIRCUIT_SUPPORT_STATUS } from '@zkproofport-app/sdk/circuits';\n *\n * CIRCUIT_SUPPORT_STATUS.coinbase_attestation; // 'supported'\n * CIRCUIT_SUPPORT_STATUS.mdl_kr_age; // 'planned'\n * ```\n */\nexport const CIRCUIT_SUPPORT_STATUS: Readonly<Record<CircuitId, CircuitSupportStatus>> =\n Object.freeze({\n coinbase_attestation: 'supported',\n coinbase_country_attestation: 'supported',\n oidc_domain_attestation: 'supported',\n giwa_attestation: 'planned',\n mdl_kr_ownership: 'planned',\n mdl_kr_age: 'planned',\n mdl_kr_region: 'planned',\n } as const);\n\n/**\n * Where each circuit's verification key lives inside the `zkproofport/circuits`\n * repository, relative to its root.\n *\n * Off-chain verification needs the verification key and nothing else — no\n * circuit bytecode, no witness. The key is public by nature: it is what anyone\n * checking a proof must already have, and the Solidity verifiers deployed\n * on-chain embed the same key.\n *\n * Exhaustive over {@link CircuitId} on purpose. A new circuit whose key path is\n * not listed here fails to compile rather than failing at verification time,\n * where the only symptom would be a proof that cannot be checked.\n */\nexport const CIRCUIT_VK_PATHS: Readonly<Record<CircuitId, string>> = Object.freeze({\n coinbase_attestation: 'coinbase-attestation/target/vk',\n coinbase_country_attestation: 'coinbase-country-attestation/target/vk',\n oidc_domain_attestation: 'oidc-domain-attestation/target/vk',\n giwa_attestation: 'giwa-attestation/target/vk',\n mdl_kr_ownership: 'mdl/kr-ownership/target/vk',\n mdl_kr_age: 'mdl/kr-age/target/vk',\n mdl_kr_region: 'mdl/kr-region/target/vk',\n} as const);\n\n/**\n * Every canonical circuit identifier, in declaration order.\n *\n * Includes circuits that are still `planned`. Use {@link SUPPORTED_CIRCUIT_IDS}\n * when you only want the ones that are officially supported today.\n */\nexport const ALL_CIRCUIT_IDS: readonly CircuitId[] = Object.freeze(\n Object.values(CIRCUIT_IDS) as CircuitId[]\n);\n\n/**\n * Circuits that are officially supported today: the two Coinbase circuits and\n * OIDC domain attestation.\n *\n * Derived from {@link CIRCUIT_SUPPORT_STATUS}, so it cannot fall out of sync.\n */\nexport const SUPPORTED_CIRCUIT_IDS: readonly CircuitId[] = Object.freeze(\n ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'supported')\n);\n\n/**\n * Circuits whose identifiers are reserved but which are not officially\n * supported yet: GIWA attestation and the three Korea Mobile ID circuits.\n *\n * Derived from {@link CIRCUIT_SUPPORT_STATUS}, so it cannot fall out of sync.\n */\nexport const PLANNED_CIRCUIT_IDS: readonly CircuitId[] = Object.freeze(\n ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'planned')\n);\n\n/**\n * Narrows an unknown value to a canonical circuit identifier.\n *\n * Returns `false` for hyphenated route names such as `'coinbase-kyc'`, which\n * are not circuit IDs.\n *\n * @example\n * ```typescript\n * isCircuitId('coinbase_attestation'); // true\n * isCircuitId('coinbase-kyc'); // false\n * ```\n */\nexport function isCircuitId(value: unknown): value is CircuitId {\n return typeof value === 'string' && (ALL_CIRCUIT_IDS as readonly string[]).includes(value);\n}\n\n/**\n * Narrows an unknown value to a circuit identifier that is officially supported\n * today. Planned circuits return `false`.\n *\n * @example\n * ```typescript\n * isSupportedCircuitId('oidc_domain_attestation'); // true\n * isSupportedCircuitId('mdl_kr_age'); // false — planned\n * ```\n */\nexport function isSupportedCircuitId(value: unknown): value is CircuitId {\n return isCircuitId(value) && CIRCUIT_SUPPORT_STATUS[value] === 'supported';\n}\n\n/**\n * Returns the support status of a circuit.\n *\n * @param circuit - A canonical circuit identifier.\n * @throws Error when the value is not a canonical circuit identifier.\n *\n * @example\n * ```typescript\n * getCircuitSupportStatus('giwa_attestation'); // 'planned'\n * ```\n */\nexport function getCircuitSupportStatus(circuit: CircuitId): CircuitSupportStatus {\n if (!isCircuitId(circuit)) {\n throw new Error(\n `Unknown circuit '${String(circuit)}'. Expected one of: ${ALL_CIRCUIT_IDS.join(', ')}`\n );\n }\n return CIRCUIT_SUPPORT_STATUS[circuit];\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AAYH;;;;;;;;;;;;;;AAcG;AACI,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;;AAEvC,IAAA,oBAAoB,EAAE,sBAAsB;;AAE5C,IAAA,4BAA4B,EAAE,8BAA8B;;AAE5D,IAAA,uBAAuB,EAAE,yBAAyB;;AAElD,IAAA,gBAAgB,EAAE,kBAAkB;;AAEpC,IAAA,gBAAgB,EAAE,kBAAkB;;AAEpC,IAAA,UAAU,EAAE,YAAY;;AAExB,IAAA,aAAa,EAAE,eAAe;AACtB,CAAA;AAUV;;;;;;;;;;;;;;AAcG;AACI,MAAM,sBAAsB,GACjC,MAAM,CAAC,MAAM,CAAC;AACZ,IAAA,oBAAoB,EAAE,WAAW;AACjC,IAAA,4BAA4B,EAAE,WAAW;AACzC,IAAA,uBAAuB,EAAE,WAAW;AACpC,IAAA,gBAAgB,EAAE,SAAS;AAC3B,IAAA,gBAAgB,EAAE,SAAS;AAC3B,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,aAAa,EAAE,SAAS;AAChB,CAAA;AAEZ;;;;;;;;;;;;AAYG;AACI,MAAM,gBAAgB,GAAwC,MAAM,CAAC,MAAM,CAAC;AACjF,IAAA,oBAAoB,EAAE,gCAAgC;AACtD,IAAA,4BAA4B,EAAE,wCAAwC;AACtE,IAAA,uBAAuB,EAAE,mCAAmC;AAC5D,IAAA,gBAAgB,EAAE,4BAA4B;AAC9C,IAAA,gBAAgB,EAAE,4BAA4B;AAC9C,IAAA,UAAU,EAAE,sBAAsB;AAClC,IAAA,aAAa,EAAE,yBAAyB;AAChC,CAAA;AAEV;;;;;AAKG;AACI,MAAM,eAAe,GAAyB,MAAM,CAAC,MAAM,CAChE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAgB;AAG3C;;;;;AAKG;AACI,MAAM,qBAAqB,GAAyB,MAAM,CAAC,MAAM,CACtE,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,sBAAsB,CAAC,EAAE,CAAC,KAAK,WAAW,CAAC;AAG5E;;;;;AAKG;AACI,MAAM,mBAAmB,GAAyB,MAAM,CAAC,MAAM,CACpE,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,sBAAsB,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;AAG1E;;;;;;;;;;;AAWG;AACG,SAAU,WAAW,CAAC,KAAc,EAAA;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,eAAqC,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC5F;AAEA;;;;;;;;;AASG;AACG,SAAU,oBAAoB,CAAC,KAAc,EAAA;IACjD,OAAO,WAAW,CAAC,KAAK,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,KAAK,WAAW;AAC5E;AAEA;;;;;;;;;;AAUG;AACG,SAAU,uBAAuB,CAAC,OAAkB,EAAA;AACxD,IAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,iBAAA,EAAoB,MAAM,CAAC,OAAO,CAAC,CAAA,oBAAA,EAAuB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CACvF;IACH;AACA,IAAA,OAAO,sBAAsB,CAAC,OAAO,CAAC;AACxC;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical ZKProofport circuit identifiers.
|
|
3
|
+
*
|
|
4
|
+
* This module is the single source of truth for circuit IDs. Every other layer
|
|
5
|
+
* — the mobile app, the demo, the relay, server-side provers — reads its list
|
|
6
|
+
* from here instead of keeping a private copy that silently drifts.
|
|
7
|
+
*
|
|
8
|
+
* It has **no imports and no dependencies**, so it can be pulled in on its own:
|
|
9
|
+
*
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { CIRCUIT_IDS, isCircuitId } from '@zkproofport-app/sdk/circuits';
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The same names are also re-exported from the package root
|
|
15
|
+
* (`@zkproofport-app/sdk`) for callers that already import the SDK.
|
|
16
|
+
*
|
|
17
|
+
* ## Identifiers are canonical and case-sensitive
|
|
18
|
+
*
|
|
19
|
+
* Each ID is the circuit's `name` in its `Nargo.toml`, verbatim. The format is
|
|
20
|
+
* lowercase with underscores. Hyphenated spellings (`coinbase-kyc`,
|
|
21
|
+
* `mdl-kr-age`) are directory or UI route names in other repositories — they
|
|
22
|
+
* are **not** circuit IDs, and passing one produces a nullifier mismatch or a
|
|
23
|
+
* failed on-chain lookup rather than a clear error.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Canonical circuit identifiers, keyed by a stable constant name.
|
|
27
|
+
*
|
|
28
|
+
* Prefer these constants over string literals so a rename is a compile error
|
|
29
|
+
* rather than a runtime surprise.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* import { CIRCUIT_IDS } from '@zkproofport-app/sdk/circuits';
|
|
34
|
+
*
|
|
35
|
+
* const relay = await sdk.createRelayRequest(CIRCUIT_IDS.COINBASE_ATTESTATION, {
|
|
36
|
+
* scope: 'myapp.com',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
const CIRCUIT_IDS = Object.freeze({
|
|
41
|
+
/** Coinbase KYC attestation. Officially supported. */
|
|
42
|
+
COINBASE_ATTESTATION: 'coinbase_attestation',
|
|
43
|
+
/** Coinbase country attestation (inclusion / exclusion). Officially supported. */
|
|
44
|
+
COINBASE_COUNTRY_ATTESTATION: 'coinbase_country_attestation',
|
|
45
|
+
/** OIDC email-domain attestation. Officially supported. */
|
|
46
|
+
OIDC_DOMAIN_ATTESTATION: 'oidc_domain_attestation',
|
|
47
|
+
/** GIWA attestation. Planned — not officially supported yet. */
|
|
48
|
+
GIWA_ATTESTATION: 'giwa_attestation',
|
|
49
|
+
/** Korea Mobile ID ownership. Planned — not officially supported yet. */
|
|
50
|
+
MDL_KR_OWNERSHIP: 'mdl_kr_ownership',
|
|
51
|
+
/** Korea Mobile ID age threshold. Planned — not officially supported yet. */
|
|
52
|
+
MDL_KR_AGE: 'mdl_kr_age',
|
|
53
|
+
/** Korea Mobile ID si/do region. Planned — not officially supported yet. */
|
|
54
|
+
MDL_KR_REGION: 'mdl_kr_region',
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Support status for every circuit.
|
|
58
|
+
*
|
|
59
|
+
* The record is exhaustive over {@link CircuitId}: adding an identifier without
|
|
60
|
+
* giving it a status is a compile error, so this list cannot drift from
|
|
61
|
+
* {@link CIRCUIT_IDS}.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* import { CIRCUIT_SUPPORT_STATUS } from '@zkproofport-app/sdk/circuits';
|
|
66
|
+
*
|
|
67
|
+
* CIRCUIT_SUPPORT_STATUS.coinbase_attestation; // 'supported'
|
|
68
|
+
* CIRCUIT_SUPPORT_STATUS.mdl_kr_age; // 'planned'
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
const CIRCUIT_SUPPORT_STATUS = Object.freeze({
|
|
72
|
+
coinbase_attestation: 'supported',
|
|
73
|
+
coinbase_country_attestation: 'supported',
|
|
74
|
+
oidc_domain_attestation: 'supported',
|
|
75
|
+
giwa_attestation: 'planned',
|
|
76
|
+
mdl_kr_ownership: 'planned',
|
|
77
|
+
mdl_kr_age: 'planned',
|
|
78
|
+
mdl_kr_region: 'planned',
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Where each circuit's verification key lives inside the `zkproofport/circuits`
|
|
82
|
+
* repository, relative to its root.
|
|
83
|
+
*
|
|
84
|
+
* Off-chain verification needs the verification key and nothing else — no
|
|
85
|
+
* circuit bytecode, no witness. The key is public by nature: it is what anyone
|
|
86
|
+
* checking a proof must already have, and the Solidity verifiers deployed
|
|
87
|
+
* on-chain embed the same key.
|
|
88
|
+
*
|
|
89
|
+
* Exhaustive over {@link CircuitId} on purpose. A new circuit whose key path is
|
|
90
|
+
* not listed here fails to compile rather than failing at verification time,
|
|
91
|
+
* where the only symptom would be a proof that cannot be checked.
|
|
92
|
+
*/
|
|
93
|
+
const CIRCUIT_VK_PATHS = Object.freeze({
|
|
94
|
+
coinbase_attestation: 'coinbase-attestation/target/vk',
|
|
95
|
+
coinbase_country_attestation: 'coinbase-country-attestation/target/vk',
|
|
96
|
+
oidc_domain_attestation: 'oidc-domain-attestation/target/vk',
|
|
97
|
+
giwa_attestation: 'giwa-attestation/target/vk',
|
|
98
|
+
mdl_kr_ownership: 'mdl/kr-ownership/target/vk',
|
|
99
|
+
mdl_kr_age: 'mdl/kr-age/target/vk',
|
|
100
|
+
mdl_kr_region: 'mdl/kr-region/target/vk',
|
|
101
|
+
});
|
|
102
|
+
/**
|
|
103
|
+
* Every canonical circuit identifier, in declaration order.
|
|
104
|
+
*
|
|
105
|
+
* Includes circuits that are still `planned`. Use {@link SUPPORTED_CIRCUIT_IDS}
|
|
106
|
+
* when you only want the ones that are officially supported today.
|
|
107
|
+
*/
|
|
108
|
+
const ALL_CIRCUIT_IDS = Object.freeze(Object.values(CIRCUIT_IDS));
|
|
109
|
+
/**
|
|
110
|
+
* Circuits that are officially supported today: the two Coinbase circuits and
|
|
111
|
+
* OIDC domain attestation.
|
|
112
|
+
*
|
|
113
|
+
* Derived from {@link CIRCUIT_SUPPORT_STATUS}, so it cannot fall out of sync.
|
|
114
|
+
*/
|
|
115
|
+
const SUPPORTED_CIRCUIT_IDS = Object.freeze(ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'supported'));
|
|
116
|
+
/**
|
|
117
|
+
* Circuits whose identifiers are reserved but which are not officially
|
|
118
|
+
* supported yet: GIWA attestation and the three Korea Mobile ID circuits.
|
|
119
|
+
*
|
|
120
|
+
* Derived from {@link CIRCUIT_SUPPORT_STATUS}, so it cannot fall out of sync.
|
|
121
|
+
*/
|
|
122
|
+
const PLANNED_CIRCUIT_IDS = Object.freeze(ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'planned'));
|
|
123
|
+
/**
|
|
124
|
+
* Narrows an unknown value to a canonical circuit identifier.
|
|
125
|
+
*
|
|
126
|
+
* Returns `false` for hyphenated route names such as `'coinbase-kyc'`, which
|
|
127
|
+
* are not circuit IDs.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* isCircuitId('coinbase_attestation'); // true
|
|
132
|
+
* isCircuitId('coinbase-kyc'); // false
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
function isCircuitId(value) {
|
|
136
|
+
return typeof value === 'string' && ALL_CIRCUIT_IDS.includes(value);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Narrows an unknown value to a circuit identifier that is officially supported
|
|
140
|
+
* today. Planned circuits return `false`.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* isSupportedCircuitId('oidc_domain_attestation'); // true
|
|
145
|
+
* isSupportedCircuitId('mdl_kr_age'); // false — planned
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
function isSupportedCircuitId(value) {
|
|
149
|
+
return isCircuitId(value) && CIRCUIT_SUPPORT_STATUS[value] === 'supported';
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Returns the support status of a circuit.
|
|
153
|
+
*
|
|
154
|
+
* @param circuit - A canonical circuit identifier.
|
|
155
|
+
* @throws Error when the value is not a canonical circuit identifier.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* getCircuitSupportStatus('giwa_attestation'); // 'planned'
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
function getCircuitSupportStatus(circuit) {
|
|
163
|
+
if (!isCircuitId(circuit)) {
|
|
164
|
+
throw new Error(`Unknown circuit '${String(circuit)}'. Expected one of: ${ALL_CIRCUIT_IDS.join(', ')}`);
|
|
165
|
+
}
|
|
166
|
+
return CIRCUIT_SUPPORT_STATUS[circuit];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export { ALL_CIRCUIT_IDS, CIRCUIT_IDS, CIRCUIT_SUPPORT_STATUS, CIRCUIT_VK_PATHS, PLANNED_CIRCUIT_IDS, SUPPORTED_CIRCUIT_IDS, getCircuitSupportStatus, isCircuitId, isSupportedCircuitId };
|
|
170
|
+
//# sourceMappingURL=circuits.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuits.mjs","sources":["../src/circuits.ts"],"sourcesContent":["/**\n * Canonical ZKProofport circuit identifiers.\n *\n * This module is the single source of truth for circuit IDs. Every other layer\n * — the mobile app, the demo, the relay, server-side provers — reads its list\n * from here instead of keeping a private copy that silently drifts.\n *\n * It has **no imports and no dependencies**, so it can be pulled in on its own:\n *\n * ```typescript\n * import { CIRCUIT_IDS, isCircuitId } from '@zkproofport-app/sdk/circuits';\n * ```\n *\n * The same names are also re-exported from the package root\n * (`@zkproofport-app/sdk`) for callers that already import the SDK.\n *\n * ## Identifiers are canonical and case-sensitive\n *\n * Each ID is the circuit's `name` in its `Nargo.toml`, verbatim. The format is\n * lowercase with underscores. Hyphenated spellings (`coinbase-kyc`,\n * `mdl-kr-age`) are directory or UI route names in other repositories — they\n * are **not** circuit IDs, and passing one produces a nullifier mismatch or a\n * failed on-chain lookup rather than a clear error.\n */\n\n/**\n * Whether a circuit is officially supported today or still on the roadmap.\n *\n * - `supported` — generally available. Safe to build a product on.\n * - `planned` — the identifier is reserved and the circuit exists, but it is\n * not officially supported yet. Availability, inputs and public-input layout\n * may change without a major version bump.\n */\nexport type CircuitSupportStatus = 'supported' | 'planned';\n\n/**\n * Canonical circuit identifiers, keyed by a stable constant name.\n *\n * Prefer these constants over string literals so a rename is a compile error\n * rather than a runtime surprise.\n *\n * @example\n * ```typescript\n * import { CIRCUIT_IDS } from '@zkproofport-app/sdk/circuits';\n *\n * const relay = await sdk.createRelayRequest(CIRCUIT_IDS.COINBASE_ATTESTATION, {\n * scope: 'myapp.com',\n * });\n * ```\n */\nexport const CIRCUIT_IDS = Object.freeze({\n /** Coinbase KYC attestation. Officially supported. */\n COINBASE_ATTESTATION: 'coinbase_attestation',\n /** Coinbase country attestation (inclusion / exclusion). Officially supported. */\n COINBASE_COUNTRY_ATTESTATION: 'coinbase_country_attestation',\n /** OIDC email-domain attestation. Officially supported. */\n OIDC_DOMAIN_ATTESTATION: 'oidc_domain_attestation',\n /** GIWA attestation. Planned — not officially supported yet. */\n GIWA_ATTESTATION: 'giwa_attestation',\n /** Korea Mobile ID ownership. Planned — not officially supported yet. */\n MDL_KR_OWNERSHIP: 'mdl_kr_ownership',\n /** Korea Mobile ID age threshold. Planned — not officially supported yet. */\n MDL_KR_AGE: 'mdl_kr_age',\n /** Korea Mobile ID si/do region. Planned — not officially supported yet. */\n MDL_KR_REGION: 'mdl_kr_region',\n} as const);\n\n/**\n * Union of every canonical circuit identifier.\n *\n * `CircuitType` (exported from the package root) is an alias of this type — the\n * two names refer to the same union, and this module is where it is defined.\n */\nexport type CircuitId = (typeof CIRCUIT_IDS)[keyof typeof CIRCUIT_IDS];\n\n/**\n * Support status for every circuit.\n *\n * The record is exhaustive over {@link CircuitId}: adding an identifier without\n * giving it a status is a compile error, so this list cannot drift from\n * {@link CIRCUIT_IDS}.\n *\n * @example\n * ```typescript\n * import { CIRCUIT_SUPPORT_STATUS } from '@zkproofport-app/sdk/circuits';\n *\n * CIRCUIT_SUPPORT_STATUS.coinbase_attestation; // 'supported'\n * CIRCUIT_SUPPORT_STATUS.mdl_kr_age; // 'planned'\n * ```\n */\nexport const CIRCUIT_SUPPORT_STATUS: Readonly<Record<CircuitId, CircuitSupportStatus>> =\n Object.freeze({\n coinbase_attestation: 'supported',\n coinbase_country_attestation: 'supported',\n oidc_domain_attestation: 'supported',\n giwa_attestation: 'planned',\n mdl_kr_ownership: 'planned',\n mdl_kr_age: 'planned',\n mdl_kr_region: 'planned',\n } as const);\n\n/**\n * Where each circuit's verification key lives inside the `zkproofport/circuits`\n * repository, relative to its root.\n *\n * Off-chain verification needs the verification key and nothing else — no\n * circuit bytecode, no witness. The key is public by nature: it is what anyone\n * checking a proof must already have, and the Solidity verifiers deployed\n * on-chain embed the same key.\n *\n * Exhaustive over {@link CircuitId} on purpose. A new circuit whose key path is\n * not listed here fails to compile rather than failing at verification time,\n * where the only symptom would be a proof that cannot be checked.\n */\nexport const CIRCUIT_VK_PATHS: Readonly<Record<CircuitId, string>> = Object.freeze({\n coinbase_attestation: 'coinbase-attestation/target/vk',\n coinbase_country_attestation: 'coinbase-country-attestation/target/vk',\n oidc_domain_attestation: 'oidc-domain-attestation/target/vk',\n giwa_attestation: 'giwa-attestation/target/vk',\n mdl_kr_ownership: 'mdl/kr-ownership/target/vk',\n mdl_kr_age: 'mdl/kr-age/target/vk',\n mdl_kr_region: 'mdl/kr-region/target/vk',\n} as const);\n\n/**\n * Every canonical circuit identifier, in declaration order.\n *\n * Includes circuits that are still `planned`. Use {@link SUPPORTED_CIRCUIT_IDS}\n * when you only want the ones that are officially supported today.\n */\nexport const ALL_CIRCUIT_IDS: readonly CircuitId[] = Object.freeze(\n Object.values(CIRCUIT_IDS) as CircuitId[]\n);\n\n/**\n * Circuits that are officially supported today: the two Coinbase circuits and\n * OIDC domain attestation.\n *\n * Derived from {@link CIRCUIT_SUPPORT_STATUS}, so it cannot fall out of sync.\n */\nexport const SUPPORTED_CIRCUIT_IDS: readonly CircuitId[] = Object.freeze(\n ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'supported')\n);\n\n/**\n * Circuits whose identifiers are reserved but which are not officially\n * supported yet: GIWA attestation and the three Korea Mobile ID circuits.\n *\n * Derived from {@link CIRCUIT_SUPPORT_STATUS}, so it cannot fall out of sync.\n */\nexport const PLANNED_CIRCUIT_IDS: readonly CircuitId[] = Object.freeze(\n ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'planned')\n);\n\n/**\n * Narrows an unknown value to a canonical circuit identifier.\n *\n * Returns `false` for hyphenated route names such as `'coinbase-kyc'`, which\n * are not circuit IDs.\n *\n * @example\n * ```typescript\n * isCircuitId('coinbase_attestation'); // true\n * isCircuitId('coinbase-kyc'); // false\n * ```\n */\nexport function isCircuitId(value: unknown): value is CircuitId {\n return typeof value === 'string' && (ALL_CIRCUIT_IDS as readonly string[]).includes(value);\n}\n\n/**\n * Narrows an unknown value to a circuit identifier that is officially supported\n * today. Planned circuits return `false`.\n *\n * @example\n * ```typescript\n * isSupportedCircuitId('oidc_domain_attestation'); // true\n * isSupportedCircuitId('mdl_kr_age'); // false — planned\n * ```\n */\nexport function isSupportedCircuitId(value: unknown): value is CircuitId {\n return isCircuitId(value) && CIRCUIT_SUPPORT_STATUS[value] === 'supported';\n}\n\n/**\n * Returns the support status of a circuit.\n *\n * @param circuit - A canonical circuit identifier.\n * @throws Error when the value is not a canonical circuit identifier.\n *\n * @example\n * ```typescript\n * getCircuitSupportStatus('giwa_attestation'); // 'planned'\n * ```\n */\nexport function getCircuitSupportStatus(circuit: CircuitId): CircuitSupportStatus {\n if (!isCircuitId(circuit)) {\n throw new Error(\n `Unknown circuit '${String(circuit)}'. Expected one of: ${ALL_CIRCUIT_IDS.join(', ')}`\n );\n }\n return CIRCUIT_SUPPORT_STATUS[circuit];\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AAYH;;;;;;;;;;;;;;AAcG;AACI,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;;AAEvC,IAAA,oBAAoB,EAAE,sBAAsB;;AAE5C,IAAA,4BAA4B,EAAE,8BAA8B;;AAE5D,IAAA,uBAAuB,EAAE,yBAAyB;;AAElD,IAAA,gBAAgB,EAAE,kBAAkB;;AAEpC,IAAA,gBAAgB,EAAE,kBAAkB;;AAEpC,IAAA,UAAU,EAAE,YAAY;;AAExB,IAAA,aAAa,EAAE,eAAe;AACtB,CAAA;AAUV;;;;;;;;;;;;;;AAcG;AACI,MAAM,sBAAsB,GACjC,MAAM,CAAC,MAAM,CAAC;AACZ,IAAA,oBAAoB,EAAE,WAAW;AACjC,IAAA,4BAA4B,EAAE,WAAW;AACzC,IAAA,uBAAuB,EAAE,WAAW;AACpC,IAAA,gBAAgB,EAAE,SAAS;AAC3B,IAAA,gBAAgB,EAAE,SAAS;AAC3B,IAAA,UAAU,EAAE,SAAS;AACrB,IAAA,aAAa,EAAE,SAAS;AAChB,CAAA;AAEZ;;;;;;;;;;;;AAYG;AACI,MAAM,gBAAgB,GAAwC,MAAM,CAAC,MAAM,CAAC;AACjF,IAAA,oBAAoB,EAAE,gCAAgC;AACtD,IAAA,4BAA4B,EAAE,wCAAwC;AACtE,IAAA,uBAAuB,EAAE,mCAAmC;AAC5D,IAAA,gBAAgB,EAAE,4BAA4B;AAC9C,IAAA,gBAAgB,EAAE,4BAA4B;AAC9C,IAAA,UAAU,EAAE,sBAAsB;AAClC,IAAA,aAAa,EAAE,yBAAyB;AAChC,CAAA;AAEV;;;;;AAKG;AACI,MAAM,eAAe,GAAyB,MAAM,CAAC,MAAM,CAChE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAgB;AAG3C;;;;;AAKG;AACI,MAAM,qBAAqB,GAAyB,MAAM,CAAC,MAAM,CACtE,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,sBAAsB,CAAC,EAAE,CAAC,KAAK,WAAW,CAAC;AAG5E;;;;;AAKG;AACI,MAAM,mBAAmB,GAAyB,MAAM,CAAC,MAAM,CACpE,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,sBAAsB,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;AAG1E;;;;;;;;;;;AAWG;AACG,SAAU,WAAW,CAAC,KAAc,EAAA;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,eAAqC,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC5F;AAEA;;;;;;;;;AASG;AACG,SAAU,oBAAoB,CAAC,KAAc,EAAA;IACjD,OAAO,WAAW,CAAC,KAAK,CAAC,IAAI,sBAAsB,CAAC,KAAK,CAAC,KAAK,WAAW;AAC5E;AAEA;;;;;;;;;;AAUG;AACG,SAAU,uBAAuB,CAAC,OAAkB,EAAA;AACxD,IAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;AACzB,QAAA,MAAM,IAAI,KAAK,CACb,CAAA,iBAAA,EAAoB,MAAM,CAAC,OAAO,CAAC,CAAA,oBAAA,EAAuB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CACvF;IACH;AACA,IAAA,OAAO,sBAAsB,CAAC,OAAO,CAAC;AACxC;;;;"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ export declare const DEEP_LINK_HOSTS: {
|
|
|
49
49
|
* ```typescript
|
|
50
50
|
* const metadata = CIRCUIT_METADATA['coinbase_attestation'];
|
|
51
51
|
* console.log(metadata.name); // "Coinbase KYC"
|
|
52
|
-
* console.log(metadata.publicInputsCount); //
|
|
52
|
+
* console.log(metadata.publicInputsCount); // 128
|
|
53
53
|
* ```
|
|
54
54
|
*/
|
|
55
55
|
export declare const CIRCUIT_METADATA: Record<CircuitType, {
|
|
@@ -80,6 +80,13 @@ export declare const VERIFIER_ABI: string[];
|
|
|
80
80
|
* Supported networks:
|
|
81
81
|
* - 84532: Base Sepolia (testnet)
|
|
82
82
|
* - 8453: Base Mainnet (production)
|
|
83
|
+
* - 91342: GIWA Sepolia (testnet) — where the GIWA account circuit verifies
|
|
84
|
+
*
|
|
85
|
+
* A chain missing from this map is not a quiet degradation: `getDefaultProvider`
|
|
86
|
+
* throws "No RPC endpoint configured for chain N". That is what a caller saw
|
|
87
|
+
* when verifying a GIWA proof on chain 91342 — the verifier contract had been
|
|
88
|
+
* deployed and the proof was valid, but the SDK had no way to reach the chain
|
|
89
|
+
* to ask. Deploying a verifier to a new network means adding it here too.
|
|
83
90
|
*
|
|
84
91
|
* @example
|
|
85
92
|
* ```typescript
|
package/dist/index.d.ts
CHANGED
|
@@ -27,5 +27,9 @@
|
|
|
27
27
|
*/
|
|
28
28
|
export { ProofportSDK, default } from './ProofportSDK';
|
|
29
29
|
export { extractScopeFromPublicInputs, extractNullifierFromPublicInputs, extractDomainFromPublicInputs, } from './verifier';
|
|
30
|
+
export { CIRCUIT_IDS, CIRCUIT_SUPPORT_STATUS, ALL_CIRCUIT_IDS, SUPPORTED_CIRCUIT_IDS, PLANNED_CIRCUIT_IDS, isCircuitId, isSupportedCircuitId, getCircuitSupportStatus, CIRCUIT_VK_PATHS, } from './circuits';
|
|
31
|
+
export { verifyProofOffChain } from './offChainVerifier';
|
|
32
|
+
export type { OffChainVerifyResult, OffChainVerifyOptions, } from './offChainVerifier';
|
|
30
33
|
export { COINBASE_ATTESTATION_PUBLIC_INPUT_LAYOUT, COINBASE_COUNTRY_PUBLIC_INPUT_LAYOUT, OIDC_DOMAIN_ATTESTATION_PUBLIC_INPUT_LAYOUT, MDL_KR_PUBLIC_INPUT_LAYOUT, } from './constants';
|
|
34
|
+
export type { CircuitId, CircuitSupportStatus } from './circuits';
|
|
31
35
|
export type { CircuitType, ProofRequestStatus, CoinbaseKycInputs, CoinbaseCountryInputs, OidcDomainInputs, MdlKrOwnershipInputs, MdlKrAgeInputs, MdlKrRegionInputs, CircuitInputs, ProofRequest, ProofResponse, QRCodeOptions, VerifierContract, ProofportConfig, ChallengeResponse, WalletSigner, RelayProofRequest, RelayProofResult, SDKEnvironment, } from './types';
|