create-inco-app is the fastest way to start building on Inco. It scaffolds a confidential project — a monorepo with Solidity contracts and a Next.js frontend, or just the contracts, or just the frontend — pre-wired with the Inco SDK, your contract framework, and a wallet provider.
Basic usage
npx create-inco-app@latest
You’ll be prompted for:
What is your project named? my-app
What would you like to scaffold? Full monorepo / Contracts only / Frontend only
Which chain would you like to use? EVM / SVM
Which contract framework? Hardhat / Foundry (skipped for frontend-only)
Which wallet provider? RainbowKit / Privy / Dynamic / Reown / Para (skipped for contracts-only)
Scaffold modes
Choose what to generate with --template (or the second prompt). Contracts-only and frontend-only are scaffolded at the project root (no monorepo wrapper).
Full monorepo (default)
Contracts only
Frontend only
Contracts and frontend in one workspace.npx create-inco-app@latest my-app --chain evm --framework hardhat --wallet rainbowkit --yes
my-app/
├── contracts/ # Solidity (Hardhat or Foundry) — ConfidentialERC20 + ConfidentialLottery
├── frontend/ # Next.js app (wallet provider + Inco SDK wired up)
└── package.json # workspace root (npm run dev, contracts:compile, ...)
Just the contract project — Hardhat or Foundry — no frontend.npx create-inco-app@latest my-contracts --template contracts --chain evm --framework foundry --yes
# Foundry # Hardhat
my-contracts/ my-contracts/
├── src/ ├── contracts/ # Solidity files
├── test/ ├── test/
├── script/ ├── ignition/ # deployment modules
├── foundry.toml ├── hardhat.config.ts
├── remappings.txt ├── utils/
└── docker-compose.yaml └── docker-compose.yaml
Just the Next.js dApp — no contracts. Wire it to an already-deployed contract address.npx create-inco-app@latest my-frontend --template frontend --chain evm --wallet rainbowkit --yes
my-frontend/
├── app/ # Next.js App Router
├── components/ # Providers.tsx (wallet) + UI
├── hooks/ # Inco SDK integration
├── lib/network.ts # network + Inco Lightning factory
└── abi/
Reference
npx create-inco-app@latest [project-name] [options]
| Option | Description |
|---|
-t, --template <type> | Scaffold type: monorepo (default), contracts, frontend |
-c, --chain <chain> | Chain type: evm, svm |
-f, --framework <fw> | Contract framework: hardhat, foundry (EVM), anchor (SVM) |
-w, --wallet <provider> | Wallet provider: rainbowkit, privy, dynamic, reown, para |
-y, --yes | Skip prompts, use defaults |
--git | Initialize a git repository |
--install | Install dependencies after scaffolding |
--use-npm / --use-pnpm / --use-yarn / --use-bun | Choose the package manager |
-h, --help | Show all options |
-v, --version | Print the version |
Networks
The project targets Base Sepolia by default and supports Base Mainnet. The frontend selects the network from a single env var — no code changes needed:
# "testnet" (Base Sepolia, default) or "mainnet" (Base Mainnet)
NEXT_PUBLIC_NETWORK=testnet
lib/network.ts reads it and returns the matching Inco Lightning client (Lightning.baseSepoliaTestnet() or Lightning.baseMainnet()).
After setup (monorepo)
-
Install dependencies:
-
Set up frontend env vars:
cp frontend/.env.example frontend/.env
# set NEXT_PUBLIC_NETWORK, your wallet key(s), and NEXT_PUBLIC_CONFLOTTERY_ADDRESS after deploy
-
Compile and test the contracts:
npm run contracts:compile
npm run contracts:test
-
(Optional) Deploy — copy
contracts/.env.sample to contracts/.env and fill in the key for your target network, then:
# local Inco node (anvil + covalidator) — run in a separate terminal
npm run contracts:node
# deploy
npm run contracts:deploy:local # or :deploy:testnet / :deploy:mainnet
contracts/.env keys, per target network:
PRIVATE_KEY_ANVIL=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 # local default
PRIVATE_KEY_BASE_SEPOLIA=<your-testnet-key>
PRIVATE_KEY_BASE=<your-mainnet-key>
-
Start the frontend (set
NEXT_PUBLIC_CONFLOTTERY_ADDRESS to your deployed address first):
Open http://localhost:3000.
Workspace scripts (monorepo)
| Script | Description |
|---|
npm run dev | Start the frontend dev server |
npm run build | Build the frontend |
npm run contracts:compile | Compile the contracts |
npm run contracts:test | Run the contract tests |
npm run contracts:node | Start the local Inco node (anvil + covalidator) |
npm run contracts:deploy:local | Deploy the lottery to the local node |
npm run contracts:deploy:testnet | Deploy the lottery to Base Sepolia |
npm run contracts:deploy:mainnet | Deploy the lottery to Base Mainnet |
deploy:token:local / :testnet / :mainnet variants deploy only the ConfidentialERC20 token. Each deploy reads its key from contracts/.env by target chain (PRIVATE_KEY_ANVIL / PRIVATE_KEY_BASE_SEPOLIA / PRIVATE_KEY_BASE).
Inco SDK integration
The frontend talks to Inco through @inco/lightning-js. The network-aware client comes from lib/network.ts:
import { Lightning } from "@inco/lightning-js/lite";
// NEXT_PUBLIC_NETWORK: "testnet" (Base Sepolia, default) or "mainnet" (Base Mainnet)
export async function getIncoLightning() {
return process.env.NEXT_PUBLIC_NETWORK === "mainnet"
? Lightning.baseMainnet()
: Lightning.baseSepoliaTestnet();
}
Encrypt a value before sending it on-chain, then decrypt results with attestation:
import { getIncoLightning } from "@/lib/network";
import { handleTypes } from "@inco/lightning-js";
import { parseEther } from "viem";
const zap = await getIncoLightning();
// Encrypt an amount for the contract
const ciphertext = await zap.encrypt(parseEther(amount), {
accountAddress: address,
dappAddress: contractAddress,
handleType: handleTypes.euint256,
});
// The Inco executor fee is read from the network and passed as msg.value
const fee = await publicClient.readContract({
address: zap.executorAddress,
abi: getFeeAbi,
functionName: "getFee",
});
writeContract({ address: contractAddress, abi, functionName: "encryptedMint", args: [ciphertext], value: fee });
// Decrypt a handle with attestation (e.g. check if the user won)
const [result] = await zap.attestedDecrypt(walletClient, [encryptedHandle]);
const plaintext = result.plaintext.value;
See Encrypting Values and Attested Decrypt for full details.
Choose your wallet provider
Each provider has its own setup. Select one to see the provider configuration and how it integrates with Inco:

RainbowKit
Multi-wallet connector (recommended)

Privy
Embedded wallets & social login

Dynamic
Multi-chain wallet orchestration

Reown
WalletConnect-powered connections

Para
Embedded + external wallet support