A modern Next.js starter template with Aztec Network integration for building privacy-focused web3 applications.
This starter repository provides a foundation for developing decentralized applications on Aztec Network, featuring wallet integration for both Azguard and Obsidion wallets, along with a complete example of a private voting contract implementation.
Checkout complete walkthrough on Youtube
- Wallet Integration: Ready-to-use connections with Azguard and Obsidion wallets
- Private Voting Contract: Complete example of a privacy-preserving voting system
- Modern UI: Clean, responsive interface built with Shadcn UI components
- Network Information: Real-time Aztec Network status display
- Dark Mode: Sleek dark theme optimized for developers
- Node.js 22+
- NPM, Yarn, or Bun
- Access to Aztec Network (Testnet or Local Sandbox)
- Azguard and/or Obsidion wallet extensions installed in your browser
# Clone the repository
git clone https://github.com/raven-house/aztec-nextjs-starter.git
# Navigate to the project directory
cd aztec-nextjs-starter
# Install dependencies
npm install
# or
yarn install
# or
bun installBefore running the development server, create a .env.local file in the root directory with the following variables:
NEXT_PUBLIC_TESTNET_NODE_URL=https://aztec-alpha-testnet-fullnode.zkv.xyz
NEXT_PUBLIC_APP_MODE=SANDBOX # or TESTNET for testnet deployment
# Start the development server
npm run dev
# or
yarn dev
# or
bun devNavigate to the voting contract directory before running contract commands:
cd circuits/voting_contractInstall all dependencies:
aztec-nargo buildCompile contracts:
aztec-nargo compileGenerate contract artifacts (run from the voting contract directory):
aztec codegen -o ../../src/artifacts target --forceRun test cases (Trixie):
aztec test- Click the "Connect Wallet" button in the header
- Select either Azguard or Obsidion wallet
- Approve the connection request in your wallet
The application stores the connected wallet information in the global context, making it available throughout the application.
The starter includes a complete example of a private voting contract with the following functionalities:
- Deploy Contract: Deploy the EasyPrivateVoting contract to Aztec Network
- Register Contract Class: Register the contract class before deployment if necessary
- Cast Vote: Cast a private vote (encrypted on-chain)
- Check Votes: View the current vote count without revealing individual votes
- End Voting: Finalize the voting process
The EasyPrivateVoting contract demonstrates privacy-preserving voting where:
- Votes are encrypted and private
- Only vote tallies are visible, not individual votes
- Only the admin can end the voting process
- Results are verifiably correct without compromising privacy
- Frontend: Next.js, React, TailwindCSS
- Smart Contracts: Aztec Network, Noir language
- Wallet Integration: Azguard and Obsidion wallets
- UI Components: Shadcn UI library
- State Management: React Context API
The application can run in two modes:
- SANDBOX: For local development (default)
- TESTNET: For deploying to Aztec Testnet
Change the NEXT_PUBLIC_APP_MODE environment variable to switch between modes.
This repository is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
- Obsidion Wallet: https://app.obsidion.xyz/
What is Nargo? Dependency management, package management tool for Noir contracts.