> For the complete documentation index, see [llms.txt](https://docs.keeta.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeta.com/features/native-tokenization/token-creation/burn-tokens.md).

# Burn Tokens

Below is a minimal, end-to-end example that mints a token and then burns part of its supply. After creating a token account and minting 10,000 units, a burn operation reduces both the holder’s balance and the token’s total supply by 2,500. Burns are staged with a builder and become final once published.

How it works:

* Create a token account, set basic info and default permission.
* Mint an initial supply to the token account.
* Start a new builder to burn: subtract the same amount from the account balance and the total supply.
* Publish to commit the burn on-chain.

This pattern keeps the ledger consistent: every burned unit is removed from circulation and reflected immediately in both balance and supply.import \* as KeetaNet from "@keetanetwork/keetanet-client";

```typescript

async function main() {
    // Generate random seed for account creation
    const seed = KeetaNet.lib.Account.generateRandomSeed({ asString: true });
    console.log("seed =", seed);

    // Create account and user client
    const account = KeetaNet.lib.Account.fromSeed(seed, 0);
    const userClient = KeetaNet.UserClient.fromNetwork("test", account);

    // Create and mint new token
    const builderMint = userClient.initBuilder();
    const pendingTokenAccount = builderMint.generateIdentifier(KeetaNet.lib.Account.AccountKeyAlgorithm.TOKEN);
    await builderMint.computeBlocks();
    const tokenAccount = pendingTokenAccount.account;

    builderMint.setInfo(
        {
            name: '',
            description: '',
            metadata: '',
            defaultPermission: new KeetaNet.lib.Permissions(['ACCESS']),
        },
        { account: tokenAccount }
    );
    builderMint.modifyTokenSupply(10_000n, { account: tokenAccount });

    await builderMint.publish();

    console.log("Token account created and minted.");
    console.log("Balances after minting:", await userClient.allBalances());

    // Burn some tokens
    const builderBurn = userClient.initBuilder();
    builderBurn.modifyTokenSupply(-2_500n, { account: tokenAccount });
    await builderBurn.publish();

    console.log("2,500 tokens burned from account", tokenAccount.publicKeyString.toString());
    console.log("Balances after burning:", await userClient.allBalances());
}

main()
    .then(() => {
        console.log("Done");
        process.exit(0);
    })
    .catch((err) => {
        console.error("Error:", err);
        process.exit(1);
    });

```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keeta.com/features/native-tokenization/token-creation/burn-tokens.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
