Skip to main content

Setup

This guide walks you through setting up the Next.js template for building confidential Solana dApps.

Clone the Template

git clone https://github.com/Inco-fhevm/nextjs-template-svm.git
cd nextjs-template-svm

Install Dependencies

npm install

Dependencies Overview

The template uses these key packages:
{
  "dependencies": {
    "@coral-xyz/anchor": "^0.32.1",
    "@inco/solana-sdk": "^0.0.2",
    "@solana/wallet-adapter-react": "^0.15.35",
    "@solana/wallet-adapter-react-ui": "^0.9.35",
    "@solana/wallet-adapter-wallets": "^0.19.32",
    "@solana/web3.js": "^1.95.3",
    "next": "16.1.1",
    "react": "19.2.3"
  }
}
PackagePurpose
@inco/solana-sdkEncrypt values and decrypt handles
@coral-xyz/anchorInteract with Solana programs
@solana/wallet-adapter-*Wallet connection UI and hooks
@solana/web3.jsSolana blockchain interactions

Environment Variables

Create a .env.local file in your project root:
# Solana RPC endpoint (optional - defaults to devnet)
NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com

Run the Development Server

npm run dev
Open http://localhost:3000 in your browser.

What You Should See

  1. Header with Inco logo and “Connect Wallet” button
  2. Amount Input field (disabled until wallet connected)
  3. Balance Display showing ”****” (hidden until revealed)

Connect Your Wallet

  1. Click “Connect Wallet”
  2. Select your wallet (Phantom, Solflare, etc.)
  3. Approve the connection
Once connected, you can:
  • Enter an amount and encrypt it
  • Mint confidential tokens
  • Reveal your encrypted balance

Next Steps

Now that your project is running, learn about the Project Structure to understand how everything fits together.