Solana’s memo program lets you attach invoice numbers, order IDs, or custom references to any payment. These memos are permanently recorded on-chain and visible in transaction logs, making it easy to match payments to your internal systems. Use just like with SPL token:
| SPL | Light | |
|---|---|---|
| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
Agent skill
Agent skill
Use the payments agent skill to add light-token payment support to your project:For orchestration, install the general skill:
- Guide
- AI Prompt
1
Setup
Installation
Installation
- npm
- yarn
- pnpm
- SDK 2.0 (token-interface)
Install packages in your working directory:Install the CLI globally:
- Localnet
- Devnet
In the code examples, use
createRpc() without arguments for localnet.Create a Token Helper for Setup
Create a Token Helper for Setup
setup.ts
2
Send a Payment with Memo
- Create the transfer instructions with
createTransferInterfaceInstructions(). Load transactions are handled under the hood. - Create a memo instruction with a message. This message will be visible in the program logs of the transaction.
- Both instructions execute atomically in the same transaction.
About loading: Light Token accounts reduce account rent ~200x by auto-compressing inactive
accounts. Before any action, the SDK detects cold balances and adds
instructions to load them. This almost always fits in a single
atomic transaction with your regular transfer. APIs return
TransactionInstruction[][]
so the same
loop handles the rare multi-transaction case automatically.SDK 2.0 (
@lightprotocol/token-interface) is the latest JavaScript SDK.
It has better API ergonomics, guarantees single-instruction loading, and is
compatible with KIT (the new Solana SDKs).Compare to SPL
Compare to SPL
3
Read Memo from Transaction Logs
After the transaction confirms, the memo appears in the transaction logs:Example Transaction Logs
Related guides
Basic payment
Send a single transfer without memo.
Verify payments
Query balances and transaction history.
Batch payments
Pack multiple transfers into one transaction.