Skip to main content

  1. Mint accounts uniquely represent a token on Solana and store its global metadata.
  2. Light mints are on-chain accounts like SPL mints, but the light token program sponsors the rent-exemption cost for you.
  3. Add an interface PDA to existing SPL or Token 2022 mints for interoperability with Light Token. The interface PDA holds SPL or Token 2022 tokens when wrapped to Light Token.
  1. A rent sponsor PDA by Light Protocol pays the rent-exemption cost for the account.
  2. Transaction fee payers bump a virtual rent balance when writing to the account, which keeps the account “hot”.
  3. “Cold” accounts virtual rent balance below threshold (eg 24h without write bump) get auto-compressed.
  4. The cold account’s state is cryptographically preserved on the Solana ledger. Users can load a cold account into hot state in-flight when using the account again.
Install the agent skill:
npx skills add https://zkcompression.com
See the AI tools guide for dedicated skills.
createMintInterface is a unified interface that dispatches to different mint creation paths based on programId:
  • TOKEN_PROGRAM_ID or TOKEN_2022_PROGRAM_ID → delegates to SPL or T22 createMint
  • Otherwise it defaults to LIGHT_TOKEN_PROGRAM_ID → creates a Light Token mint
You can use the same interface regardless of mint type.Compare to SPL:
Find the source code here.
1

Create Mint with Token Metadata

Install packages in your working directory:
npm install @lightprotocol/stateless.js@beta \
            @lightprotocol/compressed-token@beta
Install the CLI globally:
npm install -g @lightprotocol/zk-compression-cli@beta
# start local test-validator in a separate terminal
light test-validator
In the code examples, use createRpc() without arguments for localnet.
The mintAuthority must be a Signer for light-mints but can be just a PublicKey for SPL/T22.
import "dotenv/config";
import { Keypair } from "@solana/web3.js";
import { createRpc } from "@lightprotocol/stateless.js";
import { createMintInterface, createTokenMetadata } from "@lightprotocol/compressed-token";
import { homedir } from "os";
import { readFileSync } from "fs";

// devnet:
const RPC_URL = `https://devnet.helius-rpc.com?api-key=${process.env.API_KEY!}`;
const rpc = createRpc(RPC_URL);
// localnet:
// const rpc = createRpc();

const payer = Keypair.fromSecretKey(
    new Uint8Array(
        JSON.parse(readFileSync(`${homedir()}/.config/solana/id.json`, "utf8"))
    )
);

(async function () {
    const { mint, transactionSignature } = await createMintInterface(
        rpc,
        payer,
        payer,
        null,
        9,
        undefined,
        undefined,
        undefined,
        createTokenMetadata("Example Token", "EXT", "https://example.com/metadata.json")
    );

    console.log("Mint:", mint.toBase58());
    console.log("Tx:", transactionSignature);
})();

Add Interface PDA to SPL / Token 2022 mints

Register an interface PDA for an existing SPL mint for interoperability with Light Token. No mint authority required.
import "dotenv/config";
import { Keypair, PublicKey } from "@solana/web3.js";
import { createRpc } from "@lightprotocol/stateless.js";
import { createSplInterface } from "@lightprotocol/compressed-token";
import { homedir } from "os";
import { readFileSync } from "fs";

// devnet:
const RPC_URL = `https://devnet.helius-rpc.com?api-key=${process.env.API_KEY!}`;
const rpc = createRpc(RPC_URL);
// localnet:
// const rpc = createRpc();

const payer = Keypair.fromSecretKey(
    new Uint8Array(
        JSON.parse(readFileSync(`${homedir()}/.config/solana/id.json`, "utf8"))
    )
);

(async function () {
    const existingMint = new PublicKey("YOUR_EXISTING_MINT_ADDRESS");

    const tx = await createSplInterface(rpc, payer, existingMint);

    console.log("Mint:", existingMint.toBase58());
    console.log("Tx:", tx);
})();

Next Steps

Learn how to mint tokens to Light Token accounts.