You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
347 B
Python

2 years ago
from web3.auto import w3
from eth_account.messages import encode_defunct
def verify_signature(message, signature, public_address):
msg = encode_defunct(text=message)
recovered = w3.eth.account.recover_message(msg, signature=signature)
if recovered.lower() == public_address.lower():
return True
else:
return False