Sign Data
Last updated
Last updated
You can use the following RPC methods to request cryptographic signatures from users:
- Use this method to request the most human-readable signatures that are efficient to process on-chain. We recommend this for most use cases.
- Use this method for the easiest way to request human-readable signatures that don't need to be efficiently processed on-chain.
provides the most human-readable signatures that are efficient to process on-chain. It follows the specification to allow users to sign typed structured data that can be verified on-chain. It renders the structured data as usefully as possible to the user (for example, displaying known account names in place of addresses).
An eth_signTypedData_v4
payload uses a standard format of encoding structs, but has a different format for the top-level struct that is signed, which includes some metadata about the verifying contract to provide replay protection of these signatures between different contract instances.
We recommend using to generate and validate signatures. You can use to generate most of the Solidity required to verify these signatures on-chain. It currently doesn't generate the top-level struct verification code, so you must write that part manually.
The following is an example of using eth_sign
with Sender.
is the easiest way to request human-readable signatures that don't need to be efficiently processed on-chain. It's often used for signature challenges that are authenticated on a web server, such as .