Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the aztec-nr Address derivation #8966

Open
Tracked by #8953
nventuro opened this issue Oct 2, 2024 · 0 comments
Open
Tracked by #8953

Change the aztec-nr Address derivation #8966

nventuro opened this issue Oct 2, 2024 · 0 comments
Labels
C-aztec.nr Component: Aztec smart contract framework team-spf Nico's team

Comments

@nventuro
Copy link
Contributor

nventuro commented Oct 2, 2024

The AztecAddress is currently computed as poseidon2(pub_keys_hash, partial_address). This needs to change to:

let h: Field = poseidon2(pub_keys_hash, partial_address);
let mut maybe_address: Point = h * G + Ivpk_m;
if maybe_address.y > Y_HALF_RANGE { maybe_address = -maybe_address }
let address: Field = maybe_address.x; // wrap in AztecAddress

Note that this means we can no longer derive an address from just the pub keys hash and the partial address, we now also need the Ivpk_m (which part of the preimage of the pub keys hash, and we should know it in all flows in which we also know the pub keys hash).

@nventuro nventuro added C-aztec.nr Component: Aztec smart contract framework team-spf Nico's team labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-aztec.nr Component: Aztec smart contract framework team-spf Nico's team
Projects
Status: Todo
Development

No branches or pull requests

1 participant