@zkpassport/sdk 0.9.1 → 0.11.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/constants.cjs +1 -1
- package/dist/cjs/constants.d.cts +1 -1
- package/dist/cjs/index.cjs +260 -115
- package/dist/cjs/public-input-checker.cjs +167 -47
- package/dist/cjs/public-input-checker.d.cts +1 -0
- package/dist/cjs/solidity-verifier.cjs +79 -56
- package/dist/esm/{chunk-OOHOBXGU.js → chunk-6FIXE2II.js} +169 -49
- package/dist/esm/chunk-7UUZHRZ3.js +2564 -0
- package/dist/esm/{chunk-VJZDMGW3.js → chunk-JG37KYXW.js} +1 -1
- package/dist/esm/constants.d.ts +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/index.js +16 -14
- package/dist/esm/public-input-checker.d.ts +1 -0
- package/dist/esm/public-input-checker.js +2 -2
- package/dist/esm/solidity-verifier.js +2 -2
- package/package.json +5 -5
- package/dist/esm/chunk-OTQ7QDA2.js +0 -2541
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/constants.ts
|
|
2
|
-
var VERSION = "0.
|
|
2
|
+
var VERSION = "0.10.0";
|
|
3
3
|
var DEFAULT_VALIDITY = 7 * 24 * 60 * 60;
|
|
4
4
|
var DEFAULT_DATE_VALUE = /* @__PURE__ */ new Date(0);
|
|
5
5
|
var ZKPASSPORT_IOS_APP_ID_HASH = "0x1fa73686cf510f8f85757b0602de0dd72a13e68ae2092462be8b72662e7f179b";
|
package/dist/esm/constants.d.ts
CHANGED
package/dist/esm/constants.js
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-AFLQN3AC.js";
|
|
4
4
|
import {
|
|
5
5
|
PublicInputChecker
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6FIXE2II.js";
|
|
7
7
|
import {
|
|
8
8
|
SolidityVerifier
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7UUZHRZ3.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_VALIDITY,
|
|
12
12
|
VERSION
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JG37KYXW.js";
|
|
14
14
|
import "./chunk-6F4PWJZI.js";
|
|
15
15
|
|
|
16
16
|
// src/index.ts
|
|
@@ -448,11 +448,11 @@ var ZKPassport = class {
|
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
450
|
const formattedResult = formatQueryResultDates(queryResult);
|
|
451
|
-
const {
|
|
451
|
+
const { UltraHonkVerifierBackend } = await import("@aztec/bb.js");
|
|
452
452
|
if (typeof window === "undefined" && !writingDirectory) {
|
|
453
453
|
writingDirectory = "/tmp";
|
|
454
454
|
}
|
|
455
|
-
const verifier = new
|
|
455
|
+
const verifier = new UltraHonkVerifierBackend({
|
|
456
456
|
crsPath: writingDirectory ? writingDirectory + "/.bb-crs" : void 0
|
|
457
457
|
});
|
|
458
458
|
let verified = true;
|
|
@@ -489,11 +489,15 @@ var ZKPassport = class {
|
|
|
489
489
|
});
|
|
490
490
|
for (const proof of proofs) {
|
|
491
491
|
const isOuterEVM = proof.name?.startsWith("outer_evm_");
|
|
492
|
-
const proofName =
|
|
492
|
+
const proofName = proof.name;
|
|
493
493
|
const proofData = getProofData(proof.proof, getNumberOfPublicInputs(proofName));
|
|
494
494
|
const hostedPackagedCircuit = await registryClient.getPackagedCircuit(
|
|
495
495
|
proofName,
|
|
496
|
-
circuitManifest
|
|
496
|
+
circuitManifest,
|
|
497
|
+
// TODO: set to always validate when the issue is vkey hash calculation is fixed
|
|
498
|
+
// Not as important anyway, as the solidity verifier is the ultimate anchor for
|
|
499
|
+
// EVM outer proofs verification
|
|
500
|
+
{ validate: !isOuterEVM }
|
|
497
501
|
);
|
|
498
502
|
if (isOuterEVM) {
|
|
499
503
|
try {
|
|
@@ -525,13 +529,11 @@ var ZKPassport = class {
|
|
|
525
529
|
} else {
|
|
526
530
|
const vkeyBytes = Buffer.from(hostedPackagedCircuit.vkey, "base64");
|
|
527
531
|
try {
|
|
528
|
-
verified = await verifier.
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
new Uint8Array(vkeyBytes)
|
|
534
|
-
);
|
|
532
|
+
verified = await verifier.verifyProof({
|
|
533
|
+
proof: Buffer.from(proofData.proof.join(""), "hex"),
|
|
534
|
+
publicInputs: proofData.publicInputs,
|
|
535
|
+
verificationKey: new Uint8Array(vkeyBytes)
|
|
536
|
+
});
|
|
535
537
|
} catch (e) {
|
|
536
538
|
console.warn("Error verifying proof", e);
|
|
537
539
|
verified = false;
|
|
@@ -58,6 +58,7 @@ declare class PublicInputChecker {
|
|
|
58
58
|
isCorrect: boolean;
|
|
59
59
|
queryResultErrors: Partial<QueryResultErrors>;
|
|
60
60
|
}>;
|
|
61
|
+
private static checkCurrentDate;
|
|
61
62
|
static checkPublicInputs(domain: string, proofs: Array<ProofResult>, queryResult: QueryResult, validity?: number, scope?: string): Promise<{
|
|
62
63
|
isCorrect: boolean;
|
|
63
64
|
uniqueIdentifier: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkpassport/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0-beta.1",
|
|
4
4
|
"description": "Privacy-preserving identity verification using passports and ID cards",
|
|
5
5
|
"author": "ZKPassport",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"sdk"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@aztec/bb.js": "
|
|
34
|
+
"@aztec/bb.js": "2.0.3",
|
|
35
35
|
"@noble/ciphers": "^1.2.1",
|
|
36
36
|
"@noble/hashes": "^1.7.2",
|
|
37
37
|
"@noble/secp256k1": "^2.2.3",
|
|
38
|
-
"@obsidion/bridge": "
|
|
39
|
-
"@zkpassport/registry": "0.
|
|
40
|
-
"@zkpassport/utils": "0.
|
|
38
|
+
"@obsidion/bridge": "0.11.1",
|
|
39
|
+
"@zkpassport/registry": "0.11.1",
|
|
40
|
+
"@zkpassport/utils": "0.28.0",
|
|
41
41
|
"buffer": "^6.0.3",
|
|
42
42
|
"i18n-iso-countries": "^7.12.0",
|
|
43
43
|
"pako": "^2.1.0",
|