---
id: BI0084
title: "Memo message board"
url: https://carbium.sh/library/blockchainideas/memo-message-board
collection: Blockchain ideas
category: Consumer and social
revision: 1
updated: 2026-11-22
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Memo message board

A public chat with no server database. Each post is a memo transaction mentioning one board address, the thread renders from a single signature page, and lookups are spent only to name the authors. You get the read code and the live feed design.

## The board address

A post is a memo transaction: one instruction to the Memo program that carries the text. The board is an address that every post mentions. Anyone can read the board by asking for the signatures of that address, because each row of the answer carries the memo text beside the signature. A hackathon team gets a public chat with no server and no database to run, and the wallet that pays for a post is its author.

The posting side is a few lines in your own client, and the code here leaves it out because it only reads. The Memo program requires every account on its instruction to sign, so a keypair is needed only when the board sits on the Memo instruction itself. Keep the board a plain address instead and have each post mention it as a non-signer account, for example with a zero-lamport transfer to it. No board secret exists, and the board address is in every post.

| Piece | Where it lives | Source |
|---|---|---|
| Post text | The memo field of the signature row | One page read |
| Time | `blockTime` of the row | Same page |
| Order | Newest first, as the page returns it | Same page |
| Author | The transaction's fee payer | One lookup per post |
| Board | An address every post mentions | A plain address you pick |

With no argument the code reads the Memo program's own address as the board. That is every memo sent to this Memo program, so you see a busy thread before your team has posted anything.

## The thread from one call

getSignaturesForAddress answers newest first, and each row holds the signature, the slot, `blockTime`, `err` and `memo`. The memo is the post text, so one page is the thread. It arrives as a string such as `[11] hello board`, with the byte length in brackets, and a transaction that holds several memos joins them in one string. A busy address fills 100 rows quickly; a quiet team board spans days.

1. Take the board address from the command line. With none, use the Memo program address.
2. Create one RPC client for `https://services.carbium.sh`.
3. Read one page of 100 rows at confirmed commitment.
4. Drop failed transactions and rows with no memo. A failed post still sits on the page with its text, and `err` is how the code tells.
5. Clean the text. Strip the length prefix and replace control characters, because strangers write it and a terminal obeys escape codes.
6. Print the newest 15 posts with time, short signature and text.
7. Look up the fee payer of the newest 10 posts.

`main.ts` (run: `CARBIUM_KEY=<YOUR_KEY> node main.ts [<board address>]`)

```ts
// BI0084 · Memo message board
// https://carbium.sh/library/blockchainideas/memo-message-board
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

import { address, createDefaultRpcTransport, createSolanaRpcFromTransport, isSolanaError, SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR, type Signature } from "@solana/kit";

const key = process.env.CARBIUM_KEY ?? "";
if (!key) {
  console.error("Set CARBIUM_KEY to your Carbium API key.");
  process.exit(1);
}
const MEMO_PROGRAM = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"; // default board: every memo on the network
const board = address(process.argv[2] ?? MEMO_PROGRAM);
const rpc = createSolanaRpcFromTransport(
  createDefaultRpcTransport({
    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",
    headers: { "x-api-key": key },
  }),
);

type Parsed = { transaction: { message: { accountKeys: { pubkey: string }[] } } } | null;
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
// Strangers write post text: drop the "[len] " prefix and any control characters.
const clean = (m: string) => m.replace(/^\[\d+\] /, "").replace(/[\u0000-\u001f\u007f-\u009f]/g, " ").slice(0, 120);

// The fee payer is the first account key. Two tries; an old signature can answer null.
async function author(sig: Signature): Promise<string> {
  for (let attempt = 0; attempt < 2; attempt++) {
    try {
      const tx = (await rpc
        .getTransaction(sig, { commitment: "confirmed", encoding: "jsonParsed", maxSupportedTransactionVersion: 1 })
        .send()) as unknown as Parsed;
      return tx ? tx.transaction.message.accountKeys[0].pubkey : "null (below the ledger floor)";
    } catch (e) {
      if (isSolanaError(e, SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR) && e.context.statusCode === 429) {
        await sleep(Math.min(Number(e.context.headers.get("retry-after") ?? 2), 5) * 1000);
      } else throw e;
    }
  }
  return "429 on both tries";
}

async function main(): Promise<void> {
  // One page is the thread: each row carries its memo text and block time.
  const page = await rpc.getSignaturesForAddress(board, { limit: 100, commitment: "confirmed" }).send();
  const posts = page.filter((r) => r.err === null && r.memo);
  console.log(`${posts.length} posts in the newest ${page.length} signatures of ${board}`);
  for (const p of posts.slice(0, 15)) {
    const when = p.blockTime ? new Date(Number(p.blockTime) * 1000).toISOString() : "time unknown";
    console.log(`${when} ${p.signature.slice(0, 12)} ${clean(p.memo ?? "")}`);
  }
  // Lookups only name authors: the newest 10 posts, each settled on its own.
  const named = posts.slice(0, 10);
  const found = await Promise.allSettled(named.map((p) => author(p.signature)));
  found.forEach((r, i) => {
    const who = r.status === "fulfilled" ? r.value : `lookup failed: ${r.reason instanceof Error ? r.reason.message : r.reason}`;
    console.log(`${named[i].signature.slice(0, 12)} by ${who}`);
  });
}

main().catch((e) => {
  console.error("board read failed:", e instanceof Error ? e.message : e);
  process.exit(1);
});
```

