---
id: UC0050
title: "Soulbound badge verifier"
url: https://carbium.sh/library/usecase/soulbound-badge-verifier
collection: Use cases
category: Loyalty, rewards and memberships
revision: 1
updated: 2026-11-22
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Soulbound badge verifier

A read-only check that a badge mint is non-transferable under Token-2022, what its issuer can still do with it, whether a wallet holds it, what each read costs on Carbium, and where the check stops.

## What soulbound means on Solana

A Solana token account has no soulbound flag. A badge is soulbound when its mint carries the Token-2022 NonTransferable extension, which the issuer sets while creating the mint. Token-2022 is a separate token program with its own program id, and with the extension in place it refuses every transfer of that mint. A badge minted under the original token program has no such rule, whatever its metadata or its launch post says.

- The mint account is owned by the Token-2022 program. An account owned by the original program cannot carry the extension.
- The mint's extension list contains `nonTransferable`. The parsed form of the account names each extension.
- The holder's token account exists, names the wallet as its owner and holds an amount of at least 1. Under Token-2022 a token account for a non-transferable mint also carries a `nonTransferableAccount` extension.

Badges are usually one token with 0 decimals, but the extension works for any amount. The verifier accepts any positive balance and prints it.

## What the issuer can still do

Non-transferable stops moves between wallets. The issuer's other authorities stay where they were set, so the verifier prints them and your product decides which ones matter.

- Mint authority. While it is set, the issuer can mint more of the badge and supply can grow. A revoked authority fixes the supply for good.
- Permanent delegate. A mint with this extension names a delegate that can burn tokens from any holder's account. That is revocation: the issuer can take a badge back. A certificate program may want it, a membership that members own outright may treat it as a defect.
- Freeze authority. The issuer can freeze a holder's token account. The badge stays in the wallet and still reads as held, so decide whether a frozen badge counts. The holder line prints the account's `state`, `initialized` or `frozen`.
- The holder. An owner can burn their own badge. Soulbound blocks transfer between wallets and leaves disposal open.

## The verifier in one file

