services
Get a key

library / AI and blockchain / SI0031

Address type explainer

Paste an address and get its type: personal wallet, PDA, token account, program or empty. The checker tests the curve locally, reads the account's owner once, and says who can sign for the funds held there.

By Carbium · Plain-English chain queries · SI0031 · updated 2026-11-22

01

Wallet or PDA

Every Solana address is 32 bytes. For a personal wallet those bytes are the public half of an Ed25519 keypair, and whoever holds the private half signs for it. A program derived address, a PDA, is built another way. A program hashes seeds together with its own program ID and keeps the result only if it falls off the Ed25519 curve. A point off the curve has no private key, so no keypair can ever exist for it.

That gives a first test, and it needs no network. Decompress the 32 bytes as a curve point. If that works, the address is on the curve and could be a wallet. If it fails, the address is off the curve and nobody holds a key for it. An on-curve address is never a PDA, because the derivation throws those candidates away.

The second test is one read. getAccountInfo returns the account's owner program, its lamports, its data and whether it is executable. The owner decides who may debit an account. Only the owning program can lower the lamports of an account it owns, and the System Program moves SOL out of an account only when that account's own address signs. For a PDA, the program that derived it provides that signature from inside one of its instructions.

02

Who can move the funds

CurveOwner and shapeWhat it isWho moves the funds
OnSystem Program, no dataPersonal walletThe holder of the keypair, with a signature
OffSystem Program, no dataPDA holding SOLThe program that derived it, through invoke_signed with the seeds
On or offToken Program or Token-2022, 165 bytesToken accountIts authority field, which can itself be a wallet or a PDA
On or offToken Program or Token-2022, 82 bytes or account type 1Token mintNobody withdraws from it; it holds no tokens, and its mint and freeze authorities live in its data
On or offAny other programData accountOnly that program's instructions
On or offExecutableProgramNobody withdraws from code; its upgrade authority is a separate account
On or offNo accountEmpty addressNothing is held yet

The associated token account for a wallet and a mint is a PDA of the associated token program, owned by the token program. The wallet controls the tokens as the authority field inside that account. No key exists for the account's own address, which is why a wallet's associated token accounts print as off curve.

03

The checker file

Set CARBIUM_KEY and pass one or more addresses. CARBIUM_RPC_URL overrides the endpoint, which defaults to https://services.carbium.sh. The curve test is plain BigInt arithmetic, about ten lines, so it needs no dependency: it recovers x squared from y and checks that the result has a square root modulo 2^255 - 19.

main.ts
// SI0031 · Address type explainer// https://carbium.sh/library/si/address-type-explainer// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MIT// Address type explainer, read only. Run: CARBIUM_KEY=... node main.ts <address> [<address> ...]import { address, createDefaultRpcTransport, createSolanaRpcFromTransport, getAddressDecoder, getAddressEncoder, getProgramDerivedAddress } from "@solana/kit";import type { Address } from "@solana/kit";const key = process.env.CARBIUM_KEY;const args = process.argv.slice(2);if (!key || args.length === 0) {  console.error("Set CARBIUM_KEY to your Carbium API key and pass one or more addresses.");  process.exit(1);}const rpc = createSolanaRpcFromTransport(  createDefaultRpcTransport({ url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh", headers: { "x-api-key": key } }),);const P = 2n ** 255n - 19n;const pow = (base: bigint, exp: bigint): bigint => {  let r = 1n;  for (let b = base % P, e = exp; e > 0n; e >>= 1n, b = (b * b) % P) if (e & 1n) r = (r * b) % P;  return r;};const D = ((P - 121665n) * pow(121666n, P - 2n)) % P;// Ed25519 point decompression: on the curve when x^2 = (y^2 - 1) / (d*y^2 + 1) has a square root.function onCurve(a: Address): boolean {  const bytes = getAddressEncoder().encode(a);  let y = 0n;  for (let i = 31; i >= 0; i--) y = (y << 8n) | BigInt((bytes[i] ?? 0) & (i === 31 ? 0x7f : 0xff));  const y2 = (y * y) % P;  const x2 = (((y2 - 1n + P) % P) * pow((D * y2 + 1n) % P, P - 2n)) % P;  return x2 === 0n || pow(x2, (P - 1n) / 2n) === 1n;}const SYSTEM = "11111111111111111111111111111111";const TOKEN = address("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");const TOKEN_2022 = address("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");const ATA_PROGRAM = address("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");const USDC = address("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");const shape = (a: Address): string => (onCurve(a) ? "on curve" : "off curve (no private key exists)");async function explain(a: Address): Promise<void> {  console.log(`${a}\n  ${shape(a)}`);  const info = (await rpc.getAccountInfo(a, { encoding: "base64", commitment: "confirmed" }).send()).value;  if (!info) return console.log("  no account on chain, nothing is held here");  if (info.executable) return console.log("  program: code, no funds store; its upgrade authority is a separate account");  const owner: string = info.owner;  const data = Buffer.from(info.data[0], "base64");  if (owner === SYSTEM) {    console.log(`  system account, ${info.lamports} lamports`);    return console.log(onCurve(a) ? "  withdraw: the key holder signs a transfer" : "  withdraw: only the program that derived this address can sign for it");  }  if (owner === TOKEN || owner === TOKEN_2022) {    if (data.length === 82 || data[165] === 1) return console.log("  token mint, holds no tokens itself");    if (data.length === 165 || data[165] === 2) {      const authority = getAddressDecoder().decode(data.subarray(32, 64));      return console.log(`  token account, authority ${authority}, ${shape(authority)}\n  withdraw: that authority signs the transfer`);    }  }  console.log(`  data account owned by ${owner}\n  withdraw: only that program's instructions can debit it`);}const run = async (a: Address): Promise<void> => {  try { await explain(a); } catch (e) { console.error(`failed: ${a}: ${(e as Error).message}`); }};const targets: Address[] = [];for (const arg of args) {  try { targets.push(address(arg)); } catch { console.error(`failed: ${arg} is not a base58 address`); }}for (const a of targets) await run(a);const first = targets[0];if (first && onCurve(first)) {  const enc = getAddressEncoder();  const [ata] = await getProgramDerivedAddress({    programAddress: ATA_PROGRAM,    seeds: [enc.encode(first), enc.encode(TOKEN), enc.encode(USDC)],  });  console.log("\nUSDC token account derived from the first address:");  await run(ata);}

