@aztec/cli 1.0.0-nightly.20250805 → 1.0.0-nightly.20250806

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.
@@ -3,6 +3,7 @@ export declare function sequencers(opts: {
3
3
  command: 'list' | 'add' | 'remove' | 'who-next' | 'flush';
4
4
  who?: string;
5
5
  mnemonic?: string;
6
+ bn254SecretKey?: bigint;
6
7
  rpcUrl: string;
7
8
  l1RpcUrls: string[];
8
9
  chainId: number;
@@ -1 +1 @@
1
- {"version":3,"file":"sequencers.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/sequencers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,iBAwFA"}
1
+ {"version":3,"file":"sequencers.d.ts","sourceRoot":"","sources":["../../../src/cmds/infrastructure/sequencers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM3D,wBAAsB,UAAU,CAAC,IAAI,EAAE;IACrC,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,iBAoGA"}
@@ -1,10 +1,10 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- import { RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
1
+ import { Fr, createCompatibleClient } from '@aztec/aztec.js';
2
+ import { GSEContract, RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
3
3
  import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
4
4
  import { createPublicClient, createWalletClient, fallback, getContract, http } from 'viem';
5
5
  import { mnemonicToAccount } from 'viem/accounts';
6
6
  export async function sequencers(opts) {
7
- const { command, who: maybeWho, mnemonic, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
7
+ const { command, who: maybeWho, mnemonic, bn254SecretKey, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
8
8
  const client = await createCompatibleClient(rpcUrl, debugLogger);
9
9
  const { l1ContractAddresses } = await client.getNodeInfo();
10
10
  const chain = createEthereumChain(l1RpcUrls, chainId);
@@ -45,6 +45,10 @@ export async function sequencers(opts) {
45
45
  client: walletClient
46
46
  });
47
47
  const config = getL1ContractsConfigEnvVars();
48
+ const bn254SecretKeyFieldElement = bn254SecretKey ? new Fr(bn254SecretKey) : Fr.random();
49
+ const gseAddress = await rollup.getGSE();
50
+ const gseContract = new GSEContract(publicClient, gseAddress);
51
+ const registrationTuple = await gseContract.makeRegistrationTuple(bn254SecretKeyFieldElement.toBigInt());
48
52
  await Promise.all([
49
53
  await stakingAsset.write.mint([
50
54
  walletClient.account.address,
@@ -60,6 +64,9 @@ export async function sequencers(opts) {
60
64
  const hash = await writeableRollup.write.deposit([
61
65
  who,
62
66
  who,
67
+ registrationTuple.publicKeyInG1,
68
+ registrationTuple.publicKeyInG2,
69
+ registrationTuple.proofOfPossession,
63
70
  true
64
71
  ]);
65
72
  await publicClient.waitForTransactionReceipt({
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAajD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAW3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAuiB/E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAajD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAW3D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WA6iB/E"}
@@ -95,7 +95,7 @@ export function injectCommands(program, log, debugLogger) {
95
95
  const account = generateL1Account();
96
96
  log(JSON.stringify(account, null, 2));
97
97
  });
98
- program.command('add-l1-validator').description('Adds a validator to the L1 rollup contract.').addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use sending the transaction', PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use sending the transaction', 'test test test test test test test test test test test junk').addOption(l1ChainIdOption).option('--attester <address>', 'ethereum address of the attester', parseEthereumAddress).option('--staking-asset-handler <address>', 'ethereum address of the staking asset handler', parseEthereumAddress).option('--proof <buffer>', 'The proof to use for the attestation', (arg)=>Buffer.from(withoutHexPrefix(arg), 'hex')).option('--merkle-proof <string>', 'The merkle proof to use for the attestation (comma separated list of 32 byte buffers)', (arg)=>arg.split(',')).action(async (options)=>{
98
+ program.command('add-l1-validator').description('Adds a validator to the L1 rollup contract.').addOption(l1RpcUrlsOption).option('-pk, --private-key <string>', 'The private key to use sending the transaction', PRIVATE_KEY).option('-m, --mnemonic <string>', 'The mnemonic to use sending the transaction', 'test test test test test test test test test test test junk').addOption(l1ChainIdOption).option('--attester <address>', 'ethereum address of the attester', parseEthereumAddress).option('--bls-secret-key <string>', 'The BN254 scalar field element used as a secret key for BLS signatures. Will be associated with the attester address.', parseBigint).option('--staking-asset-handler <address>', 'ethereum address of the staking asset handler', parseEthereumAddress).option('--proof <buffer>', 'The proof to use for the attestation', (arg)=>Buffer.from(withoutHexPrefix(arg), 'hex')).option('--merkle-proof <string>', 'The merkle proof to use for the attestation (comma separated list of 32 byte buffers)', (arg)=>arg.split(',')).action(async (options)=>{
99
99
  const { addL1Validator } = await import('./update_l1_validators.js');
100
100
  await addL1Validator({
101
101
  rpcUrls: options.l1RpcUrls,
@@ -106,6 +106,7 @@ export function injectCommands(program, log, debugLogger) {
106
106
  stakingAssetHandlerAddress: options.stakingAssetHandler,
107
107
  merkleProof: options.merkleProof,
108
108
  proofParams: options.proof,
109
+ blsSecretKey: options.blsSecretKey,
109
110
  log,
110
111
  debugLogger
111
112
  });
@@ -23,7 +23,8 @@ export declare function generateL1Account(): {
23
23
  privateKey: `0x${string}`;
24
24
  address: `0x${string}`;
25
25
  };
26
- export declare function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, stakingAssetHandlerAddress, merkleProof, proofParams, log, debugLogger, }: StakingAssetHandlerCommandArgs & LoggerArgs & {
26
+ export declare function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, stakingAssetHandlerAddress, merkleProof, proofParams, blsSecretKey, log, debugLogger, }: StakingAssetHandlerCommandArgs & LoggerArgs & {
27
+ blsSecretKey: bigint;
27
28
  attesterAddress: EthAddress;
28
29
  proofParams: Buffer;
29
30
  merkleProof: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"update_l1_validators.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/update_l1_validators.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAS3D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,UAAU,CAAC;IAC1B,iBAAiB,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B,EAAE,UAAU,CAAC;CACxC;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,KAAK,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,iBAAiB;;;EAQhC;AAED,wBAAsB,cAAc,CAAC,EACnC,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,eAAe,EACf,0BAA0B,EAC1B,WAAW,EACX,WAAW,EACX,GAAG,EACH,WAAW,GACZ,EAAE,8BAA8B,GAC/B,UAAU,GAAG;IAAE,eAAe,EAAE,UAAU,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,iBAyCzF;AAED,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,GAAG,EACH,WAAW,GACZ,EAAE,iBAAiB,GAAG,UAAU,GAAG;IAAE,gBAAgB,EAAE,UAAU,CAAA;CAAE,iBAiBnE;AAED,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,OAAO,EACP,UAAU,EACV,QAAQ,EACR,aAAa,EACb,GAAG,EACH,WAAW,GACZ,EAAE,iBAAiB,GAAG,UAAU,iBAgBhC;AAED,wBAAsB,iBAAiB,CAAC,EACtC,OAAO,EACP,OAAO,EACP,aAAa,EACb,SAAS,EACT,GAAG,EACH,WAAW,GACZ,EAAE,iBAAiB,GAAG,UAAU,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,iBAyBxD;AAED,wBAAsB,WAAW,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,iBAAiB,GAAG,UAAU,iBAwBzG"}
1
+ {"version":3,"file":"update_l1_validators.d.ts","sourceRoot":"","sources":["../../../src/cmds/l1/update_l1_validators.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAS3D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,UAAU,CAAC;IAC1B,iBAAiB,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QA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getL1ContractsConfigEnvVars, getPublicClient, isAnvilTestChain } from '@aztec/ethereum';
1
+ import { GSEContract, L1TxUtils, RollupContract, createEthereumChain, createExtendedL1Client, getL1ContractsConfigEnvVars, getPublicClient, isAnvilTestChain } from '@aztec/ethereum';
2
2
  import { EthCheatCodes } from '@aztec/ethereum/test';
3
3
  import { RollupAbi, StakingAssetHandlerAbi } from '@aztec/l1-artifacts';
4
4
  import { ZkPassportProofParams } from '@aztec/stdlib/zkpassport';
@@ -14,7 +14,7 @@ export function generateL1Account() {
14
14
  address: account.address
15
15
  };
16
16
  }
17
- export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, stakingAssetHandlerAddress, merkleProof, proofParams, log, debugLogger }) {
17
+ export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, attesterAddress, stakingAssetHandlerAddress, merkleProof, proofParams, blsSecretKey, log, debugLogger }) {
18
18
  const dualLog = makeDualLog(log, debugLogger);
19
19
  const account = getAccount(privateKey, mnemonic);
20
20
  const chain = createEthereumChain(rpcUrls, chainId);
@@ -24,8 +24,16 @@ export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, a
24
24
  abi: StakingAssetHandlerAbi,
25
25
  client: l1Client
26
26
  });
27
- const rollup = await stakingAssetHandler.read.getRollup();
28
- dualLog(`Adding validator ${attesterAddress} to rollup ${rollup.toString()}`);
27
+ const rollupAddress = await stakingAssetHandler.read.getRollup();
28
+ dualLog(`Adding validator ${attesterAddress} to rollup ${rollupAddress.toString()}`);
29
+ const rollup = getContract({
30
+ address: rollupAddress,
31
+ abi: RollupAbi,
32
+ client: l1Client
33
+ });
34
+ const gseAddress = await rollup.read.getGSE();
35
+ const gse = new GSEContract(l1Client, gseAddress);
36
+ const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
29
37
  const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
30
38
  const proofParamsObj = ZkPassportProofParams.fromBuffer(proofParams);
31
39
  const merkleProofArray = merkleProof.map((proof)=>addLeadingHex(proof));
@@ -37,7 +45,10 @@ export async function addL1Validator({ rpcUrls, chainId, privateKey, mnemonic, a
37
45
  args: [
38
46
  attesterAddress.toString(),
39
47
  merkleProofArray,
40
- proofParamsObj.toViem()
48
+ proofParamsObj.toViem(),
49
+ registrationTuple.publicKeyInG1,
50
+ registrationTuple.publicKeyInG2,
51
+ registrationTuple.proofOfPossession
41
52
  ]
42
53
  }),
43
54
  abi: StakingAssetHandlerAbi
@@ -1,7 +1,7 @@
1
1
  import { EthAddress, type PXE } from '@aztec/aztec.js';
2
2
  import { type ContractArtifact, type FunctionAbi } from '@aztec/aztec.js/abi';
3
3
  import { type DeployL1ContractsReturnType, type L1ContractsConfig, type Operator, RollupContract } from '@aztec/ethereum';
4
- import type { Fr } from '@aztec/foundation/fields';
4
+ import { Fr } from '@aztec/foundation/fields';
5
5
  import type { LogFn, Logger } from '@aztec/foundation/log';
6
6
  import type { NoirPackageConfig } from '@aztec/foundation/noir';
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"aztec.d.ts","sourceRoot":"","sources":["../../src/utils/aztec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAShE;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GA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tE;AAKD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,iBAyB9E"}
@@ -1,5 +1,6 @@
1
1
  import { EthAddress } from '@aztec/aztec.js';
2
2
  import { FunctionType, getAllFunctionAbis, loadContractArtifact } from '@aztec/aztec.js/abi';
3
+ import { Fr } from '@aztec/foundation/fields';
3
4
  import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
4
5
  import TOML from '@iarna/toml';
5
6
  import { readFile } from 'fs/promises';
@@ -54,11 +55,14 @@ export async function deployNewRollupContracts(registryAddress, rpcUrls, chainId
54
55
  const client = createExtendedL1Client(rpcUrls, account, chain.chainInfo, undefined, mnemonicIndex);
55
56
  if (!initialValidators || initialValidators.length === 0) {
56
57
  // initialize the new rollup with Amin's validator address.
57
- const amin = EthAddress.fromString('0x3b218d0F26d15B36C715cB06c949210a0d630637');
58
+ const aminAddressString = '0x3b218d0F26d15B36C715cB06c949210a0d630637';
59
+ const amin = EthAddress.fromString(aminAddressString);
58
60
  initialValidators = [
59
61
  {
60
62
  attester: amin,
61
- withdrawer: amin
63
+ withdrawer: amin,
64
+ // No secrets here. The actual keys are not currently used.
65
+ bn254SecretKey: Fr.fromHexString(aminAddressString).toBigInt()
62
66
  }
63
67
  ];
64
68
  logger.info('Initializing new rollup with old attesters', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/cli",
3
- "version": "1.0.0-nightly.20250805",
3
+ "version": "1.0.0-nightly.20250806",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./contracts": "./dest/cmds/contracts/index.js",
@@ -69,16 +69,16 @@
69
69
  ]
70
70
  },
71
71
  "dependencies": {
72
- "@aztec/archiver": "1.0.0-nightly.20250805",
73
- "@aztec/aztec.js": "1.0.0-nightly.20250805",
74
- "@aztec/constants": "1.0.0-nightly.20250805",
75
- "@aztec/entrypoints": "1.0.0-nightly.20250805",
76
- "@aztec/ethereum": "1.0.0-nightly.20250805",
77
- "@aztec/foundation": "1.0.0-nightly.20250805",
78
- "@aztec/l1-artifacts": "1.0.0-nightly.20250805",
79
- "@aztec/p2p": "1.0.0-nightly.20250805",
80
- "@aztec/stdlib": "1.0.0-nightly.20250805",
81
- "@aztec/world-state": "1.0.0-nightly.20250805",
72
+ "@aztec/archiver": "1.0.0-nightly.20250806",
73
+ "@aztec/aztec.js": "1.0.0-nightly.20250806",
74
+ "@aztec/constants": "1.0.0-nightly.20250806",
75
+ "@aztec/entrypoints": "1.0.0-nightly.20250806",
76
+ "@aztec/ethereum": "1.0.0-nightly.20250806",
77
+ "@aztec/foundation": "1.0.0-nightly.20250806",
78
+ "@aztec/l1-artifacts": "1.0.0-nightly.20250806",
79
+ "@aztec/p2p": "1.0.0-nightly.20250806",
80
+ "@aztec/stdlib": "1.0.0-nightly.20250806",
81
+ "@aztec/world-state": "1.0.0-nightly.20250806",
82
82
  "@iarna/toml": "^2.2.5",
83
83
  "@libp2p/peer-id-factory": "^3.0.4",
84
84
  "commander": "^12.1.0",
@@ -90,8 +90,8 @@
90
90
  "viem": "2.23.7"
91
91
  },
92
92
  "devDependencies": {
93
- "@aztec/accounts": "1.0.0-nightly.20250805",
94
- "@aztec/protocol-contracts": "1.0.0-nightly.20250805",
93
+ "@aztec/accounts": "1.0.0-nightly.20250806",
94
+ "@aztec/protocol-contracts": "1.0.0-nightly.20250806",
95
95
  "@jest/globals": "^30.0.0",
96
96
  "@types/jest": "^30.0.0",
97
97
  "@types/lodash.chunk": "^4.2.9",
@@ -107,15 +107,15 @@
107
107
  "typescript": "^5.3.3"
108
108
  },
109
109
  "peerDependencies": {
110
- "@aztec/accounts": "1.0.0-nightly.20250805",
111
- "@aztec/bb-prover": "1.0.0-nightly.20250805",
112
- "@aztec/ethereum": "1.0.0-nightly.20250805",
113
- "@aztec/l1-artifacts": "1.0.0-nightly.20250805",
114
- "@aztec/noir-contracts.js": "1.0.0-nightly.20250805",
115
- "@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250805",
116
- "@aztec/noir-test-contracts.js": "1.0.0-nightly.20250805",
117
- "@aztec/protocol-contracts": "1.0.0-nightly.20250805",
118
- "@aztec/stdlib": "1.0.0-nightly.20250805"
110
+ "@aztec/accounts": "1.0.0-nightly.20250806",
111
+ "@aztec/bb-prover": "1.0.0-nightly.20250806",
112
+ "@aztec/ethereum": "1.0.0-nightly.20250806",
113
+ "@aztec/l1-artifacts": "1.0.0-nightly.20250806",
114
+ "@aztec/noir-contracts.js": "1.0.0-nightly.20250806",
115
+ "@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250806",
116
+ "@aztec/noir-test-contracts.js": "1.0.0-nightly.20250806",
117
+ "@aztec/protocol-contracts": "1.0.0-nightly.20250806",
118
+ "@aztec/stdlib": "1.0.0-nightly.20250806"
119
119
  },
120
120
  "files": [
121
121
  "dest",
@@ -1,5 +1,5 @@
1
- import { createCompatibleClient } from '@aztec/aztec.js';
2
- import { RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
1
+ import { Fr, createCompatibleClient } from '@aztec/aztec.js';
2
+ import { GSEContract, RollupContract, createEthereumChain, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
3
3
  import type { LogFn, Logger } from '@aztec/foundation/log';
4
4
  import { RollupAbi, TestERC20Abi } from '@aztec/l1-artifacts';
5
5
 
@@ -10,6 +10,7 @@ export async function sequencers(opts: {
10
10
  command: 'list' | 'add' | 'remove' | 'who-next' | 'flush';
11
11
  who?: string;
12
12
  mnemonic?: string;
13
+ bn254SecretKey?: bigint;
13
14
  rpcUrl: string;
14
15
  l1RpcUrls: string[];
15
16
  chainId: number;
@@ -17,7 +18,7 @@ export async function sequencers(opts: {
17
18
  log: LogFn;
18
19
  debugLogger: Logger;
19
20
  }) {
20
- const { command, who: maybeWho, mnemonic, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
21
+ const { command, who: maybeWho, mnemonic, bn254SecretKey, rpcUrl, l1RpcUrls, chainId, log, debugLogger } = opts;
21
22
  const client = await createCompatibleClient(rpcUrl, debugLogger);
22
23
  const { l1ContractAddresses } = await client.getNodeInfo();
23
24
 
@@ -72,6 +73,11 @@ export async function sequencers(opts: {
72
73
 
73
74
  const config = getL1ContractsConfigEnvVars();
74
75
 
76
+ const bn254SecretKeyFieldElement = bn254SecretKey ? new Fr(bn254SecretKey) : Fr.random();
77
+ const gseAddress = await rollup.getGSE();
78
+ const gseContract = new GSEContract(publicClient, gseAddress);
79
+ const registrationTuple = await gseContract.makeRegistrationTuple(bn254SecretKeyFieldElement.toBigInt());
80
+
75
81
  await Promise.all(
76
82
  [
77
83
  await stakingAsset.write.mint([walletClient.account.address, config.activationThreshold], {} as any),
@@ -79,7 +85,14 @@ export async function sequencers(opts: {
79
85
  ].map(txHash => publicClient.waitForTransactionReceipt({ hash: txHash })),
80
86
  );
81
87
 
82
- const hash = await writeableRollup.write.deposit([who, who, true]);
88
+ const hash = await writeableRollup.write.deposit([
89
+ who,
90
+ who,
91
+ registrationTuple.publicKeyInG1,
92
+ registrationTuple.publicKeyInG2,
93
+ registrationTuple.proofOfPossession,
94
+ true,
95
+ ]);
83
96
  await publicClient.waitForTransactionReceipt({ hash });
84
97
  log(`Added in tx ${hash}`);
85
98
  } else if (command === 'flush') {
@@ -293,6 +293,11 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
293
293
  )
294
294
  .addOption(l1ChainIdOption)
295
295
  .option('--attester <address>', 'ethereum address of the attester', parseEthereumAddress)
296
+ .option(
297
+ '--bls-secret-key <string>',
298
+ 'The BN254 scalar field element used as a secret key for BLS signatures. Will be associated with the attester address.',
299
+ parseBigint,
300
+ )
296
301
  .option('--staking-asset-handler <address>', 'ethereum address of the staking asset handler', parseEthereumAddress)
297
302
  .option('--proof <buffer>', 'The proof to use for the attestation', arg =>
298
303
  Buffer.from(withoutHexPrefix(arg), 'hex'),
@@ -313,6 +318,7 @@ export function injectCommands(program: Command, log: LogFn, debugLogger: Logger
313
318
  stakingAssetHandlerAddress: options.stakingAssetHandler,
314
319
  merkleProof: options.merkleProof,
315
320
  proofParams: options.proof,
321
+ blsSecretKey: options.blsSecretKey,
316
322
  log,
317
323
  debugLogger,
318
324
  });
@@ -1,4 +1,5 @@
1
1
  import {
2
+ GSEContract,
2
3
  L1TxUtils,
3
4
  RollupContract,
4
5
  createEthereumChain,
@@ -59,10 +60,16 @@ export async function addL1Validator({
59
60
  stakingAssetHandlerAddress,
60
61
  merkleProof,
61
62
  proofParams,
63
+ blsSecretKey,
62
64
  log,
63
65
  debugLogger,
64
66
  }: StakingAssetHandlerCommandArgs &
65
- LoggerArgs & { attesterAddress: EthAddress; proofParams: Buffer; merkleProof: string[] }) {
67
+ LoggerArgs & {
68
+ blsSecretKey: bigint; // scalar field element of BN254
69
+ attesterAddress: EthAddress;
70
+ proofParams: Buffer;
71
+ merkleProof: string[];
72
+ }) {
66
73
  const dualLog = makeDualLog(log, debugLogger);
67
74
  const account = getAccount(privateKey, mnemonic);
68
75
  const chain = createEthereumChain(rpcUrls, chainId);
@@ -74,8 +81,20 @@ export async function addL1Validator({
74
81
  client: l1Client,
75
82
  });
76
83
 
77
- const rollup = await stakingAssetHandler.read.getRollup();
78
- dualLog(`Adding validator ${attesterAddress} to rollup ${rollup.toString()}`);
84
+ const rollupAddress = await stakingAssetHandler.read.getRollup();
85
+ dualLog(`Adding validator ${attesterAddress} to rollup ${rollupAddress.toString()}`);
86
+
87
+ const rollup = getContract({
88
+ address: rollupAddress,
89
+ abi: RollupAbi,
90
+ client: l1Client,
91
+ });
92
+
93
+ const gseAddress = await rollup.read.getGSE();
94
+
95
+ const gse = new GSEContract(l1Client, gseAddress);
96
+
97
+ const registrationTuple = await gse.makeRegistrationTuple(blsSecretKey);
79
98
 
80
99
  const l1TxUtils = new L1TxUtils(l1Client, debugLogger);
81
100
  const proofParamsObj = ZkPassportProofParams.fromBuffer(proofParams);
@@ -86,7 +105,14 @@ export async function addL1Validator({
86
105
  data: encodeFunctionData({
87
106
  abi: StakingAssetHandlerAbi,
88
107
  functionName: 'addValidator',
89
- args: [attesterAddress.toString(), merkleProofArray, proofParamsObj.toViem()],
108
+ args: [
109
+ attesterAddress.toString(),
110
+ merkleProofArray,
111
+ proofParamsObj.toViem(),
112
+ registrationTuple.publicKeyInG1,
113
+ registrationTuple.publicKeyInG2,
114
+ registrationTuple.proofOfPossession,
115
+ ],
90
116
  }),
91
117
  abi: StakingAssetHandlerAbi,
92
118
  });
@@ -12,7 +12,7 @@ import {
12
12
  type Operator,
13
13
  RollupContract,
14
14
  } from '@aztec/ethereum';
15
- import type { Fr } from '@aztec/foundation/fields';
15
+ import { Fr } from '@aztec/foundation/fields';
16
16
  import type { LogFn, Logger } from '@aztec/foundation/log';
17
17
  import type { NoirPackageConfig } from '@aztec/foundation/noir';
18
18
  import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
@@ -116,8 +116,17 @@ export async function deployNewRollupContracts(
116
116
 
117
117
  if (!initialValidators || initialValidators.length === 0) {
118
118
  // initialize the new rollup with Amin's validator address.
119
- const amin = EthAddress.fromString('0x3b218d0F26d15B36C715cB06c949210a0d630637');
120
- initialValidators = [{ attester: amin, withdrawer: amin }];
119
+ const aminAddressString = '0x3b218d0F26d15B36C715cB06c949210a0d630637';
120
+ const amin = EthAddress.fromString(aminAddressString);
121
+
122
+ initialValidators = [
123
+ {
124
+ attester: amin,
125
+ withdrawer: amin,
126
+ // No secrets here. The actual keys are not currently used.
127
+ bn254SecretKey: Fr.fromHexString(aminAddressString).toBigInt(),
128
+ },
129
+ ];
121
130
  logger.info('Initializing new rollup with old attesters', { initialValidators });
122
131
  }
123
132