> ## Documentation Index
> Fetch the complete documentation index at: https://fhenix-docs-deep-dive-rewrite.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Compatibility

> Which package versions, toolchains, and networks work together

Use this page to pick versions before you install anything. It lists the current version of every CoFHE package, the toolchain each one requires, and the networks the SDK ships chain definitions for.

<Warning>
  The `0.7` SDK is not compatible with `0.6` contracts or `0.6` plugins. Upgrading is a breaking change that touches both your Solidity and your client code. See [upgrading from 0.6](#upgrading-from-0-6) before you start.
</Warning>

## 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.

| Package                   | Version                                                                             | What it does                                                               |
| ------------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `@cofhe/sdk`              | [`0.7.1`](https://github.com/FhenixProtocol/cofhesdk/releases/tag/@cofhe/sdk@0.7.1) | Client library for encrypting inputs, decrypting results, and signing ACPs |
| `@cofhe/react`            | `0.7.1`                                                                             | React hooks built on the SDK                                               |
| `@cofhe/abi`              | `0.7.1`                                                                             | ABI definitions for the CoFHE contracts                                    |
| `@cofhe/hardhat-plugin`   | `0.7.1`                                                                             | Mock deployment and test helpers for Hardhat 2                             |
| `@cofhe/hardhat-3-plugin` | `0.7.1`                                                                             | Mock deployment and test helpers for Hardhat 3                             |
| `@cofhe/foundry-plugin`   | `0.7.1`                                                                             | Mock deployment and test helpers for Foundry                               |
| `@cofhe/mock-contracts`   | `0.7.1`                                                                             | Mock CoFHE contracts for local testing                                     |

Solidity dependencies version separately from the SDK:

| Package                           | Version                                                                  | What it does                                     |
| --------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------ |
| `@fhenixprotocol/cofhe-contracts` | [`0.2.0`](https://github.com/FhenixProtocol/cofhe-contracts/tree/v0.2.0) | `FHE.sol` and the onchain CoFHE interfaces       |
| `@fhenixprotocol/cofhe-errors`    | `1.0.2`                                                                  | Shared error definitions for the CoFHE contracts |
| `fhenix-confidential-contracts`   | `0.4.0`                                                                  | Confidential token primitives, including FHERC20 |

<Note>
  `fhenix-confidential-contracts` is published unscoped. There is no `@fhenixprotocol/fhenix-confidential-contracts` package, so installing that name fails.
</Note>

## What each package requires

These are the peer dependencies declared by the published packages.

| Package                   | Required                                                                                                                                       | Optional                                                                                |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `@cofhe/sdk`              | `viem` ^2.38.6                                                                                                                                 | `ethers` ^5 or ^6, `@wagmi/core` ^2, `hardhat` ^2, `@nomicfoundation/hardhat-ethers` ^3 |
| `@cofhe/hardhat-plugin`   | `hardhat` ^2, `@nomicfoundation/hardhat-ethers` ^3, `ethers` ^5 or ^6, `@fhenixprotocol/cofhe-contracts` >=0.2.0, `@openzeppelin/contracts` ^5 | None                                                                                    |
| `@cofhe/hardhat-3-plugin` | `hardhat` ^3                                                                                                                                   | None                                                                                    |
| `@cofhe/foundry-plugin`   | `@fhenixprotocol/cofhe-contracts` 0.2.0, `@openzeppelin/contracts` 5.4.0                                                                       | None                                                                                    |

`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`:

| Network          | Chain ID   | SDK export    | Hardhat preset     |
| ---------------- | ---------- | ------------- | ------------------ |
| Ethereum Sepolia | `11155111` | `sepolia`     | `eth-sepolia`      |
| Arbitrum Sepolia | `421614`   | `arbSepolia`  | `arb-sepolia`      |
| Base Sepolia     | `84532`    | `baseSepolia` | None               |
| Local CoFHE      | `420105`   | `localcofhe`  | `localcofhe`       |
| Hardhat (mock)   | `31337`    | `hardhat`     | Built into Hardhat |

<Warning>
  The SDK export name and the Hardhat preset name are different strings for the same network. The SDK calls Ethereum Sepolia `sepolia`; both Hardhat plugins register the preset as `eth-sepolia`. Use the SDK name in client code and the preset name in `hardhat.config.ts`.
</Warning>

Base Sepolia has no Hardhat preset in either plugin. To deploy there, add the network yourself:

```typescript hardhat.config.ts theme={null}
networks: {
  'base-sepolia': {
    url: process.env.BASE_SEPOLIA_RPC_URL ?? 'https://sepolia.base.org',
    accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
    chainId: 84532,
  },
},
```

<h2 id="upgrading-from-0-6">
  Upgrading from 0.6
</h2>

Upgrade to `0.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/permits` entry point is now `@cofhe/sdk/acps`.
* The `InEuintXX` input types are gone, along with `FHE.asEuint32(InEuint32)` and `ITaskManager.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 `sharedEuintXX` types instead of bare `euintXX`.

Permits signed under `0.6` stop working. Your users have to sign again after you upgrade.

The [official migration guide](https://cofhesdk.fhenix.io/migrating-to-0-7-0) covers each change with before and after code. It also ships an agent skill that performs most of the mechanical edits for you.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Encrypted inputs stop verifying after upgrading" icon="key">
    `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.
  </Accordion>
</AccordionGroup>

## Next steps

* Follow the [quick start guide](/fhe-library/introduction/quick-start) to set up a development environment.
* Read the [best practices](/fhe-library/introduction/best-practices) for building with CoFHE.
* Browse the [API reference](/api-reference/introduction) for per-component detail.
