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

ecrecover return ethereum address #27

Open
Guti opened this issue May 26, 2018 · 2 comments
Open

ecrecover return ethereum address #27

Guti opened this issue May 26, 2018 · 2 comments

Comments

@Guti
Copy link

Guti commented May 26, 2018

Qtum Hex Address = RIPEMD160( SHA256( PUBLIC KEY ))

Ethereum Address = KECCAK256( PUBLIC KEY ) and drop the first 12 bytes

When we use the precompiled "ecrecover" function in a smart contract we can not obtain the QTUM address with which we have signed.

ret = dev::sha3(rec);

@qtum-neil
Copy link
Contributor

Thanks for reporting this issue, we will include a fix in our next hardfork, meanwhile, a workaround would be to use a pure solidity contract that does the recovery.

@Guti
Copy link
Author

Guti commented May 28, 2018

Thank you. I am currently using the validateSignature function of the Secp256k1 library

Secp256k1.sol

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