diff --git a/nightfall-client/src/classes/commitment.mjs b/nightfall-client/src/classes/commitment.mjs index 77afe9963..b508f824b 100644 --- a/nightfall-client/src/classes/commitment.mjs +++ b/nightfall-client/src/classes/commitment.mjs @@ -34,7 +34,7 @@ class Commitment { // we encode the top four bytes of the tokenId into the empty bytes at the top of the erc address. // this is consistent to what we do in the ZKP circuits const [top4Bytes, remainder] = this.preimage.tokenId.limbs(224, 2).map(l => BigInt(l)); - const SHIFT = 2923003274661805836407369665432566039311865085952n; + const SHIFT = 1461501637330902918203684832716283019655932542976n; this.hash = poseidon( generalise([ this.preimage.ercAddress.bigInt + top4Bytes * SHIFT, diff --git a/nightfall-deployer/circuits/deposit.zok b/nightfall-deployer/circuits/deposit.zok index ec40686f9..3057e57dd 100644 --- a/nightfall-deployer/circuits/deposit.zok +++ b/nightfall-deployer/circuits/deposit.zok @@ -10,8 +10,8 @@ from "./common/casts/u32_array_to_field.zok" import main as u32_array_to_field type Point = field[2] -// 2 ^ 161 -const field SHIFT = 2923003274661805836407369665432566039311865085952 +// 2 ^ 160 +const field SHIFT = 1461501637330902918203684832716283019655932542976 def main(\ field ercContractAddress,\ diff --git a/nightfall-deployer/circuits/double_transfer.zok b/nightfall-deployer/circuits/double_transfer.zok index 1233fcd11..489fa31b9 100644 --- a/nightfall-deployer/circuits/double_transfer.zok +++ b/nightfall-deployer/circuits/double_transfer.zok @@ -14,8 +14,8 @@ from "./common/merkle-tree/path-check.zok" import main as pathCheck type Point = field[2] -// 2 ^ 161 -const field SHIFT = 2923003274661805836407369665432566039311865085952 +// 2 ^ 160 +const field SHIFT = 1461501637330902918203684832716283019655932542976 struct OldCommitmentPreimage { u32[8] id diff --git a/nightfall-deployer/circuits/single_transfer.zok b/nightfall-deployer/circuits/single_transfer.zok index 987be63d3..2bc3b406b 100644 --- a/nightfall-deployer/circuits/single_transfer.zok +++ b/nightfall-deployer/circuits/single_transfer.zok @@ -14,8 +14,8 @@ from "./common/casts/u32_array_to_field.zok" import main as u32_array_to_field type Point = field[2] -// 2 ^ 161 -const field SHIFT = 2923003274661805836407369665432566039311865085952 +// 2 ^ 160 +const field SHIFT = 1461501637330902918203684832716283019655932542976 struct OldCommitmentPreimage { u32[8] id diff --git a/nightfall-deployer/circuits/withdraw.zok b/nightfall-deployer/circuits/withdraw.zok index 689ec4f68..12898c34e 100644 --- a/nightfall-deployer/circuits/withdraw.zok +++ b/nightfall-deployer/circuits/withdraw.zok @@ -10,8 +10,8 @@ from "./common/casts/u32_array_to_field.zok" import main as u32_array_to_field from "hashes/poseidon/poseidon.zok" import main as poseidon from "./common/merkle-tree/path-check.zok" import main as pathCheck -// 2 ^ 161 -const field SHIFT = 2923003274661805836407369665432566039311865085952 +// 2 ^ 160 +const field SHIFT = 1461501637330902918203684832716283019655932542976 struct OldCommitmentPreimage { field salt