A Secret Santa application built on Fhenix using Fully Homomorphic Encryption (FHE). Assignments are encrypted on-chain, ensuring no one can see who got whom until the reveal.
- FHE-Encrypted Assignments: Secret Santa pairings are computed and stored encrypted on-chain
- Password-Protected Games: Optional password protection using encrypted comparison
- On-Chain Randomness: Participant entropy contributes to shuffle randomness
- Permit-Based Decryption: Only participants can decrypt their own assignments
packages/
├── hardhat/ # Smart contracts (Solidity + FHE)
└── nextjs/ # Frontend (Next.js + wagmi + cofhejs)
- Node.js 18+
- Bun (recommended) or npm
bun installCopy the example env files:
cp packages/hardhat/.env.example packages/hardhat/.env
cp packages/nextjs/.env.example packages/nextjs/.env.localConfigure your environment variables:
DEPLOYER_PRIVATE_KEY- Private key for contract deploymentNEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID- WalletConnect project ID
Start the frontend:
cd packages/nextjs
bun devDeploy contracts to Fhenix Helium testnet:
cd packages/hardhat
bun hardhat deploy --network testnet- Create Game: Creator sets a name and optional password, providing initial entropy
- Join Game: Players join with password (if required) and contribute entropy
- Finalize: Creator finalizes the game, triggering the encrypted shuffle
- Reveal: Participants decrypt their individual assignments using FHE permits
- Blockchain: Fhenix (FHE-enabled EVM)
- Smart Contracts: Solidity with Fhenix FHE library
- Frontend: Next.js 14, TypeScript, Tailwind CSS
- Web3: wagmi, viem, cofhejs
MIT