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

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Create an asset

> Create an asset, like a share or a currency, with its name and symbol stored onchain, and mint 1,000 units to yourself, in one transaction.

<div className="sol-stepper not-prose" data-path="quickstart">
<div className="sol-stepper-nav" role="navigation" aria-label="Quickstart · ~8 min">
<ol>
<li data-state="done"><a href="/developers/docs/quickstart/check-balance"><span className="sol-stepper-n">Step 1<span className="sol-vh">, </span><span className="sol-stepper-done">Done</span><span className="sol-vh">: </span></span><span className="sol-stepper-t">Check a balance</span></a></li>
<li data-state="done"><a href="/developers/docs/quickstart/send-dollars"><span className="sol-stepper-n">Step 2<span className="sol-vh">, </span><span className="sol-stepper-done">Done</span><span className="sol-vh">: </span></span><span className="sol-stepper-t">Send dollars</span></a></li>
<li data-state="current"><a href="/developers/docs/quickstart/create-asset" aria-current="step"><span className="sol-stepper-n">Step 3<span className="sol-vh">: </span></span><span className="sol-stepper-t">Create an asset</span></a></li>
<li data-state="todo"><a href="/developers/docs/quickstart/send-asset"><span className="sol-stepper-n">Step 4<span className="sol-vh">: </span></span><span className="sol-stepper-t">Send the asset</span></a></li>
<li data-state="todo"><a href="/developers/docs/quickstart/freeze-holder"><span className="sol-stepper-n">Step 5<span className="sol-vh">: </span></span><span className="sol-stepper-t">Freeze a holder</span></a></li>
</ol>
</div>
</div>

On Solana you don't deploy a contract to create an asset. You create a mint
account that a shared token program manages, and each holder gets a token
account. In this step you create Example Fund (EXF), like a share in a fund,
with its name and symbol stored onchain, and mint 1,000 units to yourself.

## Create and mint the asset

Save this as `create-asset.ts` next to `client.ts` and run
`npx tsx create-asset.ts`.

<Tabs>
<Tab title="TypeScript">
<div className="sol-tab-label">TypeScript</div>

```ts
import { writeFileSync } from "node:fs";
import { generateKeyPairSigner, unwrapOption } from "@solana/kit";
import { extension } from "@solana-program/token-2022";
import { client } from "./client";

const wallet = client.identity;
const mint = await generateKeyPairSigner(); // the new asset's address
const { instructions } = client.token2022;

// One transaction: create the mint (the account that defines the asset) with
// its name, symbol, and details stored in it, then mint 1,000 EXF to your
// token account, created if needed. Amounts are in base units: 1,000 x 10^2.
const { context } = await client.sendTransaction([
  await instructions.createMint({
    newMint: mint,
    decimals: 2,
    mintAuthority: wallet,
    freezeAuthority: wallet.address, // lets you freeze holders (step 5)
    extensions: [
      extension("MetadataPointer", {
        authority: wallet.address,
        metadataAddress: mint.address,
      }),
      extension("TokenMetadata", {
        updateAuthority: wallet.address,
        mint: mint.address,
        name: "Example Fund",
        symbol: "EXF",
        uri: "https://example.com/exf.json",
        additionalMetadata: new Map([["asset class", "fund share"]]),
      }),
    ],
  }),
  await instructions.mintToATA({
    mint: mint.address,
    owner: wallet.address,
    mintAuthority: wallet,
    amount: 100_000n,
    decimals: 2,
  }),
]);

// Save the asset's address for the next steps.
writeFileSync("asset.json", JSON.stringify({ mint: mint.address }));

// Read the asset back from the network.
const asset = await client.token2022.accounts.mint.fetch(mint.address);
const metadata = unwrapOption(asset.data.extensions)?.find(
  (e) => e.__kind === "TokenMetadata",
);

console.log("Asset (mint):", mint.address);
console.log("Name:", metadata?.name, `(${metadata?.symbol})`);
console.log("Signature:", context.signature);
console.log(
  `Explorer: https://explorer.solana.com/address/${mint.address}?cluster=devnet`,
);
console.log("Supply:", Number(asset.data.supply) / 100, "EXF");
```

<div className="sol-term not-prose" data-term="paths/start/quickstart/asset" data-tab="TypeScript" data-kind="block" data-steps="1" data-l-run="Run" data-l-run-step="Run step" data-l-next="Next step" data-l-all="Run all" data-l-again="Run again" data-l-running="Running…" data-l-tx="Sending transaction…" data-l-http="Requesting…" data-l-call="Running…" data-l-confirming="Confirming…" data-l-done="Done" data-l-copied="Copied" data-l-step="Step">
<div className="sol-term-head"><span className="sol-term-title">Output of npx tsx create-asset.ts</span><span className="sol-term-env">Local test network (Surfpool)</span><button type="button" className="sol-term-copy" data-act="copy">Copy</button></div>
<div className="sol-term-screen" role="region" tabIndex="0" aria-label="Output of npx tsx create-asset.ts: Output">
<div className="sol-term-step" data-step="1" data-pending="tx">
<div className="sol-term-row sol-term-cmd"><span className="sol-term-ps" aria-hidden="true">\$</span> npx tsx create-asset.ts</div>
<div className="sol-term-row sol-term-ln">Asset (mint)\: <span className="sol-h" title="Bc9g7ThR34XGLJzmSR3h6X1xG2HxxmyrhFyDfFekBk2k"><span className="sol-h-f">Bc9g7ThR34XGLJzmSR3h6X1xG2HxxmyrhFyDfFekBk2k</span><span className="sol-h-s" aria-hidden="true">Bc9g…Bk2k</span></span></div>
<div className="sol-term-row sol-term-ln"><span className="sol-term-k">Name\:</span> Example Fund (EXF)</div>
<div className="sol-term-row sol-term-ln"><span className="sol-term-k">Signature\:</span> <span className="sol-h" title="4q3XRWyHkkuzosQXU5AnxXeDmCQXcbu4LvMd9ZNtLvBph4NZEMMFDzAgZfq9Bwyg4sB7GgLiVw1DBzq3fEBs5hrK"><span className="sol-h-f">4q3XRWyHkkuzosQXU5AnxXeDmCQXcbu4LvMd9ZNtLvBph4NZEMMFDzAgZfq9Bwyg4sB7GgLiVw1DBzq3fEBs5hrK</span><span className="sol-h-s" aria-hidden="true">4q3X…5hrK</span></span></div>
<div className="sol-term-row sol-term-ln"><span className="sol-term-k">Explorer\:</span> `https://explorer.solana.com/address/Bc9g7ThR34XGLJzmSR3h6X1xG2HxxmyrhFyDfFekBk2k?cluster=devnet`</div>
<div className="sol-term-row sol-term-ln"><span className="sol-term-k">Supply\:</span> 1000 EXF</div>
<div className="sol-term-result"><span className="sol-term-badge" data-tone="ok">Confirmed</span></div>
</div>
</div>
<div className="sol-term-foot"><button type="button" className="sol-term-btn" data-act="run">Run</button><span className="sol-term-status"></span><span className="sol-term-sr" role="status"></span></div>
</div>

