Last active
September 6, 2023 06:45
-
-
Save signorecello/dad41f8b90ae48c7355bfd1f34f8885b to your computer and use it in GitHub Desktop.
Convert public key to ethereum address in Noir
This file contains 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
let hashOfPubKey = std::hash::keccak256(pub_key); | |
let mut result : Field = 0; | |
let mut v : Field = 1; | |
for i in 0..20 { | |
let index = (20 - i); | |
result += hashOfPubKey[index + 11] as Field * v; | |
v *= 256; | |
} | |
result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment