Getting Started

This guide shows how to send your first transaction on Lighter EVM using cast.

Before you start:

  • use a disposable account that you control
  • obtain access to the Lighter EVM RPC endpoint
  • fund your account with Lighter EVM ETH

Prerequisites

Install Foundry (if not already installed), then make sure cast is available:

cast --version

1. Export environment variables

export LIGHTER_EVM_RPC_URL="<lighter_evm_rpc_url>"
export LIGHTER_EVM_PRIVATE_KEY="<your_private_key>"
export RECIPIENT="0x1111111111111111111111111111111111111111"

2. Confirm your setup

Check the chain ID:

cast chain-id --rpc-url "$LIGHTER_EVM_RPC_URL"

This should return Lighter EVM chain ID chainId = 19_529 = 0x4C49 = "LI".

Get your sender address from the private key:

export SENDER="$(cast wallet address --private-key "$LIGHTER_EVM_PRIVATE_KEY")"
echo "$SENDER"

Check sender balance:

cast balance "$SENDER" --rpc-url "$LIGHTER_EVM_RPC_URL"

3. Send a transaction with cast

Send a simple ETH transfer:

# Lighter EVM also derives its data-availability pubdata budget from the gas limit,
# so a plain transfer needs more than Ethereum's standard 21,000 gas.
cast send "$RECIPIENT" \
  --value 0.001ether \
  --gas-limit 30000 \
  --private-key "$LIGHTER_EVM_PRIVATE_KEY" \
  --rpc-url "$LIGHTER_EVM_RPC_URL"

cast send prints the transaction hash and receipt fields after submission.

4. Verify the transaction

Inspect the transaction:

cast tx <TX_HASH> --rpc-url "$LIGHTER_EVM_RPC_URL"

Inspect the receipt:

cast receipt <TX_HASH> --rpc-url "$LIGHTER_EVM_RPC_URL"

Check recipient balance:

cast balance "$RECIPIENT" --rpc-url "$LIGHTER_EVM_RPC_URL"

Did this page help you?