The thread view needs nothing beyond the first call. Time comes from the block, so a client cannot claim a post was written earlier than it landed.

## Naming the authors

The page names a signature and leaves the wallet out. The fee payer is the first account key of the transaction, so naming an author takes getTransaction, one call per post. The code looks up the newest 10 and gives each lookup two tries, at confirmed commitment. Every lookup sets `maxSupportedTransactionVersion` to 1, because mainnet carries v1 transactions and a lookup that leaves it out answers -32015 for one.

The 10 lookups run together and each one settles on its own. A lookup that fails prints its reason, and the other nine still print. A lookup can also answer null: the signature pages reach below the validator's ledger floor, so a row the page lists may have no transaction behind it. The code prints that as a null author and carries on.

A real app keeps a map from signature to author, so a refresh pays for one page and one lookup per new post. The same wallet appears again and again in a chat, so a second map from wallet to display name, kept in your own table, turns addresses into names without another call.

Anyone can put the board address into a transaction that carries a memo of their own, so a row on the page proves a mention and says nothing about membership. Each lookup returns the fee payer, and a real board keeps only the posts whose fee payer is in the team's member wallet list. [Memo instruction reader](https://carbium.sh/library/howsolana/memo-instruction-reader) decodes the instruction itself when you want the text from the lookup instead of the page.

## New posts as they land

main.ts opens no subscription, so add one beside the page read. Open a WebSocket to `wss://services.carbium.sh` with `?api-key=<YOUR_KEY>` on the URL, then send `logsSubscribe` with `mentions` set to the board address and commitment `confirmed`. Each `logsNotification` carries the signature and the transaction's logs, and the Memo program writes the text into its logs, so the notification can show the post at once. A notification with a non-null `err` is a failed post and gets dropped, the same as on the page. One getTransaction then names the author.

Read the exact text from the page row when you keep it, because the logs print it as a quoted string. After a reconnect, read the page once more and merge by signature, so a post that landed while the socket was down is not lost.

Opening a logs subscription on a mention costs 25 credits, then 20 credits per MiB sent. Free carries 5 sockets, and one socket holds every subscription a board needs. Pointed at the Memo program itself, the subscription streams every memo on the network, so use your own board address for the live part.

## What it costs

A first load is 11 calls; the 500 lookup cells fit inside the 1,024-cell burst of their class. The page call costs 50 cells in its own class. Cells are the admission charge per call, and each class has a rate per plan.

