EEVM.Transaction.Signer (eevm v0.1.0)

Copy Markdown View Source

Transaction signing-hash computation and sender recovery.

Summary

Functions

Recover the authority (signer) of an EIP-7702 authorization tuple.

Recover the sender address from a signed transaction.

Compute the signing hash for a transaction.

Functions

recover_authority(auth)

@spec recover_authority(EEVM.Transaction.Authorization.t()) ::
  {:ok, binary()} | {:error, atom()}

Recover the authority (signer) of an EIP-7702 authorization tuple.

The signed message is keccak256(0x05 || rlp([chain_id, address, nonce])). Signatures with y_parity outside 0..1, r outside 1..n-1, or a high s (EIP-2) are rejected with {:error, :invalid_signature}.

recover_sender(tx, chain_id)

@spec recover_sender(EEVM.Transaction.t(), non_neg_integer()) ::
  {:ok, binary()} | {:error, atom()}

Recover the sender address from a signed transaction.

signing_hash(tx, chain_id)

@spec signing_hash(EEVM.Transaction.t(), non_neg_integer()) :: binary()

Compute the signing hash for a transaction.