Skip to main content

Prerequisites

Before you begin, make sure you have the following installed and configured:
  • Node.js 20+ — required by both the frontend and the contracts package
  • pnpm or npm — either package manager works; examples below use npm
  • A wallet with ETH on Ethereum mainnet — needed only if you plan to deploy contracts or interact with mainnet

Tech Stack

LayerTechnologyPurpose
FrontendNext.js 16 + React 19Server components, API routes, Turbopack
StylingTailwind CSS 4Dark theme with gold accent
WalletWagmi 2 + RainbowKit 2Wallet connection, contract interaction
EncryptionZama fhEVM + TFHEFully Homomorphic Encryption on-chain
ContractsSolidity 0.8.27 + HardhatFHE-enabled smart contracts
ChainEthereum MainnetProduction deployment

Frontend Setup

1

Clone the repository

git clone https://github.com/collinsville22/Hideme.git
cd Hideme
2

Install frontend dependencies

cd frontend
npm install
The postinstall script runs automatically after npm install. It executes scripts/copy-sdk.js, which copies the Zama TFHE WASM bundles — tfhe_bg.wasm, kms_lib_bg.wasm, and relayer-sdk.js — from node_modules/@zama-fhe/relayer-sdk into public/sdk/. These files must be served statically for the in-browser FHE client to function. You do not need to run this script manually.
3

Configure environment variables

cp .env.local.example .env.local
Open .env.local and set the contract addresses and your relayer private key. See Environment Variables for a full reference on every variable.
4

Start the development server

npm run dev
The app starts on http://localhost:3000. Turbopack is used by default for fast hot-module replacement.

Contracts Setup

1

Install contract dependencies

cd contracts
npm install
2

Compile the contracts

npx hardhat compile
This compiles all Solidity files under contracts/contracts/ using Solidity 0.8.27 with the cancun EVM target and generates TypeChain bindings in types/.
3

Configure the deployer credentials

The contracts project uses Hardhat configuration variables (not a .env file). Set your mnemonic and RPC key with:
npx hardhat vars set MNEMONIC
npx hardhat vars set INFURA_API_KEY
The first account derived from MNEMONIC is used as the deployer. Alternatively, you can pass a PRIVATE_KEY directly if you adapt hardhat.config.ts to use accounts: [process.env.PRIVATE_KEY].
Never commit your mnemonic or private key to version control.
4

Deploy the factory contract

npx hardhat deploy --network mainnet --tags HideMeFactory
For a full deployment sequence covering all four contracts, see Deploying Contracts.

Zama TFHE WASM Bundles

The frontend uses Zama’s @zama-fhe/relayer-sdk package, which bundles the TFHE WebAssembly module. Because Next.js cannot bundle WASM files directly, the scripts/copy-sdk.js helper copies three files into public/sdk/ so they are served as static assets:
FilePurpose
tfhe_bg.wasmTFHE encryption/decryption WebAssembly binary
kms_lib_bg.wasmKMS client WebAssembly binary
relayer-sdk.jsJavaScript glue layer for both WASM modules
The copy step runs automatically on postinstall and as part of npm run build. If you ever delete public/sdk/ or upgrade @zama-fhe/relayer-sdk, run node scripts/copy-sdk.js from the frontend/ directory to restore the files.

Build docs developers (and LLMs) love