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

non-hex keys #3

Closed
MareoRaft opened this issue Aug 19, 2018 · 4 comments
Closed

non-hex keys #3

MareoRaft opened this issue Aug 19, 2018 · 4 comments

Comments

@MareoRaft
Copy link
Contributor

Would it be difficult to support keys that are not Hex-encoded 32-byte? I imagine some users will have such keys, and we could potentially make it more convenient for them if we can support those keys. In the meantime, I'll do a little research so I can understand the issue better.

@MareoRaft
Copy link
Contributor Author

It seems in my case the key was already Hex-encoded 32-byte, and simply ommitted the "0x" characters at the beginning. In that case, it could be helpful to the user to automatically prepend the "0x" under the condition that it's 64 characters long and only uses characters 0-9 a-f. But this could be dangerous if there is a possibility that a key is not hex-encoded and just so happens to be in the right format to look like it is. I don't know much about etherium private keys, so I don't know if this "dangerous" scenario would happen or not.

@MareoRaft
Copy link
Contributor Author

So this leads to the question of whether we need to worry about non-32-byte keys. Do etherium private keys that are, for example, 64 bytes instead of 32 bytes exist?

@merklejerk
Copy link
Owner

Yeah, it's usually not a good idea to be too permissive in crypto as you really want the user to be very conscious of what they're doing.

If I may make a suggestion, and if you haven't done so already, you might consider displaying an "ethereum blockie" image for address fields as a visual check.

Private keys are always 32 bytes. Anything more or less shouldn't work.

@MareoRaft
Copy link
Contributor Author

Okay, that makes sense. Yes, I'll try to add in blockies. I'll try out

https://github.com/ethereum/blockies

unless you have one to recommend

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

2 participants