-
-
Save n4ru/b79841f27d1bffb93edaaf9f9f973c73 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