@aztec/cli-wallet 0.0.1-commit.e6bd8901 → 0.0.1-commit.ec5f612

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.
@@ -67,7 +67,8 @@ async function inspectTx(wallet, aztecNode, txHash, log) {
67
67
  const deployed = deployNullifiers[nullifier.toString()];
68
68
  const note = deployed ? (await wallet.getNotes({
69
69
  siloedNullifier: nullifier,
70
- contractAddress: deployed
70
+ contractAddress: deployed,
71
+ scopes: 'ALL_SCOPES'
71
72
  }))[0] : undefined;
72
73
  const initialized = initNullifiers[nullifier.toString()];
73
74
  const registered = classNullifiers[nullifier.toString()];
@@ -13,7 +13,7 @@ export function injectCommands(program, log, debugLogger, walletAndNodeWrapper,
13
13
  const { importTestAccounts } = await import('./import_test_accounts.js');
14
14
  await importTestAccounts(wallet, db, json, log);
15
15
  });
16
- const createAccountCommand = program.command('create-account').description('Creates an aztec account that can be used for sending transactions. Registers the account on the PXE and deploys an account contract. Uses a Schnorr single-key account which uses the same key for encryption and authentication (not secure for production usage).').summary('Creates an aztec account that can be used for sending transactions.').addOption(createAccountOption('Alias or address of the account performing the deployment', !db, db)).option('--skip-initialization', 'Skip initializing the account contract. Useful for publicly deploying an existing account.').option('--public-deploy', 'Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions.').option('--register-class', 'Register the contract class (useful for when the contract class has not been deployed yet).').option('-p, --public-key <string>', 'Public key that identifies a private signing key stored outside of the wallet. Used for ECDSA SSH accounts over the secp256r1 curve.').addOption(createSecretKeyOption('Secret key for account. Uses random by default.', false, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('public-key')).addOption(createAliasOption('Alias for the account. Used for easy reference in subsequent commands.', !db)).addOption(createTypeOption(true)).option('--register-only', 'Just register the account on the Wallet. Do not deploy or initialize the account contract.').option('--json', 'Emit output as json')// `options.wait` is default true. Passing `--no-wait` will set it to false.
16
+ const createAccountCommand = program.command('create-account').description('Creates an aztec account that can be used for sending transactions. Registers the account on the PXE and deploys an account contract. Uses a Schnorr account which uses an immutable key for authentication.').summary('Creates an aztec account that can be used for sending transactions.').addOption(createAccountOption('Alias or address of the account performing the deployment', !db, db)).option('--skip-initialization', 'Skip initializing the account contract. Useful for publicly deploying an existing account.').option('--public-deploy', 'Publishes the account contract instance (and the class, if needed). Needed if the contract contains public functions.').option('--register-class', 'Register the contract class (useful for when the contract class has not been deployed yet).').option('-p, --public-key <string>', 'Public key that identifies a private signing key stored outside of the wallet. Used for ECDSA SSH accounts over the secp256r1 curve.').addOption(createSecretKeyOption('Secret key for account. Uses random by default.', false, (sk)=>aliasedSecretKeyParser(sk, db)).conflicts('public-key')).addOption(createAliasOption('Alias for the account. Used for easy reference in subsequent commands.', !db)).addOption(createTypeOption(true)).option('--register-only', 'Just register the account on the Wallet. Do not deploy or initialize the account contract.').option('--json', 'Emit output as json')// `options.wait` is default true. Passing `--no-wait` will set it to false.
17
17
  // https://github.com/tj/commander.js#other-option-types-negatable-boolean-and-booleanvalue
18
18
  .option('--no-wait', 'Skip waiting for the contract to be deployed. Print the hash of deployment transaction').addOption(createVerboseOption());
19
19
  addOptions(createAccountCommand, CLIFeeArgs.getOptions()).action(async (_options, command)=>{
@@ -50,4 +50,4 @@ export declare class WalletDB {
50
50
  }>;
51
51
  storeAlias(type: AliasType, key: string, value: Buffer, log: LogFn): Promise<void>;
52
52
  }
53
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FsbGV0X2RiLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc3RvcmFnZS93YWxsZXRfZGIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ25ELE9BQU8sS0FB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AE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,iBAY1F;IAEK,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,iBAStE;IAEK,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,iBASvE;IAED,gBAAgB,CAAC,GAAG,EAAE,MAAM,UAM3B;IAEM,sBAAsB,CAAC,GAAG,EAAE,MAAM,UAYxC;IAEK,aAAa,CAAC,GAAG,EAAE,MAAM,mBAW9B;IAEK,WAAW,CAAC,IAAI,CAAC,EAAE,SAAS;;;SAWjC;IAEK,oBAAoB,CAAC,cAAc,EAAE,YAAY,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAGtG;IAEK,uBAAuB,CAAC,cAAc,EAAE,YAAY,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,oCAOvF;IAEK,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM;;;;;OASnD;IAEK,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAMvE;CACF"}
@@ -9,6 +9,7 @@ export const Aliases = [
9
9
  'authwits'
10
10
  ];
11
11
  export class WalletDB {
12
+ #store;
12
13
  #accounts;
13
14
  #aliases;
14
15
  #bridgedFeeJuice;
@@ -21,6 +22,7 @@ export class WalletDB {
21
22
  return WalletDB.instance;
22
23
  }
23
24
  async init(store) {
25
+ this.#store = store;
24
26
  this.#accounts = store.openMap('accounts');
25
27
  this.#aliases = store.openMap('aliases');
26
28
  this.#bridgedFeeJuice = store.openMap('bridgedFeeJuice');
@@ -33,13 +35,15 @@ export class WalletDB {
33
35
  ]));
34
36
  }
35
37
  async pushBridgedFeeJuice(recipient, secret, amount, leafIndex, log) {
36
- let stackPointer = (await this.#bridgedFeeJuice.getAsync(`${recipient.toString()}:stackPointer`))?.readInt8() || 0;
37
- stackPointer++;
38
- await this.#bridgedFeeJuice.set(`${recipient.toString()}:${stackPointer}`, Buffer.from(`${amount.toString()}:${secret.toString()}:${leafIndex.toString()}`));
39
- await this.#bridgedFeeJuice.set(`${recipient.toString()}:stackPointer`, Buffer.from([
40
- stackPointer
41
- ]));
42
- log(`Pushed ${amount} fee juice for recipient ${recipient.toString()}. Stack pointer ${stackPointer}`);
38
+ await this.#store.transactionAsync(async ()=>{
39
+ let stackPointer = (await this.#bridgedFeeJuice.getAsync(`${recipient.toString()}:stackPointer`))?.readInt8() || 0;
40
+ stackPointer++;
41
+ await this.#bridgedFeeJuice.set(`${recipient.toString()}:${stackPointer}`, Buffer.from(`${amount.toString()}:${secret.toString()}:${leafIndex.toString()}`));
42
+ await this.#bridgedFeeJuice.set(`${recipient.toString()}:stackPointer`, Buffer.from([
43
+ stackPointer
44
+ ]));
45
+ log(`Pushed ${amount} fee juice for recipient ${recipient.toString()}. Stack pointer ${stackPointer}`);
46
+ });
43
47
  }
