feat(aztec.js): plumb immutablesHash through AccountManager.create#23508
Closed
Thunkar wants to merge 12 commits into
Closed
feat(aztec.js): plumb immutablesHash through AccountManager.create#23508Thunkar wants to merge 12 commits into
Thunkar wants to merge 12 commits into
Conversation
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.
7e3882b to
3d85c68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
AccountManagerCreateOptionsargument toAccountManager.createso callers can commit animmutablesHash(and overridedeployer/publicKeys) without bypassing the standard account-setup pipeline.getContractInstanceFromInstantiationParamsalready acceptsimmutablesHashanddeployer, 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 viaContractInstance.immutables_hashthrough the normalAccountManager.createpath, instead of constructing the instance themselves and reaching for the package-private positional constructor.Address derivation that includes
immutables_hashwas landed in #23151 (part 2 of AZIP-9).publish_for_public_executionalready forwardsimmutablesHashfrom the instance — this PR closes the remaining gap on the account-creation side.Backwards compatibility
Existing callers that don't pass
optskeep producing instances withimmutablesHash = Fr.ZERO, matching today's behavior. The fourth-argsalt?: Saltstays in place, so positional callers (incl.cli-wallet,end-to-end,EmbeddedWallet) are unaffected.Test plan
yarn-project/aztec.js/src/wallet/account_manager.test.tscovers:immutablesHash = Fr.ZEROwhen no opts are passedimmutablesHashflows into the resulting instance and addressimmutablesHashchanges the derived address