fhenix-client-sdk-encryption
Installation
SKILL.md
Fhenix Client SDK — Encrypting Inputs
Overview
Values must be encrypted client-side before going on-chain. encryptInputs([...]) takes Encryptable.* items, runs a ZK-proven encryption pipeline, and returns a typed tuple of EncryptedItemInput objects that map 1:1 to your contract's InE* struct parameters. The on-chain CoFHE library verifies each item's signature before using the ciphertext.
Encrypt and call a contract
import { Encryptable, assertCorrectEncryptedItemInput } from '@cofhe/sdk';
await cofheClient.connect(publicClient, walletClient);
const [inCount] = await cofheClient
.encryptInputs([Encryptable.uint32(42n)])
.execute();
assertCorrectEncryptedItemInput(inCount);