44
48
  async popBridgedFeeJuice(recipient, log) {
45
49
  let stackPointer = (await this.#bridgedFeeJuice.getAsync(`${recipient.toString()}:stackPointer`))?.readInt8() || 0;
@@ -59,17 +63,22 @@ export class WalletDB {
59
63
  };
60
64
  }
61
65
  async storeAccount(address, { type, secretKey, salt, alias, publicKey }, log) {
62
- if (alias) {
63
- await this.#aliases.set(`accounts:${alias}`, Buffer.from(address.toString()));
64
- }
65
- await this.#accounts.set(`${address.toString()}:type`, Buffer.from(type));
66
- await this.#accounts.set(`${address.toString()}:sk`, secretKey.toBuffer());
67
- await this.#accounts.set(`${address.toString()}:salt`, salt.toBuffer());
66
+ let publicSigningKey;
68
67
  if (type === 'ecdsasecp256r1ssh' && publicKey) {
69
- const publicSigningKey = extractECDSAPublicKeyFromBase64String(publicKey);
70
- await this.storeAccountMetadata(address, 'publicSigningKey', publicSigningKey);
68
+ publicSigningKey = extractECDSAPublicKeyFromBase64String(publicKey);
71
69
  }
72
- await this.#aliases.set('accounts:last', Buffer.from(address.toString()));
70
+ await this.#store.transactionAsync(async ()=>{
71
+ if (alias) {
72
+ await this.#aliases.set(`accounts:${alias}`, Buffer.from(address.toString()));
73
+ }
74
+ await this.#accounts.set(`${address.toString()}:type`, Buffer.from(type));
75
+ await this.#accounts.set(`${address.toString()}:sk`, secretKey.toBuffer());
76
+ await this.#accounts.set(`${address.toString()}:salt`, salt.toBuffer());
77
+ if (publicSigningKey) {
78
+ await this.#accounts.set(`${address.toString()}:publicSigningKey`, publicSigningKey);
79
+ }
80
+ await this.#aliases.set('accounts:last', Buffer.from(address.toString()));
81
+ });
73
82
  log(`Account stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
74
83
  await this.refreshAliasCache();
75
84
  }
@@ -79,29 +88,35 @@ export class WalletDB {
79
88
  await this.refreshAliasCache();
80
89
  }
81
90
  async storeContract(address, artifactPath, log, alias) {
82
- if (alias) {
83
- await this.#aliases.set(`contracts:${alias}`, Buffer.from(address.toString()));
84
- await this.#aliases.set(`artifacts:${alias}`, Buffer.from(artifactPath));
85
- }
86
- await this.#aliases.set(`contracts:last`, Buffer.from(address.toString()));
87
- await this.#aliases.set(`artifacts:last`, Buffer.from(artifactPath));
88
- await this.#aliases.set(`artifacts:${address.toString()}`, Buffer.from(artifactPath));
91
+ await this.#store.transactionAsync(async ()=>{
92
+ if (alias) {
93
+ await this.#aliases.set(`contracts:${alias}`, Buffer.from(address.toString()));
94
+ await this.#aliases.set(`artifacts:${alias}`, Buffer.from(artifactPath));
95
+ }
96
+ await this.#aliases.set(`contracts:last`, Buffer.from(address.toString()));
97
+ await this.#aliases.set(`artifacts:last`, Buffer.from(artifactPath));
98
+ await this.#aliases.set(`artifacts:${address.toString()}`, Buffer.from(artifactPath));
99
+ });
89
100
  log(`Contract stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
90
101
  await this.refreshAliasCache();
91
102
  }
