@zkproofport-app/sdk 0.4.3 → 0.5.0-beta.1
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/circuits.d.ts +1 -236
- package/dist/circuits.esm.js +1 -250
- package/dist/circuits.esm.js.map +1 -1
- package/dist/circuits.js +9 -261
- package/dist/circuits.js.map +1 -1
- package/dist/circuits.mjs +1 -250
- package/dist/circuits.mjs.map +1 -1
- package/dist/constants.d.ts +1 -166
- package/dist/index.esm.js +39 -913
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +137 -951
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -913
- package/dist/index.mjs.map +1 -1
- package/dist/offChainVerifier.d.ts +17 -16
- package/dist/typedAction.d.ts +1 -34
- package/dist/typedAction.esm.js +1 -76
- package/dist/typedAction.esm.js.map +1 -1
- package/dist/typedAction.js +9 -76
- package/dist/typedAction.js.map +1 -1
- package/dist/typedAction.mjs +1 -76
- package/dist/typedAction.mjs.map +1 -1
- package/dist/types.d.ts +2 -83
- package/dist/verifier.d.ts +1 -186
- package/package.json +8 -4
package/dist/constants.d.ts
CHANGED
|
@@ -58,44 +58,6 @@ export declare const CIRCUIT_METADATA: Record<CircuitType, {
|
|
|
58
58
|
publicInputsCount: number;
|
|
59
59
|
publicInputNames: string[];
|
|
60
60
|
}>;
|
|
61
|
-
/**
|
|
62
|
-
* Standard verifier contract ABI shared across all Barretenberg-generated verifiers.
|
|
63
|
-
* This ABI defines the interface for calling the verify function on deployed verifier contracts.
|
|
64
|
-
*
|
|
65
|
-
* Uses ethers v6 human-readable ABI format.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* import { Contract } from 'ethers';
|
|
70
|
-
*
|
|
71
|
-
* const verifier = new Contract(verifierAddress, VERIFIER_ABI, provider);
|
|
72
|
-
* const isValid = await verifier.verify(proofBytes, publicInputs);
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export declare const VERIFIER_ABI: string[];
|
|
76
|
-
/**
|
|
77
|
-
* Public RPC endpoint URLs for supported blockchain networks.
|
|
78
|
-
* Used as fallback when no custom provider is supplied.
|
|
79
|
-
*
|
|
80
|
-
* Supported networks:
|
|
81
|
-
* - 84532: Base Sepolia (testnet)
|
|
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.
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* ```typescript
|
|
93
|
-
* import { JsonRpcProvider } from 'ethers';
|
|
94
|
-
*
|
|
95
|
-
* const provider = new JsonRpcProvider(RPC_ENDPOINTS[84532]);
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
export declare const RPC_ENDPOINTS: Record<number, string>;
|
|
99
61
|
/**
|
|
100
62
|
* Default proof request expiration time in milliseconds.
|
|
101
63
|
* Requests older than this are considered expired and should not be processed.
|
|
@@ -127,131 +89,4 @@ export declare const DEFAULT_REQUEST_EXPIRY_MS: number;
|
|
|
127
89
|
* ```
|
|
128
90
|
*/
|
|
129
91
|
export declare const MAX_QR_DATA_SIZE = 2953;
|
|
130
|
-
|
|
131
|
-
* Coinbase Attestation circuit public input layout (byte offsets).
|
|
132
|
-
* Defines the byte positions of each field in the flattened public inputs array.
|
|
133
|
-
*
|
|
134
|
-
* Public inputs are packed as bytes32 values:
|
|
135
|
-
* - signal_hash: bytes 0-31
|
|
136
|
-
* - merkle_root: bytes 32-63
|
|
137
|
-
* - scope: bytes 64-95
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* const publicInputs = response.publicInputs;
|
|
142
|
-
* const signalHash = publicInputs.slice(
|
|
143
|
-
* COINBASE_ATTESTATION_PUBLIC_INPUT_LAYOUT.SIGNAL_HASH_START,
|
|
144
|
-
* COINBASE_ATTESTATION_PUBLIC_INPUT_LAYOUT.SIGNAL_HASH_END + 1
|
|
145
|
-
* );
|
|
146
|
-
* ```
|
|
147
|
-
*/
|
|
148
|
-
export declare const COINBASE_ATTESTATION_PUBLIC_INPUT_LAYOUT: {
|
|
149
|
-
readonly SIGNAL_HASH_START: 0;
|
|
150
|
-
readonly SIGNAL_HASH_END: 31;
|
|
151
|
-
readonly MERKLE_ROOT_START: 32;
|
|
152
|
-
readonly MERKLE_ROOT_END: 63;
|
|
153
|
-
readonly SCOPE_START: 64;
|
|
154
|
-
readonly SCOPE_END: 95;
|
|
155
|
-
readonly NULLIFIER_START: 96;
|
|
156
|
-
readonly NULLIFIER_END: 127;
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Coinbase Country Attestation circuit public input layout (byte offsets).
|
|
160
|
-
* Defines the byte positions of each field in the flattened public inputs array.
|
|
161
|
-
*
|
|
162
|
-
* Public inputs are packed as bytes32 values:
|
|
163
|
-
* - signal_hash: bytes 0-31
|
|
164
|
-
* - merkle_root: bytes 32-63
|
|
165
|
-
* - country_list: bytes 64-83 (20 bytes for 10 countries)
|
|
166
|
-
* - country_list_length: byte 84
|
|
167
|
-
* - is_included: byte 85
|
|
168
|
-
* - scope: bytes 86-117
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* ```typescript
|
|
172
|
-
* const publicInputs = response.publicInputs;
|
|
173
|
-
* const countryList = publicInputs.slice(
|
|
174
|
-
* COINBASE_COUNTRY_PUBLIC_INPUT_LAYOUT.COUNTRY_LIST_START,
|
|
175
|
-
* COINBASE_COUNTRY_PUBLIC_INPUT_LAYOUT.COUNTRY_LIST_END + 1
|
|
176
|
-
* );
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
export declare const COINBASE_COUNTRY_PUBLIC_INPUT_LAYOUT: {
|
|
180
|
-
readonly SIGNAL_HASH_START: 0;
|
|
181
|
-
readonly SIGNAL_HASH_END: 31;
|
|
182
|
-
readonly MERKLE_ROOT_START: 32;
|
|
183
|
-
readonly MERKLE_ROOT_END: 63;
|
|
184
|
-
readonly COUNTRY_LIST_START: 64;
|
|
185
|
-
readonly COUNTRY_LIST_END: 83;
|
|
186
|
-
readonly COUNTRY_LIST_LENGTH: 84;
|
|
187
|
-
readonly IS_INCLUDED: 85;
|
|
188
|
-
readonly SCOPE_START: 86;
|
|
189
|
-
readonly SCOPE_END: 117;
|
|
190
|
-
readonly NULLIFIER_START: 118;
|
|
191
|
-
readonly NULLIFIER_END: 149;
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Korea Mobile ID (mDL) circuit public input layout (field offsets).
|
|
195
|
-
* All three mDL circuits share the same prefix: scope [0..31] and
|
|
196
|
-
* nullifier_value [32..63], each stored one byte per field element.
|
|
197
|
-
* The suffix differs per predicate circuit:
|
|
198
|
-
* - mdl_kr_ownership (97 inputs): disclose_flags [64], owner_commit [65..96]
|
|
199
|
-
* - mdl_kr_age (66 inputs): age_threshold [64], current_year [65]
|
|
200
|
-
* - mdl_kr_region (96 inputs): region_code [64..95]
|
|
201
|
-
*
|
|
202
|
-
* @example
|
|
203
|
-
* ```typescript
|
|
204
|
-
* const nullifier = publicInputs.slice(
|
|
205
|
-
* MDL_KR_PUBLIC_INPUT_LAYOUT.NULLIFIER_START,
|
|
206
|
-
* MDL_KR_PUBLIC_INPUT_LAYOUT.NULLIFIER_END + 1
|
|
207
|
-
* );
|
|
208
|
-
* ```
|
|
209
|
-
*/
|
|
210
|
-
export declare const MDL_KR_PUBLIC_INPUT_LAYOUT: {
|
|
211
|
-
readonly SCOPE_START: 0;
|
|
212
|
-
readonly SCOPE_END: 31;
|
|
213
|
-
readonly NULLIFIER_START: 32;
|
|
214
|
-
readonly NULLIFIER_END: 63;
|
|
215
|
-
readonly OWNERSHIP_DISCLOSE_FLAGS: 64;
|
|
216
|
-
readonly OWNERSHIP_OWNER_COMMIT_START: 65;
|
|
217
|
-
readonly OWNERSHIP_OWNER_COMMIT_END: 96;
|
|
218
|
-
readonly AGE_THRESHOLD: 64;
|
|
219
|
-
readonly AGE_CURRENT_YEAR: 65;
|
|
220
|
-
readonly REGION_CODE_START: 64;
|
|
221
|
-
readonly REGION_CODE_END: 95;
|
|
222
|
-
};
|
|
223
|
-
/**
|
|
224
|
-
* OIDC Domain Attestation circuit public input layout (field offsets).
|
|
225
|
-
* Defines the field positions in the flattened public inputs array (148 fields total).
|
|
226
|
-
*
|
|
227
|
-
* Circuit public inputs (from main.nr):
|
|
228
|
-
* - pubkey_modulus_limbs: pub [u128; 18] → 18 fields (0–17)
|
|
229
|
-
* - domain: pub BoundedVec<u8, 64> → 1 len + 64 storage = 65 fields (18–82)
|
|
230
|
-
* - scope: pub [u8; 32] → 32 fields (83–114)
|
|
231
|
-
* - nullifier: pub [u8; 32] → 32 fields (115–146)
|
|
232
|
-
* - provider: pub u8 → 1 field (147)
|
|
233
|
-
*
|
|
234
|
-
* @example
|
|
235
|
-
* ```typescript
|
|
236
|
-
* const scope = publicInputs.slice(
|
|
237
|
-
* OIDC_DOMAIN_ATTESTATION_PUBLIC_INPUT_LAYOUT.SCOPE_START,
|
|
238
|
-
* OIDC_DOMAIN_ATTESTATION_PUBLIC_INPUT_LAYOUT.SCOPE_END + 1
|
|
239
|
-
* );
|
|
240
|
-
* ```
|
|
241
|
-
*/
|
|
242
|
-
export declare const OIDC_DOMAIN_ATTESTATION_PUBLIC_INPUT_LAYOUT: {
|
|
243
|
-
readonly PUBKEY_MODULUS_START: 0;
|
|
244
|
-
readonly PUBKEY_MODULUS_END: 17;
|
|
245
|
-
readonly DOMAIN_STORAGE_START: 18;
|
|
246
|
-
readonly DOMAIN_STORAGE_END: 81;
|
|
247
|
-
readonly DOMAIN_LEN: 82;
|
|
248
|
-
readonly SCOPE_START: 83;
|
|
249
|
-
readonly SCOPE_END: 114;
|
|
250
|
-
readonly NULLIFIER_START: 115;
|
|
251
|
-
readonly NULLIFIER_END: 146;
|
|
252
|
-
readonly PROVIDER: 147;
|
|
253
|
-
/** @deprecated Use DOMAIN_STORAGE_START */
|
|
254
|
-
readonly DOMAIN_START: 18;
|
|
255
|
-
/** @deprecated Use DOMAIN_LEN */
|
|
256
|
-
readonly DOMAIN_END: 82;
|
|
257
|
-
};
|
|
92
|
+
export { VERIFIER_ABI, RPC_ENDPOINTS, COINBASE_ATTESTATION_PUBLIC_INPUT_LAYOUT, COINBASE_COUNTRY_PUBLIC_INPUT_LAYOUT, MDL_KR_PUBLIC_INPUT_LAYOUT, OIDC_DOMAIN_ATTESTATION_PUBLIC_INPUT_LAYOUT, } from '@zkproofport-app/core';
|