run: node main.ts <address> [<address> ...]

Each address gets one getAccountInfo at confirmed, in base64. When the first address is on the curve, the file also derives its USDC associated token account with getProgramDerivedAddress and explains that one too, so a run shows a PDA next to the wallet it came from. Calls run one after another, and an address that fails prints its error while the loop moves on.

For a token account the file reads bytes 32 to 64 of the data, the authority field, and runs the curve test on it. A plain mint is 82 bytes and a token account 165 bytes in both token programs. Token-2022 adds extension bytes after that, with an account type byte at offset 165, and the file reads that byte to tell the two apart.

04

What it prints

LineMeaningWhat to do
on curve then no account on chainA keypair-shaped address that has never held lamports.Nothing to withdraw. A first transfer creates the account.
off curve then no account on chainA derived address nothing has funded or initialized.Nothing to withdraw. Only the deriving program could ever spend from it.
withdraw: the key holder signs a transferA system-owned wallet on the curve.Find out who holds the key.
withdraw: only the program that derived this address can sign for itA system-owned PDA.Find the program from its seeds and read its rules.
token account, authority <address>, on curveA wallet signs for the tokens.Treat it as an ordinary holder.
token account, authority <address>, off curveA program signs for the tokens.Read that program's withdraw rules.
token mint, holds no tokens itselfA mint account of either token program.Read its mint and freeze authorities in the account data.
data account owned by <program>State that belongs to a program.Read the program, since its code decides every debit.

The shape line comes first for every address, so a wrong guess about the type shows up before the owner read finishes.

05

Cost and commitment

Each address costs one getAccountInfo, an account read at 10 cells. The rate for that class is 0.5 req/s on Free, 15 on Dev, 50 on Business and 400 on Pro, and limits are per account. A long list on Free spaces itself out or meets 429 with a retry-after hint, so check a handful there. For hundreds of addresses, getMultipleAccounts reads up to 100 pubkeys a call at 10 cells each, and 300 a call is a Pro limit. SOL balances for many accounts builds that batch.

Each read runs at confirmed commitment. An account's owner changes only through a few instructions, so the type verdict is stable. A lamport balance is the value at that moment.

06

Where it ends

  • Off the curve shows that no private key exists. It does not say which program derived the address. To find that, derive the address from candidate seeds and a candidate program ID and compare; the seeds come from the program's source or IDL.
  • On the curve shows that a key can exist. Whether anyone still holds it is invisible on chain, and funds under a lost key stay where they are.
  • Withdrawal also depends on program rules. A vault PDA can sit behind a lockup, a timelock, a multisig threshold or a pause flag. The file names who signs, and the program's code decides whether it accepts that signature.
  • A system-owned account that holds data, such as a durable nonce account, is withdrawn by its nonce authority. The file still prints the key-holder line for it.
  • A token account has more than an authority. A delegate can move tokens up to an approved amount, a frozen account blocks every transfer, and a Token-2022 mint can carry a permanent delegate. The file reads the authority only.
  • An address with no account is a reading at confirmed. Any transfer can create it a moment later.
  • A program prints one line. Its upgrade authority sits in a separate ProgramData account that the file does not read.
07

When it goes wrong

what goes wrongwhat to do
A wallet you expected prints off curve.The address is probably a token account, since associated token accounts are PDAs. Pass the owner wallet instead, or read the token account's authority line, which names the wallet.
A wallet you just funded prints no account on chain.The transfer has not reached confirmed, or it went to a different address. Check the signature with getSignatureStatuses and compare the destination.
A long list stops with failed lines carrying 429.Account reads run at 0.5 req/s on Free. Wait the retry-after hint between addresses, cut the list, or move to a plan with a higher account-read rate.
The file prints failed: ... is not a base58 address.The argument did not decode to 32 bytes. Copy the full address again. The file skips it and goes on to the next one.
A token account names a wallet authority, yet the tokens will not move.The account may be frozen, or the tokens may sit behind a delegate. Read the state byte at offset 108 and the delegate field at offset 72 of the account data.
08

Questions

Can funds be withdrawn from a PDA?

Only by the program whose ID derived it, signing through invoke_signed inside one of its own instructions. Nobody holds a key for it, so what that program lets through is the whole answer.

Can I tell a PDA from a wallet without a network call?

For the curve test, yes. An address off the curve has no private key, and the file does this locally. The owner and the data need one getAccountInfo.

Is an associated token account a PDA?

Yes. It derives from the wallet, the token program and the mint under the associated token program, and the file derives one to show it. The wallet controls the tokens as the account's authority.

Does an on-curve address prove a person controls it?

It shows that a key can exist. A program can also own an on-curve account, and the owner shown in the output tells you which one.