I'm trying to interact with a smart contract in python. With Metamask i can see, that there is a signature trasferred to verify my wallet. Now the point is how to calculate this signature to use a python script. On the contract side, the signature will be compared with a calculated signature on the server:
bytes32 message = keccak256(abi.encodePacked(msg.sender, address(this)));
require(verifier.verify(message, _signature), "INVALID_SIGNATURE");
function verify(bytes32 _message, bytes memory _signature) external view returns (bool);
I assume that msg.sender will be my wallet adress but not sure about the other one?
Any links to read more about this topic would also be helpful! Thank you.
keccak256
is a generic hashing function. It can take any string as an input. If your question is aboutabi.encodePacked
, you can read about what that does in the docs.