Skip to main content

GitHub Templates

Production-ready code repositories that you can clone and deploy immediately to start building FHE-enabled dApps.

Cofhe UI Templates

A collection of lightweight frontend templates that demonstrate how to integrate Cofhejs with popular web frameworks. These templates include a complete Counter dApp example that showcases encrypted smart contract interactions. Available templates:
  • Next.js - Full-stack React framework with server-side rendering
  • React (Vite) - Fast build tool with modern React development experience
Deployed Counter Contracts:
  • Sepolia: 0x0D719dd073f4B3e36D0D263F4bb76F9B7E46D0c2
  • Arbitrum Sepolia: 0x83d6d706b9A597EF43c487e5E50c25b0Aa131b8a
These templates serve as reference implementations, showcasing every Cofhejs feature in production-ready code that developers can learn from and adapt.

Cofhe Scaffold-ETH 2

A comprehensive full-stack development template built on Scaffold-ETH 2 with CoFHE integration. This template includes everything you need to build, test, and deploy FHE-enabled smart contracts and dApps. Key technologies implemented:
  • Hardhat - Smart contract development and testing framework
  • NextJS - React framework with server-side rendering
  • RainbowKit - Wallet connection UI components
  • Wagmi & Viem - React hooks for Ethereum interactions
  • Cofhejs - Complete FHE encryption and decryption integration
  • Custom React Hooks - Comprehensive hooks for FHE operations, permit management, and encrypted value handling
Features:
  • Contract Hot Reload - Frontend auto-adapts to your smart contract as you edit it
  • Custom Hooks - Collection of React hooks for FHE operations with TypeScript autocompletion
  • Components - Pre-built components for displaying encrypted values and managing permits
  • Local Testing - Mock contracts for testing FHE operations without CoFHE co-processor
  • Wallet Integration - Connect to different wallet providers and interact with FHE-enabled networks
This template serves as the ultimate reference implementation, showcasing every FHE feature in production-ready code with comprehensive documentation and examples.

Coming Soon

F402 (X402 with Fhenix)

FHE-enabled implementation of the X402 protocol, bringing privacy-preserving functionality to decentralized exchanges and trading.

Mini Apps

Lightweight templates for building FHE-enabled mini applications with streamlined user experiences and privacy-preserving features.

Getting Started

1

Choose your template

Select the template that best matches your project requirements:
  • Cofhe UI Templates for lightweight frontend-only applications
  • Cofhe Scaffold-ETH 2 for full-stack development with smart contracts
2

Fork or clone

Use the provided links to fork the templates or clone the GitHub repositories to your local machine.
3

Install dependencies

Navigate to the template directory and install required dependencies:
yarn install
# or
npm install
4

Configure and customize

Modify the templates to match your specific use case:
  • Update contract addresses and ABIs
  • Customize the UI components
  • Configure your network settings