92
103
  async storeAuthwitness(authWit, log, alias) {
93
- if (alias) {
94
- await this.#aliases.set(`authwits:${alias}`, Buffer.from(authWit.toString()));
95
- }
96
- await this.#aliases.set(`authwits:last`, Buffer.from(authWit.toString()));
104
+ await this.#store.transactionAsync(async ()=>{
105
+ if (alias) {
106
+ await this.#aliases.set(`authwits:${alias}`, Buffer.from(authWit.toString()));
107
+ }
108
+ await this.#aliases.set(`authwits:last`, Buffer.from(authWit.toString()));
109
+ });
97
110
  log(`Authorization witness stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
98
111
  await this.refreshAliasCache();
99
112
  }
100
113
  async storeTx({ txHash }, log, alias) {
101
- if (alias) {
102
- await this.#aliases.set(`transactions:${alias}`, Buffer.from(txHash.toString()));
103
- }
104
- await this.#aliases.set(`transactions:last`, Buffer.from(txHash.toString()));
114
+ await this.#store.transactionAsync(async ()=>{
115
+ if (alias) {
116
+ await this.#aliases.set(`transactions:${alias}`, Buffer.from(txHash.toString()));
117
+ }
118
+ await this.#aliases.set(`transactions:last`, Buffer.from(txHash.toString()));
119
+ });
105
120
  log(`Transaction hash stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
106
121
  await this.refreshAliasCache();
107
122
  }
@@ -4,14 +4,14 @@ import type { AztecNode } from '@aztec/aztec.js/node';
4
4
  import { AccountManager, type Aliased, type SimulateOptions } from '@aztec/aztec.js/wallet';
5
5
  import { Fr } from '@aztec/foundation/curves/bn254';
6
6
  import type { LogFn } from '@aztec/foundation/log';
7
+ import type { AccessScopes, NotesFilter } from '@aztec/pxe/client/lazy';
7
8
  import type { PXEConfig } from '@aztec/pxe/config';
8
9
  import type { PXE } from '@aztec/pxe/server';
9
10
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
10
11
  import { NoteDao } from '@aztec/stdlib/note';
