Skip to content

fix: wrong domain separator#20969

Open
iAmMichaelConnor wants to merge 1 commit intonextfrom
mc/fix-wrong-domain-separator
Open

fix: wrong domain separator#20969
iAmMichaelConnor wants to merge 1 commit intonextfrom
mc/fix-wrong-domain-separator

Conversation

@iAmMichaelConnor
Copy link
Contributor

@iAmMichaelConnor iAmMichaelConnor commented Feb 27, 2026

When writing an address spec I noticed the same domain separator is being used in two places when deriving an address.

This PR introduces DOM_SEP__SALTED_INITIALIZATION_HASH to replace the incorrect usage of DOM_SEP__PARTIAL_ADDRESS.


pol commit salted_init_hash;

// It's reused between the partial address and salted initialization hash. Weird.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WEIRD, RIGHT?!

@iAmMichaelConnor
Copy link
Contributor Author

@LeilaWang please could you review the nr changes?

@IlyasRidhuan (or someone else on the avm team) please could you review the PIL & cpp changes, because I'm unfamiliar with that code.

Copy link
Contributor

@LeilaWang LeilaWang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nr changes LGTM!

const saltedInitializationHash = await poseidon2HashWithSeparator(
[salt, initializationHash, deployer],
DomainSeparator.PARTIAL_ADDRESS,
DomainSeparator.SALTED_INITIALIZATION_HASH,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe reuse the util from contract_address.ts here?
await computeSaltedInitializationHash({ salt, initializationHash, deployer })

When writing an address spec I noticed the same domain separator is being used in two places when deriving an address.

This PR introduces DOM_SEP__SALTED_INITIALIZATION_HASH to replace the incorrect usage of DOM_SEP__PARTIAL_ADDRESS.
@AztecBot AztecBot force-pushed the mc/fix-wrong-domain-separator branch from d92e699 to 96ee4c8 Compare February 27, 2026 20:14
@AztecBot AztecBot added this pull request to the merge queue Feb 27, 2026
@iAmMichaelConnor iAmMichaelConnor removed this pull request from the merge queue due to a manual request Feb 27, 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