@zkproofport-ai/sdk 0.4.0 → 0.4.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/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 +6 -3
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +6 -3
- 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/types.d.ts +4 -19
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/verify.d.ts +5 -1
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +15 -13
- 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/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,EA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AM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC;oBAAE,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,eAAe,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
|
@@ -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)
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;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
|
@@ -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)
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAe5C;;;;;GAKG;AACH,MAAM,O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AAE,OAAO,IAAI,CAAC;QAExD,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,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 '
|
|
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,E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AE,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,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AAGvB,YAAY;AACZ,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,0BAA0B;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAS7B,4CAA4C;AAC5C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,8CAA8C;AAC9C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,oEAAoE;AACpE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAMzE,6EAA6E;AAC7E,6DAA6D;AAC7D,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnF,6DAA6D;AAC7D,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,GACjC,MAAM,cAAc,CAAC;AAEtB,wCAAwC;AACxC,OAAO,EACL,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,4EAA4E;AAC5E,iDAAiD;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,+DAA+D;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PROVABLE_CIRCUIT_IDS } from './circuits.js';
|
|
2
2
|
import type { ActionApproval } from './actionApproval.js';
|
|
3
|
+
import type { TypedAction as CoreTypedAction } from '@zkproofport-app/core/typedAction';
|
|
3
4
|
/** Client-friendly circuit aliases. */
|
|
4
5
|
export type CircuitName = 'coinbase_kyc' | 'coinbase_country' | 'oidc_domain'
|
|
5
6
|
/** GIWA account attestation, optionally binding one EIP-712 action. */
|
|
@@ -8,10 +9,8 @@ export type CircuitName = 'coinbase_kyc' | 'coinbase_country' | 'oidc_domain'
|
|
|
8
9
|
* Canonical circuit IDs this server can prove.
|
|
9
10
|
*
|
|
10
11
|
* Derived from `PROVABLE_CIRCUIT_IDS` in `./circuits.js`, which is itself built
|
|
11
|
-
* from the canonical identifiers owned by `@zkproofport-app/
|
|
12
|
-
*
|
|
13
|
-
* rename in the customer SDK becomes a compile error instead of a silent
|
|
14
|
-
* divergence.
|
|
12
|
+
* from the canonical identifiers owned by `@zkproofport-app/core/circuits`, so
|
|
13
|
+
* a rename there becomes a compile error instead of a silent divergence.
|
|
15
14
|
*/
|
|
16
15
|
export type CircuitId = (typeof PROVABLE_CIRCUIT_IDS)[number];
|
|
17
16
|
/** Map client-friendly names to canonical circuit IDs. */
|
|
@@ -146,21 +145,7 @@ export interface AttestationData {
|
|
|
146
145
|
* A contract cannot enforce prose, though -- to check an amount on-chain the
|
|
147
146
|
* amount has to be its own field.
|
|
148
147
|
*/
|
|
149
|
-
export
|
|
150
|
-
domain: {
|
|
151
|
-
name: string;
|
|
152
|
-
version: string;
|
|
153
|
-
chainId: number;
|
|
154
|
-
/** The contract that will verify this signature. Binds it to one address. */
|
|
155
|
-
verifyingContract: string;
|
|
156
|
-
};
|
|
157
|
-
types: Record<string, Array<{
|
|
158
|
-
name: string;
|
|
159
|
-
type: string;
|
|
160
|
-
}>>;
|
|
161
|
-
primaryType: string;
|
|
162
|
-
message: Record<string, unknown>;
|
|
163
|
-
}
|
|
148
|
+
export type TypedAction = CoreTypedAction;
|
|
164
149
|
/** Terms explicitly accepted by a user; nonce is intentionally not pinned. */
|
|
165
150
|
export interface ApprovedPayment {
|
|
166
151
|
network: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.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,KAAK,MAAM,EAAE,CAAC;IACvB,aAAa,CAAC,OAAO,EAAE;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;IAC3B,yEAAyE;IACzE,QAAQ,IAAI,MAAM,CAAC;CACpB;AAED,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B;AAED,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,OAAO,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,OAAO,EAAE,WAAW,EAAwB,MAAM,eAAe,CAAC;AAqBlE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAmC;IAC9D,YAAY,EAAE,WAAW,CAAC,oBAAoB;IAC9C,gBAAgB,EAAE,WAAW,CAAC,4BAA4B;IAC1D,WAAW,EAAE,WAAW,CAAC,uBAAuB;IAChD,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;CAC/C,CAAC;AAEF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAmC;IAC5D,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,cAAc;IAClD,CAAC,WAAW,CAAC,4BAA4B,CAAC,EAAE,kBAAkB;IAC9D,CAAC,WAAW,CAAC,uBAAuB,CAAC,EAAE,aAAa;IACpD,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE,kBAAkB;CACnD,CAAC"}
|
package/dist/verify.d.ts
CHANGED
|
@@ -2,11 +2,15 @@ import type { VerifyResult, ProveResponse } from './types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Verify a ZK proof on-chain using server-provided verification info.
|
|
4
4
|
*
|
|
5
|
+
* The contract call is core's `verifyProofOnChain`; the proof and the split
|
|
6
|
+
* public inputs are passed through as they are.
|
|
7
|
+
*
|
|
8
|
+
* @param circuit - Canonical circuit id the proof was generated for
|
|
5
9
|
* @param verification - Chain info from ProveResponse (chainId, verifierAddress, rpcUrl)
|
|
6
10
|
* @param proof - Raw proof hex
|
|
7
11
|
* @param publicInputs - Concatenated public inputs hex
|
|
8
12
|
*/
|
|
9
|
-
export declare function verifyOnChain(verification: {
|
|
13
|
+
export declare function verifyOnChain(circuit: string, verification: {
|
|
10
14
|
chainId: number;
|
|
11
15
|
verifierAddress: string;
|
|
12
16
|
rpcUrl: string;
|
package/dist/verify.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAc9D;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC1E,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,YAAY,CAAC,CAiBvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAK9E"}
|
package/dist/verify.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
];
|
|
2
|
+
import { VERIFIER_ABI, verifyProofOnChain } from '@zkproofport-app/core';
|
|
3
|
+
import { isCanonicalCircuitId } from './circuits.js';
|
|
5
4
|
/**
|
|
6
5
|
* Split concatenated public inputs hex into array of bytes32 values.
|
|
7
6
|
*/
|
|
@@ -16,22 +15,25 @@ function splitPublicInputs(publicInputsHex) {
|
|
|
16
15
|
/**
|
|
17
16
|
* Verify a ZK proof on-chain using server-provided verification info.
|
|
18
17
|
*
|
|
18
|
+
* The contract call is core's `verifyProofOnChain`; the proof and the split
|
|
19
|
+
* public inputs are passed through as they are.
|
|
20
|
+
*
|
|
21
|
+
* @param circuit - Canonical circuit id the proof was generated for
|
|
19
22
|
* @param verification - Chain info from ProveResponse (chainId, verifierAddress, rpcUrl)
|
|
20
23
|
* @param proof - Raw proof hex
|
|
21
24
|
* @param publicInputs - Concatenated public inputs hex
|
|
22
25
|
*/
|
|
23
|
-
export async function verifyOnChain(verification, proof, publicInputs) {
|
|
26
|
+
export async function verifyOnChain(circuit, verification, proof, publicInputs) {
|
|
27
|
+
if (!isCanonicalCircuitId(circuit)) {
|
|
28
|
+
return { valid: false, error: `Unknown circuit '${circuit}'; cannot verify it on-chain.` };
|
|
29
|
+
}
|
|
24
30
|
const provider = new ethers.JsonRpcProvider(verification.rpcUrl);
|
|
25
|
-
const verifier = new ethers.Contract(verification.verifierAddress, VERIFIER_ABI, provider);
|
|
26
31
|
const publicInputsArray = splitPublicInputs(publicInputs);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return { valid:
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
33
|
-
return { valid: false, error: `On-chain verification failed: ${message}` };
|
|
32
|
+
const result = await verifyProofOnChain(circuit, { proofHex: proof, publicInputsHex: publicInputsArray, numPublicInputs: publicInputsArray.length }, provider, { address: verification.verifierAddress, chainId: verification.chainId, abi: VERIFIER_ABI });
|
|
33
|
+
if (result.error !== undefined) {
|
|
34
|
+
return { valid: false, error: `On-chain verification failed: ${result.error}` };
|
|
34
35
|
}
|
|
36
|
+
return { valid: result.valid === true };
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
39
|
* Verify a proof using the verification info from a ProveResponse.
|
|
@@ -51,6 +53,6 @@ export async function verifyProof(result) {
|
|
|
51
53
|
if (!result.verification) {
|
|
52
54
|
return { valid: false, error: 'No verification info in response (verifier not deployed on this network)' };
|
|
53
55
|
}
|
|
54
|
-
return verifyOnChain(result.verification, result.proof, result.publicInputs);
|
|
56
|
+
return verifyOnChain(result.circuit, result.verification, result.proof, result.publicInputs);
|
|
55
57
|
}
|
|
56
58
|
//# sourceMappingURL=verify.js.map
|
package/dist/verify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAA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AQ,EACR,EAAE,OAAO,EAAE,YAAY,CAAC,eAAe,EAAE,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,CAC5F,CAAC;IACF,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iCAAiC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;IAClF,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;AAC1C,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAqB;IACrD,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,0EAA0E,EAAE,CAAC;IAC7G,CAAC;IACD,OAAO,aAAa,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;AAC/F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkproofport-ai/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "TypeScript SDK for ZKProofport Coinbase KYC, country, OIDC and GIWA attestation proofs. Optional EIP-712 action binding for GIWA; x402 USDC payments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sdk",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@x402/core": "^2.25.0",
|
|
39
39
|
"@x402/evm": "^2.25.0",
|
|
40
|
+
"@zkproofport-app/core": "0.1.2",
|
|
40
41
|
"ethers": "^6.13.0",
|
|
41
42
|
"viem": "^2.45.2"
|
|
42
43
|
},
|
package/dist/typedAction.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedAction.d.ts","sourceRoot":"","sources":["../src/typedAction.ts"],"names":[],"mappings":"AAsBA,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAkDjE"}
|
package/dist/typedAction.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const ADDRESS = /^0x[0-9a-fA-F]{40}$/;
|
|
2
|
-
/** The reason the value is not a usable action, or `null` when it is one. */
|
|
3
|
-
export function validateTypedAction(value) {
|
|
4
|
-
if (value === undefined || value === null) {
|
|
5
|
-
return 'action is required. The circuit proves that a wallet authorised ONE EIP-712 action; there is nothing to prove without it.';
|
|
6
|
-
}
|
|
7
|
-
if (typeof value !== 'object' || Array.isArray(value)) {
|
|
8
|
-
return 'action must be an object.';
|
|
9
|
-
}
|
|
10
|
-
const a = value;
|
|
11
|
-
const d = a.domain;
|
|
12
|
-
if (!d || typeof d !== 'object') {
|
|
13
|
-
return 'action.domain is required.';
|
|
14
|
-
}
|
|
15
|
-
for (const k of ['name', 'version', 'verifyingContract']) {
|
|
16
|
-
if (typeof d[k] !== 'string' || !d[k]) {
|
|
17
|
-
return `action.domain.${k} must be a non-empty string.`;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
if (typeof d.chainId !== 'number' || !Number.isInteger(d.chainId)) {
|
|
21
|
-
return 'action.domain.chainId must be an integer.';
|
|
22
|
-
}
|
|
23
|
-
if (!ADDRESS.test(d.verifyingContract)) {
|
|
24
|
-
return 'action.domain.verifyingContract must be a 20-byte hex address.';
|
|
25
|
-
}
|
|
26
|
-
if (!a.types || typeof a.types !== 'object' || Array.isArray(a.types)) {
|
|
27
|
-
return 'action.types is required.';
|
|
28
|
-
}
|
|
29
|
-
if (typeof a.primaryType !== 'string' || !a.primaryType) {
|
|
30
|
-
return 'action.primaryType is required.';
|
|
31
|
-
}
|
|
32
|
-
if (!(a.primaryType in a.types)) {
|
|
33
|
-
return `action.primaryType '${a.primaryType}' is not one of the structs in action.types.`;
|
|
34
|
-
}
|
|
35
|
-
if (!a.message || typeof a.message !== 'object' || Array.isArray(a.message)) {
|
|
36
|
-
return 'action.message is required.';
|
|
37
|
-
}
|
|
38
|
-
const fields = a.types[a.primaryType];
|
|
39
|
-
if (!Array.isArray(fields) || fields.length === 0) {
|
|
40
|
-
return `action.types.${a.primaryType} declares no fields.`;
|
|
41
|
-
}
|
|
42
|
-
const missing = fields
|
|
43
|
-
.map(f => f?.name)
|
|
44
|
-
.filter(n => typeof n === 'string' && !(n in a.message));
|
|
45
|
-
if (missing.length) {
|
|
46
|
-
return `action.message is missing: ${missing.join(', ')}`;
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=typedAction.js.map
|
package/dist/typedAction.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedAction.js","sourceRoot":"","sources":["../src/typedAction.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAEtC,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,2HAA2H,CAAC;IACrI,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACtD,OAAO,2BAA2B,CAAC;IACrC,CAAC;IACD,MAAM,CAAC,GAAG,KAA6B,CAAC;IAExC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IACnB,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,4BAA4B,CAAC;IACtC,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EA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