-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Safer Ethereum Address Format #77
Comments
Uploaded a Javascript tool to play around with alphabets. |
Definitely agree with the motivation, but is there any reason for not simply using Base58Check, with a version byte/leading symbol of |
@amacneil The simplest solution, most tested, and probably the best. I think there might be some pride in constucting something else... One of the Seven deadly sins :P |
@amacneil my reason against I do not mind what alphabet would be used. If we care about hand written (as opposed to copy-paste only) addresses, base-58 itself has many characters which can be mistaken for another. This will stop a wrongly written address from being used, but the user must make many permutations to get the right one. Choosing the right alphabet removes this problem too. Additionally using |
What are the reasons for some of the letters being omitted from ethbase-2 and 3 alphabets? |
@axic that makes sense, good to make it easy to verify within a contract. I don't personally think hand written is worth optimizing too much for. In the long term some form of name registry will avoid people needing to deal with raw addresses. Obviously if it's easy to do then probably worth it though. Ether way, it would be nice to have a similar sort of version field to base58check, so that (for example) every address begins with E, making it easily distinguishable as an Ethereum address (and different from a Bitcoin address, even to people who may not immediately be able to recognize the different alphabets). |
@D-Nice apart from the letters which can look similar (and mentioned above), those two alphabets are lacking some letters for aesthetic reasons (not to have letters reaching below baseline) in an attempt to make the output look pleasing. Putting aesthetics aside, the three more logical choices are:
@amacneil removing 3 letters from base-58 solves that problem. I lean towards just having a prefix and not trying to come up with a field within to produce the desired prefix |
I further thought: right now there is no distinction made between addresses used on a given network. A distinction could be made by using a few bytes from the hash of block #0. i.e. for frontier/homestead it could be the constant |
@axic that is a great idea. It would prevent people like this from accidentally sending coins to testnet addresses, and unlike a fixed prefix it doesn't need to be assigned/registered for anyone creating new private chains. Not sure whether it's worth thinking about at this stage, but I think in future once sharding is implemented, addresses will need to have some form of shard prefix added to them as well. |
Now that EIP-55 is merged, is this EIP still relevant? Is there something that would happen that would cause the discussion here to continue? Is there any circumstance where this proposal would be merged or abandoned? |
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
adding vechain caip-2
Motivation
The primary motivation is to have a safer address format used for user-to-user and user-to-contract transactions/interactions.
Secondary motivations:
Clarification regarding in-contract implementation: assuming there is a contract call which receives an address type as a parameter, the client software should be able to convert the proposed address format to the raw Ethereum address and send that in the request.
Implementation across the ecosystem
It should be initially implemented in client side solutions and the network endpoints (RPC) would receive the current addresses. If #55 is implemented on the RPC level it would be easy to convert this format to that.
Probably it is safe to assume that data sent to the RPC/network level should be validated by the clients and no change is proposed to those levels.
Other formats
The ICAP format can safely store a reduced set of Ethereum addresses (called direct ICAP). The basic ICAP is a format allowing storage of all Ethereum addresses at the risk of checksum collision. This has been raised multiple times, see #57 and #70. The ICAP format also supports indirect ICAP addresses which work through a name registry. Maybe it is better to leave that to its own format - the ICAP.
The checksumming proposed in #55 is clever at being backward compatible. I like it personally and implemented where possible, but I do not think it is a complete solution.
Specification
1) The internally stored data should be (similar to how Bitcoin addresses are built):
where
flags
is a configuration field for future extensions andchecksum
corresponds to the lowest 32 bits of the sha3/keccak hash of the address. (This is different to Bitcoin.)2) This binary data should then be encoded using a defined alphabet, more on that later.
3) A prefix (such as
E
,ET
,ETH
) would be very useful to make the address easily recognizable. This prefix could either be manually appended as a string or be part of the binary (as a special value producing those letters after the transformation).I am leaning towards just using the prefix as a string and not being part of the binary data.
Contracts
I am not entirely sure, but it might make sense having either a flag or a different prefix to distinguish between external accounts and contract addresses.
One of the reasons is that without querying the network it would be clear that different gas costs would apply for making a value transfer. And it would be clear in which case contract interactions are possible.
Alphabets
Before deciding on an alphabet an important question to answer is whether we anticipate these addresses to be typed in or purely copy-pasted. If the ability to type in is important, probably an alphabet should be used which eliminates obvious errors (
i = l = 1
,0 = o
,u = v
).I have experimented with different alphabets and have no conclusion yet.
ethbase
are made up by me. I likeethbase-2
andethbase-3
.Examples
These don't have the prefix suggested above (and have
flag = 1
). I can generate a larger set and publish as a gist if needed.Alternative solution
A possible alternative solution is sticking with the hex alphabet (base-16) and checksumming the content using the method described in #55.
Important differences:
The text was updated successfully, but these errors were encountered: