diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index a047ff3bce0..b2146dd56d0 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -146,6 +146,22 @@ library Constants { uint256 internal constant MULTI_CALL_ENTRYPOINT_ADDRESS = 4; uint256 internal constant FEE_JUICE_ADDRESS = 5; uint256 internal constant ROUTER_ADDRESS = 6; + uint256 internal constant DEFAULT_NPK_M_X = + 582240093077765400562621227108555700500271598878376310175765873770292988861; + uint256 internal constant DEFAULT_NPK_M_Y = + 10422444662424639723529825114205836958711284159673861467999592572974769103684; + uint256 internal constant DEFAULT_IVPK_M_X = + 339708709767762472786445938838804872781183545349360029270386718856175781484; + uint256 internal constant DEFAULT_IVPK_M_Y = + 12719619215050539905199178334954929730355853796706924300730604757520758976849; + uint256 internal constant DEFAULT_OVPK_M_X = + 12212787719617305570587928860288475454328008955283046946846066128763901043335; + uint256 internal constant DEFAULT_OVPK_M_Y = + 3646747884782549389807830220601404629716007431341772952958971658285958854707; + uint256 internal constant DEFAULT_TPK_M_X = + 728059161893070741164607238299536939695876538801885465230641192969135857403; + uint256 internal constant DEFAULT_TPK_M_Y = + 14575718736702206050102425029229426215631664471161015518982549597389390371695; uint256 internal constant AZTEC_ADDRESS_LENGTH = 1; uint256 internal constant GAS_FEES_LENGTH = 2; uint256 internal constant GAS_LENGTH = 2; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr index 7a680ae9601..3c4617157bc 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -238,6 +238,22 @@ global MULTI_CALL_ENTRYPOINT_ADDRESS = AztecAddress::from_field(4); global FEE_JUICE_ADDRESS = AztecAddress::from_field(5); global ROUTER_ADDRESS = AztecAddress::from_field(6); +// CANONICAL DEFAULT KEYS +// This below are: +// "az_null_npk" +// "az_null_ivpk" +// "az_null_ovpk" +// "az_null_tpk" +// as bytes, hashed to curve using grumpkin::g1::affine_element::hash_to_curve(, 0); +global DEFAULT_NPK_M_X = 0x01498945581e0eb9f8427ad6021184c700ef091d570892c437d12c7d90364bbd; +global DEFAULT_NPK_M_Y = 0x170ae506787c5c43d6ca9255d571c10fa9ffa9d141666e290c347c5c9ab7e344; +global DEFAULT_IVPK_M_X = 0x00c044b05b6ca83b9c2dbae79cc1135155956a64e136819136e9947fe5e5866c; +global DEFAULT_IVPK_M_Y = 0x1c1f0ca244c7cd46b682552bff8ae77dea40b966a71de076ec3b7678f2bdb151; +global DEFAULT_OVPK_M_X = 0x1b00316144359e9a3ec8e49c1cdb7eeb0cedd190dfd9dc90eea5115aa779e287; +global DEFAULT_OVPK_M_Y = 0x080ffc74d7a8b0bccb88ac11f45874172f3847eb8b92654aaa58a3d2b8dc7833; +global DEFAULT_TPK_M_X = 0x019c111f36ad3fc1d9b7a7a14344314d2864b94f030594cd67f753ef774a1efb; +global DEFAULT_TPK_M_Y = 0x2039907fe37f08d10739255141bb066c506a12f7d1e8dfec21abc58494705b6f; + // LENGTH OF STRUCTS SERIALIZED TO FIELDS global AZTEC_ADDRESS_LENGTH: u32 = 1; global GAS_FEES_LENGTH: u32 = 2; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr b/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr index c3097bc56b6..e2d69df59ec 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr @@ -1,10 +1,16 @@ use crate::{ - address::public_keys_hash::PublicKeysHash, constants::GENERATOR_INDEX__PUBLIC_KEYS_HASH, - hash::poseidon2_hash_with_separator, point::POINT_LENGTH, - traits::{Deserialize, Serialize, Empty, is_empty, Hash}, + address::public_keys_hash::PublicKeysHash, + constants::{ + GENERATOR_INDEX__PUBLIC_KEYS_HASH, DEFAULT_NPK_M_X, DEFAULT_NPK_M_Y, DEFAULT_IVPK_M_X, + DEFAULT_IVPK_M_Y, DEFAULT_OVPK_M_X, DEFAULT_OVPK_M_Y, DEFAULT_TPK_M_X, DEFAULT_TPK_M_Y +}, + hash::poseidon2_hash_with_separator, point::POINT_LENGTH, traits::{Deserialize, Serialize, Hash} }; use dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point; +use dep::std::embedded_curve_ops::fixed_base_scalar_mul as derive_public_key; +use std::embedded_curve_ops::EmbeddedCurveScalar; +use std::default::Default; pub global PUBLIC_KEYS_LENGTH: u32 = 12; @@ -96,13 +102,13 @@ impl Serialize for TpkM { } } -impl Empty for PublicKeys { - fn empty() -> Self { +impl Default for PublicKeys { + fn default() -> Self { PublicKeys { - npk_m: NpkM { inner: Point::empty() }, - ivpk_m: IvpkM { inner: Point::empty() }, - ovpk_m: OvpkM { inner: Point::empty() }, - tpk_m: TpkM { inner: Point::empty() }, + npk_m: NpkM { inner: Point { x: DEFAULT_NPK_M_X, y: DEFAULT_NPK_M_Y, is_infinite: false } }, + ivpk_m: IvpkM { inner: Point { x: DEFAULT_IVPK_M_X, y: DEFAULT_IVPK_M_Y, is_infinite: false } }, + ovpk_m: OvpkM { inner: Point { x: DEFAULT_OVPK_M_X, y: DEFAULT_OVPK_M_Y, is_infinite: false } }, + tpk_m: TpkM { inner: Point { x: DEFAULT_TPK_M_X, y: DEFAULT_TPK_M_Y, is_infinite: false } } } } } @@ -117,16 +123,22 @@ impl Eq for PublicKeys { } impl PublicKeys { + pub fn is_empty(self) -> bool { + PublicKeys { + npk_m: NpkM { inner: Point::empty() }, + ivpk_m: IvpkM { inner: Point::empty() }, + ovpk_m: OvpkM { inner: Point::empty() }, + tpk_m: TpkM { inner: Point::empty() } + }.eq(self) + } + pub fn hash(self) -> PublicKeysHash { PublicKeysHash::from_field( - if is_empty(self) { + if self.is_empty() { 0 } else { - poseidon2_hash_with_separator( - self.serialize(), - GENERATOR_INDEX__PUBLIC_KEYS_HASH as Field, - ) - }, + poseidon2_hash_with_separator(self.serialize(), GENERATOR_INDEX__PUBLIC_KEYS_HASH as Field) + } ) } } @@ -202,13 +214,13 @@ unconstrained fn compute_public_keys_hash() { } #[test] -unconstrained fn compute_empty_hash() { - let keys = PublicKeys::empty(); +unconstrained fn compute_default_hash() { + let keys = PublicKeys::default(); let actual = keys.hash(); - let test_data_empty_hash = 0x0000000000000000000000000000000000000000000000000000000000000000; + let test_data_default_hash = 0x2ed36bfe5497fb6aa79ff85ed6657da92c17d50ac1ab5960e79a78c33687156f; - assert(actual.to_field() == test_data_empty_hash); + assert(actual.to_field() == test_data_default_hash); } #[test] diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr index f1cab7bfdca..ad244b94ba5 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr @@ -1330,7 +1330,7 @@ impl Empty for FixtureBuilder { returns_hash: 0, function_leaf_membership_witness: MembershipWitness::empty(), salted_initialization_hash: SaltedInitializationHash::from_field(0), - public_keys: PublicKeys::empty(), + public_keys: PublicKeys::default(), contract_class_artifact_hash: 0, contract_class_public_bytecode_commitment: 0, acir_hash: 0, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr index 4bf18e15d19..c854adeec7f 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr @@ -32,7 +32,7 @@ global default_contract = ContractData { contract_class_id: ContractClassId { inner: 0x28e91aaf764bc6083e2796ff884079ad895d4b948d6ce8f37f01b29d0bc95a21, }, - public_keys: PublicKeys::empty(), + public_keys: PublicKeys::default(), salted_initialization_hash: SaltedInitializationHash { inner: 0x13a939daa511233e5446905ed2cadbee14948fa75df183b53b5c14b612bffe88, }, @@ -56,7 +56,7 @@ global parent_contract = ContractData { contract_class_id: ContractClassId { inner: 0x00236b0dc6c537d5106543053c5b85c4cbe95b0474f8238b094bae63f1cbcfee, }, - public_keys: PublicKeys::empty(), + public_keys: PublicKeys::default(), salted_initialization_hash: SaltedInitializationHash { inner: 0x24bd6ac7a182e2cf25e437c72f53544ef81dfd97d9afee23abb07a638e7be749, }, @@ -70,7 +70,8 @@ pub fn get_protocol_contract(index: u32) -> ContractData { let artifact_hash = 576576 + seed; let salted_initialization_hash = SaltedInitializationHash { inner: 281972 + seed }; let public_bytecode_commitment = 38383 + seed; - let public_keys = PublicKeys::empty(); + // Empty public keys here will throw an error when doing ec ops + let public_keys = PublicKeys::default(); let function = get_protocol_contract_function(index); let private_functions_root = private_functions_root_from_siblings( diff --git a/yarn-project/aztec.js/src/contract/contract.ts b/yarn-project/aztec.js/src/contract/contract.ts index efa673794e8..708b220386e 100644 --- a/yarn-project/aztec.js/src/contract/contract.ts +++ b/yarn-project/aztec.js/src/contract/contract.ts @@ -38,7 +38,7 @@ export class Contract extends ContractBase { */ public static deploy(wallet: Wallet, artifact: ContractArtifact, args: any[], constructorName?: string) { const postDeployCtor = (address: AztecAddress, wallet: Wallet) => Contract.at(address, artifact, wallet); - return new DeployMethod(PublicKeys.empty(), wallet, artifact, postDeployCtor, args, constructorName); + return new DeployMethod(PublicKeys.default(), wallet, artifact, postDeployCtor, args, constructorName); } /** diff --git a/yarn-project/aztec.js/src/deployment/contract_deployer.ts b/yarn-project/aztec.js/src/deployment/contract_deployer.ts index 86545368e8e..f45dfd186e2 100644 --- a/yarn-project/aztec.js/src/deployment/contract_deployer.ts +++ b/yarn-project/aztec.js/src/deployment/contract_deployer.ts @@ -29,7 +29,7 @@ export class ContractDeployer { public deploy(...args: any[]) { const postDeployCtor = (address: AztecAddress, wallet: Wallet) => Contract.at(address, this.artifact, wallet); return new DeployMethod( - this.publicKeys ?? PublicKeys.empty(), + this.publicKeys ?? PublicKeys.default(), this.wallet, this.artifact, postDeployCtor, diff --git a/yarn-project/aztec/src/cli/cmds/start_pxe.ts b/yarn-project/aztec/src/cli/cmds/start_pxe.ts index fe9126f0319..bffece2414c 100644 --- a/yarn-project/aztec/src/cli/cmds/start_pxe.ts +++ b/yarn-project/aztec/src/cli/cmds/start_pxe.ts @@ -105,7 +105,7 @@ export async function addPXE( address, deployer: AztecAddress.ZERO, contractClassId: getContractClassFromArtifact(artifact!).id, - publicKeys: PublicKeys.empty(), + publicKeys: PublicKeys.default(), }; userLog(`Registering ${name} at ${address.toString()}`); await pxe.registerContract({ artifact, instance }); diff --git a/yarn-project/builder/src/contract-interface-gen/typescript.ts b/yarn-project/builder/src/contract-interface-gen/typescript.ts index 34c06fab270..200337cb22b 100644 --- a/yarn-project/builder/src/contract-interface-gen/typescript.ts +++ b/yarn-project/builder/src/contract-interface-gen/typescript.ts @@ -84,7 +84,7 @@ function generateDeploy(input: ContractArtifact) { * Creates a tx to deploy a new instance of this contract. */ public static deploy(wallet: Wallet, ${args}) { - return new DeployMethod<${contractName}>(PublicKeys.empty(), wallet, ${artifactName}, ${contractName}.at, Array.from(arguments).slice(1)); + return new DeployMethod<${contractName}>(PublicKeys.default(), wallet, ${artifactName}, ${contractName}.at, Array.from(arguments).slice(1)); } /** @@ -102,7 +102,7 @@ function generateDeploy(input: ContractArtifact) { ...args: Parameters<${contractName}['methods'][M]> ) { return new DeployMethod<${contractName}>( - opts.publicKeys ?? PublicKeys.empty(), + opts.publicKeys ?? PublicKeys.default(), opts.wallet, ${artifactName}, ${contractName}.at, diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 73680d79e42..de32b6c7b5c 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -131,6 +131,14 @@ export const REGISTERER_CONTRACT_ADDRESS = 3; export const MULTI_CALL_ENTRYPOINT_ADDRESS = 4; export const FEE_JUICE_ADDRESS = 5; export const ROUTER_ADDRESS = 6; +export const DEFAULT_NPK_M_X = 582240093077765400562621227108555700500271598878376310175765873770292988861n; +export const DEFAULT_NPK_M_Y = 10422444662424639723529825114205836958711284159673861467999592572974769103684n; +export const DEFAULT_IVPK_M_X = 339708709767762472786445938838804872781183545349360029270386718856175781484n; +export const DEFAULT_IVPK_M_Y = 12719619215050539905199178334954929730355853796706924300730604757520758976849n; +export const DEFAULT_OVPK_M_X = 12212787719617305570587928860288475454328008955283046946846066128763901043335n; +export const DEFAULT_OVPK_M_Y = 3646747884782549389807830220601404629716007431341772952958971658285958854707n; +export const DEFAULT_TPK_M_X = 728059161893070741164607238299536939695876538801885465230641192969135857403n; +export const DEFAULT_TPK_M_Y = 14575718736702206050102425029229426215631664471161015518982549597389390371695n; export const AZTEC_ADDRESS_LENGTH = 1; export const GAS_FEES_LENGTH = 2; export const GAS_LENGTH = 2; diff --git a/yarn-project/circuits.js/src/contract/contract_instance.ts b/yarn-project/circuits.js/src/contract/contract_instance.ts index 49a5f413481..84241bb5c54 100644 --- a/yarn-project/circuits.js/src/contract/contract_instance.ts +++ b/yarn-project/circuits.js/src/contract/contract_instance.ts @@ -5,7 +5,7 @@ import { getDefaultInitializer, } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; -import { Fr } from '@aztec/foundation/fields'; +import { Fr, Point } from '@aztec/foundation/fields'; import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize'; import { type FieldsOf } from '@aztec/foundation/types'; @@ -80,6 +80,7 @@ export class SerializableContractInstance { }); } + // This is only used for test purposes. PublicKeys like below will fail in normal use due to the points not being on the curve during ec ops. static empty() { return new SerializableContractInstance({ version: VERSION, @@ -87,7 +88,7 @@ export class SerializableContractInstance { deployer: AztecAddress.zero(), contractClassId: Fr.zero(), initializationHash: Fr.zero(), - publicKeys: PublicKeys.empty(), + publicKeys: new PublicKeys(Point.ZERO, Point.ZERO, Point.ZERO, Point.ZERO), }); } } @@ -122,7 +123,7 @@ export function getContractInstanceFromDeployParams( args, ) : computeInitializationHash(constructorArtifact, args); - const publicKeys = opts.publicKeys ?? PublicKeys.empty(); + const publicKeys = opts.publicKeys ?? PublicKeys.default(); const instance: ContractInstance = { contractClassId, diff --git a/yarn-project/circuits.js/src/types/public_keys.test.ts b/yarn-project/circuits.js/src/types/public_keys.test.ts index 51902c7cc1e..64a75b0966e 100644 --- a/yarn-project/circuits.js/src/types/public_keys.test.ts +++ b/yarn-project/circuits.js/src/types/public_keys.test.ts @@ -16,16 +16,24 @@ describe('PublicKeys', () => { expect(hash).toMatchInlineSnapshot(`"0x0fecd9a32db731fec1fded1b9ff957a1625c069245a3613a2538bd527068b0ad"`); // Run with AZTEC_GENERATE_TEST_DATA=1 to update noir test data - updateInlineTestData('noir-projects/aztec-nr/aztec/src/keys/public_keys.nr', 'expected_public_keys_hash', hash); + updateInlineTestData( + 'noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr', + 'expected_public_keys_hash', + hash, + ); }); - it('computes empty keys hash', () => { - const keys = PublicKeys.empty(); + it('computes default keys hash', () => { + const keys = PublicKeys.default(); const hash = keys.hash().toString(); - expect(hash).toMatchInlineSnapshot(`"0x0000000000000000000000000000000000000000000000000000000000000000"`); + expect(hash).toMatchInlineSnapshot(`"0x2ed36bfe5497fb6aa79ff85ed6657da92c17d50ac1ab5960e79a78c33687156f"`); // Run with AZTEC_GENERATE_TEST_DATA=1 to update noir test data - updateInlineTestData('noir-projects/aztec-nr/aztec/src/keys/public_keys.nr', 'test_data_empty_hash', hash); + updateInlineTestData( + 'noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr', + 'test_data_default_hash', + hash, + ); }); }); diff --git a/yarn-project/circuits.js/src/types/public_keys.ts b/yarn-project/circuits.js/src/types/public_keys.ts index 57bb3400d50..06253c2f1d0 100644 --- a/yarn-project/circuits.js/src/types/public_keys.ts +++ b/yarn-project/circuits.js/src/types/public_keys.ts @@ -1,8 +1,19 @@ import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto'; -import { Fr, Point } from '@aztec/foundation/fields'; +import { Fq, Fr, Point } from '@aztec/foundation/fields'; import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize'; -import { GeneratorIndex } from '../constants.gen.js'; +import { + DEFAULT_IVPK_M_X, + DEFAULT_IVPK_M_Y, + DEFAULT_NPK_M_X, + DEFAULT_NPK_M_Y, + DEFAULT_OVPK_M_X, + DEFAULT_OVPK_M_Y, + DEFAULT_TPK_M_X, + DEFAULT_TPK_M_Y, + GeneratorIndex, +} from '../constants.gen.js'; +import { derivePublicKeyFromSecretKey } from '../keys/derivation.js'; import { type PublicKey } from './public_key.js'; export class PublicKeys { @@ -41,8 +52,13 @@ export class PublicKeys { ); } - static empty(): PublicKeys { - return new PublicKeys(Point.ZERO, Point.ZERO, Point.ZERO, Point.ZERO); + static default(): PublicKeys { + return new PublicKeys( + new Point(new Fr(DEFAULT_NPK_M_X), new Fr(DEFAULT_NPK_M_Y), false), + new Point(new Fr(DEFAULT_IVPK_M_X), new Fr(DEFAULT_IVPK_M_Y), false), + new Point(new Fr(DEFAULT_OVPK_M_X), new Fr(DEFAULT_OVPK_M_Y), false), + new Point(new Fr(DEFAULT_TPK_M_X), new Fr(DEFAULT_TPK_M_Y), false), + ); } static random(): PublicKeys { diff --git a/yarn-project/cli-wallet/src/cmds/deploy.ts b/yarn-project/cli-wallet/src/cmds/deploy.ts index 71d131d444b..d105e8e5063 100644 --- a/yarn-project/cli-wallet/src/cmds/deploy.ts +++ b/yarn-project/cli-wallet/src/cmds/deploy.ts @@ -37,7 +37,7 @@ export async function deploy( ); } - const deployer = new ContractDeployer(contractArtifact, wallet, publicKeys ?? PublicKeys.empty(), initializer); + const deployer = new ContractDeployer(contractArtifact, wallet, publicKeys ?? PublicKeys.default(), initializer); let args = []; if (rawArgs.length > 0) { diff --git a/yarn-project/cli/src/cmds/pxe/add_contract.ts b/yarn-project/cli/src/cmds/pxe/add_contract.ts index 5298eeeb182..3904930d04c 100644 --- a/yarn-project/cli/src/cmds/pxe/add_contract.ts +++ b/yarn-project/cli/src/cmds/pxe/add_contract.ts @@ -23,7 +23,7 @@ export async function addContract( salt, initializationHash, contractClassId: getContractClassFromArtifact(artifact).id, - publicKeys: publicKeys ?? PublicKeys.empty(), + publicKeys: publicKeys ?? PublicKeys.default(), address, deployer: deployer ?? AztecAddress.ZERO, }; diff --git a/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap b/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap index 4c362396bb2..424e22ee776 100644 --- a/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap +++ b/yarn-project/noir-protocol-circuits-types/src/__snapshots__/noir_test_gen.test.ts.snap @@ -6,10 +6,10 @@ exports[`Data generation for noir tests Computes contract info for defaultContra artifact_hash: 0x0000000000000000000000000000000000000000000000000000000000003039, public_bytecode_commitment: 0x0000000000000000000000000000000000000000000000000000000000000005, private_functions_root: 0x25d76df45434ec75a83321daf941cfc667ff3a9027942e17105da4f50d1d13f9, - address: AztecAddress { inner: 0x1119ce64278d82d5178d977b0921630b2834045c8dc4bec257813bcbafdddb57 }, + address: AztecAddress { inner: 0x2ae2dcc65d0b82cc94f1890b16ff60fb7c9f0833b776fc7a519ce6bda2a64893 }, partial_address: PartialAddress { inner: 0x0cf203c94c91bed28440b00ecd888d88cce1f86ddf2aa8d33acbb9b6fc06d382 }, contract_class_id: ContractClassId { inner: 0x28e91aaf764bc6083e2796ff884079ad895d4b948d6ce8f37f01b29d0bc95a21 }, - public_keys: PublicKeys { inner: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 }, + public_keys: PublicKeys { inner: 00000000000000000000000000000000000000000000000000000000000000010000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c06ce1b0827aafa85ddeb49cdaa36306d19a74caa311e13d46d8bc688cdbffffe1c122f81a3a14964909ede0ba2a6855fc93faf6fa1a788bf467be7e7a43f80ac2941b0928df1b9480273773b36397da3e495430a2a7a3857661bc7a446c94f4d13ae7e938c892308bef0f45ee7386daa2d3b447349a7d0a11b5aa4cfbe69072c01b06105d7dc31e315550bc6bf0e4e5e7148034f7b957a514537d8c21b2db26a02c095b9dcadf22a6f64bbcb78a223b6e04014a8c8697eccbcf6b35d44452003 }, salted_initialization_hash: SaltedInitializationHash { inner: 0x13a939daa511233e5446905ed2cadbee14948fa75df183b53b5c14b612bffe88 }, deployer: AztecAddress { inner: 0x0000000000000000000000000000000000000000000000000000000000000000 } }" @@ -21,10 +21,10 @@ exports[`Data generation for noir tests Computes contract info for parentContrac artifact_hash: 0x00000000000000000000000000000000000000000000000000000000000004bc, public_bytecode_commitment: 0x0000000000000000000000000000000000000000000000000000000000000005, private_functions_root: 0x1228b39ba6702af03e595300e8484c6373f00790d0148cc3d4ff0fd1c778a83a, - address: AztecAddress { inner: 0x218802a34637b05632108fedc42176dfce00e4daa8aa9aeadbf09f8c7069267a }, + address: AztecAddress { inner: 0x190db417e88cd709dab4b82dbbe4e696d939dcd48c3dead80498ed34e6f96d98 }, partial_address: PartialAddress { inner: 0x245df9f519d616473880260dd64b19a838081bb44dc17cd6ea5d870a63d2bf57 }, contract_class_id: ContractClassId { inner: 0x00236b0dc6c537d5106543053c5b85c4cbe95b0474f8238b094bae63f1cbcfee }, - public_keys: PublicKeys { inner: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 }, + public_keys: PublicKeys { inner: 00000000000000000000000000000000000000000000000000000000000000010000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c06ce1b0827aafa85ddeb49cdaa36306d19a74caa311e13d46d8bc688cdbffffe1c122f81a3a14964909ede0ba2a6855fc93faf6fa1a788bf467be7e7a43f80ac2941b0928df1b9480273773b36397da3e495430a2a7a3857661bc7a446c94f4d13ae7e938c892308bef0f45ee7386daa2d3b447349a7d0a11b5aa4cfbe69072c01b06105d7dc31e315550bc6bf0e4e5e7148034f7b957a514537d8c21b2db26a02c095b9dcadf22a6f64bbcb78a223b6e04014a8c8697eccbcf6b35d44452003 }, salted_initialization_hash: SaltedInitializationHash { inner: 0x24bd6ac7a182e2cf25e437c72f53544ef81dfd97d9afee23abb07a638e7be749 }, deployer: AztecAddress { inner: 0x0000000000000000000000000000000000000000000000000000000000000000 } }" diff --git a/yarn-project/noir-protocol-circuits-types/src/noir_test_gen.test.ts b/yarn-project/noir-protocol-circuits-types/src/noir_test_gen.test.ts index e5233391bbc..dd191ced744 100644 --- a/yarn-project/noir-protocol-circuits-types/src/noir_test_gen.test.ts +++ b/yarn-project/noir-protocol-circuits-types/src/noir_test_gen.test.ts @@ -25,7 +25,7 @@ describe('Data generation for noir tests', () => { const defaultContract: FixtureContractData = { artifactHash: new Fr(12345), packedBytecode: Buffer.from([3, 4, 5, 6, 7]), - publicKeys: PublicKeys.empty(), + publicKeys: PublicKeys.default(), salt: new Fr(56789), privateFunctions: [ { selector: FunctionSelector.fromField(new Fr(1010101)), vkHash: new Fr(0) }, @@ -37,7 +37,7 @@ describe('Data generation for noir tests', () => { const parentContract: FixtureContractData = { artifactHash: new Fr(1212), packedBytecode: Buffer.from([3, 4, 3, 4]), - publicKeys: PublicKeys.empty(), + publicKeys: PublicKeys.default(), salt: new Fr(5656), privateFunctions: [{ selector: FunctionSelector.fromField(new Fr(334455)), vkHash: new Fr(0) }], toString: () => 'parentContract', diff --git a/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts b/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts index c34fa969661..25978d48da2 100644 --- a/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts +++ b/yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts @@ -145,7 +145,7 @@ describe('Kernel Prover', () => { oracle.getContractAddressPreimage.mockResolvedValue({ contractClassId: Fr.random(), - publicKeys: PublicKeys.empty(), + publicKeys: PublicKeys.random(), saltedInitializationHash: Fr.random(), }); oracle.getContractClassIdPreimage.mockResolvedValue({ diff --git a/yarn-project/txe/src/txe_service/txe_service.ts b/yarn-project/txe/src/txe_service/txe_service.ts index d0761d707ef..13cc7637562 100644 --- a/yarn-project/txe/src/txe_service/txe_service.ts +++ b/yarn-project/txe/src/txe_service/txe_service.ts @@ -118,7 +118,7 @@ export class TXEService { skipArgsDecoding: true, salt: Fr.ONE, // TODO: Modify this to allow for passing public keys. - publicKeys: PublicKeys.empty(), + publicKeys: PublicKeys.default(), constructorArtifact: initializerStr ? initializerStr : undefined, deployer: AztecAddress.ZERO, });