11
- import type { NotesFilter } from '@aztec/stdlib/note';
12
12
  import type { TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
13
13
  import { ExecutionPayload } from '@aztec/stdlib/tx';
14
- import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
14
+ import { BaseWallet, type FeeOptions } from '@aztec/wallet-sdk/base-wallet';
15
15
  import type { WalletDB } from '../storage/wallet_db.js';
16
16
  import type { AccountType } from './constants.js';
17
17
  export declare class CLIWallet extends BaseWallet {
@@ -28,8 +28,13 @@ export declare class CLIWallet extends BaseWallet {
28
28
  createOrRetrieveAccount(address?: AztecAddress, secretKey?: Fr, type?: AccountType, salt?: Fr, publicKey?: string): Promise<AccountManager>;
29
29
  private getFakeAccountDataFor;
30
30
  simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult>;
31
+ /**
32
+ * Uses a stub account for kernelless simulation, bypassing real account authorization.
33
+ * Falls through to the standard entrypoint path for SignerlessAccount (ZERO address).
34
+ */
35
+ protected simulateViaEntrypoint(executionPayload: ExecutionPayload, from: AztecAddress, feeOptions: FeeOptions, scopes: AccessScopes, skipTxValidation?: boolean, skipFeeEnforcement?: boolean): Promise<TxSimulationResult>;
31
36
  getContracts(): Promise<AztecAddress[]>;
32
37
  getNotes(filter: NotesFilter): Promise<NoteDao[]>;
33
38
  getContractArtifact(id: Fr): Promise<import("@aztec/stdlib/abi").ContractArtifact | undefined>;
34
39
  }
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2FsbGV0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvd2FsbGV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sRUFBRSxLQUFLLE9BQU8sRUFBMkMsTUFBTSx5QkFBeUIsQ0FBQztBQUNoRyxPQUFPLEVBQ0wsS0FBSyxxQkFBcUIsRUFHM0IsTUFBTSwyQkFBMkIsQ0FBQztBQUNuQyxPQUFPLEtBQUssRUFBR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AE,EACX,YAAY,EAAE,qBAAqB,GAClC,OAAO,CAAC,eAAe,CAAC,CAG1B;IAEc,qBAAqB,CAAC,OAAO,EAAE,YAAY,oBAezD;YAEa,aAAa;IAWrB,uBAAuB,CAC3B,OAAO,CAAC,EAAE,YAAY,EACtB,SAAS,CAAC,EAAE,EAAE,EACd,IAAI,GAAE,WAAuB,EAC7B,IAAI,CAAC,EAAE,EAAE,EACT,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,CAAC,CAmDzB;YAQa,qBAAqB;IAwBpB,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAShH;IAED;;;OAGG;IACH,UAAyB,qBAAqB,CAC5C,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,YAAY,EACpB,gBAAgB,CAAC,EAAE,OAAO,EAC1B,kBAAkB,CAAC,EAAE,OAAO,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAuC7B;IAID,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAEtC;IAID,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAEhD;IAID,mBAAmB,CAAC,EAAE,EAAE,EAAE,qEAEzB;CACF"}
@@ -48,7 +48,7 @@ export class CLIWallet extends BaseWallet {
48
48
  }
49
49
  async proveCancellationTx(from, txNonce, increasedFee) {
50
50
  const cancellationTxRequest = await this.createCancellationTxExecutionRequest(from, txNonce, increasedFee);
51
- return await this.pxe.proveTx(cancellationTxRequest);
51
+ return await this.pxe.proveTx(cancellationTxRequest, this.scopesFrom(from));
52
52
  }
53
53
  async getAccountFromAddress(address) {
54
54
  let account;
@@ -147,10 +147,22 @@ export class CLIWallet extends BaseWallet {
147
147
  };
148
148
  }
149
149
  async simulateTx(executionPayload, opts) {
150
- let simulationResults;
151
- const feeOptions = opts.fee?.estimateGas ? await this.completeFeeOptionsForEstimation(opts.from, executionPayload.feePayer, opts.fee?.gasSettings) : await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
150
+ const simulationResults = await super.simulateTx(executionPayload, opts);
151
+ if (opts.fee?.estimateGas) {
152
+ const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
153
+ const limits = getGasLimits(simulationResults, opts.fee?.estimatedGasPadding);
154
+ printGasEstimates(feeOptions, limits, this.userLog);
155
+ }
156
+ return simulationResults;
157
+ }
158
+ /**
159
+ * Uses a stub account for kernelless simulation, bypassing real account authorization.
160
+ * Falls through to the standard entrypoint path for SignerlessAccount (ZERO address).
161
+ */ async simulateViaEntrypoint(executionPayload, from, feeOptions, scopes, skipTxValidation, skipFeeEnforcement) {
162
+ if (from.equals(AztecAddress.ZERO)) {
163
+ return super.simulateViaEntrypoint(executionPayload, from, feeOptions, scopes, skipTxValidation, skipFeeEnforcement);
164
+ }
152
165
  const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
153
- const chainInfo = await this.getChainInfo();
154
166
  const executionOptions = {
155
167
  txNonce: Fr.random(),
156
168
  cancellable: this.cancellableTransactions,
@@ -160,31 +172,23 @@ export class CLIWallet extends BaseWallet {
160
172
  feeExecutionPayload,
161
173
  executionPayload
162
174
  ]) : executionPayload;
163
- // Kernelless simulations using the multicall entrypoints are not currently supported,
164
- // since we only override proper account contracts.
165
- // TODO: allow disabling kernels even when no overrides are necessary
166
- if (opts.from.equals(AztecAddress.ZERO)) {
167
- const fromAccount = await this.getAccountFromAddress(opts.from);
168
- const txRequest = await fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
169
- simulationResults = await this.pxe.simulateTx(txRequest, true, opts?.skipTxValidation, opts?.skipFeeEnforcement ?? true);
170
- } else {
171
- const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(opts.from);
172
- const txRequest = await fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
173
- const contractOverrides = {
174
- [opts.from.toString()]: {
175
- instance,
176
- artifact
175
+ const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(from);
176
+ const chainInfo = await this.getChainInfo();
177
+ const txRequest = await fromAccount.createTxExecutionRequest(finalExecutionPayload, feeOptions.gasSettings, chainInfo, executionOptions);
178
+ return this.pxe.simulateTx(txRequest, {
179
+ simulatePublic: true,
180
+ skipFeeEnforcement: true,
181
+ skipTxValidation: true,
182
+ overrides: {
183
+ contracts: {
184
+ [from.toString()]: {
185
+ instance,
186
+ artifact
187
+ }
177
188
  }
178
- };
179
- simulationResults = await this.pxe.simulateTx(txRequest, true, true, true, {
180
- contracts: contractOverrides
181
- });
182
- }
183
- if (opts.fee?.estimateGas) {
184
- const limits = getGasLimits(simulationResults, opts.fee?.estimatedGasPadding);
185
- printGasEstimates(feeOptions, limits, this.userLog);
186
- }
187
- return simulationResults;
189
+ },
190
+ scopes
191
+ });
188
192
  }
189
193
  // Exposed because of the `aztec-wallet get-tx` command. It has been decided that it's fine to keep around because
190
194
  // this is just a CLI wallet.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/cli-wallet",
3
- "version": "0.0.1-commit.e6bd8901",
3
+ "version": "0.0.1-commit.ec5f612",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/cmds/index.js",
@@ -67,19 +67,19 @@
67
67
  ]
68
68
  },
69
69
  "dependencies": {
70
- "@aztec/accounts": "0.0.1-commit.e6bd8901",
71
- "@aztec/aztec.js": "0.0.1-commit.e6bd8901",
72
- "@aztec/bb.js": "0.0.1-commit.e6bd8901",
73
- "@aztec/cli": "0.0.1-commit.e6bd8901",
74
- "@aztec/entrypoints": "0.0.1-commit.e6bd8901",
75
- "@aztec/ethereum": "0.0.1-commit.e6bd8901",
76
- "@aztec/foundation": "0.0.1-commit.e6bd8901",
77
- "@aztec/kv-store": "0.0.1-commit.e6bd8901",
78
- "@aztec/noir-contracts.js": "0.0.1-commit.e6bd8901",
79
- "@aztec/noir-noirc_abi": "0.0.1-commit.e6bd8901",
80
- "@aztec/pxe": "0.0.1-commit.e6bd8901",
81
- "@aztec/stdlib": "0.0.1-commit.e6bd8901",
82
- "@aztec/wallet-sdk": "0.0.1-commit.e6bd8901",
70
+ "@aztec/accounts": "0.0.1-commit.ec5f612",
71
+ "@aztec/aztec.js": "0.0.1-commit.ec5f612",
72
+ "@aztec/bb.js": "0.0.1-commit.ec5f612",
73
+ "@aztec/cli": "0.0.1-commit.ec5f612",
74
+ "@aztec/entrypoints": "0.0.1-commit.ec5f612",
75
+ "@aztec/ethereum": "0.0.1-commit.ec5f612",
76
+ "@aztec/foundation": "0.0.1-commit.ec5f612",
77
+ "@aztec/kv-store": "0.0.1-commit.ec5f612",
78
+ "@aztec/noir-contracts.js": "0.0.1-commit.ec5f612",
79
+ "@aztec/noir-noirc_abi": "0.0.1-commit.ec5f612",
80
+ "@aztec/pxe": "0.0.1-commit.ec5f612",
81
+ "@aztec/stdlib": "0.0.1-commit.ec5f612",
82
+ "@aztec/wallet-sdk": "0.0.1-commit.ec5f612",
83
83
  "commander": "^12.1.0",
84
84
  "inquirer": "^10.1.8",
85
85
  "source-map-support": "^0.5.21",
@@ -88,7 +88,7 @@ async function inspectTx(wallet: CLIWallet, aztecNode: AztecNode, txHash: TxHash
88
88
  for (const nullifier of effects.nullifiers) {
89
89
  const deployed = deployNullifiers[nullifier.toString()];
90
90
  const note = deployed
91
- ? (await wallet.getNotes({ siloedNullifier: nullifier, contractAddress: deployed }))[0]
91
+ ? (await wallet.getNotes({ siloedNullifier: nullifier, contractAddress: deployed, scopes: 'ALL_SCOPES' }))[0]
92
92
  : undefined;
93
93
  const initialized = initNullifiers[nullifier.toString()];
94
94
  const registered = classNullifiers[nullifier.toString()];
package/src/cmds/index.ts CHANGED
@@ -63,7 +63,7 @@ export function injectCommands(
63
63
  const createAccountCommand = program
64
64
  .command('create-account')
65
65
  .description(
66
- 'Creates an aztec account that can be used for sending transactions. Registers the account on the PXE and deploys an account contract. Uses a Schnorr single-key account which uses the same key for encryption and authentication (not secure for production usage).',
66
+ 'Creates an aztec account that can be used for sending transactions. Registers the account on the PXE and deploys an account contract. Uses a Schnorr account which uses an immutable key for authentication.',
67
67
  )
68
68
  .summary('Creates an aztec account that can be used for sending transactions.')
69
69
  .addOption(createAccountOption('Alias or address of the account performing the deployment', !db, db))
@@ -12,6 +12,7 @@ export const Aliases = ['accounts', 'contracts', 'artifacts', 'secrets', 'transa
12
12
  export type AliasType = (typeof Aliases)[number];
13
13
 
14
14
  export class WalletDB {
15
+ #store!: AztecAsyncKVStore;
15
16
  #accounts!: AztecAsyncMap<string, Buffer>;
16
17
  #aliases!: AztecAsyncMap<string, Buffer>;
17
18
  #bridgedFeeJuice!: AztecAsyncMap<string, Buffer>;
@@ -29,6 +30,7 @@ export class WalletDB {
29
30
  }
30
31
 
31
32
  async init(store: AztecAsyncKVStore) {
33
+ this.#store = store;
32
34
  this.#accounts = store.openMap('accounts');
33
35
  this.#aliases = store.openMap('aliases');
34
36
  this.#bridgedFeeJuice = store.openMap('bridgedFeeJuice');
@@ -41,14 +43,17 @@ export class WalletDB {
41
43
  }
42
44
 
43
45
  async pushBridgedFeeJuice(recipient: AztecAddress, secret: Fr, amount: bigint, leafIndex: bigint, log: LogFn) {
44
- let stackPointer = (await this.#bridgedFeeJuice.getAsync(`${recipient.toString()}:stackPointer`))?.readInt8() || 0;
45
- stackPointer++;
46
- await this.#bridgedFeeJuice.set(
47
- `${recipient.toString()}:${stackPointer}`,
48
- Buffer.from(`${amount.toString()}:${secret.toString()}:${leafIndex.toString()}`),
49
- );
50
- await this.#bridgedFeeJuice.set(`${recipient.toString()}:stackPointer`, Buffer.from([stackPointer]));
51
- log(`Pushed ${amount} fee juice for recipient ${recipient.toString()}. Stack pointer ${stackPointer}`);
46
+ await this.#store.transactionAsync(async () => {
47
+ let stackPointer =
48
+ (await this.#bridgedFeeJuice.getAsync(`${recipient.toString()}:stackPointer`))?.readInt8() || 0;
49
+ stackPointer++;
50
+ await this.#bridgedFeeJuice.set(
51
+ `${recipient.toString()}:${stackPointer}`,
52
+ Buffer.from(`${amount.toString()}:${secret.toString()}:${leafIndex.toString()}`),
53
+ );
54
+ await this.#bridgedFeeJuice.set(`${recipient.toString()}:stackPointer`, Buffer.from([stackPointer]));
55
+ log(`Pushed ${amount} fee juice for recipient ${recipient.toString()}. Stack pointer ${stackPointer}`);
56
+ });
52
57
  }
53
58
 
54
59
  async popBridgedFeeJuice(recipient: AztecAddress, log: LogFn) {
@@ -76,19 +81,24 @@ export class WalletDB {
76
81
  }: { type: AccountType; secretKey: Fr; salt: Fr; alias: string | undefined; publicKey: string | undefined },
77
82
  log: LogFn,
78
83
  ) {
79
- if (alias) {
80
- await this.#aliases.set(`accounts:${alias}`, Buffer.from(address.toString()));
81
- }
82
- await this.#accounts.set(`${address.toString()}:type`, Buffer.from(type));
83
- await this.#accounts.set(`${address.toString()}:sk`, secretKey.toBuffer());
84
- await this.#accounts.set(`${address.toString()}:salt`, salt.toBuffer());
84
+ let publicSigningKey: Buffer | undefined;
85
85
  if (type === 'ecdsasecp256r1ssh' && publicKey) {
86
- const publicSigningKey = extractECDSAPublicKeyFromBase64String(publicKey);
87
- await this.storeAccountMetadata(address, 'publicSigningKey', publicSigningKey);
86
+ publicSigningKey = extractECDSAPublicKeyFromBase64String(publicKey);
88
87
  }
89
- await this.#aliases.set('accounts:last', Buffer.from(address.toString()));
90
- log(`Account stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
91
88
 
89
+ await this.#store.transactionAsync(async () => {
90
+ if (alias) {
91
+ await this.#aliases.set(`accounts:${alias}`, Buffer.from(address.toString()));
92
+ }
93
+ await this.#accounts.set(`${address.toString()}:type`, Buffer.from(type));
94
+ await this.#accounts.set(`${address.toString()}:sk`, secretKey.toBuffer());
95
+ await this.#accounts.set(`${address.toString()}:salt`, salt.toBuffer());
96
+ if (publicSigningKey) {
97
+ await this.#accounts.set(`${address.toString()}:publicSigningKey`, publicSigningKey);
98
+ }
99
+ await this.#aliases.set('accounts:last', Buffer.from(address.toString()));
100
+ });
101
+ log(`Account stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
92
102
  await this.refreshAliasCache();
93
103
  }
94
104
 
@@ -100,35 +110,38 @@ export class WalletDB {
100
110
  }
101
111
 
102
112
  async storeContract(address: AztecAddress, artifactPath: string, log: LogFn, alias?: string) {
103
- if (alias) {
104
- await this.#aliases.set(`contracts:${alias}`, Buffer.from(address.toString()));
105
- await this.#aliases.set(`artifacts:${alias}`, Buffer.from(artifactPath));
106
- }
107
- await this.#aliases.set(`contracts:last`, Buffer.from(address.toString()));
108
- await this.#aliases.set(`artifacts:last`, Buffer.from(artifactPath));
109
- await this.#aliases.set(`artifacts:${address.toString()}`, Buffer.from(artifactPath));
113
+ await this.#store.transactionAsync(async () => {
114
+ if (alias) {
115
+ await this.#aliases.set(`contracts:${alias}`, Buffer.from(address.toString()));
116
+ await this.#aliases.set(`artifacts:${alias}`, Buffer.from(artifactPath));
117
+ }
118
+ await this.#aliases.set(`contracts:last`, Buffer.from(address.toString()));
119
+ await this.#aliases.set(`artifacts:last`, Buffer.from(artifactPath));
120
+ await this.#aliases.set(`artifacts:${address.toString()}`, Buffer.from(artifactPath));
121
+ });
110
122
  log(`Contract stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
111
-
112
123
  await this.refreshAliasCache();
113
124
  }
114
125
 
115
126
  async storeAuthwitness(authWit: AuthWitness, log: LogFn, alias?: string) {
116
- if (alias) {
117
- await this.#aliases.set(`authwits:${alias}`, Buffer.from(authWit.toString()));
118
- }
119
- await this.#aliases.set(`authwits:last`, Buffer.from(authWit.toString()));
127
+ await this.#store.transactionAsync(async () => {
128
+ if (alias) {
129
+ await this.#aliases.set(`authwits:${alias}`, Buffer.from(authWit.toString()));
130
+ }
131
+ await this.#aliases.set(`authwits:last`, Buffer.from(authWit.toString()));
132
+ });
120
133
  log(`Authorization witness stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
121
-
122
134
  await this.refreshAliasCache();
123
135
  }
124
136
 
125
137
  async storeTx({ txHash }: { txHash: TxHash }, log: LogFn, alias?: string) {
126
- if (alias) {
127
- await this.#aliases.set(`transactions:${alias}`, Buffer.from(txHash.toString()));
128
- }
129
- await this.#aliases.set(`transactions:last`, Buffer.from(txHash.toString()));
138
+ await this.#store.transactionAsync(async () => {
139
+ if (alias) {
140
+ await this.#aliases.set(`transactions:${alias}`, Buffer.from(txHash.toString()));
141
+ }
142
+ await this.#aliases.set(`transactions:last`, Buffer.from(txHash.toString()));
143
+ });
130
144
  log(`Transaction hash stored in database with alias${alias ? `es last & ${alias}` : ' last'}`);
131
-
132
145
  await this.refreshAliasCache();
133
146
  }
134
147
 
@@ -13,16 +13,16 @@ import { AccountManager, type Aliased, type SimulateOptions } from '@aztec/aztec
13
13
  import type { DefaultAccountEntrypointOptions } from '@aztec/entrypoints/account';
14
14
  import { Fr } from '@aztec/foundation/curves/bn254';
15
15
  import type { LogFn } from '@aztec/foundation/log';
16
+ import type { AccessScopes, NotesFilter } from '@aztec/pxe/client/lazy';
16
17
  import type { PXEConfig } from '@aztec/pxe/config';
17
18
  import type { PXE } from '@aztec/pxe/server';
18
19
  import { createPXE, getPXEConfig } from '@aztec/pxe/server';
19
20
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
20
21
  import { deriveSigningKey } from '@aztec/stdlib/keys';
21
22
  import { NoteDao } from '@aztec/stdlib/note';
22
- import type { NotesFilter } from '@aztec/stdlib/note';
23
23
  import type { TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
24
24
  import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
25
- import { BaseWallet } from '@aztec/wallet-sdk/base-wallet';
25
+ import { BaseWallet, type FeeOptions } from '@aztec/wallet-sdk/base-wallet';
26
26
 
27
27
  import type { WalletDB } from '../storage/wallet_db.js';
28
28
  import type { AccountType } from './constants.js';
@@ -87,7 +87,7 @@ export class CLIWallet extends BaseWallet {
87
87
  increasedFee: InteractionFeeOptions,
88
88
  ): Promise<TxProvingResult> {
89
89
  const cancellationTxRequest = await this.createCancellationTxExecutionRequest(from, txNonce, increasedFee);
90
- return await this.pxe.proveTx(cancellationTxRequest);
90
+ return await this.pxe.proveTx(cancellationTxRequest, this.scopesFrom(from));
91
91
  }
92
92
 
93
93
  override async getAccountFromAddress(address: AztecAddress) {
@@ -208,12 +208,40 @@ export class CLIWallet extends BaseWallet {
208
208
  }
209
209
 
210
210
  override async simulateTx(executionPayload: ExecutionPayload, opts: SimulateOptions): Promise<TxSimulationResult> {
211
- let simulationResults;
212
- const feeOptions = opts.fee?.estimateGas
213
- ? await this.completeFeeOptionsForEstimation(opts.from, executionPayload.feePayer, opts.fee?.gasSettings)
214
- : await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
211
+ const simulationResults = await super.simulateTx(executionPayload, opts);
212
+
213
+ if (opts.fee?.estimateGas) {
214
+ const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings);
215
+ const limits = getGasLimits(simulationResults, opts.fee?.estimatedGasPadding);
216
+ printGasEstimates(feeOptions, limits, this.userLog);
217
+ }
218
+ return simulationResults;
219
+ }
220
+
221
+ /**
222
+ * Uses a stub account for kernelless simulation, bypassing real account authorization.
223
+ * Falls through to the standard entrypoint path for SignerlessAccount (ZERO address).
224
+ */
225
+ protected override async simulateViaEntrypoint(
226
+ executionPayload: ExecutionPayload,
227
+ from: AztecAddress,
228
+ feeOptions: FeeOptions,
229
+ scopes: AccessScopes,
230
+ skipTxValidation?: boolean,
231
+ skipFeeEnforcement?: boolean,
232
+ ): Promise<TxSimulationResult> {
233
+ if (from.equals(AztecAddress.ZERO)) {
234
+ return super.simulateViaEntrypoint(
235
+ executionPayload,
236
+ from,
237
+ feeOptions,
238
+ scopes,
239
+ skipTxValidation,
240
+ skipFeeEnforcement,
241
+ );
242
+ }
243
+
215
244
  const feeExecutionPayload = await feeOptions.walletFeePaymentMethod?.getExecutionPayload();
216
- const chainInfo = await this.getChainInfo();
217
245
  const executionOptions: DefaultAccountEntrypointOptions = {
218
246
  txNonce: Fr.random(),
219
247
  cancellable: this.cancellableTransactions,
@@ -223,44 +251,23 @@ export class CLIWallet extends BaseWallet {
223
251
  ? mergeExecutionPayloads([feeExecutionPayload, executionPayload])
224
252
  : executionPayload;
225
253
 
226
- // Kernelless simulations using the multicall entrypoints are not currently supported,
227
- // since we only override proper account contracts.
228
- // TODO: allow disabling kernels even when no overrides are necessary
229
- if (opts.from.equals(AztecAddress.ZERO)) {
230
- const fromAccount = await this.getAccountFromAddress(opts.from);
231
- const txRequest = await fromAccount.createTxExecutionRequest(
232
- finalExecutionPayload,
233
- feeOptions.gasSettings,
234
- chainInfo,
235
- executionOptions,
236
- );
237
- simulationResults = await this.pxe.simulateTx(
238
- txRequest,
239
- true /* simulatePublic */,
240
- opts?.skipTxValidation,
241
- opts?.skipFeeEnforcement ?? true,
242
- );
243
- } else {
244
- const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(opts.from);
245
- const txRequest = await fromAccount.createTxExecutionRequest(
246
- finalExecutionPayload,
247
- feeOptions.gasSettings,
248
- chainInfo,
249
- executionOptions,
250
- );
251
- const contractOverrides = {
252
- [opts.from.toString()]: { instance, artifact },
253
- };
254
- simulationResults = await this.pxe.simulateTx(txRequest, true /* simulatePublic */, true, true, {
255
- contracts: contractOverrides,
256
- });
257
- }
258
-
259
- if (opts.fee?.estimateGas) {
260
- const limits = getGasLimits(simulationResults, opts.fee?.estimatedGasPadding);
261
- printGasEstimates(feeOptions, limits, this.userLog);
262
- }
263
- return simulationResults;
254
+ const { account: fromAccount, instance, artifact } = await this.getFakeAccountDataFor(from);
255
+ const chainInfo = await this.getChainInfo();
256
+ const txRequest = await fromAccount.createTxExecutionRequest(
257
+ finalExecutionPayload,
258
+ feeOptions.gasSettings,
259
+ chainInfo,
260
+ executionOptions,
261
+ );
262
+ return this.pxe.simulateTx(txRequest, {
263
+ simulatePublic: true,
264
+ skipFeeEnforcement: true,
265
+ skipTxValidation: true,
266
+ overrides: {
267
+ contracts: { [from.toString()]: { instance, artifact } },
268
+ },
269
+ scopes,
270
+ });
264
271
  }
265
272
 
266
273
  // Exposed because of the `aztec-wallet get-tx` command. It has been decided that it's fine to keep around because