# Cofhe SDK Docs > Documentation for the Cofhe SDK ## Docs - [Foundry Plugin](/foundry): `@cofhe/foundry-plugin` provides two contracts for writing CoFHE tests with Foundry: - [Get started](/getting-started): Hello world! - [Hardhat 3 Plugin](/hardhat-3): `@cofhe/hardhat-3-plugin` is the CoFHE plugin for [Hardhat 3](https://hardhat.org). It deploys the full CoFHE mock stack on every `network.connect()` call and attaches a `cofhe` namespace to the connection object — no setup boilerplate required. - [Getting Started](/hardhat): `@cofhe/hardhat-plugin` extends Hardhat with everything you need to build and test FHE-enabled contracts locally — mock contracts, a pre-configured CoFHE client, and test utilities. - [Cofhe SDK](/intro): `@cofhe/sdk` is the TypeScript client for [CoFHE](https://cofhe-docs.fhenix.zone/deep-dive/cofhe-components/overview). It handles the client-side operations required to interact with FHE-enabled smart contracts: encrypting inputs with ZK proofs, decrypting [handles](/reference/dictionary#handle) via the [Threshold Network](/reference/dictionary#threshold-network), and managing EIP-712 [ACPs](/reference/dictionary#acp) for access control. - [Migrating from ](/migrating-from-cofhejs): `@cofhe/sdk` is the successor to `cofhejs`, redesigned around an explicit, builder-pattern API that gives you full control over encryption, decryption, and ACP (Access Control Permission) management. Migration should be strightforward with a 1-to-1 mapping of functions and features. - [Migrating to ](/migrating-to-0-7-0): `0.7.0` renames Permit to ACP, replaces per-ciphertext input signatures with **one signature per batch**, and requires every encryption to declare the contract that will consume it. It also moves to `@fhenixprotocol/cofhe-contracts` `0.2.x`, **which deletes the `InEuintXX` structs** — so most projects need Solidity changes, not just TypeScript changes. - [Quick Start](/quick-start): Set up a Hardhat project with `@cofhe/hardhat-plugin`, write a contract that stores an encrypted `uint32`, and test the encrypt → store → decrypt flow. - [ACPs](/sdk/acp): ACPs (Access Control Permissions, formerly called *permits*) are EIP-712 signatures that authorize decryption of confidential data. The `issuer` field identifies who is accessing the data - the issuer must have been granted access on-chain via `FHE.allow(handle, address)`. When an ACP is used, CoFHE validates it against the ACL contract to confirm that the issuer has access to the requested encrypted handle. - [Cofhe Client](/sdk/client): This page covers the core SDK lifecycle: - [Decrypting to Transact](/sdk/decrypt-to-tx): Use `decryptForTx` to reveal a **confidential (encrypted)** value on-chain: it returns the plaintext together with a Threshold Network signature, so a contract can verify the reveal when you publish it in a transaction. - [Decrypting to View](/sdk/decrypt-to-view): Use `decryptForView` to reveal a **confidential (encrypted)** value **locally** (in your app) so you can display it in the UI. - [Encrypting Inputs](/sdk/encrypting-inputs): `encryptInputs` encrypts plaintext values into FHE ciphertexts that can be passed as inputs to a confidential smart contract transaction. Values must be encrypted before being passed on-chain to preserve confidentiality. - [Verifying Decrypt Results](/sdk/verify-decrypt-result): When you use [`decryptForTx`](./decrypt-to-tx.mdx), the Threshold Network returns: - [Writing Decrypt Result to Contract](/sdk/writing-decrypt-result-to-contract): This page covers the “decrypt → write tx” flow after you run [`decryptForTx`](./decrypt-to-tx.mdx): you take `{ ctHash, decryptedValue, signature }` and submit a transaction that your contract can verify. - [Writing Encrypted Data to Contract](/sdk/writing-encrypted-data-to-contract): This page covers the “encrypt → write tx” flow: encrypt plaintext values into ciphertext hashes and pass them, plus one shared signature, directly into a contract call. - [Decryption Lifecycle](/reference/decryption-lifecycle): This page explains the shared production-side lifecycle behind both [Decrypting to View](/sdk/decrypt-to-view) and [Decrypting to Transact](/sdk/decrypt-to-tx). - [Dictionary](/reference/dictionary): A quick glossary of common terms used throughout the Cofhe SDK and CoFHE docs. - [EncryptedCounter.sol](/reference/encrypted-counter-sol): This contract is included as a reference that is used throughout the SDK documentation to explain core functionality such as encrypting inputs, decrypting for view, and decrypting for transactions. - [Faster Encryption (Multi-Threaded Proving)](/reference/faster-encryption): Generating the ZK proof of knowledge is by far the most expensive part of `encryptInputs` — typically **90%+ of the total time**. TFHE's WASM build is compiled with [rayon](https://github.com/rayon-rs/rayon), so that proof can be computed across several threads instead of one. - [Sharing Encrypted Values Between Contracts](/reference/sharing-encrypted-values): Passing an encrypted handle to another contract is easy — it is a `bytes32`. Letting that contract *compute* on it is the part that needs care, because the ACL decides who may use a ciphertext and by default only your contract can. - [ACPs in React](/react/acp): The React hooks decrypt with an ACP the same way the SDK does. By default that is the active ACP of the connected account, so a signed-in user sees their own data with no extra code. This page covers the case where one view should decrypt with a different ACP: data someone shared with the user. For creating, sharing and importing ACPs themselves, see [ACPs](/sdk/acp). - [Client](/hardhat/client): The plugin extends `hre` with `hre.cofhe`, providing three ways to create and connect a `CofheClient` in your Hardhat tests. - [Getting Started](/hardhat/getting-started): This guide walks through integrating `@cofhe/hardhat-plugin` into an existing Hardhat project — from installation to your first passing FHE test. - [Logging](/hardhat/logging): The mock contracts log every FHE operation to the console. This makes it easy to inspect what your contracts are doing under the hood during tests. - [Mock Contracts](/hardhat/mock-contracts): The plugin deploys a suite of mock contracts that simulate the full CoFHE coprocessor stack on the Hardhat network. This lets you develop and test FHE contracts without running the off-chain FHE engine. - [Testing](/hardhat/testing): This page shows the common patterns for writing Hardhat tests with the CoFHE plugin.