</Tab>
<Tab title="CLI">
<div className="sol-tab-label">CLI</div>

```bash
solana-keygen new --no-bip39-passphrase -o exf.json  # the asset's address
spl-token create-token exf.json --program-2022 --decimals 2 \
  --enable-freeze --enable-metadata
MINT=$(solana address -k exf.json)
spl-token initialize-metadata $MINT \
  "Example Fund" EXF https://example.com/exf.json
spl-token create-account $MINT  # your token account for EXF
spl-token mint $MINT 1000
```

</Tab>
</Tabs>

The script prints a link to your asset in Solana Explorer, with its name,
symbol, supply, and mint authority.

What the code does:

1. **Create the asset.** `client.token2022.instructions.createMint(...)`
   creates a Token-2022 mint account with 2 decimals, funded with the deposit
   (rent) that keeps it open. Your wallet is the mint authority, the only key
   that can create more, and the freeze authority, the only key that can freeze
   a holder's account (step 5). Two extensions store metadata in the mint
   itself: `MetadataPointer` says where it lives, and `TokenMetadata` holds the
   name, symbol, a details link, and extra fields (here,
   `asset class: fund share`).
2. **Mint 1,000 units to yourself.** `mintToATA(...)` opens your token account
   for the asset and adds 100,000 base units (1,000 units with 2 decimals).
3. **Send it.** `client.sendTransaction([...])` puts both in one transaction.
   If any instruction fails, none of them take effect.

The script saves the asset's address in `asset.json` for the next steps, then
reads the mint back and prints `Name: Example Fund (EXF)` and
`Supply: 1000 EXF`.

<div className="sol-concept not-prose">
[<span className="sol-concept-name">Mints & authorities</span> <span className="sol-concept-def">A mint account defines a token: its supply, its decimals, who may create more (mint authority), and who may freeze holders (freeze authority).</span>](/developers/docs/tokens/basics/create-mint)
</div>

<div className="sol-concept not-prose">
[<span className="sol-concept-name">Token accounts</span> <span className="sol-concept-def">Wallets don't hold tokens directly.</span>](/developers/docs/tokens/basics/create-token-account)
</div>
