Which versions to install
Every@cofhe/* package is released from the same monorepo at the same version, and each one pins the others exactly. Keep them all on the same version. Mixing them is the most common cause of a broken install.
Solidity dependencies version separately from the SDK:
fhenix-confidential-contracts is published unscoped. There is no @fhenixprotocol/fhenix-confidential-contracts package, so installing that name fails.What each package requires
These are the peer dependencies declared by the published packages.viem is the only client library the SDK always needs. The optional entries are adapters: install ethers or @wagmi/core only if you want to pass those objects to the SDK.
Pick your Hardhat plugin by the Hardhat version you already run: @cofhe/hardhat-plugin for Hardhat 2, @cofhe/hardhat-3-plugin for Hardhat 3. They are not interchangeable.
Supported networks
The SDK ships chain definitions for these networks, exported from@cofhe/sdk/chains:
Base Sepolia has no Hardhat preset in either plugin. To deploy there, add the network yourself:
hardhat.config.ts
Upgrading from 0.6
Upgrade to0.6.1 first, then to 0.7.1. The 0.7 release changes four things that will break a 0.6 project:
- Permits are renamed to ACPs. The
@cofhe/sdk/permitsentry point is now@cofhe/sdk/acps. - The
InEuintXXinput types are gone, along withFHE.asEuint32(InEuint32)andITaskManager.verifyInput. - Signing moved from one signature per ciphertext to one signature per batch, which requires a
setConsumingContract()call. - Encrypted values passed between contracts now use the
sharedEuintXXtypes instead of bareeuintXX.
0.6 stop working. Your users have to sign again after you upgrade.
The official migration guide covers each change with before and after code. It also ships an agent skill that performs most of the mechanical edits for you.
Troubleshooting
Encrypted inputs stop verifying after upgrading
Encrypted inputs stop verifying after upgrading
0.7 signs one batch rather than one ciphertext, and the input types changed. A 0.6 client against 0.7 contracts fails verification. Upgrade both sides together.Next steps
- Follow the quick start guide to set up a development environment.
- Read the best practices for building with CoFHE.
- Browse the API reference for per-component detail.