Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add eth_addr_checksum validation, update eth_addr (#1080)
rationale: - ethereum addresses are derived from a public key (the last 20 bytes). The network accepts any case insensitive address as long as it is a 40 char alphanumeric (When the last 20 bytes are converted to hex). It is 0x prefixed so that it becomes 42 in length, hence the current eth_addr implementation is modified to reflect this. - Checksum-ing is optional on ethereum and is a way of typo checking the address hence this is introduced as a new validation i.e. eth_addr_checksum. refs: - https://github.com/ethereum/go-ethereum/blob/master/crypto/crypto.go#L275 - https://goethereumbook.org/en/wallet-generate/ - https://goethereumbook.org/en/address-check/
- Loading branch information
1 parent
8f07b03
commit b95730f
Showing
3 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
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
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
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