Author

Topic: Publickey/ETH address python help (Read 36 times)

copper member
Activity: 250
Merit: 412
Building A Crypto Empire
January 20, 2022, 09:42:54 PM
#1
Hello guys again,

Last time I posted about Bitcoin address recovery, this time its to do with Ethereum address recovery.

I am using eth-keys python package for testing purposes  (https://pypi.org/project/eth-keys/)

Trying to recover the PublicKey by providing the message and signature.
The function I am calling is:

Code:
eth_keys.KeyAPI.PublicKey.recover_from_msg(message, signature)

Params:

Code:
msg = 'its wed jan 19, 0244;2022'
message = bytes(msg, 'utf-8')
signature = bytes.fromhex('206d55f3108c016ed650a01b9e5ebd6bc0278aebbb545a3afeda42aa19eb15780686127622c09f08c31565a3eda085bfc239d1973215f4d0818ed6537487b2461b')

Its returning this error:
 
Code:
coincurve/ecdsa.py", line 60, in deserialize_recoverable raise ValueError('Invalid recovery id.') ValueError: Invalid recovery id.
eth_keys/backends/coincurve.py", line 105, in ecdsa_recover except (ValueError, Exception) as err: eth_keys.exceptions.BadSignature: Invalid recovery id.

When I try to print out the recovery_id being passed in the code it returns: 27

Need some ideas on this, is that correct recovery_id? Between I have been searching for days trying to figure out other issues with this eth-package, and now the dependency “coincurve” is raising this error.
Jump to: