feat!: bind fee payment method and cancellable into account entrypoint authwit - #25157
Draft
vezenovm wants to merge 1 commit into
Draft
feat!: bind fee payment method and cancellable into account entrypoint authwit#25157vezenovm wants to merge 1 commit into
vezenovm wants to merge 1 commit into
Conversation
…t authwit The account entrypoint authorized only the app payload hash, so a party holding an account's authorization witness (a relayer or delegated prover) could reuse it while switching fee_payment_method (EXTERNAL -> PREEXISTING_FEE_JUICE) or flipping cancellable, driving fee-payer and cancellation side effects the account never approved. AccountActions::entrypoint now authorizes a combined hash over the app payload, fee_payment_method, and cancellable under a new aztec-nr-owned domain separator, mirrored in the TypeScript builder. Gas settings are not yet bound; that needs the self-paid-deploy flow to build the witness with settings resolved during send preparation, and is left as a follow-up.
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.
Problem
Fixes F-841
AccountActions::entrypointauthorized onlyapp_payload.hash(). The laterfee_payment_methodandcancellableinputs were unsigned, so a party holding an account's authorization witness (a relayer or delegated prover) could reuse it while switchingfee_payment_methodfromEXTERNALtoPREEXISTING_FEE_JUICE(making the account pay from its own fee-juice balance) or flippingcancellable, driving side effects the account never approved.Fix
The entrypoint now authorizes a combined hash over
app_payload.hash(),fee_payment_method, andcancellableunder a new aztec-nr-owned domain separator (DOM_SEP__ENTRYPOINT_PAYLOAD), mirrored in the TypeScript builder (computeEntrypointPayloadHash).compute_authwit_message_hashis unchanged, so the pinnedAuthRegistryis unaffected and no standard-contract re-pin is needed. All in-repo account contracts delegate toAccountActions::entrypoint, so they inherit the change on recompile with no per-contract edits.Scope
fee_payment_methodandcancellableare deterministic at witness-build time, so binding them does not affect the self-paid deploy flow. Binding the full gas settings is deliberately deferred to a follow-up: self-paid deploy builds the account witness before gas settings are resolved during send preparation (and estimation vs send use different gas), so it needs a deploy-flow sequencing change. Self-paid deploy is first-party (the same local PXE builds and proves), which F-841 identifies as not the exposed path.Tests
domain_separators_are_validregisters the new separator and checks derivation + whole-namespace collision-freedom.account_entrypoint.test.ts: the payload authwit request hash is stable for identical requests, differs across everyfee_payment_methodtransition, differs whencancellableflips, and a drift guard re-derives the separator fromaz_dom_sep__entrypoint_payload.Breaking change
The authorized message preimage changes, so client and account bytecode must be upgraded together, and third-party wallets that build the entrypoint witness themselves must include
fee_payment_methodandcancellable. Documented in the developer migration notes.