Create a free Team What is Teams? Learn more. How can I check if an Ethereum address is valid? Ask Question. Asked 5 years, 9 months ago. Active 4 months ago. Viewed 71k times. Improve this question. ZMitton ZMitton 2, 3 3 gold badges 15 15 silver badges 32 32 bronze badges. Related medium. Add a comment. Active Oldest Votes. SetString expanded, 10 if checkSumNum. Mod checkSumNum, Big Cmp Big1! Improve this answer. Nikolai Golub 4 4 bronze badges. Great answer!
Out of curiosity, any idea how good the checksum is? EIP 55 compares the regular address checksum with ICAP: "On average there will be 15 check bits per address, and the net probability that a randomly generated address if mistyped will accidentally pass a check is 0.
It would be nice to be able to check for validity in Solidity as well. One way to do this would be to transfer a tiny amount of ether to any new address you create, and check for non-zero balance in Solidity. Should that be a separate question? PedroLobito For sha3, you can use keccak from a library like github. Alper Yes a smart contract address can be capitalized according to EIP 55, example.
Show 7 more comments. The isaddress method also checks for checksum! It will also check the checksum, if the address has upper and lowercase letters. As atul stated — I. The scheme is as follows: convert the address to hex, but if the ith digit is a letter ie. Stepan Poperechnyi Stepan Poperechnyi 1 1 gold badge 8 8 silver badges 20 20 bronze badges. It still seems to be a better way to write the plausibility test regex.
Balidator Balidator 41 1 1 silver badge 2 2 bronze badges. The python Web3 library also has address checking methods. ICAP has preliminary support merged in some Ethereum client. Gustav Simonsson Gustav Simonsson 1 1 silver badge 3 3 bronze badges. There are multiple services which convert you non-checksummed Ethereum address to a checksummed, but we found the easiest way is to use etherscan. Not too long ago, Ethereum addresses did not have any checksum at all, and it was only in that Ethereum co-founder and lead developer Vitalik Buterin implemented the function due to popular demand.
Due to the nature of cryptocurrencies, you are the sole owner of your address and your funds. There is no higher authority to appeal to in an event of a mistake. Insert your Ethereum address in the search field. You will be taken to an overview of the inputted address.
At the top of the page will be your checksummed address. This can be verified by checking if it contains capital letters. Tags: checksum Ethereum. Download App Keep track of your holdings and explore over 10, cryptocurrencies.