EVM Node: Output EIP-55-compatible addresses
Part of L2-211
What
This change updates the address_to_string function to return addresses with a
mixed-case checksum, following the EIP-55 standard.
Why
EIP-55 has been introduced to prevent errors from mistyped addresses. It provides a checksum mechanism that helps verify the integrity of an address, reducing the risk of sending funds to an incorrect recipient due to a typo.
How
The address_to_string function was reimplemented. It now calculates the
Keccak-256 hash of the address. Based on this hash, it selectively capitalizes
the alphabetic characters of the address string to create the checksum, and
prefixes the result with "0x".
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Thomas Letan