@zkpassport/sdk 0.9.0 → 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.
- package/dist/cjs/constants.cjs +10 -4
- package/dist/cjs/constants.d.cts +5 -3
- package/dist/cjs/index.cjs +765 -737
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/public-input-checker.cjs +59 -58
- package/dist/cjs/solidity-verifier.cjs +692 -667
- package/dist/cjs/types.d.cts +11 -2
- package/dist/esm/chunk-I7PGO4XY.js +2567 -0
- package/dist/esm/chunk-JG37KYXW.js +18 -0
- package/dist/esm/{chunk-BUYJZSHP.js → chunk-O7ZONMCQ.js} +60 -59
- package/dist/esm/constants.d.ts +5 -3
- package/dist/esm/constants.js +7 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +16 -14
- package/dist/esm/public-input-checker.js +2 -2
- package/dist/esm/solidity-verifier.js +2 -2
- package/dist/esm/types.d.ts +11 -2
- package/package.json +4 -4
- package/dist/esm/chunk-JITNXEQS.js +0 -2542
- package/dist/esm/chunk-XOQW7AOQ.js +0 -14
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryBuilder, QueryResultErrors, SolidityVerifierParameters } from './types.cjs';
|
|
2
|
-
export { QueryBuilderResult, QueryResultError } from './types.cjs';
|
|
2
|
+
export { QueryBuilderResult, QueryResultError, SolidityCommitments, SolidityProofVerificationData, SolidityServiceConfig } from './types.cjs';
|
|
3
3
|
import { ProofMode, ProofResult, QueryResult, NullifierType, SupportedChain } from '@zkpassport/utils';
|
|
4
4
|
export * from '@zkpassport/utils';
|
|
5
5
|
export { ASEAN_COUNTRIES, EEA_COUNTRIES, EU_COUNTRIES, MERCOSUR_COUNTRIES, SANCTIONED_COUNTRIES, SCHENGEN_COUNTRIES } from '@zkpassport/utils';
|
|
@@ -29,22 +29,19 @@ var import_registry = require("@zkpassport/registry");
|
|
|
29
29
|
// src/constants.ts
|
|
30
30
|
var DEFAULT_VALIDITY = 7 * 24 * 60 * 60;
|
|
31
31
|
var DEFAULT_DATE_VALUE = /* @__PURE__ */ new Date(0);
|
|
32
|
-
var
|
|
32
|
+
var ZKPASSPORT_IOS_APP_ID_HASH = "0x1fa73686cf510f8f85757b0602de0dd72a13e68ae2092462be8b72662e7f179b";
|
|
33
|
+
var ZKPASSPORT_ANDROID_APP_ID_HASH = "0x24d9929b248be7eeecaa98e105c034a50539610f3fdd4cb9c8983ef4100d615d";
|
|
33
34
|
var APPLE_APP_ATTEST_ROOT_KEY_HASH = "0x2532418a107c5306fa8308c22255792cf77e4a290cbce8a840a642a3e591340b";
|
|
35
|
+
var GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH = "0x16700a2d9168a194fc85f237af5829b5a2be05b8ae8ac4879ada34cf54a9c211";
|
|
34
36
|
|
|
35
37
|
// src/public-input-checker.ts
|
|
36
38
|
var PublicInputChecker = class {
|
|
37
39
|
static checkDiscloseBytesPublicInputs(proof, queryResult) {
|
|
38
40
|
const queryResultErrors = {};
|
|
39
41
|
let isCorrect = true;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
44
|
-
const disclosedDataIDCard = import_utils.DisclosedData.fromDisclosedBytes(
|
|
45
|
-
(proof.committedInputs?.disclose_bytes).disclosedBytes,
|
|
46
|
-
"id_card"
|
|
47
|
-
);
|
|
42
|
+
const disclosedBytes = (proof.committedInputs?.disclose_bytes).disclosedBytes ?? (proof.committedInputs?.disclose_bytes_evm).disclosedBytes;
|
|
43
|
+
const disclosedDataPassport = import_utils.DisclosedData.fromDisclosedBytes(disclosedBytes, "passport");
|
|
44
|
+
const disclosedDataIDCard = import_utils.DisclosedData.fromDisclosedBytes(disclosedBytes, "id_card");
|
|
48
45
|
if (queryResult.document_type) {
|
|
49
46
|
if (queryResult.document_type.eq && queryResult.document_type.eq.result && queryResult.document_type.eq.expected !== disclosedDataPassport.documentType) {
|
|
50
47
|
console.warn("Document type does not match the expected document type");
|
|
@@ -339,10 +336,10 @@ var PublicInputChecker = class {
|
|
|
339
336
|
0
|
|
340
337
|
);
|
|
341
338
|
const minAge = (0, import_utils.getMinAgeFromCommittedInputs)(
|
|
342
|
-
proof.committedInputs?.compare_age
|
|
339
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
343
340
|
);
|
|
344
341
|
const maxAge = (0, import_utils.getMaxAgeFromCommittedInputs)(
|
|
345
|
-
proof.committedInputs?.compare_age
|
|
342
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
346
343
|
);
|
|
347
344
|
if (queryResult.age) {
|
|
348
345
|
if (queryResult.age.gte && queryResult.age.gte.result && minAge !== queryResult.age.gte.expected) {
|
|
@@ -430,7 +427,7 @@ var PublicInputChecker = class {
|
|
|
430
427
|
};
|
|
431
428
|
}
|
|
432
429
|
const currentDate = (0, import_utils.getCurrentDateFromCommittedInputs)(
|
|
433
|
-
proof.committedInputs?.compare_age
|
|
430
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
434
431
|
);
|
|
435
432
|
if (!(0, import_utils.areDatesEqual)(currentDate, today) && !(0, import_utils.areDatesEqual)(currentDate, today.getTime() - 864e5)) {
|
|
436
433
|
console.warn("Current date in the proof is too old");
|
|
@@ -459,15 +456,15 @@ var PublicInputChecker = class {
|
|
|
459
456
|
0
|
|
460
457
|
);
|
|
461
458
|
const minDate = (0, import_utils.getBirthdateMinDateTimestamp)(
|
|
462
|
-
proof.committedInputs?.compare_birthdate,
|
|
459
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm,
|
|
463
460
|
-1 * import_utils.SECONDS_BETWEEN_1900_AND_1970
|
|
464
461
|
);
|
|
465
462
|
const maxDate = (0, import_utils.getBirthdateMaxDateTimestamp)(
|
|
466
|
-
proof.committedInputs?.compare_birthdate,
|
|
463
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm,
|
|
467
464
|
-1 * import_utils.SECONDS_BETWEEN_1900_AND_1970
|
|
468
465
|
);
|
|
469
466
|
const currentDate = (0, import_utils.getCurrentDateFromCommittedInputs)(
|
|
470
|
-
proof.committedInputs?.compare_birthdate
|
|
467
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm
|
|
471
468
|
);
|
|
472
469
|
if (queryResult.birthdate) {
|
|
473
470
|
if (queryResult.birthdate.gte && queryResult.birthdate.gte.result && !(0, import_utils.areDatesEqual)(minDate, queryResult.birthdate.gte.expected)) {
|
|
@@ -569,13 +566,13 @@ var PublicInputChecker = class {
|
|
|
569
566
|
0
|
|
570
567
|
);
|
|
571
568
|
const minDate = (0, import_utils.getMinDateFromCommittedInputs)(
|
|
572
|
-
proof.committedInputs?.compare_expiry
|
|
569
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
573
570
|
);
|
|
574
571
|
const maxDate = (0, import_utils.getMaxDateFromCommittedInputs)(
|
|
575
|
-
proof.committedInputs?.compare_expiry
|
|
572
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
576
573
|
);
|
|
577
574
|
const currentDate = (0, import_utils.getCurrentDateFromCommittedInputs)(
|
|
578
|
-
proof.committedInputs?.compare_expiry
|
|
575
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
579
576
|
);
|
|
580
577
|
if (queryResult.expiry_date) {
|
|
581
578
|
if (queryResult.expiry_date.gte && queryResult.expiry_date.gte.result && !(0, import_utils.areDatesEqual)(minDate, queryResult.expiry_date.gte.expected)) {
|
|
@@ -957,13 +954,13 @@ var PublicInputChecker = class {
|
|
|
957
954
|
let isCorrect = true;
|
|
958
955
|
let queryResultErrors = {};
|
|
959
956
|
if (queryResult.facematch && queryResult.facematch.passed) {
|
|
960
|
-
if (facematchCommittedInputs.rootKeyLeaf !== APPLE_APP_ATTEST_ROOT_KEY_HASH) {
|
|
957
|
+
if (facematchCommittedInputs.rootKeyLeaf !== APPLE_APP_ATTEST_ROOT_KEY_HASH && facematchCommittedInputs.rootKeyLeaf !== GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH) {
|
|
961
958
|
console.warn("Invalid facematch root key hash");
|
|
962
959
|
isCorrect = false;
|
|
963
960
|
queryResultErrors.facematch = {
|
|
964
961
|
...queryResultErrors.facematch,
|
|
965
962
|
eq: {
|
|
966
|
-
expected: APPLE_APP_ATTEST_ROOT_KEY_HASH
|
|
963
|
+
expected: `${APPLE_APP_ATTEST_ROOT_KEY_HASH} (iOS) or ${GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH} (Android)`,
|
|
967
964
|
received: facematchCommittedInputs.rootKeyLeaf,
|
|
968
965
|
message: "Invalid facematch root key hash"
|
|
969
966
|
}
|
|
@@ -982,7 +979,7 @@ var PublicInputChecker = class {
|
|
|
982
979
|
}
|
|
983
980
|
};
|
|
984
981
|
}
|
|
985
|
-
if (facematchCommittedInputs.
|
|
982
|
+
if (facematchCommittedInputs.appIdHash !== ZKPASSPORT_IOS_APP_ID_HASH && facematchCommittedInputs.appIdHash !== ZKPASSPORT_ANDROID_APP_ID_HASH) {
|
|
986
983
|
console.warn(
|
|
987
984
|
"Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
|
|
988
985
|
);
|
|
@@ -990,8 +987,8 @@ var PublicInputChecker = class {
|
|
|
990
987
|
queryResultErrors.facematch = {
|
|
991
988
|
...queryResultErrors.facematch,
|
|
992
989
|
eq: {
|
|
993
|
-
expected:
|
|
994
|
-
received: facematchCommittedInputs.
|
|
990
|
+
expected: `${ZKPASSPORT_IOS_APP_ID_HASH} (iOS) or ${ZKPASSPORT_ANDROID_APP_ID_HASH} (Android)`,
|
|
991
|
+
received: facematchCommittedInputs.appIdHash,
|
|
995
992
|
message: "Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
|
|
996
993
|
}
|
|
997
994
|
};
|
|
@@ -1124,8 +1121,8 @@ var PublicInputChecker = class {
|
|
|
1124
1121
|
}
|
|
1125
1122
|
};
|
|
1126
1123
|
}
|
|
1127
|
-
if (!!committedInputs?.compare_age) {
|
|
1128
|
-
const ageCommittedInputs = committedInputs?.compare_age;
|
|
1124
|
+
if (!!committedInputs?.compare_age || !!committedInputs?.compare_age_evm) {
|
|
1125
|
+
const ageCommittedInputs = committedInputs?.compare_age ?? committedInputs?.compare_age_evm;
|
|
1129
1126
|
const ageParameterCommitment = isForEVM ? await (0, import_utils.getAgeEVMParameterCommitment)(
|
|
1130
1127
|
ageCommittedInputs.currentDateTimestamp,
|
|
1131
1128
|
ageCommittedInputs.minAge,
|
|
@@ -1153,8 +1150,9 @@ var PublicInputChecker = class {
|
|
|
1153
1150
|
...queryResultErrors,
|
|
1154
1151
|
...queryResultErrorsAge
|
|
1155
1152
|
};
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1153
|
+
}
|
|
1154
|
+
if (!!committedInputs?.compare_birthdate || !!committedInputs?.compare_birthdate_evm) {
|
|
1155
|
+
const birthdateCommittedInputs = committedInputs?.compare_birthdate ?? committedInputs?.compare_birthdate_evm;
|
|
1158
1156
|
const birthdateParameterCommitment = isForEVM ? await (0, import_utils.getDateEVMParameterCommitment)(
|
|
1159
1157
|
import_utils.ProofType.BIRTHDATE,
|
|
1160
1158
|
birthdateCommittedInputs.currentDateTimestamp,
|
|
@@ -1186,8 +1184,9 @@ var PublicInputChecker = class {
|
|
|
1186
1184
|
...queryResultErrors,
|
|
1187
1185
|
...queryResultErrorsBirthdate
|
|
1188
1186
|
};
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1187
|
+
}
|
|
1188
|
+
if (!!committedInputs?.compare_expiry || !!committedInputs?.compare_expiry_evm) {
|
|
1189
|
+
const expiryCommittedInputs = committedInputs?.compare_expiry ?? committedInputs?.compare_expiry_evm;
|
|
1191
1190
|
const expiryParameterCommitment = isForEVM ? await (0, import_utils.getDateEVMParameterCommitment)(
|
|
1192
1191
|
import_utils.ProofType.EXPIRY_DATE,
|
|
1193
1192
|
expiryCommittedInputs.currentDateTimestamp,
|
|
@@ -1217,8 +1216,9 @@ var PublicInputChecker = class {
|
|
|
1217
1216
|
...queryResultErrors,
|
|
1218
1217
|
...queryResultErrorsExpiryDate
|
|
1219
1218
|
};
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1219
|
+
}
|
|
1220
|
+
if (!!committedInputs?.disclose_bytes || !!committedInputs?.disclose_bytes_evm) {
|
|
1221
|
+
const discloseCommittedInputs = committedInputs?.disclose_bytes ?? committedInputs?.disclose_bytes_evm;
|
|
1222
1222
|
const discloseParameterCommitment = isForEVM ? await (0, import_utils.getDiscloseEVMParameterCommitment)(
|
|
1223
1223
|
discloseCommittedInputs.discloseMask,
|
|
1224
1224
|
discloseCommittedInputs.disclosedBytes
|
|
@@ -1244,8 +1244,9 @@ var PublicInputChecker = class {
|
|
|
1244
1244
|
...queryResultErrors,
|
|
1245
1245
|
...queryResultErrorsDisclose
|
|
1246
1246
|
};
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1247
|
+
}
|
|
1248
|
+
if (!!committedInputs?.inclusion_check_nationality || !!committedInputs?.inclusion_check_nationality_evm) {
|
|
1249
|
+
const inclusionCheckNationalityCommittedInputs = committedInputs?.inclusion_check_nationality ?? committedInputs?.inclusion_check_nationality_evm;
|
|
1249
1250
|
const inclusionCheckNationalityParameterCommitment = isForEVM ? await (0, import_utils.getCountryEVMParameterCommitment)(
|
|
1250
1251
|
import_utils.ProofType.NATIONALITY_INCLUSION,
|
|
1251
1252
|
inclusionCheckNationalityCommittedInputs.countries
|
|
@@ -1275,8 +1276,9 @@ var PublicInputChecker = class {
|
|
|
1275
1276
|
...queryResultErrors,
|
|
1276
1277
|
...queryResultErrorsNationalityInclusion
|
|
1277
1278
|
};
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1279
|
+
}
|
|
1280
|
+
if (!!committedInputs?.inclusion_check_issuing_country || !!committedInputs?.inclusion_check_issuing_country_evm) {
|
|
1281
|
+
const inclusionCheckIssuingCountryCommittedInputs = committedInputs?.inclusion_check_issuing_country ?? committedInputs?.inclusion_check_issuing_country_evm;
|
|
1280
1282
|
const inclusionCheckIssuingCountryParameterCommitment = isForEVM ? await (0, import_utils.getCountryEVMParameterCommitment)(
|
|
1281
1283
|
import_utils.ProofType.ISSUING_COUNTRY_INCLUSION,
|
|
1282
1284
|
inclusionCheckIssuingCountryCommittedInputs.countries
|
|
@@ -1306,8 +1308,9 @@ var PublicInputChecker = class {
|
|
|
1306
1308
|
...queryResultErrors,
|
|
1307
1309
|
...queryResultErrorsIssuingCountryInclusion
|
|
1308
1310
|
};
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
+
}
|
|
1312
|
+
if (!!committedInputs?.exclusion_check_nationality || !!committedInputs?.exclusion_check_nationality_evm) {
|
|
1313
|
+
const exclusionCheckNationalityCommittedInputs = committedInputs?.exclusion_check_nationality ?? committedInputs?.exclusion_check_nationality_evm;
|
|
1311
1314
|
const exclusionCheckNationalityParameterCommitment = isForEVM ? await (0, import_utils.getCountryEVMParameterCommitment)(
|
|
1312
1315
|
import_utils.ProofType.NATIONALITY_EXCLUSION,
|
|
1313
1316
|
exclusionCheckNationalityCommittedInputs.countries
|
|
@@ -1337,8 +1340,9 @@ var PublicInputChecker = class {
|
|
|
1337
1340
|
...queryResultErrors,
|
|
1338
1341
|
...queryResultErrorsNationalityExclusion
|
|
1339
1342
|
};
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1343
|
+
}
|
|
1344
|
+
if (!!committedInputs?.exclusion_check_issuing_country || !!committedInputs?.exclusion_check_issuing_country_evm) {
|
|
1345
|
+
const exclusionCheckIssuingCountryCommittedInputs = committedInputs?.exclusion_check_issuing_country ?? committedInputs?.exclusion_check_issuing_country_evm;
|
|
1342
1346
|
const exclusionCheckIssuingCountryParameterCommitment = isForEVM ? await (0, import_utils.getCountryEVMParameterCommitment)(
|
|
1343
1347
|
import_utils.ProofType.ISSUING_COUNTRY_EXCLUSION,
|
|
1344
1348
|
exclusionCheckIssuingCountryCommittedInputs.countries
|
|
@@ -1368,8 +1372,9 @@ var PublicInputChecker = class {
|
|
|
1368
1372
|
...queryResultErrors,
|
|
1369
1373
|
...queryResultErrorsIssuingCountryExclusion
|
|
1370
1374
|
};
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1375
|
+
}
|
|
1376
|
+
if (!!committedInputs?.bind || !!committedInputs?.bind_evm) {
|
|
1377
|
+
const bindCommittedInputs = committedInputs?.bind ?? committedInputs?.bind_evm;
|
|
1373
1378
|
const bindParameterCommitment = isForEVM ? await (0, import_utils.getBindEVMParameterCommitment)((0, import_utils.formatBoundData)(bindCommittedInputs.data)) : await (0, import_utils.getBindParameterCommitment)((0, import_utils.formatBoundData)(bindCommittedInputs.data));
|
|
1374
1379
|
if (!paramCommitments.includes(bindParameterCommitment)) {
|
|
1375
1380
|
console.warn("This proof does not verify the bound data");
|
|
@@ -1389,9 +1394,10 @@ var PublicInputChecker = class {
|
|
|
1389
1394
|
...queryResultErrors,
|
|
1390
1395
|
...queryResultErrorsBind
|
|
1391
1396
|
};
|
|
1392
|
-
}
|
|
1397
|
+
}
|
|
1398
|
+
if (!!committedInputs?.exclusion_check_sanctions || !!committedInputs?.exclusion_check_sanctions_evm) {
|
|
1393
1399
|
const sanctionsBuilder = await import_utils.SanctionsBuilder.create();
|
|
1394
|
-
const exclusionCheckSanctionsCommittedInputs = committedInputs?.exclusion_check_sanctions;
|
|
1400
|
+
const exclusionCheckSanctionsCommittedInputs = committedInputs?.exclusion_check_sanctions ?? committedInputs?.exclusion_check_sanctions_evm;
|
|
1395
1401
|
const exclusionCheckSanctionsParameterCommitment = isForEVM ? await sanctionsBuilder.getSanctionsEvmParameterCommitment() : await sanctionsBuilder.getSanctionsParameterCommitment();
|
|
1396
1402
|
if (!paramCommitments.includes(exclusionCheckSanctionsParameterCommitment)) {
|
|
1397
1403
|
console.warn("This proof does not verify the exclusion from the sanction lists");
|
|
@@ -1418,22 +1424,19 @@ var PublicInputChecker = class {
|
|
|
1418
1424
|
...queryResultErrors,
|
|
1419
1425
|
...queryResultErrorsSanctionsExclusion
|
|
1420
1426
|
};
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1427
|
+
}
|
|
1428
|
+
if (!!committedInputs?.facematch || !!committedInputs?.facematch_evm) {
|
|
1429
|
+
const facematchCommittedInputs = committedInputs?.facematch ?? committedInputs?.facematch_evm;
|
|
1423
1430
|
const facematchParameterCommitment = isForEVM ? await (0, import_utils.getFacematchEvmParameterCommitment)(
|
|
1424
1431
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
1425
1432
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
1426
|
-
BigInt(facematchCommittedInputs.
|
|
1427
|
-
|
|
1428
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
1429
|
-
1n
|
|
1433
|
+
BigInt(facematchCommittedInputs.appIdHash),
|
|
1434
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
1430
1435
|
) : await (0, import_utils.getFacematchParameterCommitment)(
|
|
1431
1436
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
1432
1437
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
1433
|
-
BigInt(facematchCommittedInputs.
|
|
1434
|
-
|
|
1435
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
1436
|
-
1n
|
|
1438
|
+
BigInt(facematchCommittedInputs.appIdHash),
|
|
1439
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
1437
1440
|
);
|
|
1438
1441
|
if (!paramCommitments.includes(facematchParameterCommitment)) {
|
|
1439
1442
|
console.warn("This proof does not verify FaceMatch");
|
|
@@ -2016,16 +2019,14 @@ var PublicInputChecker = class {
|
|
|
2016
2019
|
};
|
|
2017
2020
|
uniqueIdentifier = (0, import_utils.getNullifierFromDisclosureProof)(proofData).toString(10);
|
|
2018
2021
|
uniqueIdentifierType = (0, import_utils.getNullifierTypeFromDisclosureProof)(proofData);
|
|
2019
|
-
} else if (proof.name
|
|
2022
|
+
} else if (proof.name?.startsWith("facematch") && !proof.name?.endsWith("_evm")) {
|
|
2020
2023
|
const facematchCommittedInputs = proof.committedInputs?.facematch;
|
|
2021
2024
|
const paramCommittment = (0, import_utils.getParameterCommitmentFromDisclosureProof)(proofData);
|
|
2022
2025
|
const calculatedParamCommitment = await (0, import_utils.getFacematchParameterCommitment)(
|
|
2023
2026
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
2024
2027
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
2025
|
-
BigInt(facematchCommittedInputs.
|
|
2026
|
-
|
|
2027
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
2028
|
-
1n
|
|
2028
|
+
BigInt(facematchCommittedInputs.appIdHash),
|
|
2029
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
2029
2030
|
);
|
|
2030
2031
|
if (paramCommittment !== calculatedParamCommitment) {
|
|
2031
2032
|
console.warn("The FaceMatch verification does not match the ones from the proof");
|