@zkproofport-ai/sdk 0.4.0 → 0.5.0
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 +26 -13
- package/dist/action.js +1 -1
- package/dist/action.js.map +1 -1
- package/dist/circuits.d.ts +25 -102
- package/dist/circuits.d.ts.map +1 -1
- package/dist/circuits.js +18 -110
- package/dist/circuits.js.map +1 -1
- package/dist/extract.d.ts +12 -5
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +12 -5
- package/dist/extract.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/oidc-inputs.d.ts +53 -6
- package/dist/oidc-inputs.d.ts.map +1 -1
- package/dist/oidc-inputs.js +126 -29
- package/dist/oidc-inputs.js.map +1 -1
- package/dist/types.d.ts +10 -20
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/verify.d.ts +30 -6
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +63 -16
- package/dist/verify.js.map +1 -1
- package/package.json +2 -1
- package/dist/typedAction.d.ts +0 -3
- package/dist/typedAction.d.ts.map +0 -1
- package/dist/typedAction.js +0 -50
- package/dist/typedAction.js.map +0 -1
package/README.md
CHANGED
|
@@ -121,11 +121,9 @@ console.log('Valid:', verification.valid);
|
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
|
|
124
|
-
## Binding a proof to one action
|
|
124
|
+
## Binding a proof to one action
|
|
125
125
|
|
|
126
|
-
>
|
|
127
|
-
>
|
|
128
|
-
> One circuit can bind an action, on a testnet and not generally available:
|
|
126
|
+
> One circuit can bind an action, on GIWA Sepolia:
|
|
129
127
|
>
|
|
130
128
|
> | Circuit | Chain | Verifier |
|
|
131
129
|
> |---|---|---|
|
|
@@ -386,7 +384,7 @@ if (result.attestation) {
|
|
|
386
384
|
| `proofWithInputs` | string | Combined proof + public inputs |
|
|
387
385
|
| `attestation` | object | TEE attestation (document, proof_hash, verification) or null |
|
|
388
386
|
| `timing` | object | Execution times per step |
|
|
389
|
-
| `verification` | object |
|
|
387
|
+
| `verification` | object | The on-chain verifier the server used; `verifyProof` checks it against the pinned one |
|
|
390
388
|
|
|
391
389
|
## On-Chain Verification
|
|
392
390
|
|
|
@@ -404,6 +402,15 @@ if (verification.valid) {
|
|
|
404
402
|
}
|
|
405
403
|
```
|
|
406
404
|
|
|
405
|
+
`verifyProof` does not take the server's word for where to verify. It calls
|
|
406
|
+
ZKProofport's own pinned verifier contract for the proof's circuit and chain,
|
|
407
|
+
refuses a result that names a different contract, and reads the chain through
|
|
408
|
+
its own public RPC rather than one the result names. Before the contract call
|
|
409
|
+
it also checks the proof's issuer: for Google/Microsoft proofs, that the signing
|
|
410
|
+
key is one the provider currently publishes; for Coinbase and GIWA proofs, that
|
|
411
|
+
the signer list is the official one. Any failed check returns
|
|
412
|
+
`{ valid: false, error }`.
|
|
413
|
+
|
|
407
414
|
## Step-by-Step API
|
|
408
415
|
|
|
409
416
|
For GIWA actions, obtain human approval before preparing inputs. `prepareInputs` needs the camelCase hashes to recover A's public key from the approved EIP-712 digest; it does not add those hashes to its returned object. Attach the snake_case fields for submission. `signal_hash` is still computed internally for nullifier derivation and is not the action signing message. Low-level witness APIs accept signatures but cannot establish who operated the signing wallet.
|
|
@@ -508,7 +515,7 @@ const result = await generateProof(
|
|
|
508
515
|
{},
|
|
509
516
|
{
|
|
510
517
|
circuit: 'oidc_domain',
|
|
511
|
-
jwt: googleIdToken, //
|
|
518
|
+
jwt: googleIdToken, // id_token from the ZKProofport device sign-in (Google Workspace)
|
|
512
519
|
scope: 'myapp:verify-domain',
|
|
513
520
|
},
|
|
514
521
|
);
|
|
@@ -526,7 +533,7 @@ const result = await generateProof(
|
|
|
526
533
|
{},
|
|
527
534
|
{
|
|
528
535
|
circuit: 'oidc_domain',
|
|
529
|
-
jwt: microsoftIdToken, //
|
|
536
|
+
jwt: microsoftIdToken, // id_token from the ZKProofport device sign-in (Microsoft 365)
|
|
530
537
|
provider: 'microsoft',
|
|
531
538
|
scope: 'myapp:verify-domain',
|
|
532
539
|
},
|
|
@@ -555,8 +562,8 @@ const result = await generateProof(
|
|
|
555
562
|
);
|
|
556
563
|
|
|
557
564
|
// Extract domain and nullifier from proof
|
|
558
|
-
const domain = extractDomainFromPublicInputs(result.publicInputs);
|
|
559
|
-
const nullifier = extractNullifierFromPublicInputs(result.publicInputs);
|
|
565
|
+
const domain = extractDomainFromPublicInputs(result.publicInputs, 'oidc_domain_attestation');
|
|
566
|
+
const nullifier = extractNullifierFromPublicInputs(result.publicInputs, 'oidc_domain_attestation');
|
|
560
567
|
|
|
561
568
|
console.log('Verified domain:', domain);
|
|
562
569
|
console.log('Nullifier:', nullifier);
|
|
@@ -564,7 +571,7 @@ console.log('Nullifier:', nullifier);
|
|
|
564
571
|
|
|
565
572
|
**Public Input Layout (oidc_domain_attestation):**
|
|
566
573
|
|
|
567
|
-
The proof contains
|
|
574
|
+
The proof contains 214 public input fields (32 bytes each):
|
|
568
575
|
|
|
569
576
|
| Fields | Description |
|
|
570
577
|
|--------|-------------|
|
|
@@ -573,12 +580,18 @@ The proof contains 148 public input fields (32 bytes each):
|
|
|
573
580
|
| 82 | Domain length |
|
|
574
581
|
| 83-114 | Scope (32 bytes) |
|
|
575
582
|
| 115-146 | Nullifier (32 bytes) |
|
|
576
|
-
| 147 | Provider identifier (u8) |
|
|
583
|
+
| 147 | Provider identifier (u8): 0 Google, 1 Microsoft |
|
|
584
|
+
| 148-179 | keccak256 of the id_token's `aud` (32 bytes) |
|
|
585
|
+
| 180 | Nonce mode (u8): always 0 here — device sign-in carries no nonce |
|
|
586
|
+
| 181-212 | Nonce binding (32 bytes): all zero in nonce mode 0 |
|
|
587
|
+
| 213 | `now`: unix seconds the proof was made at; the circuit proves the token was valid then |
|
|
588
|
+
|
|
589
|
+
Only id_tokens from the ZKProofport device sign-in (`zkproofport-prove --login-google-workspace` or `--login-microsoft-365`) are accepted: a token issued to any other client, or an expired one, is refused before anything is paid. Verify a proof soon after it is made — verifiers accept `now` up to 15 minutes old.
|
|
577
590
|
|
|
578
591
|
**Functions:**
|
|
579
592
|
|
|
580
|
-
- `extractDomainFromPublicInputs(publicInputs: string): string | null` — Extracts the email domain (e.g., "google.com") from public inputs. Returns null if extraction fails.
|
|
581
|
-
- `extractNullifierFromPublicInputs(publicInputs: string): string | null` — Extracts the 32-byte nullifier as a 0x-prefixed hex string. Returns null if extraction fails.
|
|
593
|
+
- `extractDomainFromPublicInputs(publicInputs: string, circuit: CircuitId): string | null` — Extracts the email domain (e.g., "google.com") from public inputs. Returns null if extraction fails.
|
|
594
|
+
- `extractNullifierFromPublicInputs(publicInputs: string, circuit: CircuitId): string | null` — Extracts the 32-byte nullifier as a 0x-prefixed hex string. Returns null if extraction fails.
|
|
582
595
|
|
|
583
596
|
## Types Reference
|
|
584
597
|
|
package/dist/action.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
|
-
import { validateTypedAction } from '
|
|
2
|
+
import { validateTypedAction } from '@zkproofport-app/core/typedAction';
|
|
3
3
|
/**
|
|
4
4
|
* Validate and hash a caller-owned EIP-712 action before asking a wallet to sign.
|
|
5
5
|
* `types` must omit EIP712Domain and have one root matching `primaryType`.
|
package/dist/action.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../src/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE;;;;GAIG;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e,CAAC,CAAC;gBACpF,aAAa,CAAC,KAAK,CAAC,IAAI,EAAG,KAAiC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;aAAM,IAAI,IAAI,KAAK,MAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,qBAAqB,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IACD,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAEpE,OAAO;QACL,eAAe,EAAE,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC;QAClE,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;KACzC,CAAC;AACJ,CAAC"}
|
package/dist/circuits.d.ts
CHANGED
|
@@ -1,117 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical ZKProofport circuit identifiers, for `@zkproofport-ai/sdk`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* the
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* There are two reasons, and only the first is temporary:
|
|
18
|
-
*
|
|
19
|
-
1. ~~The published customer SDK does not ship the module.~~ **No longer true**
|
|
20
|
-
* as of 0.2.16, whose `exports` map carries `./circuits` and whose tarball
|
|
21
|
-
* has `dist/circuits.{js,esm.js,mjs,d.ts}` — verified with `npm pack`
|
|
22
|
-
* 2026-09-11. Reason 2 is now the only one holding this mirror up.
|
|
23
|
-
* 2. This package is published to npm, and `@zkproofport-app/sdk` carries
|
|
24
|
-
* `qrcode` and `socket.io-client` (38 transitive packages, measured). The
|
|
25
|
-
* `./circuits` subpath is dependency-free at *import* time, but npm still
|
|
26
|
-
* installs the whole dependency tree. Paying that on every
|
|
27
|
-
* `npx zkproofport-mcp` for seven strings is a poor trade, so even after the
|
|
28
|
-
* SDK publishes the subpath this mirror may be worth keeping.
|
|
29
|
-
*
|
|
30
|
-
* The root server tree keeps its own mirror at `src/config/circuitIds.ts` — the
|
|
31
|
-
* two trees are compiled and shipped separately (`rootDir: src` in each,
|
|
32
|
-
* different npm packages / Docker images), so neither can import the other.
|
|
33
|
-
*
|
|
34
|
-
* ## What stops the mirrors drifting
|
|
35
|
-
*
|
|
36
|
-
* `tests/circuitIds.test.ts` at the repo root reads the real customer SDK — the
|
|
37
|
-
* installed package if present, otherwise the sibling checkout at
|
|
38
|
-
* `../proofport-app-sdk` — and fails when either mirror disagrees with it, or
|
|
39
|
-
* with the other. It fails, rather than skips, when it can find neither.
|
|
40
|
-
*
|
|
41
|
-
* ## Identifiers are canonical and case-sensitive
|
|
42
|
-
*
|
|
43
|
-
* Each id is the circuit's `name` in its `Nargo.toml`, verbatim: lowercase with
|
|
44
|
-
* underscores. Hyphenated spellings (`coinbase-kyc`) are directory or UI route
|
|
45
|
-
* names elsewhere and are not circuit ids; passing one produces a nullifier
|
|
46
|
-
* mismatch or a failed on-chain lookup rather than a clear error.
|
|
4
|
+
* `@zkproofport-app/core/circuits` is the single source of truth for circuit
|
|
5
|
+
* identifiers across every layer: the mobile app, the relay, the demo, the
|
|
6
|
+
* proofport-ai server and this package. Everything canonical here is
|
|
7
|
+
* re-exported from it.
|
|
8
|
+
*
|
|
9
|
+
* Until core existed this file was a hand-kept mirror, because the only
|
|
10
|
+
* published home of the list was `@zkproofport-app/sdk`, whose dependency tree
|
|
11
|
+
* is a poor trade on every `npx zkproofport-mcp`. Core's `./circuits` subpath
|
|
12
|
+
* has no dependencies, so the mirror and the test that compared it are gone.
|
|
13
|
+
*
|
|
14
|
+
* What stays is this package's own subset -- the circuits the proofport-ai
|
|
15
|
+
* server can prove -- which core has no opinion on.
|
|
47
16
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* - `supported` — generally available.
|
|
52
|
-
* - `planned` — the identifier is reserved, but availability, inputs and
|
|
53
|
-
* public-input layout may still change.
|
|
54
|
-
*/
|
|
55
|
-
export type CircuitSupportStatus = 'supported' | 'experimental' | 'planned';
|
|
56
|
-
/**
|
|
57
|
-
* Every canonical circuit identifier ZKProofport has assigned, keyed by a stable
|
|
58
|
-
* constant name. Mirrors `CIRCUIT_IDS` in `@zkproofport-app/sdk/circuits`.
|
|
59
|
-
*
|
|
60
|
-
* This is the full ZKProofport catalogue, which is wider than what the
|
|
61
|
-
* proofport-ai server can prove — see {@link PROVABLE_CIRCUIT_IDS} for that.
|
|
62
|
-
*/
|
|
63
|
-
export declare const CIRCUIT_IDS: Readonly<{
|
|
64
|
-
/** Coinbase KYC attestation. Officially supported. */
|
|
65
|
-
readonly COINBASE_ATTESTATION: "coinbase_attestation";
|
|
66
|
-
/** Coinbase country attestation (inclusion / exclusion). Officially supported. */
|
|
67
|
-
readonly COINBASE_COUNTRY_ATTESTATION: "coinbase_country_attestation";
|
|
68
|
-
/** OIDC email-domain attestation. Officially supported. */
|
|
69
|
-
readonly OIDC_DOMAIN_ATTESTATION: "oidc_domain_attestation";
|
|
70
|
-
/** GIWA attestation. Planned — not officially supported yet. */
|
|
71
|
-
readonly GIWA_ATTESTATION: "giwa_attestation";
|
|
72
|
-
/** Korea Mobile ID ownership. Planned — not officially supported yet. */
|
|
73
|
-
readonly MDL_KR_OWNERSHIP: "mdl_kr_ownership";
|
|
74
|
-
/** Korea Mobile ID age threshold. Planned — not officially supported yet. */
|
|
75
|
-
readonly MDL_KR_AGE: "mdl_kr_age";
|
|
76
|
-
/** Korea Mobile ID si/do region. Planned — not officially supported yet. */
|
|
77
|
-
readonly MDL_KR_REGION: "mdl_kr_region";
|
|
78
|
-
}>;
|
|
17
|
+
import { type CircuitId as CoreCircuitId } from '@zkproofport-app/core/circuits';
|
|
18
|
+
export { CIRCUIT_IDS, CIRCUIT_SUPPORT_STATUS, ALL_CIRCUIT_IDS, SUPPORTED_CIRCUIT_IDS, EXPERIMENTAL_CIRCUIT_IDS, PLANNED_CIRCUIT_IDS, getCircuitSupportStatus, isCircuitId as isCanonicalCircuitId, } from '@zkproofport-app/core/circuits';
|
|
19
|
+
export type { CircuitSupportStatus } from '@zkproofport-app/core/circuits';
|
|
79
20
|
/**
|
|
80
21
|
* Union of every canonical circuit identifier.
|
|
81
22
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*/
|
|
88
|
-
export type CanonicalCircuitId = (typeof CIRCUIT_IDS)[keyof typeof CIRCUIT_IDS];
|
|
89
|
-
/**
|
|
90
|
-
* Support status for every canonical circuit. Exhaustive over
|
|
91
|
-
* {@link CanonicalCircuitId}, so an identifier without a status is a compile
|
|
92
|
-
* error.
|
|
93
|
-
*/
|
|
94
|
-
export declare const CIRCUIT_SUPPORT_STATUS: Readonly<Record<CanonicalCircuitId, CircuitSupportStatus>>;
|
|
95
|
-
/** Every canonical circuit identifier, in declaration order. */
|
|
96
|
-
export declare const ALL_CIRCUIT_IDS: readonly CanonicalCircuitId[];
|
|
97
|
-
/** Circuits ZKProofport officially supports today. Derived, so it cannot desync. */
|
|
98
|
-
export declare const SUPPORTED_CIRCUIT_IDS: readonly CanonicalCircuitId[];
|
|
99
|
-
/** Circuits whose identifiers are reserved but not officially supported yet. */
|
|
100
|
-
export declare const PLANNED_CIRCUIT_IDS: readonly CanonicalCircuitId[];
|
|
101
|
-
/**
|
|
102
|
-
* Narrows an unknown value to a canonical circuit identifier. Returns `false`
|
|
103
|
-
* for hyphenated route names such as `'coinbase-kyc'`.
|
|
23
|
+
* Core calls this type `CircuitId`. It is named `CanonicalCircuitId` here
|
|
24
|
+
* because {@link CircuitId} is already this package's public name for the
|
|
25
|
+
* narrower set proofport-ai can prove; widening it would be a silent breaking
|
|
26
|
+
* change for anyone writing `Record<CircuitId, ...>`, and would let
|
|
27
|
+
* `circuit: 'mdl_kr_age'` typecheck against an endpoint that cannot serve it.
|
|
104
28
|
*/
|
|
105
|
-
export
|
|
106
|
-
/** Returns the support status of a canonical circuit. */
|
|
107
|
-
export declare function getCircuitSupportStatus(circuit: CanonicalCircuitId): CircuitSupportStatus;
|
|
29
|
+
export type CanonicalCircuitId = CoreCircuitId;
|
|
108
30
|
/**
|
|
109
31
|
* The circuits the proofport-ai server can prove: the ones it has compiled
|
|
110
32
|
* artifacts, an input builder and a deployed verifier for.
|
|
111
33
|
*
|
|
112
|
-
* A strict subset of
|
|
113
|
-
*
|
|
114
|
-
*
|
|
34
|
+
* A strict subset of core's ids -- `satisfies` makes an id that is no longer
|
|
35
|
+
* canonical a compile error here. The server keeps the same list in
|
|
36
|
+
* `src/config/circuitIds.ts`; the two trees ship separately and cannot import
|
|
37
|
+
* each other, so `tests/circuitIds.test.ts` holds them equal.
|
|
115
38
|
*/
|
|
116
39
|
export declare const PROVABLE_CIRCUIT_IDS: readonly ["coinbase_attestation", "coinbase_country_attestation", "oidc_domain_attestation", "giwa_attestation"];
|
|
117
40
|
/** Narrows an unknown value to a circuit the proofport-ai server can prove. */
|
package/dist/circuits.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circuits.d.ts","sourceRoot":"","sources":["../src/circuits.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"circuits.d.ts","sourceRoot":"","sources":["../src/circuits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAe,KAAK,SAAS,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE9F,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,IAAI,oBAAoB,GACpC,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC;AAI/C;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,kHAKiB,CAAC;AAEnD,+EAA+E;AAC/E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAE/E"}
|
package/dist/circuits.js
CHANGED
|
@@ -1,127 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical ZKProofport circuit identifiers, for `@zkproofport-ai/sdk`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* the
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* There are two reasons, and only the first is temporary:
|
|
18
|
-
*
|
|
19
|
-
1. ~~The published customer SDK does not ship the module.~~ **No longer true**
|
|
20
|
-
* as of 0.2.16, whose `exports` map carries `./circuits` and whose tarball
|
|
21
|
-
* has `dist/circuits.{js,esm.js,mjs,d.ts}` — verified with `npm pack`
|
|
22
|
-
* 2026-09-11. Reason 2 is now the only one holding this mirror up.
|
|
23
|
-
* 2. This package is published to npm, and `@zkproofport-app/sdk` carries
|
|
24
|
-
* `qrcode` and `socket.io-client` (38 transitive packages, measured). The
|
|
25
|
-
* `./circuits` subpath is dependency-free at *import* time, but npm still
|
|
26
|
-
* installs the whole dependency tree. Paying that on every
|
|
27
|
-
* `npx zkproofport-mcp` for seven strings is a poor trade, so even after the
|
|
28
|
-
* SDK publishes the subpath this mirror may be worth keeping.
|
|
29
|
-
*
|
|
30
|
-
* The root server tree keeps its own mirror at `src/config/circuitIds.ts` — the
|
|
31
|
-
* two trees are compiled and shipped separately (`rootDir: src` in each,
|
|
32
|
-
* different npm packages / Docker images), so neither can import the other.
|
|
33
|
-
*
|
|
34
|
-
* ## What stops the mirrors drifting
|
|
35
|
-
*
|
|
36
|
-
* `tests/circuitIds.test.ts` at the repo root reads the real customer SDK — the
|
|
37
|
-
* installed package if present, otherwise the sibling checkout at
|
|
38
|
-
* `../proofport-app-sdk` — and fails when either mirror disagrees with it, or
|
|
39
|
-
* with the other. It fails, rather than skips, when it can find neither.
|
|
40
|
-
*
|
|
41
|
-
* ## Identifiers are canonical and case-sensitive
|
|
42
|
-
*
|
|
43
|
-
* Each id is the circuit's `name` in its `Nargo.toml`, verbatim: lowercase with
|
|
44
|
-
* underscores. Hyphenated spellings (`coinbase-kyc`) are directory or UI route
|
|
45
|
-
* names elsewhere and are not circuit ids; passing one produces a nullifier
|
|
46
|
-
* mismatch or a failed on-chain lookup rather than a clear error.
|
|
4
|
+
* `@zkproofport-app/core/circuits` is the single source of truth for circuit
|
|
5
|
+
* identifiers across every layer: the mobile app, the relay, the demo, the
|
|
6
|
+
* proofport-ai server and this package. Everything canonical here is
|
|
7
|
+
* re-exported from it.
|
|
8
|
+
*
|
|
9
|
+
* Until core existed this file was a hand-kept mirror, because the only
|
|
10
|
+
* published home of the list was `@zkproofport-app/sdk`, whose dependency tree
|
|
11
|
+
* is a poor trade on every `npx zkproofport-mcp`. Core's `./circuits` subpath
|
|
12
|
+
* has no dependencies, so the mirror and the test that compared it are gone.
|
|
13
|
+
*
|
|
14
|
+
* What stays is this package's own subset -- the circuits the proofport-ai
|
|
15
|
+
* server can prove -- which core has no opinion on.
|
|
47
16
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* constant name. Mirrors `CIRCUIT_IDS` in `@zkproofport-app/sdk/circuits`.
|
|
51
|
-
*
|
|
52
|
-
* This is the full ZKProofport catalogue, which is wider than what the
|
|
53
|
-
* proofport-ai server can prove — see {@link PROVABLE_CIRCUIT_IDS} for that.
|
|
54
|
-
*/
|
|
55
|
-
export const CIRCUIT_IDS = Object.freeze({
|
|
56
|
-
/** Coinbase KYC attestation. Officially supported. */
|
|
57
|
-
COINBASE_ATTESTATION: 'coinbase_attestation',
|
|
58
|
-
/** Coinbase country attestation (inclusion / exclusion). Officially supported. */
|
|
59
|
-
COINBASE_COUNTRY_ATTESTATION: 'coinbase_country_attestation',
|
|
60
|
-
/** OIDC email-domain attestation. Officially supported. */
|
|
61
|
-
OIDC_DOMAIN_ATTESTATION: 'oidc_domain_attestation',
|
|
62
|
-
/** GIWA attestation. Planned — not officially supported yet. */
|
|
63
|
-
GIWA_ATTESTATION: 'giwa_attestation',
|
|
64
|
-
/** Korea Mobile ID ownership. Planned — not officially supported yet. */
|
|
65
|
-
MDL_KR_OWNERSHIP: 'mdl_kr_ownership',
|
|
66
|
-
/** Korea Mobile ID age threshold. Planned — not officially supported yet. */
|
|
67
|
-
MDL_KR_AGE: 'mdl_kr_age',
|
|
68
|
-
/** Korea Mobile ID si/do region. Planned — not officially supported yet. */
|
|
69
|
-
MDL_KR_REGION: 'mdl_kr_region',
|
|
70
|
-
});
|
|
71
|
-
/**
|
|
72
|
-
* Support status for every canonical circuit. Exhaustive over
|
|
73
|
-
* {@link CanonicalCircuitId}, so an identifier without a status is a compile
|
|
74
|
-
* error.
|
|
75
|
-
*/
|
|
76
|
-
export const CIRCUIT_SUPPORT_STATUS = Object.freeze({
|
|
77
|
-
coinbase_attestation: 'supported',
|
|
78
|
-
coinbase_country_attestation: 'supported',
|
|
79
|
-
oidc_domain_attestation: 'supported',
|
|
80
|
-
// Experimental since 2026-09-22: built, deployed on GIWA Sepolia and
|
|
81
|
-
// provable here. Testnet-only, which is what keeps it out of 'supported'.
|
|
82
|
-
giwa_attestation: 'experimental',
|
|
83
|
-
mdl_kr_ownership: 'planned',
|
|
84
|
-
mdl_kr_age: 'planned',
|
|
85
|
-
mdl_kr_region: 'planned',
|
|
86
|
-
});
|
|
87
|
-
/** Every canonical circuit identifier, in declaration order. */
|
|
88
|
-
export const ALL_CIRCUIT_IDS = Object.freeze(Object.values(CIRCUIT_IDS));
|
|
89
|
-
/** Circuits ZKProofport officially supports today. Derived, so it cannot desync. */
|
|
90
|
-
export const SUPPORTED_CIRCUIT_IDS = Object.freeze(ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'supported'));
|
|
91
|
-
/** Circuits whose identifiers are reserved but not officially supported yet. */
|
|
92
|
-
export const PLANNED_CIRCUIT_IDS = Object.freeze(ALL_CIRCUIT_IDS.filter((id) => CIRCUIT_SUPPORT_STATUS[id] === 'planned'));
|
|
93
|
-
/**
|
|
94
|
-
* Narrows an unknown value to a canonical circuit identifier. Returns `false`
|
|
95
|
-
* for hyphenated route names such as `'coinbase-kyc'`.
|
|
96
|
-
*/
|
|
97
|
-
export function isCanonicalCircuitId(value) {
|
|
98
|
-
return typeof value === 'string' && ALL_CIRCUIT_IDS.includes(value);
|
|
99
|
-
}
|
|
100
|
-
/** Returns the support status of a canonical circuit. */
|
|
101
|
-
export function getCircuitSupportStatus(circuit) {
|
|
102
|
-
if (!isCanonicalCircuitId(circuit)) {
|
|
103
|
-
throw new Error(`Unknown circuit '${String(circuit)}'. Expected one of: ${ALL_CIRCUIT_IDS.join(', ')}`);
|
|
104
|
-
}
|
|
105
|
-
return CIRCUIT_SUPPORT_STATUS[circuit];
|
|
106
|
-
}
|
|
17
|
+
import { CIRCUIT_IDS } from '@zkproofport-app/core/circuits';
|
|
18
|
+
export { CIRCUIT_IDS, CIRCUIT_SUPPORT_STATUS, ALL_CIRCUIT_IDS, SUPPORTED_CIRCUIT_IDS, EXPERIMENTAL_CIRCUIT_IDS, PLANNED_CIRCUIT_IDS, getCircuitSupportStatus, isCircuitId as isCanonicalCircuitId, } from '@zkproofport-app/core/circuits';
|
|
107
19
|
// ── proofport-ai's own subset ───────────────────────────────────────────────
|
|
108
|
-
// Everything above mirrors the customer SDK. Everything below is this repo's,
|
|
109
|
-
// and the SDK has no opinion on it.
|
|
110
20
|
/**
|
|
111
21
|
* The circuits the proofport-ai server can prove: the ones it has compiled
|
|
112
22
|
* artifacts, an input builder and a deployed verifier for.
|
|
113
23
|
*
|
|
114
|
-
* A strict subset of
|
|
115
|
-
*
|
|
116
|
-
*
|
|
24
|
+
* A strict subset of core's ids -- `satisfies` makes an id that is no longer
|
|
25
|
+
* canonical a compile error here. The server keeps the same list in
|
|
26
|
+
* `src/config/circuitIds.ts`; the two trees ship separately and cannot import
|
|
27
|
+
* each other, so `tests/circuitIds.test.ts` holds them equal.
|
|
117
28
|
*/
|
|
118
29
|
export const PROVABLE_CIRCUIT_IDS = [
|
|
119
30
|
CIRCUIT_IDS.COINBASE_ATTESTATION,
|
|
120
31
|
CIRCUIT_IDS.COINBASE_COUNTRY_ATTESTATION,
|
|
121
32
|
CIRCUIT_IDS.OIDC_DOMAIN_ATTESTATION,
|
|
122
|
-
// Added 2026-09-22 with the server's own list, which a test holds byte
|
|
123
|
-
// identical to this one: the two trees ship separately and cannot import
|
|
124
|
-
// each other, so nothing else stops one moving without the other.
|
|
125
33
|
CIRCUIT_IDS.GIWA_ATTESTATION,
|
|
126
34
|
];
|
|
127
35
|
/** Narrows an unknown value to a circuit the proofport-ai server can prove. */
|
package/dist/circuits.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circuits.js","sourceRoot":"","sources":["../src/circuits.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"circuits.js","sourceRoot":"","sources":["../src/circuits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,WAAW,EAAmC,MAAM,gCAAgC,CAAC;AAE9F,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,WAAW,IAAI,oBAAoB,GACpC,MAAM,gCAAgC,CAAC;AAcxC,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,CAAC,oBAAoB;IAChC,WAAW,CAAC,4BAA4B;IACxC,WAAW,CAAC,uBAAuB;IACnC,WAAW,CAAC,gBAAgB;CACoB,CAAC;AAEnD,+EAA+E;AAC/E,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,oBAA0C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAClG,CAAC"}
|
package/dist/extract.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Every function here takes the circuit id explicitly. There used to be a
|
|
7
7
|
* `detectCircuit(fieldCount)` that inferred the circuit from the *number* of
|
|
8
|
-
* public inputs (128 → coinbase, 150 → country, 148 → oidc, anything else →
|
|
8
|
+
* public inputs (128 → coinbase, 150 → country, 148 → oidc v1, anything else →
|
|
9
9
|
* coinbase). It is gone. Field count is a size, not an identity: nothing
|
|
10
10
|
* guarantees two circuits have different counts, and when they collide the
|
|
11
11
|
* inference returns whichever branch is written first, silently, with no error.
|
|
@@ -18,9 +18,12 @@
|
|
|
18
18
|
*
|
|
19
19
|
* ## Public-input layouts are this repo's knowledge
|
|
20
20
|
*
|
|
21
|
-
* The index ranges below
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* The index ranges below repeat what `@zkproofport-app/core` holds for the
|
|
22
|
+
* same circuits. Core's extractors are not used because they differ in
|
|
23
|
+
* contract: they take an array of fields and throw on an unknown circuit,
|
|
24
|
+
* while these take the server's one concatenated hex string and answer `null`
|
|
25
|
+
* for anything this server cannot prove. Only the *identifiers* come from
|
|
26
|
+
* `./circuits.js` (re-exporting `@zkproofport-app/core/circuits`).
|
|
24
27
|
*
|
|
25
28
|
* coinbase_attestation (128 fields):
|
|
26
29
|
* Index 0-31: signal_hash (32 bytes)
|
|
@@ -36,13 +39,17 @@
|
|
|
36
39
|
* Index 86-117: scope (32 bytes)
|
|
37
40
|
* Index 118-149: nullifier (32 bytes)
|
|
38
41
|
*
|
|
39
|
-
* oidc_domain_attestation (
|
|
42
|
+
* oidc_domain_attestation (214 fields, circuit v2; 0-147 are v1's, unchanged):
|
|
40
43
|
* Index 0-17: pubkey_modulus_limbs (18 x u128)
|
|
41
44
|
* Index 18-81: domain storage (BoundedVec<u8, 64>)
|
|
42
45
|
* Index 82: domain len
|
|
43
46
|
* Index 83-114: scope (32 bytes)
|
|
44
47
|
* Index 115-146: nullifier (32 bytes)
|
|
45
48
|
* Index 147: provider (u8)
|
|
49
|
+
* Index 148-179: aud_hash (32 bytes, keccak256 of the token's aud)
|
|
50
|
+
* Index 180: nonce_mode (u8; 0 for proofs from this server's device flow)
|
|
51
|
+
* Index 181-212: nonce_binding (32 bytes; all zero in nonce_mode 0)
|
|
52
|
+
* Index 213: now (u64 unix seconds; iat <= now < exp)
|
|
46
53
|
*/
|
|
47
54
|
import type { CircuitId } from './types.js';
|
|
48
55
|
/**
|
package/dist/extract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4E5C;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,SAAS,GACjB,MAAM,GAAG,IAAI,CAWf;AAED;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAC9C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,SAAS,GACjB,MAAM,GAAG,IAAI,CAWf;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,SAAS,GACjB,MAAM,GAAG,IAAI,CAwBf"}
|
package/dist/extract.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Every function here takes the circuit id explicitly. There used to be a
|
|
7
7
|
* `detectCircuit(fieldCount)` that inferred the circuit from the *number* of
|
|
8
|
-
* public inputs (128 → coinbase, 150 → country, 148 → oidc, anything else →
|
|
8
|
+
* public inputs (128 → coinbase, 150 → country, 148 → oidc v1, anything else →
|
|
9
9
|
* coinbase). It is gone. Field count is a size, not an identity: nothing
|
|
10
10
|
* guarantees two circuits have different counts, and when they collide the
|
|
11
11
|
* inference returns whichever branch is written first, silently, with no error.
|
|
@@ -18,9 +18,12 @@
|
|
|
18
18
|
*
|
|
19
19
|
* ## Public-input layouts are this repo's knowledge
|
|
20
20
|
*
|
|
21
|
-
* The index ranges below
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* The index ranges below repeat what `@zkproofport-app/core` holds for the
|
|
22
|
+
* same circuits. Core's extractors are not used because they differ in
|
|
23
|
+
* contract: they take an array of fields and throw on an unknown circuit,
|
|
24
|
+
* while these take the server's one concatenated hex string and answer `null`
|
|
25
|
+
* for anything this server cannot prove. Only the *identifiers* come from
|
|
26
|
+
* `./circuits.js` (re-exporting `@zkproofport-app/core/circuits`).
|
|
24
27
|
*
|
|
25
28
|
* coinbase_attestation (128 fields):
|
|
26
29
|
* Index 0-31: signal_hash (32 bytes)
|
|
@@ -36,13 +39,17 @@
|
|
|
36
39
|
* Index 86-117: scope (32 bytes)
|
|
37
40
|
* Index 118-149: nullifier (32 bytes)
|
|
38
41
|
*
|
|
39
|
-
* oidc_domain_attestation (
|
|
42
|
+
* oidc_domain_attestation (214 fields, circuit v2; 0-147 are v1's, unchanged):
|
|
40
43
|
* Index 0-17: pubkey_modulus_limbs (18 x u128)
|
|
41
44
|
* Index 18-81: domain storage (BoundedVec<u8, 64>)
|
|
42
45
|
* Index 82: domain len
|
|
43
46
|
* Index 83-114: scope (32 bytes)
|
|
44
47
|
* Index 115-146: nullifier (32 bytes)
|
|
45
48
|
* Index 147: provider (u8)
|
|
49
|
+
* Index 148-179: aud_hash (32 bytes, keccak256 of the token's aud)
|
|
50
|
+
* Index 180: nonce_mode (u8; 0 for proofs from this server's device flow)
|
|
51
|
+
* Index 181-212: nonce_binding (32 bytes; all zero in nonce_mode 0)
|
|
52
|
+
* Index 213: now (u64 unix seconds; iat <= now < exp)
|
|
46
53
|
*/
|
|
47
54
|
import { CIRCUIT_IDS } from './circuits.js';
|
|
48
55
|
/**
|
package/dist/extract.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAe5C;;;;;GAKG;AACH,MAAM,OAAO,GAAyC;IACpD,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE;IAC7E,CAAC,WAAW,CAAC,4BAA4B,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;IACvF,CAAC,WAAW,CAAC,uBAAuB,CAAC,EAAE;QACrC,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC;QAChB,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;QACrB,aAAa,EAAE,EAAE;QACjB,SAAS,EAAE,E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dist/index.d.ts
CHANGED
|
@@ -24,6 +24,6 @@ export type { ExternalWallet } from './cdp.js';
|
|
|
24
24
|
export { EthersWalletSigner, fromEthersWallet, fromPrivateKey } from './signer.js';
|
|
25
25
|
export { extractDomainFromPublicInputs, extractScopeFromPublicInputs, extractNullifierFromPublicInputs, } from './extract.js';
|
|
26
26
|
export { fetchAttestation, getSignerAddress, } from './attestation.js';
|
|
27
|
-
export { validateTypedAction } from '
|
|
27
|
+
export { validateTypedAction } from '@zkproofport-app/core/typedAction';
|
|
28
28
|
export { hashTypedAction } from './action.js';
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,YAAY,EACZ,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,WAAW,EACX,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAI9D,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG9E,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC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AAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzE,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG/F,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAInD,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGnF,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAGxE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { CIRCUIT_NAME_MAP, CIRCUIT_ID_MAP } from './types.js';
|
|
2
|
-
// Canonical circuit identifiers
|
|
3
|
-
//
|
|
2
|
+
// Canonical circuit identifiers, from @zkproofport-app/core, plus the subset
|
|
3
|
+
// the proofport-ai server can prove. See ./circuits.ts.
|
|
4
4
|
export { CIRCUIT_IDS, CIRCUIT_SUPPORT_STATUS, ALL_CIRCUIT_IDS, SUPPORTED_CIRCUIT_IDS, PLANNED_CIRCUIT_IDS, PROVABLE_CIRCUIT_IDS, isCanonicalCircuitId, isProvableCircuitId, getCircuitSupportStatus, } from './circuits.js';
|
|
5
5
|
// Constants
|
|
6
6
|
export { CIRCUITS, COINBASE_ATTESTER_CONTRACT, AUTHORIZED_SIGNERS, } from './constants.js';
|
|
@@ -28,10 +28,9 @@ export { EthersWalletSigner, fromEthersWallet, fromPrivateKey } from './signer.j
|
|
|
28
28
|
export { extractDomainFromPublicInputs, extractScopeFromPublicInputs, extractNullifierFromPublicInputs, } from './extract.js';
|
|
29
29
|
// Attestation (customer-facing helpers)
|
|
30
30
|
export { fetchAttestation, getSignerAddress, } from './attestation.js';
|
|
31
|
-
// Checking the EIP-712 action a giwa_attestation proof can bind to.
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
export { validateTypedAction } from './typedAction.js';
|
|
31
|
+
// Checking the EIP-712 action a giwa_attestation proof can bind to. The one
|
|
32
|
+
// implementation lives in @zkproofport-app/core.
|
|
33
|
+
export { validateTypedAction } from '@zkproofport-app/core/typedAction';
|
|
35
34
|
// Validate and hash caller-owned actions before local signing.
|
|
36
35
|
export { hashTypedAction } from './action.js';
|
|
37
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE9D,6EAA6E;AAC7E,wDAAwD;AACxD,OA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