π Documentation | π Community support | π FHE resources by Zama
Zama SDK is a suite of TypeScript libraries for building privacy-preserving dApps on EVM-compatible blockchains powered by the Zama Confidential Blockchain Protocol. It provides everything you need to interact with confidential smart contracts using Fully Homomorphic Encryption (FHE) β from encrypting inputs and decrypting results to managing access control β all from familiar TypeScript and React environments.
Zama SDK is designed for developers who want to integrate confidential operations into their applications without learning cryptography:
- End-to-end encryption: Transaction data and on-chain state remain encrypted at all times.
- Framework-agnostic core: Works with viem, ethers, or any EVM library.
- React-ready: First-class React hooks powered by
@tanstack/react-query.
| Package | Description |
|---|---|
@zama-fhe/sdk |
Core SDK β confidential contract operations, FHE relayer, contract call builders, viem/ethers adapters, Web Worker support |
@zama-fhe/react-sdk |
React hooks wrapping the core SDK via @tanstack/react-query, with wagmi sub-path |
- TypeScript-first: Fully typed APIs with tree-shakeable ESM builds for minimal bundle size.
- Privacy by design: Encrypt inputs, decrypt outputs, and manage access control for confidential smart contracts.
- Multi-library support: Adapters for both viem and ethers, so you can use whichever EVM library your project already depends on.
- React hooks: Dedicated React package with hooks for encrypting, decrypting, reencrypting, and querying confidential state β all backed by
@tanstack/react-queryfor caching and suspense. - Workers: Offload heavy FHE operations to workers in Web and Node.js environments for non-blocking performance.
- Wagmi integration: Drop-in wagmi connector support for seamless wallet and provider management in React apps.
# Core SDK (vanilla TypeScript)
pnpm add @zama-fhe/sdk
# or: npm install @zama-fhe/sdk / yarn add @zama-fhe/sdk
# React hooks
pnpm add @zama-fhe/react-sdk @tanstack/react-query
# or: npm install @zama-fhe/react-sdk @tanstack/react-query / yarn add @zama-fhe/react-sdk @tanstack/react-queryPrerequisites: Node.js >= 22, pnpm >= 10
pnpm install # Install dependencies
pnpm build # Build all (sdk first, then react-sdk)
pnpm test # Watch mode
pnpm test:run # Single run
pnpm typecheck # Type checking
pnpm lint # Linting
pnpm format:check # Formatting checkE2E tests:
pnpm e2e:test # Run Playwright E2E tests
pnpm e2e:test:ui # Playwright UI modeNote: The
forge-fhevmsubmodule and its soldeer dependencies are installed automatically bypnpm install.
See CONTRIBUTING.md for the full contributor guide (branching, PRs, code style, architecture).
This repository includes an opt-in Claude Code configuration in claude-setup/settings.json. It provides:
- Auto-allowed commands β
pnpm build,pnpm test,pnpm lint,pnpm typecheck,pnpm format, and git diff variants run without prompting. - Denied reads β
.envfiles and.next/are blocked to prevent accidental secret exposure. - Ask-before-running β destructive commands (
rm), remote pushes (git push), and release commands require explicit approval. - Post-edit hooks β every file write/edit automatically triggers
pnpm typecheck,pnpm lint, andpnpm format. - Custom skills β custom skills required for good development practices to contribute to this repo.
To use it, install Claude Code and run pnpm setup:claude.
There are two ways to contribute to Zama SDK:
- Open issues to report bugs and typos, or to suggest new ideas
- Request to become an official contributor by emailing [email protected].
Becoming an approved contributor involves signing our Contributor License Agreement (CLA). Only approved contributors can send pull requests, so please make sure to get in touch before you do!
This software is distributed under the BSD-3-Clause-Clear license. Read this for more details.
- Documentation β Official documentation of the Zama Confidential Blockchain Protocol.
- Awesome Zama β FHEVM β Curated articles, talks, and ecosystem projects.
π If you find this project helpful or interesting, please consider giving it a star on GitHub! Your support helps to grow the community and motivates further development.
π Community forum on Discourse