Framework-agnostic SDKs for Fully Homomorphic Encryption (FHE) on EVM chains
This monorepo contains the core SDK packages for building FHE-powered applications with Zama's fhEVM.
| Package | Version | Description |
|---|---|---|
| @zama-fhe/core-sdk | 0.1.0 | Framework-agnostic core SDK (works with ethers.js & viem) |
| @zama-fhe/react-sdk | 0.1.0 | React hooks for FHE operations (works with wagmi, viem, or ethers.js) |
npm install @zama-fhe/react-sdkimport { FhevmProvider, useConfidentialTransfer } from '@zama-fhe/react-sdk'
import { sepolia } from '@zama-fhe/react-sdk/chains'
function App() {
return (
<FhevmProvider config={createFhevmConfig({ chains: [sepolia] })}>
<YourApp />
</FhevmProvider>
)
}npm install @zama-fhe/core-sdk ethers
# or
npm install @zama-fhe/core-sdk viemimport { writeConfidentialTransfer } from '@zama-fhe/core-sdk'
import { ethers } from 'ethers'
const wallet = new ethers.Wallet(privateKey, provider)
const result = await writeConfidentialTransfer(config, {
chainId: 11155111,
contractAddress: '0x...',
to: '0x...',
amount: 100n,
provider: wallet,
})- Node.js >= 18.0.0
- pnpm >= 8.0.0
pnpm installpnpm buildpnpm test# Watch mode for core-sdk
pnpm watch:core
# Watch mode for react-sdk
pnpm watch:react
# Run all checks (CI locally)
pnpm cizama-fhe-sdk/
├── packages/
│ ├── core-sdk/ # @zama-fhe/core-sdk
│ └── react-sdk/ # @zama-fhe/react-sdk
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI
├── .changeset/ # Changesets for versioning
├── pnpm-workspace.yaml # pnpm workspace config
├── tsconfig.base.json # Shared TypeScript config
└── package.json # Root package with scripts
pnpm build- Build all packagespnpm test- Run tests in all packagespnpm lint- Lint all packagespnpm typecheck- Type check all packagespnpm ci- Run full CI suite locally
pnpm build:core- Build only core-sdkpnpm build:react- Build only react-sdkpnpm test:core- Test only core-sdkpnpm test:react- Test only react-sdk
This monorepo uses Changesets for version management and publishing.
When you make changes to a package:
pnpm changesetFollow the prompts to:
- Select which packages changed
- Choose version bump type (major/minor/patch)
- Write a description of the changes
# Bump versions and update CHANGELOGs
pnpm changeset version
# Build and publish to npm
pnpm release- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
pnpm test) - Create a changeset (
pnpm changeset) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
@zama-fhe/relayer-sdk (Zama) ← Low-level FHE primitives
↓
@zama-fhe/core-sdk ← Framework-agnostic actions
↓
@zama-fhe/react-sdk ← React hooks layer
↓
Your Application ← dApps, backends, CLIs
BSD-3-Clause-Clear