---
id: UC0061
title: "Send recipient preflight"
url: https://carbium.sh/library/usecase/send-recipient-preflight
collection: Use cases
category: Wallet products
revision: 1
updated: 2026-11-22
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Send recipient preflight

A read-only Node check that sorts recipient addresses into wallet, token account, mint, program, program-owned data or absent, shows each one's owner program and curve status, and prints a verdict before you send.

## What on-curve means

A Solana address is 32 bytes. For a wallet those bytes are the public half of an ed25519 keypair, a point on the ed25519 curve, and whoever holds the private key can sign for it. Roughly half of all 32-byte values are not a point on that curve. No private key can exist for those, so no signature will ever come from the address itself.

Program derived addresses are picked from that second half on purpose. A program computes one from seeds and its own id, and the runtime lets that program, and only that program, sign for the address during a call it makes. Off-curve is the normal state of a vault, an escrow, a pool authority or any address a program controls.

So `oncurve=false` tells you who cannot sign, and nothing about whether tokens are lost. It is expected when you meant to pay a program and a warning when you meant to pay a person. Every associated token account address is also off-curve, because it is derived from the owner, the token program and the mint. An explorer that flags your own token account as off-curve is describing the account's address. The wallet that controls the tokens is the owner field stored inside it.

The [address type explainer](https://carbium.sh/library/si/address-type-explainer) walks through the account types in detail. This check applies them to one decision: send, hold or stop.

## Recipient kinds and the verdict

The data at an address decides what it is. One `getMultipleAccounts` read returns the owner program, the executable flag and the data length, which is enough to sort every address into one of six kinds.

| Kind | How the read shows it | Verdict |
|---|---|---|
| Wallet | System program owner, no data | OK on the curve. HOLD off the curve, since no key can sign for it. |
| Absent | No account at the address | OK on the curve, the first deposit creates it. HOLD off the curve. |
| Token account | Token or Token-2022 owner, 165 bytes or more | CHECK. Pay it only with its own mint; the holder field says who controls it. |
| Mint | Token program owner, 82 bytes (a Token-2022 mint with extensions is longer) | STOP. A mint stores supply and authorities, and nothing is owed to it. |
| Program | Executable flag set | STOP. A program id is not a recipient. |
| Program-owned data | Owned by a program, not a token account | HOLD. Only the owning program can move funds out. |

OK sends. CHECK means the destination is a token account: pay it with its own mint only, and look at the holder, the wallet or program that controls it. HOLD waits for someone who knows the owner to confirm it. STOP means the address cannot receive what you are sending. An absent address on the curve is a new wallet and gets OK. An absent address off the curve gets HOLD, because the seeds that derive it belong to some program, and you should know which one before you pay it.

## Run the check

Pass up to 100 addresses as arguments. With none, the script takes the newest transaction that touches the USDC mint, reads its token balances and checks the owners listed there. That list mixes ordinary wallets with program-controlled owners, so the output shows both outcomes. Each line prints the address, its kind, owner program, curve status and verdict.

`main.ts` (run: `CARBIUM_KEY=$CARBIUM_KEY node main.ts <address> <address>`)

```ts
// UC0061 · Send recipient preflight
// https://carbium.sh/library/usecase/send-recipient-preflight
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

// Preflight a send: sort each recipient by kind, owner program and curve status, then print a verdict.
import { address, createDefaultRpcTransport, createSolanaRpcFromTransport, getAddressDecoder, getAddressEncoder, isAddress } 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 url = process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh";
const rpc = createSolanaRpcFromTransport(createDefaultRpcTransport({ url, headers: { "x-api-key": key } }));
const given = process.argv.slice(2);
if (given.length > 100 || !given.every((a) => isAddress(a))) {
  console.error("Usage: node main.ts [<address> ...] (up to 100 base58 addresses)");
  process.exit(1);
}

const USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
const SYSTEM = "11111111111111111111111111111111";
const TOKEN = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
const TOKEN_2022 = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
const names: Record<string, string> = { [SYSTEM]: "System", [TOKEN]: "Token", [TOKEN_2022]: "Token-2022" };
const encoder = getAddressEncoder();
const decoder = getAddressDecoder();

// On the ed25519 curve when x^2 = (y^2 - 1) / (d*y^2 + 1) has a square root mod p.
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;
const onCurve = (a: string): boolean => {
  const bytes = encoder.encode(address(a));
  let y = 0n;
  for (let i = 31; i >= 0; i--) y = (y << 8n) | BigInt(bytes[i]);
  y &= (1n << 255n) - 1n;
  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;
};

// With no arguments: the owners in the newest USDC transaction that still has a ledger record.
async function recentOwners(): Promise<string[]> {
  const sigs = await rpc.getSignaturesForAddress(address(USDC), { limit: 10 }).send();
  for (const s of sigs) {
    if (s.err) continue;
    try {
      const tx = await rpc.getTransaction(s.signature, { encoding: "json", maxSupportedTransactionVersion: 1 }).send();
      const owners = (tx?.meta?.postTokenBalances ?? []).filter((b) => b.mint === USDC && b.owner).map((b) => b.owner as string);
      if (owners.length) return [...new Set(owners)].slice(0, 20);
    } catch (e) { console.log(`getTransaction ${s.signature.slice(0, 8)} failed: ${e}`); }
  }
  return [];
}

const targets = given.length ? given : await recentOwners().catch((e: unknown) => { console.log(`discovery failed: ${e}`); return [] as string[]; });
if (!targets.length) { console.log("no addresses to check"); process.exit(0); }
const { value } = await rpc.getMultipleAccounts(targets.map((a) => address(a)), { encoding: "base64" }).send()
  .catch((e: unknown) => { console.error(`getMultipleAccounts failed: ${e}`); return process.exit(1); });

targets.forEach((a, i) => {
  const acc = value[i];
  const off = !onCurve(a);
  const curve = off ? "off-curve" : "on-curve";
  if (!acc) { console.log(`${a}  absent  -  ${curve}  ${off ? "HOLD: nothing there and no key, learn which program derives it" : "OK: the first deposit creates it"}`); return; }
  const d = Buffer.from(acc.data[0], "base64");
  const tok = acc.owner === TOKEN || acc.owner === TOKEN_2022;
  const kind = acc.executable ? "program"
    : tok && (d.length === 82 || (d.length > 165 && d[165] === 1)) ? "mint"
    : tok && d.length >= 165 && d.length !== 355 ? "token account"
    : acc.owner === SYSTEM && d.length === 0 ? "wallet"
    : "program-owned data";
  const holder = kind === "token account" ? decoder.decode(d.subarray(32, 64)) : null;
  const verdict = kind === "wallet" ? (off ? "HOLD: a system account no key can sign for" : "OK")
    : holder ? `CHECK: pay it with its own mint only, holder ${holder} is ${onCurve(holder) ? "on-curve" : "off-curve"}`
    : kind === "program-owned data" ? "HOLD: only the owning program can move funds out"
    : `STOP: a ${kind} is not a place to send to`;
  console.log(`${a}  ${kind}  ${names[acc.owner] ?? acc.owner}  ${curve}  ${verdict}`);
});
```

The curve test is bigint arithmetic on the 32 bytes. It reads the low 255 bits as y, solves the curve equation for x squared, and asks whether that value has a square root. A token account's holder sits at bytes 32 to 64 of its data, so the script decodes it and tests that address too. Reads leave commitment out, so `@solana/kit` 8.6.0 fills in confirmed. The answer describes one moment, so run it again just before you sign.

Finding owners takes `getSignaturesForAddress` on the mint, then `getTransaction` for each signature until one has token balances. Signature pages come from an address index that keeps up to 30 days and reaches below the validator's ledger floor, so `getTransaction` can answer null for an older signature, and the loop skips it. The call passes `maxSupportedTransactionVersion: 1`, because mainnet carries v1 transactions and a call without it answers -32015 for one. A failed call prints and the loop moves on.

The classification read is one `getMultipleAccounts` call at 10 [cells](https://carbium.sh/docs#rpc) per address: 1000 cells for 100, or 1001 once the body passes 4 KiB. The method takes up to 300 pubkeys on Pro, and below Pro the 1024-cell burst caps a call at 100, so the script stops at 100. Account reads run at 0.5 req/s on Free, 15 on Dev, 50 on Business and 400 on Pro, so a longer payout list goes out as several calls at your plan's rate. Discovery adds 50 cells for the signature page and 50 for each transaction it reads. For a bigger batch with amounts and balances, see the [bulk payout preflight](https://carbium.sh/library/usecase/bulk-payout-preflight-check).

## Token accounts for off-curve owners

Paying a program-controlled owner in a token means paying that owner's associated token account. The address derives from the owner, the token program and the mint, and the derivation accepts any 32 bytes as the owner, on-curve or not. The associated token program creates the account for an off-curve owner without complaint. The legacy `@solana/spl-token` helper that derives the address refuses an off-curve owner unless you pass `allowOwnerOffCurve`, a guard against paying an address nobody can sign for. The [associated token address lookup](https://carbium.sh/library/howsolana/associated-token-address-lookup) shows the derivation.

Passing that flag is right for a vault you chose and wrong for a pasted string. Rebuild the owner from its seeds in your own code, and confirm that the program behind those seeds has an instruction that moves tokens out. The token account's authority is the program-derived address, and only that program can sign for it. Tokens sent to a program with no withdraw path stay there until the program gains one.

A wallet can also own more than one token account for one mint. The associated account is the usual destination, but a balance can sit in an account you did not derive, and the check lists the account you gave it.

## Where it ends

- The check reads state at one moment at confirmed. An absent address can fill, and a program can change.
- Kind and curve status say who can sign. They do not say the recipient is the person you meant, and a transfer cannot be recalled. Nothing here declares funds safe.
- Whether a program has a path to move tokens out of its derived address is in the program's code, which the script does not read.
- For a token account the script shows the holder and its curve status. It does not compare the account's mint with the mint you are sending, and it does not read the frozen state or decode Token-2022 extensions.
- Discovery reads the ten newest signatures of one mint. Signature history reaches back 30 days at most, and an empty page past that marks the index's age limit; the address may have older transactions.
- Screening who you are allowed to pay is a separate step that sits with you.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| Tokens went to an off-curve token account and the receiving wallet shows no balance. | The token account address is off-curve by construction. Read the account, take the owner field at bytes 32 to 64 and look at that wallet's token accounts for the mint. |
| The spl-token helper throws a token-owner-off-curve error. | The owner address has no key. If it is the program-derived address you meant, rebuild it from its seeds and pass allowOwnerOffCurve. If it was pasted, stop and confirm it with the recipient. |
| A first SOL deposit to an absent address on the curve fails. | A new account must hold at least the rent-exempt minimum. Read getMinimumBalanceForRentExemption for 0 bytes and send at least that amount. |
| A list of more than 100 addresses cannot be read in one call below Pro. | The 1024-cell burst caps a getMultipleAccounts call at 100 pubkeys there. Split the list into calls of 100 and space them to the account-read rate of your plan. |
| Discovery prints no addresses, or a getTransaction call fails. | An older signature can come back null, so skip it. Pass maxSupportedTransactionVersion: 1 with an encoding, because a call without it answers -32015 for a v1 transaction. |

## Questions

### Is an off-curve address a burn address?

The curve status carries no such label. A program-derived address with a withdraw path is recoverable by that program, and an address no program signs for is out of reach. The difference is in the program's code, which you read or ask its operator about.

### Can I get tokens back from an off-curve account?

Only if the program that derives the address can sign a transfer out of it. If it has a withdraw instruction, its operator can tell you how to call it. If it has none, nobody can move the tokens.

### Why does my explorer show my own token account as off-curve?

Associated token accounts are program-derived addresses, so they are always off-curve. Open the account and read its owner field, which is the wallet that controls the tokens.

### Does on-curve mean a person holds the key?

It means a key can exist. Anyone can generate an on-curve address and discard the key, so the check cannot tell a live wallet from a lost one.

## Related

- [Associated token address lookup](https://carbium.sh/library/howsolana/associated-token-address-lookup) (How to use Solana, HS0022)
- [Bulk payout preflight check](https://carbium.sh/library/usecase/bulk-payout-preflight-check) (Use cases, UC0029)
- [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)
