I want to build an ink! contract where some functions need to verify messages signed by the caller.
In ink! contract there is a helper function named ink_env::ecdsa_recover()
, which seems helpful in my use case. However, I am not sure how to sign ecdsa messages using polkadot.{js}. I can only generate sr25519 signatures.
An alternative is to verify sr25519 signatures in the contract instead of ecdsa signatures. However, it seems that verifying sr25519 signatures requires the caller's public key, but I only have the caller's AccountId
(or address). Is there a way to convert the address to the public key in ink! contract?