# `Ethers.Transaction.Protocol`
[🔗](https://github.com/ExWeb3/elixir_ethers/blob/v0.6.12/lib/ethers/transaction/protocol.ex#L1)

Protocol for handling Ethereum Virtual Machine (EVM) transactions.

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `to_rlp_list`

```elixir
@spec to_rlp_list(t(), mode :: :payload | :hash) :: [binary() | [binary()]]
```

Returns a list ready to be RLP encoded for a given transaction.

## Parameters
- `transaction` - Transaction struct containing the transaction data
- `mode` - Encoding mode:
  - `:payload` - For encoding the transaction payload
  - `:hash` - For encoding the transaction hash

# `type_envelope`

```elixir
@spec type_envelope(t()) :: binary()
```

Returns the binary value of the transaction type envelope.
For legacy transactions, returns an empty binary.

# `type_id`

```elixir
@spec type_id(t()) :: non_neg_integer()
```

Returns type of transaction as an integer.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
