---
id: UC0072
title: "Token metadata change alerts"
url: https://carbium.sh/library/usecase/token-metadata-change-alerts
collection: Use cases
category: Compliance, risk and monitoring
revision: 1
updated: 2026-11-22
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Token metadata change alerts

Watch a token's name, symbol and URI for edits. You get a script that derives each metadata address, reads up to 100 in one call, hashes the fields into a local database, and prints changed or unchanged.

## Where a token's metadata lives

A mint account holds supply, decimals and two authorities. It holds no name. The name, the symbol and a link to an image sit in a separate account, and wallets and marketplaces read that account to decide what to show a holder. For most tokens and NFTs the account belongs to the Token Metadata program, and its address is derived from the mint: a program derived address from the seeds `metadata`, the program's own address and the mint. Anyone can compute it offline, so a watcher needs no index to find it.

Token-2022 mints can skip that program. A mint with the `metadataPointer` extension names the account that holds its metadata, and that can be the mint itself, with a `tokenMetadata` record stored inside it. The pointer has to name the mint first, or the in-mint record is not the one readers use. A Token-2022 mint that carries the pointer therefore says where its metadata is by its own bytes, and the derived address above is the wrong place to look for it. A Token-2022 mint with no pointer can still have a Token Metadata account at the derived address. [Token-2022 metadata lookup](https://carbium.sh/library/howsolana/token-2022-metadata-lookup) covers that read.

## What mutable metadata lets an authority change

A Token Metadata account stores an update authority and an `isMutable` flag. While the flag is true, the update authority can rewrite the name, symbol and URI in one transaction, with no action from any holder. It can also change the creator list and the seller fee, and hand the authority to another key. Nothing on the token itself moves: balances, supply and the mint authority stay as they were, so a system that only watches transfers sees nothing happen.

- Display: a holder who bought a token under one name can open a wallet later and read another name and symbol.
- Image and attributes: the URI points at a JSON file, and editing the URI swaps the whole file.
- Impersonation: an edit can give a token the name and symbol of a well known one.
- Listing review: a token that passed review last month passed on the facts of that day.

An issuer can close the door. Setting `isMutable` to false is a one-way change, and the program has no instruction that sets it back to true. Many fixed collections do this after launch. A token that stays mutable is not a warning sign on its own: teams rebrand, fix typos and move image hosting, and the update authority is often a multisig. The job of an alert is to make each edit visible when it happens, so a person can look at who made it.

## Store a hash and compare it

The script keeps one row per mint in a local SQLite file: a hash and the three fields it came from. On each run it reads the current fields, hashes them and compares. One hash is a single value to test, and the stored fields let an alert show what the old values were. After it reports an edit, the script stores the new values, so each edit alerts once.

| Field | Where it sits | Form |
|---|---|---|
| Key | byte 0 | 4 for a metadata account |
| Update authority | bytes 1 to 32 | A 32-byte address |
| Mint | bytes 33 to 64 | A 32-byte address |
| Name | from byte 65 | A 4-byte little-endian length, then text padded with zero bytes to 32 |
| Symbol | right after the name | The same form, padded to 10 |
| URI | right after the symbol | The same form, padded to 200 |

After the URI come the seller fee, an optional creator list of variable length, a sale flag and `isMutable`. The script steps over the creator list by its stored count, 34 bytes a creator, to reach the flag. It trims the zero padding before hashing, so the hash covers the text a wallet shows.

## The script

Pass mint addresses as arguments, or none to watch USDC, USDT, JUP and BONK. It reads your [API key](https://carbium.sh/docs#auth) from `CARBIUM_KEY` and takes the endpoint from `CARBIUM_RPC_URL`, with [`https://services.carbium.sh`](https://carbium.sh/docs#endpoints) as the default. It derives each metadata address locally, makes one `getMultipleAccounts` call at confirmed commitment, and stops with a message when the list is longer than 100.

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

```ts
// UC0072 · Token metadata change alerts
// https://carbium.sh/library/usecase/token-metadata-change-alerts
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

// Read-only watcher: hashes each token's name, symbol and URI from its Token Metadata account and reports edits since the last run.
import { createHash } from "node:crypto";
import { DatabaseSync } from "node:sqlite";
import { address, createDefaultRpcTransport, createSolanaRpcFromTransport, getAddressDecoder, getAddressEncoder, getProgramDerivedAddress, isAddress, 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 url = process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh";
// No arguments: watch USDC, USDT, JUP and BONK.
const args = process.argv.length > 2 ? process.argv.slice(2) : [
  "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
  "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN", "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
];
const bad = args.filter((m) => !isAddress(m));
if (bad.length || args.length > 100) {
  console.error(`Pass 1 to 100 mint addresses (one call). Not an address: ${bad.join(" ") || "none"}`);
  process.exit(1);
}
const mints = args as Address[];

// The metadata account of a mint: seeds "metadata", the program, the mint.
const META = address("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s");
const enc = getAddressEncoder();
const pdas = await Promise.all(mints.map(async (m) =>
  (await getProgramDerivedAddress({ programAddress: META, seeds: ["metadata", enc.encode(META), enc.encode(m)] }))[0]));

const rpc = createSolanaRpcFromTransport(createDefaultRpcTransport({ url, headers: { "x-api-key": key } }));
const { value } = await rpc.getMultipleAccounts(pdas, { encoding: "base64", commitment: "confirmed" }).send()
  .catch((e) => { console.error("getMultipleAccounts failed:", e instanceof Error ? e.message : e); return process.exit(1); });

const db = new DatabaseSync("metadata.db");
db.exec("CREATE TABLE IF NOT EXISTS seen (mint TEXT PRIMARY KEY, hash TEXT, name TEXT, symbol TEXT, uri TEXT)");
const get = db.prepare("SELECT hash, name, symbol, uri FROM seen WHERE mint = ?");
const put = db.prepare("INSERT OR REPLACE INTO seen VALUES (?, ?, ?, ?, ?)");
const decoder = getAddressDecoder();
let changed = false;

mints.forEach((mint, i) => {
  const acc = value[i];
  if (!acc || acc.owner !== META) return void console.log(`${mint} no Token Metadata account`);
  try {
    const d = Buffer.from(acc.data[0], "base64");
    if (d[0] !== 4) throw new Error("not a metadata account");
    let at = 65; // after key, update authority and mint
    const text = () => { // 4-byte length, then zero-padded text
      const n = d.readUInt32LE(at);
      at += 4 + n;
      return d.toString("utf8", at - n, at).replace(/\0+$/, "");
    };
    const name = text(), symbol = text(), uri = text();
    at += 2; // seller fee
    if (d[at++] === 1) at += 4 + 34 * d.readUInt32LE(at); // creators: a count, then 34 bytes each
    const mutable = d[at + 1] === 1; // the byte after the primary-sale flag
    const authority = decoder.decode(d.subarray(1, 33));
    const hash = createHash("sha256").update(JSON.stringify([name, symbol, uri])).digest("hex");
    const old = get.get(mint) as { hash: string; name: string; symbol: string; uri: string } | undefined;
    let verdict = "unchanged";
    if (!old) verdict = "baseline stored";
    else if (old.hash !== hash) { verdict = `CHANGED, was ${old.name} | ${old.symbol} | ${old.uri}`; changed = true; }
    if (old?.hash !== hash) put.run(mint, hash, name, symbol, uri);
    console.log(`${mint} name=${name} symbol=${symbol} authority=${authority} mutable=${mutable} ${verdict}`);
  } catch (e) {
    console.log(`${mint} unreadable: ${e instanceof Error ? e.message : e}`);
  }
});
if (changed) process.exitCode = 2;
```

Each line gives the mint, name, symbol, update authority, the mutable flag and a verdict. The first run stores a baseline for every mint and prints `baseline stored`. Later runs print `unchanged`, or `CHANGED` with the old name, symbol and URI. A mint with no Token Metadata account says so, and an account that will not parse prints `unreadable` while the run goes on with the rest. A run that finds an edit exits with 2, which a cron job or a systemd timer can turn into a message to the channel your risk team reads. The database path is relative, so run it from the same folder each time.

## What one run costs

[Account reads](https://carbium.sh/docs#rpc) cost 10 cells per pubkey in `getMultipleAccounts`, so a 100-mint run costs 1000 cells, or 1001 when the body is over 4 KiB. The call takes up to 300 pubkeys, but below Pro the 1024-cell [burst](https://carbium.sh/docs#limits) caps one call at 100, which is why the script stops there. A longer watch list splits into several runs, and a Pro key can send up to 300 pubkeys in one.

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

A run is one call, so a Free key can start one every two seconds at most.

## Where it ends

- The URI is a pointer. The JSON behind it, with the image link and attributes, lives on an ordinary web or file host, and its owner can change it with no Solana transaction. The hash sees a URI edit and misses a content change behind an unchanged URI. Fetching that JSON is a separate job with its own host, timeouts and trust questions, and the script leaves it out.
- Polling sees states and never events. An edit made and reverted between two runs leaves no trace in the hash.
- When an edit happened is a question for `getSignaturesForAddress` on the metadata address. It costs 50 cells and reaches back 30 days at most, because its pages come from Carbium's own address index. An empty page past that is the index's age limit, and the address may have older transactions.
- Token-2022 metadata kept inside the mint is skipped. Those mints print that they have no Token Metadata account.
- The update authority and the mutable flag are printed and not hashed. A new authority, or a flag turning false, shows in the line and does not print `CHANGED`.
- A changed hash says a field was edited. Whether the edit is a problem is a decision for a person, and a token name is not an identity: two unrelated tokens can share one.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| Every run prints baseline stored. | The database path is relative. Run the script from the same folder each time, or it opens a new empty file. |
| A Token-2022 mint prints no Token Metadata account. | Its metadata may sit in the mint behind a metadataPointer. Read the mint itself, as the Token-2022 metadata lookup entry shows. |
| A list of more than 100 mints stops with a message. | Below Pro the burst caps one getMultipleAccounts call at 100 pubkeys. Split the list into runs of 100. |
| An image is swapped and the script prints unchanged. | The URI did not change, only the file behind it. Fetch and hash the JSON in a separate job. |
| The baseline records a name that was already an edit. | The first run only stores what it finds. Take the baseline from a state your team reviewed, then watch from there. |

## Questions

### What does mutable metadata mean for a token holder?

While the flag is true, the update authority can change the name, symbol and URI at any time with no action from holders. Balances and supply stay the same, so only a metadata read shows the edit.

### Can a token become mutable again after it is locked?

No. Setting isMutable to false is a one-way change, and the program has no instruction that reverses it.

### How many mints does one run check?

Up to 100 in one getMultipleAccounts call, which costs 1000 cells. A Pro key can send up to 300 pubkeys in a call, and below Pro the burst caps it at 100.

### Does a changed hash mean the token was tampered with?

No. It means a field was edited. Teams edit for rebrands and typo fixes, so check who signed the transaction and whether the new values fit the project.

### Where does an NFT collection keep its metadata?

A collection NFT is a mint with its own metadata account, so add the collection mint to the watch list like any other.

## Related

- [Token-2022 metadata lookup](https://carbium.sh/library/howsolana/token-2022-metadata-lookup) (How to use Solana, HS0013)
- [Token authority screening](https://carbium.sh/library/usecase/token-authority-screening) (Use cases, UC0009)
- [carbium.sh/docs#rpc](https://carbium.sh/docs#rpc)
- [carbium.sh/docs#limits](https://carbium.sh/docs#limits)
- [carbium.sh/docs#auth](https://carbium.sh/docs#auth)
- [carbium.sh/docs#endpoints](https://carbium.sh/docs#endpoints)
- [carbium.sh/docs#migrate](https://carbium.sh/docs#migrate)
