Skip to content
FhenixProtocolPublic

About

CoFHE tooling monorepo

Resources

Stars

10 stars

Watchers

0 watching

Forks

Repository files navigation

CoFHE SDK

This repository contains the tooling for interacting with Fhenix's CoFHE coprocessor.

Packages

  • @cofhe/sdk — core SDK for fetching FHE keys, encrypting inputs, decrypting handles, and working with ACPs via subpath modules such as @cofhe/sdk/adapters, @cofhe/sdk/acps, @cofhe/sdk/web, and @cofhe/sdk/node.
  • @cofhe/react — React hooks and components for CoFHE-enabled frontends.
  • @cofhe/abi — shared contract ABIs.
  • @cofhe/mock-contracts — local mock contracts for testing CoFHE flows.
  • @cofhe/hardhat-plugin — Hardhat 2 integration for deploying and using the mock stack.
  • @cofhe/hardhat-3-plugin — Hardhat 3 integration.
  • @cofhe/foundry-plugin — Foundry helpers for CoFHE contract tests.
  • @cofhe/site — documentation site (not published to npm).

The repository also contains shared TypeScript and ESLint configuration packages under packages/.

Requirements

  • Node.js 18 or newer
  • pnpm 8.15.6

Development

Install dependencies:

pnpm install

Build the packages:

pnpm build

Run the test suite:

pnpm test

Useful repository-wide commands:

pnpm lint
pnpm check:types
pnpm check:formatting
pnpm format

Documentation

Run the documentation site locally with:

pnpm docs

The SDK documentation is published at cofhesdk.fhenix.io. For CoFHE itself and the FHE.sol contract library, see cofhe-docs.fhenix.zone.

Examples

Example applications live in examples/. See examples/README.md for the current example setup and usage instructions.

Migration

cofheClient.encryptInputs(...).execute() returns [...hashes, signature] — one external* handle per input followed by a single signature authenticating the whole batch — replacing the old per-item CofheInUint8/EncryptedUint8Input structs. setConsumingContract(address) is required before execute().

See the 0.7.0 migration guide, or run the migration skill against your project.

Versioning and releases

This monorepo uses Changesets for package versioning and release notes.

Create a changeset for package changes with:

pnpm changeset

Add a changeset only when a published package changes. Changes to docs, @cofhe/site, the examples, or the private config packages don't need one. Keep the changeset short and written for consumers of the package, and call out breaking changes.

Notes

  • FHE keys are fetched only when client.encryptInputs(...).execute() is called because they are only needed for input encryption.
  • TFHE WASM initialization is also deferred until client.encryptInputs(...).execute() is called.

About

CoFHE tooling monorepo

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages