[pad / catalog / burn / docs][] [FAQ] [Home]
4pad

Post Protocol

Version 1. This page is the complete specification. If you implement it, your client reads and writes the same board as this website, and you do not need our API, our code or our permission.

Ideas

  • A thread is a coin: a Meteora DBC pool created from a valid 4pad config (see The Curve). The thread's identity is the token's mint address.
  • A reply is a Solana transaction with a memo.
  • A tag is an address nobody owns. Mentioning a tag in a transaction files that transaction under it, because Solana indexes transactions by every address they touch.

There is no server-side state. Deleting this website deletes nothing.

Tags

Tags are program-derived addresses of the SPL Memo program. They are never created as accounts and hold nothing; they exist only to be mentioned.

MEMO   = MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr

board  = PDA(["4pad", "board", "pad"],        MEMO)
thread = PDA(["4pad", "thread", <mint 32 bytes>],  MEMO)

The board tag for /pad/ is 8h6T3HQSXzjDzvGhTnZeqCAJzYxJcYzRAvAMYnqs4Yjv.

Writing a reply

A reply is a transaction, signed and paid by the poster, containing these three instructions. Order does not matter. Other instructions (compute budget, for example) may be present.

1. Memo. SPL Memo v2, with the poster as the only signer account. The data is UTF-8:

4pad/1 r <mint>[ sage]\n<comment>
  • 4pad/1 is the protocol and version. r means reply.
  • <mint> is the thread's mint address in base58.
  • sage is optional. A sage reply does not bump the thread.
  • Everything after the first newline is the comment, at most 600 bytes of UTF-8. It may contain newlines.

2. Thread mark. A System Program transfer of 0 lamports from the poster to the thread tag.

3. Board mark. A System Program transfer of 0 lamports from the poster to the board tag.

A zero-lamport transfer moves nothing and creates nothing. It is there so the tag address appears in the transaction.

The memo program's compute cost grows with the text, about 400 compute units per byte. A full-length post needs a compute limit of roughly 300,000 units.

Total cost to the poster: the Solana transaction fee. No tokens are spent or burned by posting.

Reading

One thread. Call getSignaturesForAddress(thread tag), newest first, paging with before as needed. Each result includes the transaction's memo text. Keep a result if:

  • err is null (failed transactions are not posts),
  • its memo contains a valid 4pad/1 r header,
  • the mint in the header is the thread you asked for.

blockTime is the post's timestamp. Oldest first is display order.

The whole board. Do the same with the board tag. That gives every reply on the board, each naming its thread, which is enough to compute reply counts, bump order and the latest replies for every thread in a few calls.

The memo field. RPC returns memos as [<byte length>] <text>, with multiple memos joined by ; . Find 4pad/1, and if a length prefix precedes it, cut the text to that many bytes.

Who posted. getSignaturesForAddress does not return the signer. Fetch the transaction; the fee payer (first account key) is the poster. This never changes, so cache it forever.

Threads

To list threads, list the pools:

  1. Fetch all DBC config accounts whose fee claimer is the burner, 6XaN1h3FGM9aZFKLsVCEUtyE3pvTVWRJj4BVMc1Ga4JD.
  2. Discard every config that fails the validity rules in The Curve. This step is not optional: anyone can create a config that names the burner.
  3. For each remaining config, fetch the DBC virtual pools that use it. Each pool is a thread.

The opening post is the token's own metadata: name, symbol, image and description. Its timestamp is the pool's activation time and its author is the pool's creator.

Bump order. A thread's bump time is the time of its newest reply without sage, or its creation time if it has none.

Post numbers

Imageboards number their posts, and >>123456789 links depend on it. With no server to hand out numbers, every client derives the same nine-digit number from the post itself: the transaction signature for a reply, the mint address for an opening post.

function hash2(s):                       # s is the base58 string
    a = 0x811c9dc5
    b = 0x01000193
    for c in char codes of s:
        a = imul(a XOR c, 0x01000193)                      (unsigned 32-bit)
        b = imul(b XOR c XOR (a >>> 13), 0x85ebca6b)       (unsigned 32-bit)
    return (a, b)

function postNo(id):
    (a, b) = hash2(id)
    return 100000000 + (((a mod 30000) * 30000 + (b mod 30000)) mod 900000000)

Numbers are not sequential and a collision inside one thread is possible, though unlikely below a few thousand replies. Nobody can choose their number in advance without grinding signatures, so GETs are luck. As they should be.

Poster IDs

The eight-character ID next to a post is derived from the poster's wallet and the thread's mint, so one wallet has one ID per thread and unrelated IDs across threads.

B58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

function posterId(wallet, mint):
    (a, b) = hash2(wallet + ":" + mint)
    out = ""
    for i in 0..7:
        n = a if i < 4 else b
        out += B58[n mod 58]
        if i < 4: a = floor(a / 58) else b = floor(b / 58)
    return out

The ID is a convenience, not privacy. The wallet behind every post is public on chain, and this site links each ID to it. A post by the wallet that created the coin is marked ## Dev.

Comment formatting

Comments are plain text. Clients should render:

  • a line beginning with > (and not >> plus a post number) as greentext,
  • >> followed by a nine-digit post number as a link to that post,
  • http:// and https:// URLs as links.

Nothing else is markup. Never interpret a comment as HTML.

What a frontend may do

A frontend chooses what it renders. This one hides a short public list of threads and posts that are illegal to display (see Rules). Hiding is local to the frontend: the transactions remain on chain and other clients may show them.

This site's read API

The site exposes what it reads from chain as JSON, for convenience only. Nothing here is authoritative; the chain is.

Endpoint Returns
GET /api/board every thread, the valid configs, and board stats
GET /api/thread/<mint> one thread and all of its replies
Style:
About • Fees & Burns • Rules • Risks • Verify • Burn Ledger
4pad is an independent community project. It is not affiliated with, endorsed by, or operated by 4chan.
Coins launched here are made by their posters, not by 4pad. Most memecoins go to zero. Nothing on this site is financial advice.