@zkproofport-app/sdk 0.5.0-beta.2 → 0.5.0-beta.3
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 +11 -3
- package/dist/ProofportSDK.d.ts +30 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +85 -13
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +120 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +85 -13
- package/dist/index.mjs.map +1 -1
- package/dist/offChainVerifier.d.ts +12 -3
- package/package.json +2 -2
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
* two pieces, so nothing is joined back here.
|
|
36
36
|
*/
|
|
37
37
|
import { type CircuitId } from './circuits';
|
|
38
|
+
import { type OidcRequestContext } from '@zkproofport-app/core';
|
|
38
39
|
export interface OffChainVerifyResult {
|
|
39
40
|
valid: boolean;
|
|
40
41
|
error?: string;
|
|
@@ -48,6 +49,12 @@ export interface OffChainVerifyOptions {
|
|
|
48
49
|
verificationKey?: Uint8Array;
|
|
49
50
|
/** Milliseconds before the fetch is abandoned. Default 30000. */
|
|
50
51
|
timeoutMs?: number;
|
|
52
|
+
/**
|
|
53
|
+
* For `oidc_domain_attestation`: the request the proof answers. A proof made
|
|
54
|
+
* with a request-bound nonce (the app path) must be bound to exactly this
|
|
55
|
+
* scope and requestId. See core's `checkOidcPolicy`.
|
|
56
|
+
*/
|
|
57
|
+
request?: OidcRequestContext;
|
|
51
58
|
}
|
|
52
59
|
/**
|
|
53
60
|
* Verify a proof off-chain, against its verification key.
|
|
@@ -55,9 +62,11 @@ export interface OffChainVerifyOptions {
|
|
|
55
62
|
* Needs no setup from the caller: the verifier ships with this SDK and is
|
|
56
63
|
* loaded on first use.
|
|
57
64
|
*
|
|
58
|
-
* For `oidc_domain_attestation` it first checks the
|
|
59
|
-
*
|
|
60
|
-
*
|
|
65
|
+
* For `oidc_domain_attestation` it first checks the token's audience, nonce and
|
|
66
|
+
* time (core's `checkOidcPolicy`, against `options.request` when given) and the
|
|
67
|
+
* proof's RSA key against the provider's published JWKS (core's
|
|
68
|
+
* `checkOidcProviderKey`); any refusal, or a JWKS that cannot be fetched, is
|
|
69
|
+
* `{ valid: false }`.
|
|
61
70
|
*
|
|
62
71
|
* @param circuit - Canonical circuit identifier
|
|
63
72
|
* @param proof - Proof bytes as hex, WITHOUT public inputs (as the relay sends it)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkproofport-app/sdk",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.3",
|
|
4
4
|
"description": "ZKProofport SDK for requesting zero-knowledge proofs from the ZKProofport mobile app and verifying them on-chain",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"buffer": "^6.0.3",
|
|
43
43
|
"qrcode": "^1.5.3",
|
|
44
44
|
"socket.io-client": "^4.8.0",
|
|
45
|
-
"@zkproofport-app/core": "0.
|
|
45
|
+
"@zkproofport-app/core": "0.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@rollup/plugin-commonjs": "^25.0.7",
|