This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Don't kill 1/2 bytes from private keys please #2033
Labels
Bug
Addressing a bug
Comments
This was referenced Mar 31, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using:
a) If your private key is hex0x - all good.
b) If your private key is hex - everyting will work fine, no errors, but your signed transaction will be with private key with one byte zero'ed.
c) If your private key is Buffer - everything will be signed, no errors, but your signed transaction will be with private key with two first bytes zero'ed.
...which is kind of cute that 3 different representations create 3 valid, different signed transactions, all thanks to web3 not validating it's inputs and this internally doing the same https://github.com/MaiaVictor/eth-lib/blob/master/src/account.js#L47
The text was updated successfully, but these errors were encountered: