Why I Hit the Wall
My batch transfer had 22 accounts (sender + 20 recipients + system program). Each account key takes 32 bytes. 22 ×ばつ 32 = 704 bytes just for the addresses.
Add signature (64 bytes), header (3 bytes), blockhash (32 bytes), instructions (variable). Total: ~1,148 bytes.
Dangerously close to 1,232. Add one more recipient? Fail. Add a memo? Fail. Add any complexity? Fail.
I was 84 bytes from the edge. That's one short sentence.
The Escape
I learned about Address Lookup Tables (ALTs).
An ALT is an on-chain account that stores addresses. Once stored, a transaction references them by a 1-byte index instead of the full 32-byte address.
Think of it like a URL shortener. You store the long URL once. Everyone else uses the short code.
Same concept.
What Changed
My batch transfer went from 22 full addresses to 1 ALT address + 21 one-byte indexes.
Before: 704 bytes for addresses
After: 32 bytes (ALT) + 21 bytes (indexes) = 53 bytes
My transaction size dropped from ~1,148 bytes to ~562 bytes.
Suddenly I had room. Add more recipients. Add a memo. Add error handling. All fit.
What I Learned
The 1,232-byte limit isn't arbitrary. It's Solana prioritizing network speed over developer convenience.
Fragmented packets are slower. Solana said no fragmentation. One packet. One transaction. Done.
This forces constraints:
List every account upfront
Batch operations need ALTs
Complex DeFi requires careful design
But the network stays fast. 4,000+ transactions per second fast.