A developer CLI for interacting with Fhenix CoFHE — the FHE Coprocessor powering confidential computation on Ethereum.
CoFHE (Confidential on Fully Homomorphic Encryption) is Fhenix's off-chain FHE Coprocessor. It executes encrypted computations on behalf of EVM smart contracts — without ever decrypting the data on-chain.
Smart Contract → emits FHE event → CoFHE Pipeline → Encrypted Result → On-chain
│
┌────────────▼──────────────┐
│ Validation → fheOS │
│ Execution → Publishing │
│ Threshold Network (MPC) │
└───────────────────────────┘
Key features:
- 50x faster decryption than competitors via Threshold Network
- Single Solidity import —
import {FHE} from "@fhenixprotocol/cofhe-contracts/FHE.sol" - EVM-compatible — Arbitrum, Ethereum, any L2
- Quantum-resistant — TFHE lattice-based cryptography
- EigenLayer-secured — cryptoeconomic fraud proof guarantees
# Clone the repo
git clone https://github.com/oxatik/fhenix-cli
cd fhenix-cli
# Install dependencies
npm install
# Build TypeScript
npm run build
# Link globally (optional)
npm linkfhenix <command> [options]
| Command | Description |
|---|---|
fhenix encrypt |
Encrypt a value using CoFHE FHE types |
fhenix decrypt |
Unseal a ciphertext via Threshold Network |
fhenix wallet |
Generate/import/show/balance wallet |
fhenix network |
List/switch/status of CoFHE networks |
fhenix permit |
Create/show/revoke PermitV2 access tokens |
fhenix contract |
View Solidity templates, call contracts |
fhenix info |
CoFHE architecture, FHE types, resources |
Encrypt a plaintext value into an FHE ciphertext handle (ctHash).
fhenix encrypt --value 42 --type uint32
fhenix encrypt --value true --type bool
fhenix encrypt --value 0xDEAD...BEEF --type address
fhenix encrypt --value 100 --type uint32 --show-pipelineSupported FHE types: bool, uint8, uint16, uint32, uint64, uint128, uint256, address
Unseal an encrypted ciphertext handle via CoFHE Threshold Decryption Network.
fhenix decrypt --cthash 0xabc123... --type uint32
fhenix unseal --cthash 0xabc123... --type bool --show-pipelineManage your local Ethereum wallet for testnet interaction.
fhenix wallet generate # Create a new wallet
fhenix wallet import --key 0x.. # Import by private key
fhenix wallet show # Show address
fhenix wallet show --reveal-key # Show private key (dangerous!)
fhenix wallet balance # Fetch ETH balance from RPCWallets are saved to ~/.fhenix/wallet.json with mode 600.
Switch between CoFHE-supported networks.
fhenix network list # Show all networks
fhenix network use arbitrum-sepolia # Switch network
fhenix network use eth-sepolia
fhenix network use localhost
fhenix network status # Ping RPC + show CoFHE componentsSupported Networks:
| ID | Name | Chain ID |
|---|---|---|
arbitrum-sepolia |
Arbitrum Sepolia (CoFHE Testnet) | 421614 |
eth-sepolia |
Ethereum Sepolia | 11155111 |
localhost |
Local Hardhat | 31337 |
Generate and manage PermitV2 — CoFHE's access control system for decrypting sealed values.
fhenix permit create # Create a permit (30 days default)
fhenix permit create --contract 0x... --project FHERC20 --days 7
fhenix permit show # Show active permit
fhenix permit revoke # Delete local permitPermits are saved to ~/.fhenix/permit.json.
View Solidity templates and interact with CoFHE contracts.
fhenix contract template --list # List all templates
fhenix contract template --name counter # View EncryptedCounter template
fhenix contract template --name fherc20 # View fhERC-20 token template
fhenix contract template --name vote # View Private Voting template
fhenix contract template --name counter > Counter.sol # Save to file
fhenix contract call --address 0x... --function "getCount()" --type uint32
fhenix contract addresses # Known CoFHE contract addressesDisplay CoFHE architecture and resources.
fhenix info # Overview
fhenix info --pipeline # Visual CoFHE pipeline diagram
fhenix info --fhe-types # All FHE Solidity types (euint32, ebool, etc.)[1] Event Ingestion Smart contract emits FHE operation event
[2] Validation ZK-proves encrypted input correctness
[3] Queued Execution Batched TFHE ops (100 ops/worker)
[4] FHE Computation fheOS runs encrypted computation
[5] Result Publishing Encrypted result posted back on-chain
[6] Threshold Decryption MPC nodes cooperate to decrypt (only if needed)
import {FHE, euint32, InEuint32} from "@fhenixprotocol/cofhe-contracts/FHE.sol";
contract EncryptedCounter {
euint32 private counter;
function add(InEuint32 calldata encryptedValue) public {
euint32 value = FHE.asEuint32(encryptedValue);
counter = counter + value;
}
}View all templates: fhenix contract template --list
| Resource | Link |
|---|---|
| Fhenix Docs | https://fhenix.io |
| CoFHE Docs | https://cofhe-docs.fhenix.zone |
| cofhejs SDK | https://github.com/FhenixProtocol/cofhejs |
| Hardhat Starter | https://github.com/FhenixProtocol/cofhe-hardhat-starter |
| Discord | https://discord.gg/fhenix |
| Arbitrum Sepolia Faucet | https://faucet.arbitrum.io |
fhenix-cli/
├── src/
│ ├── index.ts # CLI entry point
│ ├── commands/
│ │ ├── encrypt.ts # fhenix encrypt
│ │ ├── decrypt.ts # fhenix decrypt / unseal
│ │ ├── wallet.ts # fhenix wallet
│ │ ├── network.ts # fhenix network
│ │ ├── permit.ts # fhenix permit
│ │ ├── contract.ts # fhenix contract
│ │ └── info.ts # fhenix info
│ └── utils/
│ ├── config.ts # Network configs, FHE types, file I/O
│ └── logger.ts # Chalk-based display utilities
├── package.json
├── tsconfig.json
└── README.md
MIT © oxatik