confidential-fhevm

Generate confidential smart contracts on Zama FHEVM with encrypted I/O and ACL permissions.

Updated May 10, 2026
One-click install
npx skills add https://github.com/harystyleseze/confidential-fhevm-skill --skill confidential-fhevm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: confidential-fhevm
Source: https://github.com/harystyleseze/confidential-fhevm-skill/tree/main/skills/confidential-fhevm
Command: npx skills add https://github.com/harystyleseze/confidential-fhevm-skill --skill confidential-fhevm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

It solves the difficulty of writing correct, production-ready confidential smart contracts by guiding an AI agent through the full Zama FHEVM workflow—contract architecture, encrypted I/O, ACL permissions, testing, deployment, and SDK v3 frontend integration—while preventing common mistakes like forbidden branching on encrypted booleans or missing FHE.allowThis after encrypted writes.

Core Features & Use Cases

  • Solidity contract patterns for FHEVM: teaches the encrypted handle mental model, required ZamaEthereumConfig inheritance, and safe encrypted control-flow using FHE.select.
  • Permission and decryption correctness: enforces ACL rules (FHE.allowThis, FHE.allow, allowTransient, makePubliclyDecryptable) and covers both user decryption and public 3-step decryption (makePubliclyDecryptable → publicDecrypt → checkSignatures).
  • Testing and deployment across toolchains: supports both Foundry (forge-fhevm) and Hardhat (@fhevm/hardhat-plugin) tracks, plus Sepolia deployment workflow and frontend ABI syncing.
  • Frontend integration with SDK v3: provides guidance for Next.js + wagmi + @zama-fhe/react-sdk v3 hooks (useEncrypt, useUserDecrypt, usePublicDecrypt, token/ERC-7984 flows) and UX patterns for making privacy understandable.
  • Safety validation via a static linter: includes fhevm-lint to detect critical and high-risk anti-patterns before returning code.

Quick Start

Use the confidential-fhevm skill to generate a complete end-to-end confidential voting dApp using the prompt: "Write me a confidential voting contract with encrypted YES/NO weights, test it locally, and ship a Next.js SDK v3 frontend that supports public reveal after the deadline."

Frequently Asked Questions about confidential-fhevm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write confidential smart contracts on Zama FHEVM with correct encrypted inputs and outputs?

Writing confidential smart contracts on Zama FHEVM requires using the encrypted handle mental model, inheriting ZamaEthereumConfig, and enforcing safe encrypted control-flow with FHE.select to manage encrypted I/O correctly.

How do I set up ACL permissions and public decryption ceremonies for FHEVM contracts?

Setting up ACL permissions for FHEVM contracts involves applying rules like FHE.allowThis and FHE.allow after encrypted writes, while public decryption requires a 3-step ceremony: makePubliclyDecryptable, publicDecrypt, and checkSignatures.

Does the Zama FHEVM workflow support both Foundry and Hardhat toolchains for testing and deployment?

The Zama FHEVM workflow supports both Foundry and Hardhat toolchains, utilizing forge-fhevm with per-ciphertext proofs for Foundry tracks and @fhevm/hardhat-plugin with mock mode for Hardhat tracks.

How do I integrate a Next.js frontend with FHEVM using SDK v3 hooks for encrypted voting?

Integrating a Next.js frontend with FHEVM uses @zama-fhe/react-sdk v3 hooks like useEncrypt and useUserDecrypt, combined with wagmi, to manage encrypted voting flows and ERC-7984 confidential token integrations.

Why does branching on encrypted booleans fail in FHEVM smart contracts and how do I avoid it?

Branching on encrypted booleans fails because FHEVM operations must remain deterministic, which you avoid by using safe encrypted control-flow patterns like FHE.select and running a static linter to detect high-risk anti-patterns.

What is the best way to lint Solidity and frontend code for FHEVM confidential smart contract anti-patterns?

The best way to lint FHEVM confidential smart contract code is using the fhevm-lint static analyzer to automatically detect and enforce critical and high-risk anti-patterns in Solidity and frontend code before deployment.