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 or Yarn
- 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-starter
# Install dependencies
npm install
# or
yarn install
# Start the development server
npm run dev
# or
yarn dev
Install All dependencies
aztec-nargo build
Compile contracts
aztec-nargo compile
Generate contract artifacts
aztec codegen -o ../src/artifacts target --force
Run test cases(Trixie)
aztec test
NOTE: You need to register your contract first using script bun run register-contract
before trying deployment using Obsidion wallet.
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
APP_MODE=SANDBOX # or TESTNET for testnet deployment
- 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 APP_MODE
environment variable to switch between modes.
MIT
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