How to verify a message's signature in motoko?

Verifying the signature of a message is one of the most common uses of smart contracts.
(the “message” is a string or bytes value, not canister’s call.)
Ethereum example: userA signs “hello world” with the EIP712 rule, then userB send a transaction with userA’s address and signature as arguments to the smart contract, which will be verified in the smart contract.

1 Like