Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support Mixed-case Checksum address encoding #23

Closed
sambacha opened this issue Mar 11, 2024 · 8 comments
Closed

Feature: Support Mixed-case Checksum address encoding #23

sambacha opened this issue Mar 11, 2024 · 8 comments

Comments

@sambacha
Copy link

sambacha commented Mar 11, 2024

See the EIP Specification here: https://github.com/ethereum/ercs/blob/master/ERCS/erc-55.md https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1191.md

EIP-11911: This uses ChainId to encode mixed-case checksumming to addresses, allow the same address to be differentiated based on the encoding of character case based on ChainId

Footnotes

  1. Correct EIP is 1191, not 55

@paulmillr
Copy link
Owner

This one? erc-55 doesn't mention anything about chainid

addChecksum(nonChecksummedAddress: string): string {
const low = addr.parse(nonChecksummedAddress).data.toLowerCase();
const hash = bytesToHex(keccak_256(low));
let checksummed = '';
for (let i = 0; i < low.length; i++) {
const hi = Number.parseInt(hash[i], 16);
const li = low[i];
checksummed += hi <= 7 ? li : li.toUpperCase(); // if char is 9-f, upcase it
}
return add0x(checksummed);

@sambacha
Copy link
Author

whoops, meant this one sorry! https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1191.md

@sambacha
Copy link
Author

example:

EIP-1191 Checksum for mevETH

0x24aE2dA0F361AA4bE46B48EB19c91e02c5E4F27e

Normal Checksum

0x24Ae2dA0f361AA4BE46b48EB19C91e02c5e4f27E

@paulmillr
Copy link
Owner

That seems useful.

@paulmillr
Copy link
Owner

c8a86a6

@sambacha
Copy link
Author

Hell yeah, thanks for getting this done so quickly!

@ricmoo
Copy link

ricmoo commented May 10, 2024

I’ve just been made aware of these changes.

EIP-1191 is a derelict EIP, has been removed and discouraged from existing libraries and should not be introduced.

Web3.js and EthereumJS (back in 2021) had to wait until a major version to remove it, which I would suspect would be the same here.

The discussion-to link in the EIP covers much of the issues, as well as helps give context why it was never moved from last call to final. It was contention and breaks (entirely) backwards compatibility in the address format, which EIP-155 tried so desperately to maintain.

I would love to carry on this discussion further if necessary and interested though. I thought the EIP had finally been defeated, but now see people talking about it again, so wanted to speak up. :)

@paulmillr
Copy link
Owner

@sambacha thoughts on reverting this?

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

No branches or pull requests

3 participants