Skip to main content
The create-inco-app CLI allows you to create a new full-stack confidential dApp with a Next.js frontend, Anchor programs (Rust), and the Inco Solana SDK. It is the easiest way to get started building on Inco for Solana.

Basic usage

npx create-inco-app@latest
On installation, you’ll see the following prompts:
What is your project named? my-app
Which chain would you like to use? SVM
Which contract framework would you like to use? Anchor
Which wallet provider would you like to use? Solana Wallet Adapter / Privy
After the prompts, create-inco-app will create a folder with your project name and install the required dependencies.

Reference

npx create-inco-app@latest [project-name] [options]
The following options are available:
OptionDescription
-h or --helpShow all available options
-v or --versionOutput the version number
-f or --framework <value>Contract framework (anchor)
-w or --wallet <value>Wallet provider (solana-wallet-adapter, privy)
-c or --chain <value>Chain type (svm)
-y or --yesSkip prompts, use defaults
--installAuto-install dependencies after scaffolding
--gitInitialize a git repository
--use-npmExplicitly tell the CLI to bootstrap using npm
--use-pnpmExplicitly tell the CLI to bootstrap using pnpm
--use-yarnExplicitly tell the CLI to bootstrap using Yarn
--use-bunExplicitly tell the CLI to bootstrap using Bun

Project Structure

The scaffolded project is a monorepo with two workspaces:
my-app/
├── programs/              # Anchor workspace (Rust programs)
│   ├── programs/
│   │   ├── confidential-pool/     # Privacy-preserving lottery
│   │   └── confidential-token/    # Encrypted token system
│   ├── tests/             # Integration tests
│   └── Anchor.toml        # Anchor configuration (devnet)
└── frontend/              # Next.js app (pre-configured for Solana devnet)
    ├── components/
    │   ├── Providers.tsx       # Wallet provider setup
    │   └── ConfPool.tsx        # Example dApp component
    ├── hooks/
    │   └── useConfPool.ts      # Inco Solana SDK integration
    └── idl/                    # Program IDLs (auto-synced)
The frontend is pre-configured for Solana devnet. All wallet providers connect to devnet by default, no network configuration changes are needed.

Examples

With default options

npx create-inco-app@latest

With Anchor and Solana Wallet Adapter

npx create-inco-app@latest my-app --framework anchor --wallet solana-wallet-adapter --chain svm --yes

With Anchor and Privy

npx create-inco-app@latest my-app --framework anchor --wallet privy --chain svm --yes

Build & Test Programs

Run the test command from the project root — it builds, deploys to a local validator, runs tests, and automatically syncs the program IDs and IDLs to the frontend:
cd my-app
npm install
npm run programs:test
After the test completes, the frontend .env is automatically updated with the deployed program IDs. Then run the frontend:
cd my-app && npm run dev
Open http://localhost:3000 to see your dApp.
For Privy, you need a Privy App ID with Solana (SVM) enabled. Set NEXT_PUBLIC_PRIVY_APP_ID in frontend/.env.local before running the frontend. For Solana Wallet Adapter, no additional configuration is needed — it works out of the box.

Inco Solana SDK Integration

The scaffolded app uses @inco/solana-sdk for client-side encryption. On-chain, the Anchor programs use inco-lightning CPI for encrypted operations.

Client-side encryption

import { encryptValue } from "@inco/solana-sdk/encryption";
import { hexToBuffer } from "@inco/solana-sdk/utils";

// Encrypt a value before sending on-chain
const amount = BigInt(Math.floor(parseFloat("100") * 1e9));
const encryptedHex = await encryptValue(amount);

// Pass encrypted value to your Anchor program
const tx = await program.methods
  .mintTo(hexToBuffer(encryptedHex), 0)
  .accounts({
    mint: mintAddress,
    account: tokenAccountAddress,
    mintAuthority: publicKey,
    incoLightningProgram: INCO_LIGHTNING_PROGRAM_ID,
    systemProgram: SystemProgram.programId,
  })
  .transaction();

On-chain encrypted operations (Rust)

use inco_lightning::instructions::*;

// Encrypted addition
e_add(ctx, pool.pool_balance, participant.deposit_amount)?;

// Encrypted comparison
e_eq(ctx, participant.index_handle, pool.winner_index)?;

// Random encrypted value
e_rand(ctx)?;

// Grant decryption access
allow(ctx, handle, allowed_address)?;
See Encryption and Attested Decrypt for full details.

Choose Your Wallet Provider

Each wallet provider has its own setup. Select one to see the provider configuration:
solana

Solana Wallet Adapter

Native Solana wallets (Phantom, Solflare)
privy

Privy

Embedded wallets & social login

Quick Reference

CommandDescription
npm run programs:testBuild, test, and sync programs to frontend
npm run programs:buildBuild Anchor programs only
npm run programs:syncSync IDLs and program IDs to frontend
npm run devStart frontend