Last active
March 18, 2025 05:15
-
-
Save VictorNS69/3708d6c20a66dcf9eec235d46e02bc76 to your computer and use it in GitHub Desktop.
Revisions
-
VictorNS69 revised this gist
Mar 10, 2020 . No changes.There are no files selected for viewing
-
VictorNS69 renamed this gist
Jan 16, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
VictorNS69 created this gist
Jan 16, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/usr/bin/env python3 """ You will need to install the pycryptodome package. You can do it with: pip3 install pycryptodome Note: To install pip3, run the following command sudo apt install python3-pip """ import codecs from Crypto.Hash import keccak # An example of public key is: a33e56a80b9dc83a4456265d877c0765cea76146e625572fc679804f8867222ca3c816433a9b6e6690b0b8e919ffa874982706e812314aae09d85fc62fc4fa3c public_key_bytes = codecs.decode("your public key here", "hex") keccak_hash = keccak.new(digest_bits=256) keccak_hash.update(public_key_bytes) keccak_digest = keccak_hash.hexdigest() wallet_len = 40 wallet = "0x" + keccak_digest[-wallet_len:] print("address", wallet)