> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spark.money/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Token

Creating a token registers it on the network and locks in its properties. Once created, the token exists immediately and you can start minting. All token properties (name, ticker, decimals, max supply, freezability) are permanent and cannot be changed after creation.

<Frame className="chill">
  <img className="block dark:hidden" src="https://mintcdn.com/lightspark/MT8MDW9URVqeJM53/images/issuance/create-token-light.png?fit=max&auto=format&n=MT8MDW9URVqeJM53&q=85&s=eff41c96eec7b9dc4f8557a63fea715d" alt="Create Token" width="3840" height="2160" data-path="images/issuance/create-token-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/lightspark/OQ3nooAPVcDN2i7X/images/issuance/create-token.png?fit=max&auto=format&n=OQ3nooAPVcDN2i7X&q=85&s=61fc5b1320b58320b09265e4131ef704" alt="Create Token" width="3840" height="2160" data-path="images/issuance/create-token.png" />
</Frame>

## Create Your Token

```typescript theme={null}
import { IssuerSparkWallet } from "@buildonspark/issuer-sdk";

const { wallet } = await IssuerSparkWallet.initialize({
  options: { network: "REGTEST" }
});

const { tokenIdentifier, transactionHash } = await wallet.createToken({
  tokenName: "Acme Dollar",
  tokenTicker: "ACME",
  decimals: 6,
  maxSupply: 0n,
  isFreezable: true,
  returnIdentifierForCreate: true
});

console.log("Token created:", tokenIdentifier); // btkn1q...
console.log("Announcement tx:", transactionHash);
```

## Token Properties

All properties are permanent. Choose carefully.

### Name and Ticker

Display name and symbol shown in wallets and explorers.

```typescript theme={null}
tokenName: "Acme Dollar"
tokenTicker: "ACME"
```

### Decimals

Defines the smallest unit. If `decimals: 6`, then `1000000` base units = 1 token.

| Decimals | Smallest Unit | Common Usage  |
| :------- | :------------ | :------------ |
| 6        | 0.000001      | Stablecoins   |
| 8        | 0.00000001    | Bitcoin-style |

### Max Supply

`0n` for unlimited. Any other value caps total supply forever.

```typescript theme={null}
// Unlimited
maxSupply: 0n

// Capped at 21 million (8 decimals)
maxSupply: 21_000_000_00000000n
```

### Freezable

If `true`, you can freeze addresses from transacting your token. If `false`, you lose this ability permanently.

<Warning>
  This cannot be changed. If you set `isFreezable: false`, you can never freeze tokens.
</Warning>

## Get Token Info

After creation, retrieve your token's metadata and identifier:

```typescript theme={null}
const [tokenIdentifier] = await wallet.getIssuerTokenIdentifiers();
if (!tokenIdentifier) throw new Error("No token identifiers found for this issuer");

const [metadata] = await wallet.getIssuerTokensMetadata([tokenIdentifier]);
if (!metadata) throw new Error(`No metadata found for token ${tokenIdentifier}`);

console.log(metadata.tokenName);    // "Acme Dollar"
console.log(metadata.tokenTicker);  // "ACME"
console.log(metadata.decimals);     // 6
console.log(metadata.maxSupply);    // 0n
console.log(metadata.isFreezable);  // true

console.log(tokenIdentifier); // btkn1q...
```

## Vanity Identifiers

Token identifiers are derived from your wallet keys. Want a custom suffix like `btkn1...usdc`? Use the [vanity generator](https://github.com/buildonspark/spark/tree/main/tools/vanity-token-generator).