The script runs on your server. It reads `CARBIUM_KEY`, takes a comma-separated list of badge mints and an optional wallet, and sends `getMultipleAccounts` calls with `jsonParsed` encoding to [`https://services.carbium.sh`](https://carbium.sh/docs#endpoints), the key in the [`x-api-key` header](https://carbium.sh/docs#auth). With a wallet it derives the Token-2022 associated token account for each mint and reads those in a second call. With no arguments it takes the newest Token-2022 program signatures, collects the mints in those transactions and classifies them.

`main.ts` (run: `CARBIUM_KEY=$CARBIUM_KEY node main.ts [<mint>[,<mint>...] [<wallet>]]`)

```ts
// UC0050 · Soulbound badge verifier
// https://carbium.sh/library/usecase/soulbound-badge-verifier
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

// Read-only soulbound badge verifier: is the mint non-transferable (Token-2022), what can its issuer still do, does a wallet hold it?
import { address, createDefaultRpcTransport, createSolanaRpcFromTransport, getAddressEncoder, getProgramDerivedAddress, type Address } 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 [mintsArg, walletArg] = process.argv.slice(2);

const rpc = createSolanaRpcFromTransport(createDefaultRpcTransport({
  url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",
  headers: { "x-api-key": key },
}));

const TOKEN_2022 = address("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
const TOKEN_ORIGINAL = address("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
const ATA_PROGRAM = address("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
const enc = getAddressEncoder();

type Info = { extensions?: { extension: string }[]; mintAuthority?: string | null; freezeAuthority?: string | null; owner?: string; mint?: string; state?: string; tokenAmount?: { amount: string } };
type Acct = { owner: string; data: unknown } | null;
const infoOf = (a: Acct) => (a?.data as { parsed?: { info?: Info } } | undefined)?.parsed?.info;
const extsOf = (a: Acct) => (infoOf(a)?.extensions ?? []).map((e) => e.extension);

// One getMultipleAccounts call: 10 cells per pubkey, read at finalized.
const read = async (list: Address[]) =>
  (await rpc.getMultipleAccounts(list, { encoding: "jsonParsed", commitment: "finalized" }).send()).value as unknown as Acct[];

// Demo input: the mints seen in the newest Token-2022 transactions.
async function discover(): Promise<string[]> {
  const sigs = await rpc.getSignaturesForAddress(TOKEN_2022, { limit: 10, commitment: "finalized" }).send();
  const mints = new Set<string>();
  for (const s of sigs.filter((x) => !x.err)) {
    try {
      const res = await rpc.getTransaction(s.signature, { encoding: "jsonParsed", maxSupportedTransactionVersion: 1, commitment: "finalized" }).send();
      const tx = res as unknown as { meta?: { postTokenBalances?: { mint: string }[] } | null } | null;
      for (const b of tx?.meta?.postTokenBalances ?? []) mints.add(b.mint);
    } catch (e) { console.error(`skipped ${s.signature.slice(0, 8)}: ${(e as Error).message}`); }
  }
  return [...mints];
}

const mints = (mintsArg ? mintsArg.split(",") : await discover()).slice(0, 100).map((m) => address(m));
if (!mints.length) { console.error("no mints to check"); process.exit(1); }
const wallet = walletArg ? address(walletArg) : undefined;
const atas = wallet
  ? await Promise.all(mints.map(async (m) => (await getProgramDerivedAddress({
      programAddress: ATA_PROGRAM,
      seeds: [enc.encode(wallet), enc.encode(TOKEN_2022), enc.encode(m)],
    }))[0]))
  : [];
const [mintRes, heldRes] = await Promise.allSettled([read(mints), atas.length ? read(atas) : Promise.resolve([] as Acct[])]);
if (mintRes.status === "rejected") { console.error(`mint read failed: ${mintRes.reason}`); process.exit(1); }
if (heldRes.status === "rejected") console.error(`holder read failed: ${heldRes.reason}`);

let verified = false;
for (const [i, mint] of mints.entries()) {
  const m = mintRes.value[i] ?? null;
  const exts = extsOf(m);
  const info = infoOf(m);
  const soulbound = m?.owner === TOKEN_2022 && exts.includes("nonTransferable");
  const program = !m ? "no account" : m.owner === TOKEN_2022 ? "Token-2022" : m.owner === TOKEN_ORIGINAL ? "original token program" : `owned by ${m.owner}`;
  const notes = [program];
  if (exts.includes("permanentDelegate")) notes.push("permanent delegate can burn it");
  if (info?.mintAuthority) notes.push("mint authority open");
  if (info?.freezeAuthority) notes.push("freeze authority set");
  let held = "";
  if (wallet && heldRes.status === "fulfilled") {
    const t = infoOf(heldRes.value[i] ?? null);
    const has = !!t && t.owner === wallet && t.mint === mint && BigInt(t.tokenAmount?.amount ?? "0") >= 1n;
    verified = verified || (soulbound && has);
    held = has ? ` | held ${t?.tokenAmount?.amount} (${t?.state ?? "unknown state"})` : " | not held";
  }
  console.log(`${soulbound ? "SOULBOUND    " : "not soulbound"} ${mint}: ${notes.join(", ")}${held}`);
}
console.log(wallet ? (verified ? "BADGE VERIFIED" : "NO VERIFIED BADGE") : "no wallet given: pass one to check holding");
```

Each mint gets one line: `SOULBOUND` or `not soulbound`, then the facts behind it, such as the program that owns the mint and whether a mint authority, freeze authority or permanent delegate is set. With a wallet each line adds the held amount and the token account's state, and the last line reads BADGE VERIFIED when at least one mint is soulbound and held. A wallet that holds a transferable token never verifies, because the two checks are separate.

Non-transferable mints are rare among the newest Token-2022 transactions, so the no-argument run mostly prints transferable verdicts. Pass a badge mint you know to see the soulbound result.

## What it costs on Carbium

`getMultipleAccounts` is an [account read](https://carbium.sh/docs#rpc) at 10 cells per pubkey. Checking a mint costs 10 cells, and checking a mint with a wallet costs 20, one for the mint and one for the token account. A call takes at most 100 pubkeys below Pro, because the 1024-cell burst caps it there, so the script reads 100 mints at most. 300 pubkeys in one call is a Pro limit. A 100-pubkey call costs 1000 cells, 1001 over a 4 KiB body.

| Plan | Price per month | Account reads, req/s |
|---|---|---|
| Free | $0 | 0.5 |
| Dev | $20 | 15 |
| Business | $250 | 50 |
| Pro | $500 | 400 |

The extension has to be set before the mint is initialized, so a mint's soulbound status never changes after creation. Cache that verdict for good and spend account reads only on the parts that move: the authorities and the holder's balance. A badge program that re-reads the mint for its authorities pays 20 cells a check, and one that caches the authorities too pays 10 cells for the holder read alone.

The demo run with no arguments adds one `getSignaturesForAddress` call and up to ten `getTransaction` calls at 50 cells each, at most 550 cells in all.

## Where it ends

- Only Token-2022 non-transferable mints count. A badge on the original token program that stays put because its token account is frozen prints `original token program` and not soulbound here, and an account on another program, such as a badge on another asset standard with its own lock, prints `owned by` and that program's address. The issuer's freeze authority can usually thaw a frozen account.
- The script reads the associated token account. A wallet can own several token accounts for one mint, and a badge in a different one reads as not held. `getTokenAccountsByOwner` with the Token-2022 program id lists them all.
- A badge's name and image sit in the mint's metadata. Token-2022 keeps them in the in-mint `tokenMetadata` extension once a `metadataPointer` extension names the mint, and [Token-2022 metadata lookup](https://carbium.sh/library/howsolana/token-2022-metadata-lookup) reads them. The verifier reads neither.
- Anyone can create a mint with the extension and a copied name. Compare the mint address against the list your issuer publishes, or check that the mint authority is your own key while it is still set.
- Holding an address proves nothing about who controls it. Pair the check with a signed message from the wallet, as in the [NFT membership gate](https://carbium.sh/library/usecase/nft-membership-gate).
- A wallet's owner can sell its keys along with the badge, and the verifier cannot tell.
- The script lists no holders of a mint. `getTokenLargestAccounts` is not served and answers [-32601](https://carbium.sh/docs#errors), the final answer for a method that is not served. Who held a badge before comes from `getSignaturesForAddress` on the mint address, whose signatures list every mint and burn of the badge and whose pages reach back 30 days at most. An empty page past that is the index's age limit.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| A badge sold as soulbound prints `original token program` in the verifier. | That mint can move between wallets. Treat it as transferable, or reissue the badge from a Token-2022 mint with the non-transferable extension. |
| A lookalike mint with the extension and your badge's name passes the check. | Compare the mint address with your own list of badge mints before you read anything else. |
| The no-argument run fails on a transaction with error -32015. | Send `maxSupportedTransactionVersion: 1` with `getTransaction`, as the script does. Without it a version 1 transaction is refused and is not charged. |
| `getTransaction` returns null for a signature that `getSignaturesForAddress` listed. | The address index reaches below the validator's ledger floor, so an older signature can list but not load. Skip a null result, as the script does, and test on the newest signatures. |
| A holder shows as not holding the badge although they own it. | The badge sits in a token account other than the associated one. List the wallet's Token-2022 accounts with `getTokenAccountsByOwner` and match the mint. |
| Bulk checks return 429 during a launch. | Cache each mint's soulbound verdict permanently, read only holders, and compare your account-read rate with the next plan. |

## Questions

### Can a member recover a soulbound badge after losing their wallet?

Not by transfer. The issuer mints a fresh badge to the new wallet and, if the mint has a permanent delegate, burns the old one. Without that extension the old badge stays in the lost wallet.

### Is a non-transferable NFT the same as a soulbound token?

On Solana soulbound is a property of the mint. A Token-2022 mint with supply 1, 0 decimals and the non-transferable extension is a soulbound NFT, and the same script verifies it.

### How many badges can one call check?

A call takes up to 100 pubkeys below Pro, and 300 on Pro. Each pubkey costs 10 cells. With a wallet the script reads the mints and the token accounts in two calls.

### Do I need a WebSocket to catch revocations?

No. Re-read the holder's token account when access matters, such as at login or at the gated action. A burned badge reads as not held on the next call.

## Related

- [Token-2022 metadata lookup](https://carbium.sh/library/howsolana/token-2022-metadata-lookup) (How to use Solana, HS0013)
- [NFT membership gate](https://carbium.sh/library/usecase/nft-membership-gate) (Use cases, UC0012)
- [carbium.sh/docs#rpc](https://carbium.sh/docs#rpc)
- [carbium.sh/docs#endpoints](https://carbium.sh/docs#endpoints)
- [carbium.sh/docs#auth](https://carbium.sh/docs#auth)
- [carbium.sh/docs#limits](https://carbium.sh/docs#limits)
- [carbium.sh/docs#errors](https://carbium.sh/docs#errors)
