Skip to content

feat(aztec.js): plumb immutablesHash through AccountManager.create#23508

Closed
Thunkar wants to merge 12 commits into
nextfrom
gj/plumb_immutables_hash
Closed

feat(aztec.js): plumb immutablesHash through AccountManager.create#23508
Thunkar wants to merge 12 commits into
nextfrom
gj/plumb_immutables_hash

Conversation

@Thunkar
Copy link
Copy Markdown
Contributor

@Thunkar Thunkar commented May 22, 2026

Summary

Adds an optional AccountManagerCreateOptions argument to AccountManager.create so callers can commit an immutablesHash (and override deployer / publicKeys) without bypassing the standard account-setup pipeline.

export interface AccountManagerCreateOptions {
  immutablesHash?: Fr;
  deployer?: AztecAddress;
  publicKeys?: PublicKeys;
}

static async create(
  wallet: Wallet,
  secretKey: Fr,
  accountContract: AccountContract,
  salt?: Salt,
  opts?: AccountManagerCreateOptions,
): Promise<AccountManager>

getContractInstanceFromInstantiationParams already accepts immutablesHash and deployer, so this is pure plumbing — no protocol-level changes.

Motivation

Enables third-party wallets (e.g. @aztec-kit/embedded-wallet) to set up AZIP-9 initializerless accounts that bind their signing key via ContractInstance.immutables_hash through the normal AccountManager.create path, instead of constructing the instance themselves and reaching for the package-private positional constructor.

Address derivation that includes immutables_hash was landed in #23151 (part 2 of AZIP-9). publish_for_public_execution already forwards immutablesHash from the instance — this PR closes the remaining gap on the account-creation side.

Backwards compatibility

Existing callers that don't pass opts keep producing instances with immutablesHash = Fr.ZERO, matching today's behavior. The fourth-arg salt?: Salt stays in place, so positional callers (incl. cli-wallet, end-to-end, EmbeddedWallet) are unaffected.

Test plan

  • New yarn-project/aztec.js/src/wallet/account_manager.test.ts covers:
    • default immutablesHash = Fr.ZERO when no opts are passed
    • a non-zero immutablesHash flows into the resulting instance and address
    • changing immutablesHash changes the derived address

nchamo and others added 12 commits May 21, 2026 10:26
Adds an optional `AccountManagerCreateOptions` argument to
`AccountManager.create` so callers can commit an `immutablesHash`
(and override `deployer` / `publicKeys`) without bypassing the
standard account-setup pipeline.

Motivation: enables third-party wallets to set up AZIP-9
initializerless accounts that bind their signing key via
`ContractInstance.immutables_hash` (see #23151) through the normal
`AccountManager.create` path. Today they have to construct the
instance themselves and reach for the package-private positional
constructor.

The change is backwards compatible: callers that don't pass `opts`
keep producing instances with `immutablesHash = Fr.ZERO`, matching
today's behavior.
@Thunkar Thunkar force-pushed the gj/plumb_immutables_hash branch from 7e3882b to 3d85c68 Compare May 22, 2026 15:05
@Thunkar Thunkar closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants