Skip to content

Output addresses in EIP-55 checksum format#16

Open
heswithme wants to merge 1 commit intoHrikB:masterfrom
heswithme:feature/checksum-addresses
Open

Output addresses in EIP-55 checksum format#16
heswithme wants to merge 1 commit intoHrikB:masterfrom
heswithme:feature/checksum-addresses

Conversation

@heswithme
Copy link

Output addresses in EIP-55 checksum format

Summary

This PR adds EIP-55 checksum formatting to all output addresses, improving compatibility with Ethereum tooling and making addresses more recognizable.

Changes

  • Added src/checksum.rs module implementing EIP-55 checksum address formatting
  • Modified address output in src/lib.rs to use checksum format instead of lowercase hex

Details

The implementation follows the EIP-55 specification:

  1. Hash the lowercase hex address (without 0x prefix) using Keccak256
  2. For each character in the address that is a letter (a-f), uppercase it if the corresponding bit in the hash is 1

Example Output

Before:

0xe6ab51a5f6e3ff03ab49e6000000000000000000000000000000000000000000 => 0x003833d688046bc9b40aaf4629589850beb7d70e

After:

0xe6ab51a5f6e3ff03ab49e6000000000000000000000000000000000000000000 => 0x003833d688046bc9b40aAF4629589850bEb7d70e

Testing

  • Added unit tests for checksum implementation with official EIP-55 test vectors
  • Manually tested mining functionality to ensure output is correctly formatted
  • No changes to core mining logic or performance

Backward Compatibility

This change only affects the display format of addresses in output. It does not affect:

  • Pattern matching logic
  • Mining performance
  • Input parsing
  • File format compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant