Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ mintlify-docs/
# Dependencies
node_modules/

stash
stash
docs-audit.md
docs-audit.txt
1 change: 1 addition & 0 deletions .mintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
1 change: 1 addition & 0 deletions .mintlifyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
7 changes: 7 additions & 0 deletions api-reference/libraries/light-token.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "light-token"
description: "Light Token program crate for rent-free token accounts and mints"
url: "https://docs.rs/light-token/latest/light_token/"
---

View the full reference: [light-token](https://docs.rs/light-token/latest/light_token/)
3 changes: 1 addition & 2 deletions blog/light-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ We have dedicated toolkits for specific use cases:

- [Payments](/light-token/toolkits/for-payments)
- [Wallets](/light-token/toolkits/for-wallets)
- [Streaming mints](/light-token/toolkits/for-streaming-mints)
- [Streaming tokens](/light-token/toolkits/for-streaming-tokens)


Get in touch on telegram for help!

Expand Down
20 changes: 10 additions & 10 deletions changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ description: "Latest Releases"
rss: true
---

<Update label="Alpha Releases" description="October 2025">
<Update label="Beta Releases" description="January 2026">

### ZK Compression CLI

<Tabs>
<Tab title="npm">
```bash
npm i -g @lightprotocol/zk-compression-cli@alpha
npm i -g @lightprotocol/zk-compression-cli@beta
```
</Tab>
<Tab title="yarn">
```bash
yarn global add @lightprotocol/zk-compression-cli@0.27.1-alpha.2
yarn global add @lightprotocol/zk-compression-cli@beta
```
</Tab>
<Tab title="pnpm">
```bash
pnpm add -g @lightprotocol/zk-compression-cli@alpha
pnpm add -g @lightprotocol/zk-compression-cli@beta
```
</Tab>
</Tabs>
Expand All @@ -32,20 +32,20 @@ rss: true
<Tabs>
<Tab title="npm">
```bash
npm install @lightprotocol/stateless.js@0.22.1-alpha.1
npm install @lightprotocol/compressed-token
npm install @lightprotocol/stateless.js@beta
npm install @lightprotocol/compressed-token@beta
```
</Tab>
<Tab title="yarn">
```bash
yarn add @lightprotocol/stateless.js@0.22.1-alpha.1
yarn add @lightprotocol/compressed-token
yarn add @lightprotocol/stateless.js@beta
yarn add @lightprotocol/compressed-token@beta
```
</Tab>
<Tab title="pnpm">
```bash
pnpm add @lightprotocol/stateless.js@0.22.1-alpha.1
pnpm add @lightprotocol/compressed-token
pnpm add @lightprotocol/stateless.js@beta
pnpm add @lightprotocol/compressed-token@beta
```
</Tab>
</Tabs>
Expand Down
16 changes: 8 additions & 8 deletions client-library/client-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ Use the [API documentation](https://lightprotocol.github.io/light-protocol/) to

```bash
npm install --save \
@lightprotocol/stateless.js@0.22.1-alpha.1 \
@lightprotocol/compressed-token@0.22.1-alpha.1 \
@lightprotocol/stateless.js@beta \
@lightprotocol/compressed-token@beta \
@solana/web3.js
```

Expand All @@ -138,8 +138,8 @@ npm install --save \

```bash
yarn add \
@lightprotocol/stateless.js@0.22.1-alpha.1 \
@lightprotocol/compressed-token@0.22.1-alpha.1 \
@lightprotocol/stateless.js@beta \
@lightprotocol/compressed-token@beta \
@solana/web3.js
```

Expand All @@ -149,8 +149,8 @@ yarn add \

```bash
pnpm add \
@lightprotocol/stateless.js@0.22.1-alpha.1 \
@lightprotocol/compressed-token@0.22.1-alpha.1 \
@lightprotocol/stateless.js@beta \
@lightprotocol/compressed-token@beta \
@solana/web3.js
```

Expand Down Expand Up @@ -182,7 +182,7 @@ const rpc = createRpc('https://devnet.helius-rpc.com/?api-key=YOUR_API_KEY');
1. Install the CLI

```bash
npm i -g @lightprotocol/zk-compression-cli@alpha
npm i -g @lightprotocol/zk-compression-cli@beta
```

2. Start a local Solana test validator, photon indexer, and prover server on default ports 8899, 8784, and 3001.
Expand Down Expand Up @@ -253,7 +253,7 @@ client.payer = read_keypair_file("~/.config/solana/id.json")?;
1. Install the CLI

```bash
npm i -g @lightprotocol/zk-compression-cli@alpha
npm i -g @lightprotocol/zk-compression-cli@beta
```

2. Start a single-node Solana cluster, an RPC node, and a prover node at ports 8899, 8784, and 3001.
Expand Down
8 changes: 0 additions & 8 deletions compressed-tokens/advanced-guides/example-node-js.mdx

This file was deleted.

8 changes: 0 additions & 8 deletions compressed-tokens/advanced-guides/example-web-client.mdx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,12 @@ const connection = createRpc(); // defaults to localhost:8899
console.log(`Token-2022 mint created with address: ${mint.publicKey.toString()}`);

// Step 3: Call createTokenPool() to initialize omnibus account
// and register Token-2022 mint with Compressed Token Program
// and register Token-2022 mint with Light Token Program
// Create PDA that holds SPL tokens for compressed tokens
const registerTxId = await createTokenPool(
connection,
payer,
mint.publicKey, // Token-2022 mint to register with compressed token program
mint.publicKey, // Token-2022 mint to register with Light Token Program
undefined,
TOKEN_2022_PROGRAM_ID
);
Expand Down
207 changes: 207 additions & 0 deletions compressed-tokens/for-privy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
---
title: "Rent-Free SPL Accounts with Privy"
sidebarTitle: "Privy Guide"
description: "Integrate compressed tokens with Privy embedded wallets for rent-free SPL token accounts and transfers."
keywords: ["privy solana", "privy compressed tokens", "embedded wallet compression", "rent-free tokens privy"]
---
import Toolkits2Setup from "/snippets/setup/toolkits2-setup.mdx";
import TransferNodejs from "/snippets/code-snippets/privy/transfer/nodejs.mdx";
import TransferReact from "/snippets/code-snippets/privy/transfer/react.mdx";
import CompressNodejs from "/snippets/code-snippets/privy/compress/nodejs.mdx";
import CompressReact from "/snippets/code-snippets/privy/compress/react.mdx";
import DecompressNodejs from "/snippets/code-snippets/privy/decompress/nodejs.mdx";
import DecompressReact from "/snippets/code-snippets/privy/decompress/react.mdx";
import BalancesNodejs from "/snippets/code-snippets/privy/balances/nodejs.mdx";
import BalancesReact from "/snippets/code-snippets/privy/balances/react.mdx";
import TransactionHistoryNodejs from "/snippets/code-snippets/privy/transaction-history/nodejs.mdx";
import TransactionHistoryReact from "/snippets/code-snippets/privy/transaction-history/react.mdx";
import ActionCode from '/snippets/code-snippets/compressed-token/create-mint/action.mdx';
import AiPromptNodejs from "/snippets/ai-prompts/privy-nodejs-compressed.mdx";
import AiPromptReact from "/snippets/ai-prompts/privy-react-compressed.mdx";

| Creation Cost | SPL Token Account | Compressed Token |
| :------------ | :---------------- | :--------------- |
| **Per account** | ~2,000,000 lamports | ~**5,000** lamports |

Privy handles user authentication and wallet management. You build transactions with tokens (SOL, SPL or compressed) and Privy signs them client-side:

1. Authenticate with Privy
2. Build unsigned transaction
4. Sign transaction using Privy's wallet provider
5. Send signed transaction to RPC

## What you will implement
<table>
<thead>
<tr>
<th style={{ width: "20%" }}></th>
<th>SPL</th>
<th>Compressed </th>
</tr>
</thead>
<tbody>
<tr>
<td>[**Transfer**](#full-code-examples)</td>
<td>transferChecked()</td>
<td>transfer()</td>
</tr>
<tr>
<td>[**Compress**](#full-code-examples)</td>
<td>N/A</td>
<td>compress()</td>
</tr>
<tr>
<td>[**Decompress**](#full-code-examples)</td>
<td>N/A</td>
<td>decompress()</td>
</tr>
<tr>
<td>[**Get Balance**](#get-balances)</td>
<td>getAccount()</td>
<td>getCompressedTokenAccountsByOwner()</td>
</tr>
<tr>
<td>[**Transaction History**](#get-transaction-history)</td>
<td>getSignaturesForAddress()</td>
<td>getCompressionSignaturesForOwner()</td>
</tr>
</tbody>
</table>

<Tabs>
<Tab title="Guide">
<Steps>
<Step>
### Prerequisites

<Toolkits2Setup />

Connect to an RPC endpoint that supports ZK Compression (Helius, Triton)
```typescript
import { createRpc } from "@lightprotocol/stateless.js";

import {
transfer,
compress,
decompress,
selectMinCompressedTokenAccountsForTransfer,
} from "@lightprotocol/compressed-token";

const rpc = createRpc(RPC_ENDPOINT);
```

<Accordion title="Setup test mint">


<Info>
Before we call compress or decompresss, we need:

* An SPL mint with a interface PDA for compression. This PDA can be created for new SPL mints via [`createMint()`](/compressed-tokens/guides/create-mint-with-token-pool) or added to existing SPL mints via [`createTokenPool()`](/compressed-tokens/guides/add-token-pools-to-mint-accounts).
* For `compress()` SPL tokens in an Associated Token Account, or
* For `decompress()` compressed token accounts with sufficient balance.
</Info>

<ActionCode />

</Accordion>
</Step>
<Step>
## Full Code Examples

<Info>
Find complete examples on Github: [nodejs](https://github.com/Lightprotocol/examples-zk-compression/tree/main/privy/nodejs-privy-compressed) and [react](https://github.com/Lightprotocol/examples-zk-compression/tree/main/privy/react-privy-compressed).
</Info>

<Tabs>
<Tab title="Compressed Transfer">

Send compressed tokens to another recipient, similar to SPL token transfers:

1. Fetch compressed token accounts with `getCompressedTokenAccountsByOwner`
2. Select sender accounts with `selectMinCompressedTokenAccountsForTransfer`
3. Fetch a validity proof from your RPC provider to prove the account's state correctness
4. Build the transfer instruction and transaction
5. Sign with Privy and send transaction

<Tabs>
<Tab title="Node.js">
<TransferNodejs />
</Tab>
<Tab title="React">
<TransferReact />
</Tab>
</Tabs>

</Tab>

<Tab title="Compress SPL to Recipient">

Convert SPL to compressed tokens and send to a recipient in one instruction.

<Tabs>
<Tab title="Node.js">
<CompressNodejs />
</Tab>
<Tab title="React">
<CompressReact />
</Tab>
</Tabs>

</Tab>

<Tab title="Decompress (Offramp)">

Convert compressed tokens back to SPL tokens.

<Tabs>
<Tab title="Node.js">
<DecompressNodejs />
</Tab>
<Tab title="React">
<DecompressReact />
</Tab>
</Tabs>

</Tab>
</Tabs>

</Step>
</Steps>
## Get balances

Fetch SPL and compressed token balances.

<Tabs>
<Tab title="Node.js">
<BalancesNodejs />
</Tab>
<Tab title="React">
<BalancesReact />
</Tab>
</Tabs>

## Get transaction history

Fetch compressed token transaction history for an owner, with optional detailed compression information.

<Tabs>
<Tab title="Node.js">
<TransactionHistoryNodejs />
</Tab>
<Tab title="React">
<TransactionHistoryReact />
</Tab>
</Tabs>
</Tab>

<Tab title="AI Prompt">
<Tabs>
<Tab title="Node.js">
<AiPromptNodejs />
</Tab>
<Tab title="React">
<AiPromptReact />
</Tab>
</Tabs>
</Tab>
</Tabs>
8 changes: 7 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,13 @@
"Jotaro",
"Yano",
"jito",
"Jito"
"Jito",
"Offramp",
"offramp",
"offramps",
"zkcompression",
"Tasktool",
"clippy"
],
"ignorePaths": [
"node_modules",
Expand Down
Loading