Welcome to FHEVM SDK
FHEVM SDK is a universal, framework-agnostic SDK for building confidential decentralized applications (dApps) using Zama's Fully Homomorphic Encryption (FHE) technology.
Why FHEVM SDK?
Building privacy-preserving dApps shouldn't be complicated. FHEVM SDK provides a simple, intuitive API that works seamlessly with your favorite frameworks.
Key Features
- 🎯 Framework-Agnostic Core - Use with any JavaScript framework or Node.js
- ⚛️ React Hooks - Wagmi-like API for React applications
- 💚 Vue Composables - First-class Vue 3 support
- 🔒 Full Type Safety - Written in TypeScript with complete type definitions
- 🌳 Tree-Shakeable - Import only what you need
- ⚡ Production Ready - Based on battle-tested implementations
- 🛠️ Easy Integration - Minimal configuration required
What is Fully Homomorphic Encryption (FHE)?
Fully Homomorphic Encryption (FHE) allows computations to be performed on encrypted data without decrypting it first. This means you can build applications that preserve user privacy while still performing complex operations on-chain.
Use Cases
- 🏦 Confidential DeFi - Private balances, transfers, and trading
- 🎮 Private Gaming - Hidden game state and player information
- 🗳️ Secure Voting - Private voting with public verification
- 💼 Enterprise Solutions - Confidential business logic on-chain
Quick Example
React
import { FHEVMProvider, useConfidentialBalance } from '@fhevmsdk/react'
function App() {
return (
<WagmiProvider config={wagmiConfig}>
<FHEVMProvider network="sepolia">
<BalanceDisplay />
</FHEVMProvider>
</WagmiProvider>
)
}
function BalanceDisplay() {
const { decryptedBalance, revealBalance, isRevealing } =
useConfidentialBalance({
contractAddress: '0x...',
abi: tokenABI,
})
return (
<div>
{decryptedBalance ? (
<p>Balance: {decryptedBalance}</p>
) : (
<button onClick={revealBalance} disabled={isRevealing}>
Reveal Balance
</button>
)}
</div>
)
}
Vue
<script setup lang="ts">
import { useConfidentialBalance } from '@fhevmsdk/vue'
import { tokenABI } from './abi'
const { decryptedBalance, revealBalance, isRevealing } =
useConfidentialBalance({
contractAddress: '0x...',
abi: tokenABI,
})
</script>
<template>
<div>
<p v-if="decryptedBalance">Balance: {{ decryptedBalance }}</p>
<button v-else @click="revealBalance" :disabled="isRevealing">
Reveal Balance
</button>
</div>
</template>
Get Started
Choose your framework to get started:
- React Quick Start - Get started with React
- Vue Quick Start - Get started with Vue
- Vanilla JS Quick Start - Framework-agnostic usage
Package Overview
This SDK is split into framework-specific packages:
| Package | Description | Version |
|---|---|---|
| @fhevmsdk/core | Framework-agnostic core library | |
| @fhevmsdk/react | React hooks and components | |
| @fhevmsdk/vue | Vue 3 composables |
Community & Support
License
MIT © FHEVM SDK