Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/ethers/personal_message.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ defmodule Ethers.PersonalMessage do

Recovery and verification here are `ecrecover`-based and therefore work for
externally-owned accounts (EOAs) only. Signatures from smart-contract wallets
(ERC-1271/ERC-6492) cannot be verified this way and need the RPC-backed
`Ethers.Signature` module.
(ERC-1271/ERC-6492) always fail these checks. Prefer
`Ethers.Signature.verify_message/4`, which verifies EOA and smart-contract wallet
signatures alike; use the functions here when you specifically need a pure, RPC-free
check for signatures known to come from EOA keys.
"""

alias Ethers.ExecutionError
Expand Down Expand Up @@ -97,7 +99,8 @@ defmodule Ethers.PersonalMessage do
comparison is done on the decoded 20-byte addresses, so checksum/case differences are
ignored. Returns `false` (does not raise) when the signature is malformed.

EOA-only — for smart-contract wallets use the RPC-backed `Ethers.Signature` module.
EOA-only — prefer `Ethers.Signature.verify_message/4` to also support smart-contract
wallets (see "Verification scope" in the module docs).

## Examples

Expand Down
8 changes: 8 additions & 0 deletions lib/ethers/typed_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ defmodule Ethers.TypedData do
`signature` may be given as a `0x`-prefixed hex string (130 hex chars) or a raw 65-byte binary
(`r ‖ s ‖ v`).

Recovery is `ecrecover`-based and therefore works for externally-owned accounts (EOAs)
only — smart-contract wallets (ERC-1271/ERC-6492) do not have a recoverable signer.

## Returns

- a checksummed `0x` address string on success.
Expand Down Expand Up @@ -389,6 +392,11 @@ defmodule Ethers.TypedData do

`signature` may be a `0x`-prefixed hex string or a raw 65-byte binary.

EOA-only — signatures from smart-contract wallets (ERC-1271/ERC-6492) always fail this
check. Prefer `Ethers.Signature.verify_typed_data/4`, which verifies EOA and
smart-contract wallet signatures alike; use this function when you specifically need a
pure, RPC-free check for signatures known to come from EOA keys.

## Examples

```elixir
Expand Down
Loading