| Plan | getSignaturesForAddress | getTransaction |
|---|---|---|
| Free ($0) | 0.24 req/s | 0.24 req/s |
| Dev ($20) | 1.2 req/s | 1.2 req/s |
| Business ($250) | 100 req/s | 5 req/s |
| Pro ($500) | 500 req/s | 25 req/s |

After the first load the burst is spent, and only new posts need lookups. A Free key then names about one new author every 4 seconds, a Dev key about one a second, and a Business key five a second. A team chat posts far less than that, and the signature-to-author map keeps repeats free.

Credits meter the RPC and WebSocket work on top of the rate, and Free starts with 500K credits once at sign-up. Limits are per account, so every key on the account shares the same budget.

## Where it ends

- The thread is 30 days at most, because the page comes from an [address index](https://carbium.sh/docs/migrate) that keeps up to 30 days. An empty page past that is the index's age limit, and the board may hold older posts. Keep your own copy of each post from the day it appears.
- Posts are public and permanent. There is no edit, no delete and no private message; encrypt text before you post if a thread needs to be private.
- A post is as long as one transaction allows, which is 1,232 bytes for a legacy or v0 transaction, so in those formats the text is a few hundred characters at most.
- A lookup can answer null for an older signature the page lists. The thread still renders; only the author line is missing.
- Anyone can mention the board, so spam and look-alike rows will appear. Filter on the fee payer being a member wallet, and keep a mute list of wallets.
- The code reads only. Posting needs a client that signs and sends, which you build and test yourself.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| A lookup prints null for an author. | The page listed a signature that is older than the validator's ledger. The address index reaches further back than the ledger, so getTransaction can answer null. Keep the row, show the text, and leave the author blank. |
| A lookup answers -32015. | The call left out `maxSupportedTransactionVersion` or set it to 0, and the transaction is v1. Set it to 1 on every getTransaction call, as the code does. |
| The page has rows but no posts print. | The rows are failed transactions or carry no memo. A transaction can mention the board without a memo, for example a plain transfer to the address. The code keeps rows with `err` null and a memo. |
| The lookup lines print 429 on both tries. | The burst was spent by an earlier refresh and the plan's rate for getTransaction is low. Cache authors by signature so a refresh looks up only new posts, or spread the 10 lookups over several seconds. |
| The page comes back empty for a team board. | Nothing mentions the address yet, or the last post is older than 30 days and has left the index. Check the address against a post's account list, and post once to see a row. |
| A post's text looks cut off or shows control characters. | The code trims to 120 characters and replaces control characters with spaces. Raise the limit for your page, and keep the replacement. |

## Questions

### Do I need to deploy a program for a Solana chat app?

No. The Memo program is already on mainnet, and a post is one instruction to it. Your app needs only a client that signs the post and the read code here.

### Why read the memo from the signature page and not from each transaction?

The page row already carries the memo, so the thread costs one call of 50 cells. Lookups are spent on authors only, and a cache by signature means a repeat visit looks up only the new posts.

### Can a user delete or edit a post?

No. A transaction stays on chain. Hide a post in your own view by signature, and keep a hidden-list in your own table.

### Does this run on the Free plan?

Yes. The first load is 11 calls and fits the burst, and one WebSocket holds the live subscription under the 5-socket limit.

### How do I show names instead of addresses?

Keep a table from wallet to display name in your own database and look the fee payer up in it. An address with no row shows its first characters.

## Related

- [Memo instruction reader](https://carbium.sh/library/howsolana/memo-instruction-reader) (How to use Solana, HS0033)
- [Wallet social feed](https://carbium.sh/library/blockchainideas/wallet-social-feed) (Blockchain ideas, BI0007)
- [carbium.sh/docs/rpc](https://carbium.sh/docs/rpc)
- [carbium.sh/docs/websocket](https://carbium.sh/docs/websocket)
- [carbium.sh/docs/limits](https://carbium.sh/docs/limits)
- [carbium.sh/docs/endpoints](https://carbium.sh/docs/endpoints)
- [carbium.sh/docs/migrate](https://carbium.sh/docs/migrate)
