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
web3.accounts.create() generating wrong public key #1267
Comments
A minimum working example so I can be reproduced would help, is MEW giving you the public key or the address? |
I have a similar problem, I try to get a public key from a private key, and |
@phoax the private key should always be prefixed with |
Lots of confusion could be solved by allowing a buffer to be passed as well, not just a string that'll have its first 2 bytes stripped cuz it's expecting a "0x" prefix. |
I had the same error with an incorrect account address being generated from passing in a privateKey variable using: Simply fixed by using: Thanks @kevinwucodes Of course I upgrade my web3 and went in day's worth of debugging different errors to arrive back at this problem and before actually finding this solution.... |
Which Web3.js version?: 1.0.0-beta.27
Which operating system?: Windows / Chrome
How installed?: NPM
Using it with Angular-CLI project
actual behavior
An account generated by web3.accounts.create() is creating an account with public/private key. Which is desired behavior, But when i try to access the account using the private key on myetherwallet.com, it displayes a different public key than the one given by web3.
expected behavior
The public key should be same.
steps to reproduce
initialize web3 and create a new account. I created 10 accounts and 8 out of them had the issue.
The text was updated successfully, but these errors were encountered: