This crate verifies any Ethereum signature including:
This crate uses Alloy and requires an RPC provider in order to verify all signature types.
use alloy_primitives::{address, bytes, eip191_hash_message};
use alloy_provider::{network::Ethereum, ReqwestProvider};
let address = address!("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
let message = "xxx";
let signature = bytes!("aaaa");
let provider = ReqwestProvider::<Ethereum>::new_http("https://rpc.example.com");
let verification = verify_signature(signature, address, message, provider).await.unwrap();
if verification.is_valid() {
// signature valid
}
See test cases in src/lib.rs
for more examples.