Sending a Versioned Transaction

Welcome to the ultimate guide for Solana's v0 transactions and Address Lookup Tables (LUTs)! This guide uses real working code from the Jelli dApp Playground that you can test right now.

🎯 What Are Versioned Transactions?

Solana supports two transaction types:

  • Legacy: The old format (max 35 accounts)

  • v0: The new hotness with Address Lookup Table support (max 256 accounts!)

Think of v0 transactions as the difference between sending a postcard (legacy) vs sending a package with a shipping manifest (v0 + LUTs). The manifest lets you reference way more stuff without cluttering the package itself.

🎮 Interactive Playground

You can test everything in this guide live:

  • Basic v0 Transactions: /sending-a-versioned-transaction/

  • Full LUT Workflow: /address-lookup-tables/


📤 Part 1: Your First Versioned Transaction

Let's start simple - sending a basic v0 transaction without LUTs.

Setup Your HTML

<!DOCTYPE html>
<html>
<head>
    <title>Versioned Transactions with Jelli</title>
</head>
<body>
    <!-- Load Solana Web3.js via CDN -->
    <script src="https://cdn.jsdelivr.net/npm/@solana/web3.js@latest/lib/index.iife.min.js"></script>
    <script src="your-script.js"></script>
</body>
</html>

Create Your First v0 Transaction

🎉 Congratulations! You just sent a versioned transaction. But we're just getting started...


🏗️ Part 2: Address Lookup Tables - The Real Power

Now for the fun part - LUTs! Think of them as address books that let you pack way more accounts into a single transaction.

Step 1: Create an Address Lookup Table

Step 2: Extend Your LUT (Add Addresses)

Step 3: Use Your LUT in a Transaction


🎪 Putting It All Together

Here's the complete flow:


🚨 Critical Gotchas

1. maxSupportedTransactionVersion

Always add this when fetching v0 transactions:

2. LUT Timing

  • Creation: Use connection.getSlot('confirmed') then subtract 2

  • Extension: Wait 5+ seconds after creation

  • Usage: Wait 5+ seconds after extension

3. Connection Commitments

  • LUT Creation: new Connection(url, 'confirmed')

  • Everything Else: new Connection(url) (no commitment)


🎯 Why Use LUTs?

Before LUTs: Max 35 accounts per transaction With LUTs: Max 256 accounts per transaction!

Perfect for:

  • 🏪 Complex DeFi operations

  • 🎮 Gaming with many assets

  • 🏛️ DAO governance with many participants

  • 🔄 Batch operations


🧪 Test Your Skills

Try the interactive examples:

  1. Basic v0: Create and send a versioned transaction

  2. LUT Master: Build the full create → extend → use workflow

Each example has detailed console logging so you can see exactly what's happening!


📚 Quick Reference

Happy building with Solana v0 transactions! 🚀


🎮 Try the live examples: Visit /sending-a-versioned-transaction/ and /address-lookup-tables/ to test everything in this guide!


📚 References

Last updated