Skip to content

ethers.js signature provides different signature than golang "go-ethereum" #4339

Answered by zemse
riskers asked this question in Q&A
Discussion options

You must be logged in to vote

Quoting ricmoo's reply in #823 (comment),

For the signature, recovery param is 0x00, while the v value is 0 + 27 == 0x1b. Ethers and many toolings append the v value while the go lib is appending the recovery param.

Both can be said as a valid ECDSA signatures, but some libraries may not entertain the 0x00 or 0x01 value, they might expect value of v to be 27 or 28. So to have the signature from go library working, you can add 27 or 0x1b to the last byte.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by riskers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants