@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.
@@ -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";
@@ -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-6FIXE2II.js";
7
7
  import {
8
8
  SolidityVerifier
9
- } from "./chunk-OTQ7QDA2.js";
9
+ } from "./chunk-7UUZHRZ3.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;
@@ -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;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  PublicInputChecker
3
- } from "./chunk-OOHOBXGU.js";
4
- import "./chunk-VJZDMGW3.js";
3
+ } from "./chunk-6FIXE2II.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-7UUZHRZ3.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.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": "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
- "@obsidion/bridge": "^0.10.4",
39
- "@zkpassport/registry": "0.10.2",
40
- "@zkpassport/utils": "0.24.2",
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",