Back to Fhevm

Overview

sdk/js-sdk/docs/README.md

0.14.0-22.4 KB
Original Source

Overview

Welcome to the FHEVM SDK!

@fhevm/sdk is the JavaScript/TypeScript SDK for building apps on FHEVM chains. It lets you encrypt values client-side, send encrypted inputs to your confidential smart contracts, and decrypt results — without plaintext ever touching the blockchain. It powers this end-to-end flow using Fully Homomorphic Encryption (FHE), so your contracts compute directly on encrypted data.

You install it with npm and bring your own Ethereum library — the SDK ships identical adapters for ethers v6 and viem v2:

bash
npm install @fhevm/sdk

Requires Node.js 22 or newer.

What you can do

  • Encrypt plaintext client-side and produce an input proof your contract can verify.
  • Decrypt private results — the plaintext is reconstructed locally and never leaves your application.
  • Read public values a contract has made publicly readable.
  • Use one API for ethers and viem — pick an adapter; the methods are identical.
  • Load only the cryptography you need — encrypt-only, decrypt-only, or both.
  • Start with zero config — built-in definitions for Ethereum mainnet and Sepolia.

Where to go next

If you're new to the Zama Protocol, start with the Litepaper or the Protocol Overview to understand the foundations.

Otherwise:

🟨 Go to Getting started to run your first encryption and decryption in under five minutes.

🟨 Go to Clients to choose the right client for your page.

🟨 Go to Encryption to encrypt values and build input proofs.

🟨 Go to Decryption to decrypt private and public values.

🟨 Go to API reference to look up an exact signature.

🟨 Go to Migration if you're moving from the Relayer SDK (@zama-fhe/relayer-sdk).

Supported chains

ChainIDStatus
Ethereum mainnet1Production
Ethereum Sepolia11155111Testnet

See Chains to add a custom or local chain.

Help center

Ask technical questions and discuss with the community.