This crate verifies any Ethereum signature including:
cargo add erc6492 --git https://github.com/reown-com/erc6492
or
erc6492 = { git = "https://github.com/reown-com/erc6492.git", version = "0.1.0" }
This crate uses Alloy and requires an RPC provider in order to verify all signature types.
let address = address!("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
let message = eip191_hash_message("Hello, world!");
let signature = bytes!("aaaa");
let provider = ReqwestProvider::<Ethereum>::new_http("https://rpc.example.com".parse().unwrap());
let verification = verify_signature(signature, address, message, provider).await.unwrap();
if verification.is_valid() {
// signature valid
}
See doctest on verify_signature()
and test cases in src/lib.rs
for more examples.