@zkpassport/sdk 0.9.0 → 0.9.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 +10 -4
- package/dist/cjs/constants.d.cts +5 -3
- package/dist/cjs/index.cjs +731 -725
- package/dist/cjs/index.d.cts +1 -1
- package/dist/cjs/public-input-checker.cjs +61 -54
- package/dist/cjs/solidity-verifier.cjs +669 -670
- package/dist/cjs/types.d.cts +11 -2
- package/dist/esm/{chunk-BUYJZSHP.js → chunk-OOHOBXGU.js} +62 -55
- package/dist/esm/chunk-OTQ7QDA2.js +2541 -0
- package/dist/esm/chunk-VJZDMGW3.js +18 -0
- 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 +3 -3
- 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 +1 -1
- package/dist/esm/chunk-JITNXEQS.js +0 -2542
- package/dist/esm/chunk-XOQW7AOQ.js +0 -14
package/dist/cjs/types.d.cts
CHANGED
|
@@ -21,17 +21,26 @@ type QueryResultErrors = {
|
|
|
21
21
|
scope?: QueryResultError<string>;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
type
|
|
24
|
+
type SolidityProofVerificationData = {
|
|
25
25
|
vkeyHash: string;
|
|
26
26
|
proof: string;
|
|
27
27
|
publicInputs: string[];
|
|
28
|
+
};
|
|
29
|
+
type SolidityCommitments = {
|
|
28
30
|
committedInputs: string;
|
|
29
31
|
committedInputCounts: number[];
|
|
32
|
+
};
|
|
33
|
+
type SolidityServiceConfig = {
|
|
30
34
|
validityPeriodInSeconds: number;
|
|
31
35
|
domain: string;
|
|
32
36
|
scope: string;
|
|
33
37
|
devMode: boolean;
|
|
34
38
|
};
|
|
39
|
+
type SolidityVerifierParameters = {
|
|
40
|
+
proofVerificationData: SolidityProofVerificationData;
|
|
41
|
+
commitments: SolidityCommitments;
|
|
42
|
+
serviceConfig: SolidityServiceConfig;
|
|
43
|
+
};
|
|
35
44
|
type QueryBuilderResult = {
|
|
36
45
|
/**
|
|
37
46
|
* The URL of the request.
|
|
@@ -188,4 +197,4 @@ type QueryBuilder = {
|
|
|
188
197
|
done: () => QueryBuilderResult;
|
|
189
198
|
};
|
|
190
199
|
|
|
191
|
-
export type { QueryBuilder, QueryBuilderResult, QueryResultError, QueryResultErrors, SolidityVerifierParameters };
|
|
200
|
+
export type { QueryBuilder, QueryBuilderResult, QueryResultError, QueryResultErrors, SolidityCommitments, SolidityProofVerificationData, SolidityServiceConfig, SolidityVerifierParameters };
|
|
@@ -2,8 +2,10 @@ import {
|
|
|
2
2
|
APPLE_APP_ATTEST_ROOT_KEY_HASH,
|
|
3
3
|
DEFAULT_DATE_VALUE,
|
|
4
4
|
DEFAULT_VALIDITY,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH,
|
|
6
|
+
ZKPASSPORT_ANDROID_APP_ID_HASH,
|
|
7
|
+
ZKPASSPORT_IOS_APP_ID_HASH
|
|
8
|
+
} from "./chunk-VJZDMGW3.js";
|
|
7
9
|
|
|
8
10
|
// src/public-input-checker.ts
|
|
9
11
|
import {
|
|
@@ -62,14 +64,9 @@ var PublicInputChecker = class {
|
|
|
62
64
|
static checkDiscloseBytesPublicInputs(proof, queryResult) {
|
|
63
65
|
const queryResultErrors = {};
|
|
64
66
|
let isCorrect = true;
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
);
|
|
69
|
-
const disclosedDataIDCard = DisclosedData.fromDisclosedBytes(
|
|
70
|
-
(proof.committedInputs?.disclose_bytes).disclosedBytes,
|
|
71
|
-
"id_card"
|
|
72
|
-
);
|
|
67
|
+
const disclosedBytes = (proof.committedInputs?.disclose_bytes).disclosedBytes ?? (proof.committedInputs?.disclose_bytes_evm).disclosedBytes;
|
|
68
|
+
const disclosedDataPassport = DisclosedData.fromDisclosedBytes(disclosedBytes, "passport");
|
|
69
|
+
const disclosedDataIDCard = DisclosedData.fromDisclosedBytes(disclosedBytes, "id_card");
|
|
73
70
|
if (queryResult.document_type) {
|
|
74
71
|
if (queryResult.document_type.eq && queryResult.document_type.eq.result && queryResult.document_type.eq.expected !== disclosedDataPassport.documentType) {
|
|
75
72
|
console.warn("Document type does not match the expected document type");
|
|
@@ -364,10 +361,10 @@ var PublicInputChecker = class {
|
|
|
364
361
|
0
|
|
365
362
|
);
|
|
366
363
|
const minAge = getMinAgeFromCommittedInputs(
|
|
367
|
-
proof.committedInputs?.compare_age
|
|
364
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
368
365
|
);
|
|
369
366
|
const maxAge = getMaxAgeFromCommittedInputs(
|
|
370
|
-
proof.committedInputs?.compare_age
|
|
367
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
371
368
|
);
|
|
372
369
|
if (queryResult.age) {
|
|
373
370
|
if (queryResult.age.gte && queryResult.age.gte.result && minAge !== queryResult.age.gte.expected) {
|
|
@@ -455,7 +452,7 @@ var PublicInputChecker = class {
|
|
|
455
452
|
};
|
|
456
453
|
}
|
|
457
454
|
const currentDate = getCurrentDateFromCommittedInputs(
|
|
458
|
-
proof.committedInputs?.compare_age
|
|
455
|
+
proof.committedInputs?.compare_age ?? proof.committedInputs?.compare_age_evm
|
|
459
456
|
);
|
|
460
457
|
if (!areDatesEqual(currentDate, today) && !areDatesEqual(currentDate, today.getTime() - 864e5)) {
|
|
461
458
|
console.warn("Current date in the proof is too old");
|
|
@@ -484,15 +481,15 @@ var PublicInputChecker = class {
|
|
|
484
481
|
0
|
|
485
482
|
);
|
|
486
483
|
const minDate = getBirthdateMinDateTimestamp(
|
|
487
|
-
proof.committedInputs?.compare_birthdate,
|
|
484
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm,
|
|
488
485
|
-1 * SECONDS_BETWEEN_1900_AND_1970
|
|
489
486
|
);
|
|
490
487
|
const maxDate = getBirthdateMaxDateTimestamp(
|
|
491
|
-
proof.committedInputs?.compare_birthdate,
|
|
488
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm,
|
|
492
489
|
-1 * SECONDS_BETWEEN_1900_AND_1970
|
|
493
490
|
);
|
|
494
491
|
const currentDate = getCurrentDateFromCommittedInputs(
|
|
495
|
-
proof.committedInputs?.compare_birthdate
|
|
492
|
+
proof.committedInputs?.compare_birthdate ?? proof.committedInputs?.compare_birthdate_evm
|
|
496
493
|
);
|
|
497
494
|
if (queryResult.birthdate) {
|
|
498
495
|
if (queryResult.birthdate.gte && queryResult.birthdate.gte.result && !areDatesEqual(minDate, queryResult.birthdate.gte.expected)) {
|
|
@@ -594,13 +591,13 @@ var PublicInputChecker = class {
|
|
|
594
591
|
0
|
|
595
592
|
);
|
|
596
593
|
const minDate = getMinDateFromCommittedInputs(
|
|
597
|
-
proof.committedInputs?.compare_expiry
|
|
594
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
598
595
|
);
|
|
599
596
|
const maxDate = getMaxDateFromCommittedInputs(
|
|
600
|
-
proof.committedInputs?.compare_expiry
|
|
597
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
601
598
|
);
|
|
602
599
|
const currentDate = getCurrentDateFromCommittedInputs(
|
|
603
|
-
proof.committedInputs?.compare_expiry
|
|
600
|
+
proof.committedInputs?.compare_expiry ?? proof.committedInputs?.compare_expiry_evm
|
|
604
601
|
);
|
|
605
602
|
if (queryResult.expiry_date) {
|
|
606
603
|
if (queryResult.expiry_date.gte && queryResult.expiry_date.gte.result && !areDatesEqual(minDate, queryResult.expiry_date.gte.expected)) {
|
|
@@ -982,19 +979,25 @@ var PublicInputChecker = class {
|
|
|
982
979
|
let isCorrect = true;
|
|
983
980
|
let queryResultErrors = {};
|
|
984
981
|
if (queryResult.facematch && queryResult.facematch.passed) {
|
|
985
|
-
if (facematchCommittedInputs.rootKeyLeaf !== APPLE_APP_ATTEST_ROOT_KEY_HASH) {
|
|
982
|
+
if (facematchCommittedInputs.rootKeyLeaf !== APPLE_APP_ATTEST_ROOT_KEY_HASH && facematchCommittedInputs.rootKeyLeaf !== GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH) {
|
|
986
983
|
console.warn("Invalid facematch root key hash");
|
|
987
984
|
isCorrect = false;
|
|
988
985
|
queryResultErrors.facematch = {
|
|
989
986
|
...queryResultErrors.facematch,
|
|
990
987
|
eq: {
|
|
991
|
-
expected: APPLE_APP_ATTEST_ROOT_KEY_HASH
|
|
988
|
+
expected: `${APPLE_APP_ATTEST_ROOT_KEY_HASH} (iOS) or ${GOOGLE_APP_ATTEST_RSA_ROOT_KEY_HASH} (Android)`,
|
|
992
989
|
received: facematchCommittedInputs.rootKeyLeaf,
|
|
993
990
|
message: "Invalid facematch root key hash"
|
|
994
991
|
}
|
|
995
992
|
};
|
|
996
993
|
}
|
|
997
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
|
+
);
|
|
998
1001
|
if (facematchCommittedInputs.environment !== EXPECTED_ENVIRONMENT) {
|
|
999
1002
|
console.warn("Invalid facematch environment, it should be production");
|
|
1000
1003
|
isCorrect = false;
|
|
@@ -1007,7 +1010,7 @@ var PublicInputChecker = class {
|
|
|
1007
1010
|
}
|
|
1008
1011
|
};
|
|
1009
1012
|
}
|
|
1010
|
-
if (facematchCommittedInputs.appId !==
|
|
1013
|
+
if (facematchCommittedInputs.appId !== ZKPASSPORT_IOS_APP_ID_HASH && facematchCommittedInputs.appId !== ZKPASSPORT_ANDROID_APP_ID_HASH) {
|
|
1011
1014
|
console.warn(
|
|
1012
1015
|
"Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
|
|
1013
1016
|
);
|
|
@@ -1015,7 +1018,7 @@ var PublicInputChecker = class {
|
|
|
1015
1018
|
queryResultErrors.facematch = {
|
|
1016
1019
|
...queryResultErrors.facematch,
|
|
1017
1020
|
eq: {
|
|
1018
|
-
expected:
|
|
1021
|
+
expected: `${ZKPASSPORT_IOS_APP_ID_HASH} (iOS) or ${ZKPASSPORT_ANDROID_APP_ID_HASH} (Android)`,
|
|
1019
1022
|
received: facematchCommittedInputs.appId,
|
|
1020
1023
|
message: "Invalid facematch app id hash, the attestation should be coming from the ZKPassport app"
|
|
1021
1024
|
}
|
|
@@ -1149,8 +1152,8 @@ var PublicInputChecker = class {
|
|
|
1149
1152
|
}
|
|
1150
1153
|
};
|
|
1151
1154
|
}
|
|
1152
|
-
if (!!committedInputs?.compare_age) {
|
|
1153
|
-
const ageCommittedInputs = committedInputs?.compare_age;
|
|
1155
|
+
if (!!committedInputs?.compare_age || !!committedInputs?.compare_age_evm) {
|
|
1156
|
+
const ageCommittedInputs = committedInputs?.compare_age ?? committedInputs?.compare_age_evm;
|
|
1154
1157
|
const ageParameterCommitment = isForEVM ? await getAgeEVMParameterCommitment(
|
|
1155
1158
|
ageCommittedInputs.currentDateTimestamp,
|
|
1156
1159
|
ageCommittedInputs.minAge,
|
|
@@ -1178,8 +1181,9 @@ var PublicInputChecker = class {
|
|
|
1178
1181
|
...queryResultErrors,
|
|
1179
1182
|
...queryResultErrorsAge
|
|
1180
1183
|
};
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1184
|
+
}
|
|
1185
|
+
if (!!committedInputs?.compare_birthdate || !!committedInputs?.compare_birthdate_evm) {
|
|
1186
|
+
const birthdateCommittedInputs = committedInputs?.compare_birthdate ?? committedInputs?.compare_birthdate_evm;
|
|
1183
1187
|
const birthdateParameterCommitment = isForEVM ? await getDateEVMParameterCommitment(
|
|
1184
1188
|
ProofType.BIRTHDATE,
|
|
1185
1189
|
birthdateCommittedInputs.currentDateTimestamp,
|
|
@@ -1211,8 +1215,9 @@ var PublicInputChecker = class {
|
|
|
1211
1215
|
...queryResultErrors,
|
|
1212
1216
|
...queryResultErrorsBirthdate
|
|
1213
1217
|
};
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1218
|
+
}
|
|
1219
|
+
if (!!committedInputs?.compare_expiry || !!committedInputs?.compare_expiry_evm) {
|
|
1220
|
+
const expiryCommittedInputs = committedInputs?.compare_expiry ?? committedInputs?.compare_expiry_evm;
|
|
1216
1221
|
const expiryParameterCommitment = isForEVM ? await getDateEVMParameterCommitment(
|
|
1217
1222
|
ProofType.EXPIRY_DATE,
|
|
1218
1223
|
expiryCommittedInputs.currentDateTimestamp,
|
|
@@ -1242,8 +1247,9 @@ var PublicInputChecker = class {
|
|
|
1242
1247
|
...queryResultErrors,
|
|
1243
1248
|
...queryResultErrorsExpiryDate
|
|
1244
1249
|
};
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1250
|
+
}
|
|
1251
|
+
if (!!committedInputs?.disclose_bytes || !!committedInputs?.disclose_bytes_evm) {
|
|
1252
|
+
const discloseCommittedInputs = committedInputs?.disclose_bytes ?? committedInputs?.disclose_bytes_evm;
|
|
1247
1253
|
const discloseParameterCommitment = isForEVM ? await getDiscloseEVMParameterCommitment(
|
|
1248
1254
|
discloseCommittedInputs.discloseMask,
|
|
1249
1255
|
discloseCommittedInputs.disclosedBytes
|
|
@@ -1269,8 +1275,9 @@ var PublicInputChecker = class {
|
|
|
1269
1275
|
...queryResultErrors,
|
|
1270
1276
|
...queryResultErrorsDisclose
|
|
1271
1277
|
};
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1278
|
+
}
|
|
1279
|
+
if (!!committedInputs?.inclusion_check_nationality || !!committedInputs?.inclusion_check_nationality_evm) {
|
|
1280
|
+
const inclusionCheckNationalityCommittedInputs = committedInputs?.inclusion_check_nationality ?? committedInputs?.inclusion_check_nationality_evm;
|
|
1274
1281
|
const inclusionCheckNationalityParameterCommitment = isForEVM ? await getCountryEVMParameterCommitment(
|
|
1275
1282
|
ProofType.NATIONALITY_INCLUSION,
|
|
1276
1283
|
inclusionCheckNationalityCommittedInputs.countries
|
|
@@ -1300,8 +1307,9 @@ var PublicInputChecker = class {
|
|
|
1300
1307
|
...queryResultErrors,
|
|
1301
1308
|
...queryResultErrorsNationalityInclusion
|
|
1302
1309
|
};
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1310
|
+
}
|
|
1311
|
+
if (!!committedInputs?.inclusion_check_issuing_country || !!committedInputs?.inclusion_check_issuing_country_evm) {
|
|
1312
|
+
const inclusionCheckIssuingCountryCommittedInputs = committedInputs?.inclusion_check_issuing_country ?? committedInputs?.inclusion_check_issuing_country_evm;
|
|
1305
1313
|
const inclusionCheckIssuingCountryParameterCommitment = isForEVM ? await getCountryEVMParameterCommitment(
|
|
1306
1314
|
ProofType.ISSUING_COUNTRY_INCLUSION,
|
|
1307
1315
|
inclusionCheckIssuingCountryCommittedInputs.countries
|
|
@@ -1331,8 +1339,9 @@ var PublicInputChecker = class {
|
|
|
1331
1339
|
...queryResultErrors,
|
|
1332
1340
|
...queryResultErrorsIssuingCountryInclusion
|
|
1333
1341
|
};
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1342
|
+
}
|
|
1343
|
+
if (!!committedInputs?.exclusion_check_nationality || !!committedInputs?.exclusion_check_nationality_evm) {
|
|
1344
|
+
const exclusionCheckNationalityCommittedInputs = committedInputs?.exclusion_check_nationality ?? committedInputs?.exclusion_check_nationality_evm;
|
|
1336
1345
|
const exclusionCheckNationalityParameterCommitment = isForEVM ? await getCountryEVMParameterCommitment(
|
|
1337
1346
|
ProofType.NATIONALITY_EXCLUSION,
|
|
1338
1347
|
exclusionCheckNationalityCommittedInputs.countries
|
|
@@ -1362,8 +1371,9 @@ var PublicInputChecker = class {
|
|
|
1362
1371
|
...queryResultErrors,
|
|
1363
1372
|
...queryResultErrorsNationalityExclusion
|
|
1364
1373
|
};
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1374
|
+
}
|
|
1375
|
+
if (!!committedInputs?.exclusion_check_issuing_country || !!committedInputs?.exclusion_check_issuing_country_evm) {
|
|
1376
|
+
const exclusionCheckIssuingCountryCommittedInputs = committedInputs?.exclusion_check_issuing_country ?? committedInputs?.exclusion_check_issuing_country_evm;
|
|
1367
1377
|
const exclusionCheckIssuingCountryParameterCommitment = isForEVM ? await getCountryEVMParameterCommitment(
|
|
1368
1378
|
ProofType.ISSUING_COUNTRY_EXCLUSION,
|
|
1369
1379
|
exclusionCheckIssuingCountryCommittedInputs.countries
|
|
@@ -1393,8 +1403,9 @@ var PublicInputChecker = class {
|
|
|
1393
1403
|
...queryResultErrors,
|
|
1394
1404
|
...queryResultErrorsIssuingCountryExclusion
|
|
1395
1405
|
};
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1406
|
+
}
|
|
1407
|
+
if (!!committedInputs?.bind || !!committedInputs?.bind_evm) {
|
|
1408
|
+
const bindCommittedInputs = committedInputs?.bind ?? committedInputs?.bind_evm;
|
|
1398
1409
|
const bindParameterCommitment = isForEVM ? await getBindEVMParameterCommitment(formatBoundData(bindCommittedInputs.data)) : await getBindParameterCommitment(formatBoundData(bindCommittedInputs.data));
|
|
1399
1410
|
if (!paramCommitments.includes(bindParameterCommitment)) {
|
|
1400
1411
|
console.warn("This proof does not verify the bound data");
|
|
@@ -1414,9 +1425,10 @@ var PublicInputChecker = class {
|
|
|
1414
1425
|
...queryResultErrors,
|
|
1415
1426
|
...queryResultErrorsBind
|
|
1416
1427
|
};
|
|
1417
|
-
}
|
|
1428
|
+
}
|
|
1429
|
+
if (!!committedInputs?.exclusion_check_sanctions || !!committedInputs?.exclusion_check_sanctions_evm) {
|
|
1418
1430
|
const sanctionsBuilder = await SanctionsBuilder.create();
|
|
1419
|
-
const exclusionCheckSanctionsCommittedInputs = committedInputs?.exclusion_check_sanctions;
|
|
1431
|
+
const exclusionCheckSanctionsCommittedInputs = committedInputs?.exclusion_check_sanctions ?? committedInputs?.exclusion_check_sanctions_evm;
|
|
1420
1432
|
const exclusionCheckSanctionsParameterCommitment = isForEVM ? await sanctionsBuilder.getSanctionsEvmParameterCommitment() : await sanctionsBuilder.getSanctionsParameterCommitment();
|
|
1421
1433
|
if (!paramCommitments.includes(exclusionCheckSanctionsParameterCommitment)) {
|
|
1422
1434
|
console.warn("This proof does not verify the exclusion from the sanction lists");
|
|
@@ -1443,22 +1455,19 @@ var PublicInputChecker = class {
|
|
|
1443
1455
|
...queryResultErrors,
|
|
1444
1456
|
...queryResultErrorsSanctionsExclusion
|
|
1445
1457
|
};
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1458
|
+
}
|
|
1459
|
+
if (!!committedInputs?.facematch || !!committedInputs?.facematch_evm) {
|
|
1460
|
+
const facematchCommittedInputs = committedInputs?.facematch ?? committedInputs?.facematch_evm;
|
|
1448
1461
|
const facematchParameterCommitment = isForEVM ? await getFacematchEvmParameterCommitment(
|
|
1449
1462
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
1450
1463
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
1451
1464
|
BigInt(facematchCommittedInputs.appId),
|
|
1452
|
-
|
|
1453
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
1454
|
-
1n
|
|
1465
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
1455
1466
|
) : await getFacematchParameterCommitment(
|
|
1456
1467
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
1457
1468
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
1458
1469
|
BigInt(facematchCommittedInputs.appId),
|
|
1459
|
-
|
|
1460
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
1461
|
-
1n
|
|
1470
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
1462
1471
|
);
|
|
1463
1472
|
if (!paramCommitments.includes(facematchParameterCommitment)) {
|
|
1464
1473
|
console.warn("This proof does not verify FaceMatch");
|
|
@@ -2041,16 +2050,14 @@ var PublicInputChecker = class {
|
|
|
2041
2050
|
};
|
|
2042
2051
|
uniqueIdentifier = getNullifierFromDisclosureProof(proofData).toString(10);
|
|
2043
2052
|
uniqueIdentifierType = getNullifierTypeFromDisclosureProof(proofData);
|
|
2044
|
-
} else if (proof.name
|
|
2053
|
+
} else if (proof.name?.startsWith("facematch") && !proof.name?.endsWith("_evm")) {
|
|
2045
2054
|
const facematchCommittedInputs = proof.committedInputs?.facematch;
|
|
2046
2055
|
const paramCommittment = getParameterCommitmentFromDisclosureProof(proofData);
|
|
2047
2056
|
const calculatedParamCommitment = await getFacematchParameterCommitment(
|
|
2048
2057
|
BigInt(facematchCommittedInputs.rootKeyLeaf),
|
|
2049
2058
|
facematchCommittedInputs.environment === "development" ? 0n : 1n,
|
|
2050
2059
|
BigInt(facematchCommittedInputs.appId),
|
|
2051
|
-
|
|
2052
|
-
// facematchCommittedInputs.mode === "regular" ? 1n : 2n,
|
|
2053
|
-
1n
|
|
2060
|
+
facematchCommittedInputs.mode === "regular" ? 1n : 2n
|
|
2054
2061
|
);
|
|
2055
2062
|
if (paramCommittment !== calculatedParamCommitment) {
|
|
2056
2063
|
console.warn("The FaceMatch verification does not match the ones from the proof");
|