I'd like to sign a message via Phantom (https://solana.stackexchange.com/questions/1320/how-to-verify-a-signature-from-the-phantom-wallet), and then have a smart contract verify the signature of the message to be from the correct public key.

From searches, I found there is an ed25519 signature program (https://github.com/solana-labs/solana/blob/master/core/src/sigverify.rs), but I have no idea how to use it. And no idea if this is how one would verify a signature in a rust smart contract.

Ethereum has an method `ecrecover` in Solidity that allows one to verify a signature given the message and public address. I'm hoping for something similar.

Thanks