fhenix-on-chain-decryption

Installation
SKILL.md

Fhenix On-Chain Decryption

Overview

Decryption is a two-phase, multi-step process — there is no synchronous on-chain FHE.decrypt. The Threshold Network (MPC) decrypts off-chain and signs the result (ECDSA, via its Dispatcher); the contract verifies that signature on-chain.

The 3 steps:

  1. On-chain: grant decrypt permission on the handle — FHE.allowPublic(ct) (anyone) / FHE.allow(ct, addr) / FHE.allowSender(ct).
  2. Off-chain: client calls decryptForTx(ctHash) (see fhenix-client-sdk-decryption-tx) → { ctHash, decryptedValue (bigint), signature }.
  3. On-chain: submit the result via publish or verify.

Publish vs verify (step 3)

Function Behavior Use when
FHE.publishDecryptResult(ct, plaintext, sig) Verifies sig, stores result on-chain (readable via getDecryptResult). Reverts on bad sig. Result should be globally reusable
FHE.verifyDecryptResult(ct, plaintext, sig) → bool Verifies sig without storing. Reverts on bad sig. Only need to confirm authenticity in-tx
FHE.verifyDecryptResultSafe(...) → bool Returns false instead of reverting Branch on validity without revert
Installs
1
First Seen
Jun 22, 2026
fhenix-on-chain-decryption — nickthelegend/fhenix-skills