Skip to main content

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:
SPLLight
TransfercreateTransferInstruction()createTransferInterfaceInstructions()
Use the payments agent skill to add light-token payment support to your project:
For orchestration, install the general skill:
1

Setup

Install packages in your working directory:
Install the CLI globally:
In the code examples, use createRpc() without arguments for localnet.
Additionally install the memo program package:
setup.ts
2

Send a Payment with Memo

  1. Create the transfer instructions with createTransferInterfaceInstructions(). Load transactions are handled under the hood.
  2. Create a memo instruction with a message. This message will be visible in the program logs of the transaction.
  3. Both instructions execute atomically in the same transaction.
After the transaction confirms, fetch it to view the memo in the logs. The memo appears as a log message from the Memo program.
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).
3

Read Memo from Transaction Logs

After the transaction confirms, the memo appears in the transaction logs:
Example Transaction Logs

Basic payment

Send a single transfer without memo.

Verify payments

Query balances and transaction history.

Batch payments

Pack multiple transfers into one transaction.

Didn’t find what you were looking for?

Reach out! Telegram | email | Discord