@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 CHANGED
@@ -121,11 +121,9 @@ console.log('Valid:', verification.valid);
121
121
  ```
122
122
 
123
123
 
124
- ## Binding a proof to one action (experimental, testnet only)
124
+ ## Binding a proof to one action
125
125
 
126
- > **Experimental. Testnet only.**
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 | On-chain verifier info (chainId, address, rpcUrl) |
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, // JWT id_token from Google OAuth
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, // JWT id_token from Microsoft OAuth
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 148 public input fields (32 bytes each):
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 './typedAction.js';
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`.
@@ -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,kBAAkB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAAmB;IAIjD,MAAM,KAAK,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC1C,IAAI,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IAElC,IAAI,cAAc,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACnC,MAAM,IAAI,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`zkproofport/proofport-app-sdk`,
7
- * `src/circuits.ts`) is the single source of truth for circuit identifiers
8
- * across every layer: the mobile app, the relay, the demo, and proofport-ai.
9
- * The names below are that module's values, verbatim — the same eight ids in
10
- * the same order with the same support statuses.
11
- *
12
- * This file is a **mirror, not a second source of truth**. Nothing here may be
13
- * edited on its own judgement: change the SDK first, then bring the change over.
14
- *
15
- * ## Why this package keeps a copy
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
- * Whether a circuit is officially supported today or still on the roadmap.
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
- * The customer SDK calls this type `CircuitId`. It is named
83
- * `CanonicalCircuitId` here because {@link CircuitId} is already this package's
84
- * public name for the narrower set proofport-ai can prove; widening it would be
85
- * a silent breaking change for anyone writing `Record<CircuitId, …>`, and would
86
- * let `circuit: 'mdl_kr_age'` typecheck against an endpoint that cannot serve it.
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 declare function isCanonicalCircuitId(value: unknown): value is CanonicalCircuitId;
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 {@link ALL_CIRCUIT_IDS} — `satisfies` makes an id that is
113
- * no longer canonical a compile error here, and the entries are the canonical
114
- * constants rather than repeated string literals.
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. */
@@ -1 +1 @@
1
- {"version":3,"file":"circuits.d.ts","sourceRoot":"","sources":["../src/circuits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,cAAc,GAAG,SAAS,CAAC;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;IACtB,sDAAsD;;IAEtD,kFAAkF;;IAElF,2DAA2D;;IAE3D,gEAAgE;;IAEhE,yEAAyE;;IAEzE,6EAA6E;;IAE7E,4EAA4E;;EAEnE,CAAC;AAEZ;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEhF;;;;G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G,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
- * ## The customer SDK owns this list
5
- *
6
- * `@zkproofport-app/sdk/circuits` (repo `zkproofport/proofport-app-sdk`,
7
- * `src/circuits.ts`) is the single source of truth for circuit identifiers
8
- * across every layer: the mobile app, the relay, the demo, and proofport-ai.
9
- * The names below are that module's values, verbatim — the same eight ids in
10
- * the same order with the same support statuses.
11
- *
12
- * This file is a **mirror, not a second source of truth**. Nothing here may be
13
- * edited on its own judgement: change the SDK first, then bring the change over.
14
- *
15
- * ## Why this package keeps a copy
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
- * Every canonical circuit identifier ZKProofport has assigned, keyed by a stable
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 {@link ALL_CIRCUIT_IDS} — `satisfies` makes an id that is
115
- * no longer canonical a compile error here, and the entries are the canonical
116
- * constants rather than repeated string literals.
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. */
@@ -1 +1 @@
1
- {"version":3,"file":"circuits.js","sourceRoot":"","sources":["../src/circuits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAWH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,sDAAsD;IACtD,oBAAoB,EAAE,sBAAsB;IAC5C,kFAAkF;IAClF,4BAA4B,EAAE,8BAA8B;IAC5D,2DAA2D;IAC3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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 are per-circuit facts that proofport-ai owns; the
22
- * customer SDK has no layout data. Only the *identifiers* come from
23
- * `./circuits.js` (mirroring `@zkproofport-app/sdk/circuits`).
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 (148 fields):
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
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;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"}
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 are per-circuit facts that proofport-ai owns; the
22
- * customer SDK has no layout data. Only the *identifiers* come from
23
- * `./circuits.js` (mirroring `@zkproofport-app/sdk/circuits`).
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 (148 fields):
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
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../src/extract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;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,EAAE;KACd;IACD,kDAAkD;IAClD,iEAAiE;IACjE,sEAAsE;IACtE,wEAAwE;IACxE,2EAA2E;IAC3E,wEAAwE;IACxE,0EAA0E;IAC1E,6BAA6B;IAC7B,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;CAC7E,CAAC;AAEF;;;;;;GAMG;AACH,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AE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;YAC/D,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
package/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 './typedAction.js';
27
+ export { validateTypedAction } from '@zkproofport-app/core/typedAction';
28
28
  export { hashTypedAction } from './action.js';
29
29
  //# sourceMappingURL=index.d.ts.map
@@ -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,eA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AAM,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
- // Mirrors @zkproofport-app/sdk/circuits — see ./circuits.ts for why a mirror.
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. Mirrored
32
- // from the customer SDK; see the note in typedAction.ts for why, and
33
- // tests/typedAction.test.ts for the guard that keeps them equal.
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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