@zkpassport/sdk 0.9.1 → 0.10.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.
@@ -1,5 +1,5 @@
1
1
  // src/constants.ts
2
- var VERSION = "0.9.1";
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";
@@ -5,7 +5,7 @@ import {
5
5
  GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH,
6
6
  ZKPASSPORT_ANDROID_APP_ID_HASH,
7
7
  ZKPASSPORT_IOS_APP_ID_HASH
8
- } from "./chunk-VJZDMGW3.js";
8
+ } from "./chunk-JG37KYXW.js";
9
9
 
10
10
  // src/public-input-checker.ts
11
11
  import {
@@ -992,12 +992,6 @@ var PublicInputChecker = class {
992
992
  };
993
993
  }
994
994
  const EXPECTED_ENVIRONMENT = "production";
995
- console.log("facematchCommittedInputs.environment", facematchCommittedInputs.environment);
996
- console.log("EXPECTED_ENVIRONMENT", EXPECTED_ENVIRONMENT);
997
- console.log(
998
- "facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT",
999
- facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT
1000
- );
1001
995
  if (facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT) {
1002
996
  console.warn("Invalid facematch environment, it should be production");
1003
997
  isCorrect = false;
@@ -1010,7 +1004,7 @@ var PublicInputChecker = class {
1010
1004
  }
1011
1005
  };
1012
1006
  }
1013
- if (facematchCommittedInputs.appId !== ZKPASSPORT_IOS_APP_ID_HASH && facematchCommittedInputs.appId !== ZKPASSPORT_ANDROID_APP_ID_HASH) {
1007
+ if (facematchCommittedInputs.appIdHash !== ZKPASSPORT_IOS_APP_ID_HASH && facematchCommittedInputs.appIdHash !== ZKPASSPORT_ANDROID_APP_ID_HASH) {
1014
1008
  console.warn(
1015
1009
  "Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
1016
1010
  );
@@ -1019,7 +1013,7 @@ var PublicInputChecker = class {
1019
1013
  ...queryResultErrors.facematch,
1020
1014
  eq: {
1021
1015
  expected: `${ZKPASSPORT_IOS_APP_ID_HASH} (iOS) or ${ZKPASSPORT_ANDROID_APP_ID_HASH} (Android)`,
1022
- received: facematchCommittedInputs.appId,
1016
+ received: facematchCommittedInputs.appIdHash,
1023
1017
  message: "Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
1024
1018
  }
1025
1019
  };
@@ -1461,12 +1455,12 @@ var PublicInputChecker = class {
1461
1455
  const facematchParameterCommitment = isForEVM ? await getFacematchEvmParameterCommitment(
1462
1456
  BigInt(facematchCommittedInputs.rootKeyLeaf),
1463
1457
  facematchCommittedInputs.environment === "development" ? 0n : 1n,
1464
- BigInt(facematchCommittedInputs.appId),
1458
+ BigInt(facematchCommittedInputs.appIdHash),
1465
1459
  facematchCommittedInputs.mode === "regular" ? 1n : 2n
1466
1460
  ) : await getFacematchParameterCommitment(
1467
1461
  BigInt(facematchCommittedInputs.rootKeyLeaf),
1468
1462
  facematchCommittedInputs.environment === "development" ? 0n : 1n,
1469
- BigInt(facematchCommittedInputs.appId),
1463
+ BigInt(facematchCommittedInputs.appIdHash),
1470
1464
  facematchCommittedInputs.mode === "regular" ? 1n : 2n
1471
1465
  );
1472
1466
  if (!paramCommitments.includes(facematchParameterCommitment)) {
@@ -2056,7 +2050,7 @@ var PublicInputChecker = class {
2056
2050
  const calculatedParamCommitment = await getFacematchParameterCommitment(
2057
2051
  BigInt(facematchCommittedInputs.rootKeyLeaf),
2058
2052
  facematchCommittedInputs.environment === "development" ? 0n : 1n,
2059
- BigInt(facematchCommittedInputs.appId),
2053
+ BigInt(facematchCommittedInputs.appIdHash),
2060
2054
  facematchCommittedInputs.mode === "regular" ? 1n : 2n
2061
2055
  );
2062
2056
  if (paramCommittment !== calculatedParamCommitment) {
@@ -1,4 +1,4 @@
1
- declare const VERSION = "0.9.1";
1
+ declare const VERSION = "0.10.0";
2
2
  declare const DEFAULT_VALIDITY: number;
3
3
  declare const DEFAULT_DATE_VALUE: Date;
4
4
  declare const ZKPASSPORT_IOS_APP_ID_HASH = "0x1fa73686cf510f8f85757b0602de0dd72a13e68ae2092462be8b72662e7f179b";
@@ -6,7 +6,7 @@ import {
6
6
  VERSION,
7
7
  ZKPASSPORT_ANDROID_APP_ID_HASH,
8
8
  ZKPASSPORT_IOS_APP_ID_HASH
9
- } from "./chunk-VJZDMGW3.js";
9
+ } from "./chunk-JG37KYXW.js";
10
10
  export {
11
11
  APPLE_APP_ATTEST_ROOT_KEY_HASH,
12
12
  DEFAULT_DATE_VALUE,
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-OOHOBXGU.js";
6
+ } from "./chunk-O7ZONMCQ.js";
7
7
  import {
8
8
  SolidityVerifier
9
- } from "./chunk-OTQ7QDA2.js";
9
+ } from "./chunk-I7PGO4XY.js";
10
10
  import {
11
11
  DEFAULT_VALIDITY,
12
12
  VERSION
13
- } from "./chunk-VJZDMGW3.js";
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 { BarretenbergVerifier } = await import("@aztec/bb.js");
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 BarretenbergVerifier({
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 = isOuterEVM ? proof.name.replace("outer_evm_", "outer_") : proof.name;
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.verifyUltraHonkProof(
529
- {
530
- proof: Buffer.from(proofData.proof.join(""), "hex"),
531
- publicInputs: proofData.publicInputs
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;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  PublicInputChecker
3
- } from "./chunk-OOHOBXGU.js";
4
- import "./chunk-VJZDMGW3.js";
3
+ } from "./chunk-O7ZONMCQ.js";
4
+ import "./chunk-JG37KYXW.js";
5
5
  export {
6
6
  PublicInputChecker
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SolidityVerifier
3
- } from "./chunk-OTQ7QDA2.js";
4
- import "./chunk-VJZDMGW3.js";
3
+ } from "./chunk-I7PGO4XY.js";
4
+ import "./chunk-JG37KYXW.js";
5
5
  export {
6
6
  SolidityVerifier
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkpassport/sdk",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
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": "1.0.0-nightly.20250723",
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
38
  "@obsidion/bridge": "^0.10.4",
39
- "@zkpassport/registry": "0.10.2",
40
- "@zkpassport/utils": "0.24.2",
39
+ "@zkpassport/registry": "0.11.1",
40
+ "@zkpassport/utils": "0.25.2",
41
41
  "buffer": "^6.0.3",
42
42
  "i18n-iso-countries": "^7.12.0",
43
43
  "pako": "^2.1.0",