feat(aztec-nr): let contracts choose the message tag derivation - #24432
Merged
Conversation
nchamo
marked this pull request as ready for review
July 1, 2026 15:29
vezenovm
approved these changes
Jul 1, 2026
vezenovm
left a comment
Contributor
There was a problem hiding this comment.
looks good, mostly nits, approving as I leave to you to decide which you want to adopt
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.
Motivation
The handshake registry delivers its own notes as a self-send, tagged through the generic on-chain tagging path. That path references
STANDARD_HANDSHAKE_REGISTRY_ADDRESS, so the registry embeds its own address in its own bytecode. A contract's deploy address is a hash of its bytecode, so the pinned address never converges: re-pinning moves the bytecode, which moves the address.Building on #24387, a contract can now fix its tag derivation at compile time. When the registry fixes the address-derived derivation, the handshake-registry references fold out of its bytecode via dead-code elimination, the self-reference disappears, and the address converges, all without changing the emitted tag.
The change
via_*methods, honored over the wallet's default resolution:via_non_interactive_handshake()via_address_derived_secret()OnchainUnconstrainedDeliveryandOnchainConstrainedDelivery; the address-derived derivation is exposed only on the unconstrained builder, since it cannot back constrained delivery.via_*call) is unchanged: reuse a registered handshake, otherwise the wallet-resolved strategy.