For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Overview

TypeScript SDK for confidential smart contracts, with Go and Rust clients. Shield, transfer, and unshield tokens with Fully Homomorphic Encryption.

Welcome to the Zama SDK!

Looking for the legacy Relayer SDK?

This is the new default SDK for building on the Zama Protocol. The legacy @zama-fhe/relayer-sdk lives at github.com/zama-ai/relayer-sdk.

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 Quick start to get from zero to a working confidential transfer in under 5 minutes.

🟨 Go to Build your first confidential dApp for an end-to-end React tutorial.

🟨 Go to Configuration for step-by-step instructions on shielding, transfers, balances, and more.

🟨 Go to SDK reference for the full core SDK API.

🟨 Go to React reference for all React hooks and components.

Features

Shield & unshield

Convert public ERC-20 tokens into encrypted form and back. The SDK handles approvals, encryption, and the two-step unshield flow.

Confidential transfers

Encrypt amounts client-side before submitting on-chain. On-chain observers see the transaction but never the value.

React hooks

TanStack Query-based hooks with cached decryption, automatic cache invalidation, and one-signature permit management.

Two packages, one import

Package
Use when...

You are building with vanilla TypeScript, Node.js, or any non-React framework

You are building a React app (hooks and React-specific providers)

If you are using React, install both packages: @zama-fhe/react-sdk provides the hooks and ZamaProvider, while @zama-fhe/sdk is a peer dependency that provides core utilities, relayer factories, chain presets, and error helpers. For wagmi apps, build the config with createConfig from @zama-fhe/react-sdk/wagmi and pass it to <ZamaProvider config={zamaConfig}>. For non-React apps, use createConfig from @zama-fhe/sdk/viem or @zama-fhe/sdk/ethers.

Install

Your first confidential transfer in 30 seconds

Ready to build? Jump to the Quick start for a full working example with your stack.

Go and Rust

Go and Rust services use the SDK through native clients. Each client talks to a local SDK daemon that runs alongside your application. Start with the Go quick start or the Rust quick start.

Task
Core SDK
React SDK
Go
Rust

Encrypt inputs for confidential contract calls

Yes

Yes

Yes

Yes

Decrypt values your account can access, or publicly decryptable values

Yes

Yes

Yes

Yes

Decrypt on behalf of an account that delegated access

Yes

Yes

Yes

Yes

Prepare unsigned transactions for external signing

Yes

Through the core SDK

Yes

Yes

Shield, transfer, unshield, read balances, and manage operators on tokens

Yes

Yes

Not yet

Not yet

Help center

Ask technical questions, discuss with the community, or report a bug.

Last updated