A lightweight Rust utility for creating and managing Solana Address Lookup Tables (ALTs) on Mainnet and Devnet. This tool streamlines the process of initializing lookup tables and populating them with common program IDs for optimized transaction serialization.
- Simple API – Single
create_atl_addressfunction handles the entire ALT lifecycle - Automatic Verification – Confirms all addresses were added successfully
- Devnet & Mainnet Support – Works with any Solana network via custom RPC endpoints
- Production-Ready – Includes proper error handling and transaction confirmation
- Rust & Cargo – Install from rustup.rs
- Funded Solana Wallet – With SOL for transaction fees on your target network
- RPC Endpoint – Devnet, Testnet, or Mainnet URL
git clone https://github.com/DevWonder01/solana-address-lookup-table-rs.git
cd solana-address-lookup-table-rsSet the following environment variables before running:
# Your Solana wallet private key (Base58 format)
export DEV_B58="<YOUR_BASE58_PRIVATE_KEY_HERE>"
# RPC endpoint URL (Devnet recommended for testing)
export RPC_URL="https://api.devnet.solana.com"Tip: Use Devnet for testing to avoid mainnet fees. Switch to https://api.mainnet-beta.solana.com for production.
Ensure your Cargo.toml has compatible versions. We recommend:
solana-sdk = "2.0.0"
solana-client = "2.0.0"
solana-program = "2.0.0"All Solana crates should use the same version to avoid conflicts.
cargo runThe program will output the public key of your newly created lookup table:
Lookup Table Address: 9B5X4ARiMZZoNXHzLuGMMHqEb9MysKn5nLPaKXVpp1Gm
Use this address in your application to build versioned transactions with optimized serialization.
The create_atl_address function executes three sequential steps:
Sends a transaction with a create_lookup_table instruction to initialize a new, empty lookup table on the Solana network.
After confirming table creation, sends a second transaction with an extend_lookup_table instruction. This populates the table with a predefined set of common Solana program IDs.
Fetches and deserializes the lookup table from the network to confirm all addresses were successfully added. Returns the lookup table's public key upon success.
| Variable | Description | Example |
|---|---|---|
DEV_B58 |
Base58-encoded private key of your wallet | <your-key-here> |
RPC_URL |
Solana RPC endpoint | https://api.devnet.solana.com |
Devnet (Recommended for Testing)
export RPC_URL="https://api.devnet.solana.com"Testnet
export RPC_URL="https://api.testnet.solana.com"Mainnet Beta (Production)
export RPC_URL="https://api.mainnet-beta.solana.com"Ensure your wallet has SOL to cover transaction fees:
- Devnet: Request airdrop via
solana airdrop 2 - Mainnet: Transfer SOL from another wallet
- Verify your
RPC_URLis correct and accessible - Try switching RPC endpoints if one is experiencing downtime
Ensure all Solana dependencies in Cargo.toml use the same version number.
[Add your license here]
Contributions are welcome! Feel free to submit issues and pull requests.
Built for the Solana ecosystem