library / Blockchain ideas / Consumer and social / BI0117
Wallet privacy exposure report
Give it any wallet address and get a plain list of what a stranger can read about it: balance, token accounts, recent signatures, co-signers, counterparties and active hours. Four public reads, no signing, no private key.
Who sees what
Solana's ledger is open. Every validator replays every block, and an RPC node hands any transaction it still keeps to whoever asks. No login gates the history of an address. For a wallet owner the useful question is what a stranger can assemble from reads that anyone is free to make.
| Party | What it can read |
|---|---|
| Any reader of the chain | Balances, token accounts, signatures, instructions and the full account list of every transaction |
| The wallet owner | The same public data, plus the private key, which is the only thing that can sign |
| Validators | Every transaction in the blocks they replay; a leader also gets transactions before they land, with the sending node's network address |
| An RPC operator | Every request that reaches it, with your IP address and the addresses you look up |
| A program | Only the accounts and instruction data passed to it in one call |
The first row is the one a consumer app can show. The report takes one address and prints what that open reader gets, so an owner sees their own footprint the way an outsider does.
What the report reads
| Question | Method | What comes back |
|---|---|---|
| How much does it hold? | getBalance | Lamports in the wallet |
| Which tokens does it touch? | getTokenAccountsByOwner | Every token account, with its mint |
| How active is it? | getSignaturesForAddress | Signatures, slots and block times |
| Who is it linked to? | getTransaction | Fee payer, co-signers and every other account in the transaction |
None of the calls name a commitment, so @solana/kit 8.6.0 sends confirmed for each. The server's own default would be finalized.
The two history methods cost 50 cells each, so a listing plus ten transaction bodies is 550 cells, and each class absorbs a burst up to 1,024 cells. A Free key refills these two methods at 0.24 req/s and a Dev key at 1.2, so back-to-back runs on Free spend their burst quickly. Other plans refill faster, as rate limits shows for each method.
The signature listing comes from an address index that keeps up to 30 days. Its pages reach below the validator's ledger floor, so getTransaction can answer null for an older signature the listing still shows. The script skips those and counts them. Mainnet also carries v1 transactions, so every body read sets maxSupportedTransactionVersion: 1; with the value absent or 0 such a transaction answers -32015.
The script
Pass a wallet address as the first argument. With no argument it reads the newest signatures of the token program, takes the fee payer of the first transaction it can load, and reports on that wallet, so a first run always has something to show.
// BI0117 · Wallet privacy exposure report// https://carbium.sh/library/blockchainideas/wallet-privacy-exposure-report// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MITimport { address, createDefaultRpcTransport, createSolanaRpcFromTransport, 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 url = process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh";const rpc = createSolanaRpcFromTransport(createDefaultRpcTransport({ url, headers: { "x-api-key": key } }));const TOKEN = address("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");const TOKEN_2022 = address("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");const cfg = { maxSupportedTransactionVersion: 1, encoding: "json" } as const;type Msg = { accountKeys?: string[]; header?: { numRequiredSignatures: number } };async function readTx(sig: Signature) { const tx = await rpc.getTransaction(sig, cfg).send(); if (!tx) return null; // older than the ledger floor const m = tx.transaction.message as unknown as Msg; return { keys: m.accountKeys ?? [], signers: m.header?.numRequiredSignatures ?? 1 };}async function pickWallet(): Promise<string> { const sigs = await rpc.getSignaturesForAddress(TOKEN, { limit: 5 }).send(); for (const s of sigs) { const t = await readTx(s.signature).catch(() => null); if (t?.keys[0]) return t.keys[0]; } throw new Error("no active wallet found");}const why = (r: PromiseRejectedResult) => `failed: ${r.reason?.message ?? r.reason}`;const wallet = process.argv[2] ?? (await pickWallet());const owner = address(wallet);const [bal, accts, sigs] = await Promise.allSettled([ rpc.getBalance(owner).send(), Promise.all( [TOKEN, TOKEN_2022].map((programId) => rpc.getTokenAccountsByOwner(owner, { programId }, { encoding: "jsonParsed" }).send(), ), ), rpc.getSignaturesForAddress(owner, { limit: 10 }).send(),]);console.log("wallet:", wallet);if (bal.status === "fulfilled") console.log("balance (lamports):", bal.value.value);else console.log("balance", why(bal));if (accts.status === "fulfilled") { const mints = accts.value.flatMap((r) => r.value.map((a) => (a.account.data as unknown as { parsed: { info: { mint: string } } }).parsed.info.mint), ); console.log("token accounts:", mints.length, "distinct mints:", new Set(mints).size);} else console.log("token accounts", why(accts));if (sigs.status === "rejected") { console.log("signatures", why(sigs)); process.exit(0);}const hours = new Set( sigs.value.filter((s) => s.blockTime != null).map((s) => new Date(Number(s.blockTime) * 1000).getUTCHours()),);console.log("recent signatures:", sigs.value.length, "active UTC hours:", [...hours].sort((a, b) => a - b).join(","));const txs = await Promise.allSettled(sigs.value.map((s) => readTx(s.signature)));const cosigners = new Set<string>();const others = new Set<string>();let skipped = 0;for (const t of txs) { if (t.status !== "fulfilled" || !t.value) { skipped++; continue; } const v = t.value; v.keys.forEach((k, i) => { if (k !== wallet) (i < v.signers ? cosigners : others).add(k); });}console.log("co-signers:", cosigners.size, "other accounts:", others.size, "transactions skipped:", skipped);
run: node main.ts
Reading the output
- Fee payer and co-signers: the first account in a transaction pays the fee, and the next accounts up to the signature count also signed. A wallet that keeps signing next to the same second key is tied to that key in public. Funding a fresh wallet from a labelled one ties the two as well.
- Counterparties: the report lists every other account in the sampled transactions. A token transfer to an existing token account lists the token accounts and the sender's authority, never the receiving wallet, so a counterparty here is often a token account that still needs one more lookup to find its owner.
- Token accounts: a wallet can own more than one token account for one mint, so the script prints the account count and the distinct mint count apart. The gap between them shows leftover accounts that point back to the same holding.
- Active hours: block times fall into UTC hours. Ten signatures with a narrow band of hours say a lot about the owner's time zone and routine.
- Balance: the lamport figure lets a reader size the wallet before any other read.
The same output doubles as a checklist for the owner. Keep separate wallets for separate jobs, fund each from a source you are happy to link, and expect the hours you sign at to be readable by anyone.
Where it ends
- The sample is the ten newest signatures. A wallet with a long past shows more counterparties than the report does.
- History stops at 30 days. An empty page past that point marks the index's age limit, and the address may have older transactions that stay out of reach.
- Version 0 transactions can load extra accounts through address lookup tables. The script reads the static account list only, so those accounts are undercounted.
- Counterparties are accounts, never people. The report has no labels for exchanges, programs or known entities, so a reader still has to interpret the list.
- Public reads show only the chain. What an RPC operator or a validator sees of your network address and your lookups is outside this report.
When it goes wrong
| what goes wrong | what to do |
|---|---|
| getTransaction answers null for a signature the listing returned | The signature is older than the ledger the node still serves. The script counts it as skipped; read the newest signatures first and treat null as a normal answer. |
| A transaction read fails with -32015 | Set maxSupportedTransactionVersion to 1 on every getTransaction call. Absent or 0, a v1 transaction is refused at no charge. |
| The token account count looks too low for a busy wallet | Token accounts live under two programs. Query both the classic token program and Token-2022, as the script does. |
| The signature list is empty for a wallet you know has history | The address index keeps 30 days at most. An empty page past that limit marks the index's age, not an empty address. |
| Every call returns 401 UNKNOWN_KEY | The key reached the door cut short or mistyped. Copy the whole key into CARBIUM_KEY and send it in the x-api-key header. |
| One of the three parallel reads fails and the report is half empty | The balance, token and signature reads settle apart and each failure is printed, so run again. When one keeps failing, look up its code in errors. |
Questions
Does this report reveal anything a block explorer would not?
No. It reads the same public ledger and only arranges it: co-signers, counterparties and active hours in one place. The point is to see your own wallet the way an outsider can.
Why list co-signers separately from other accounts?
Co-signers authorised the transaction with their own key, so they are tied to the wallet more strongly than an account that was merely referenced. The script splits the account list by the signature count in the message header.
Can I run it on a wallet I do not own?
Yes, since every read is public. Keep it to addresses that are yours or already public, and never use the output to target someone.
How do I cut the exposure it shows?
Use separate wallets for separate purposes, avoid funding them from one labelled source, and avoid a fixed daily pattern. None of this hides history that is already on chain.