AI agent that writes Fhenix CoFHE smart contracts from natural language. Fully encrypted computation on-chain. No data leaks. Ever.
from division_fhe import generate, FHE_TASKS
import asyncio
# List available tasks
print(FHE_TASKS)
# Generate a contract
result = asyncio.run(generate(
description="A private voting contract",
name="ConfidentialVoting",
provider="deepseek"
))
print(result["code"])
# Generate from description division-fhe "A sealed bid auction with FHE" # Use specific task key division-fhe --task-key voting # Benchmark providers division-fhe --benchmark # List built-in tasks division-fhe --list-tasks
# Generate contract
curl -X POST https://sunima.app/fhenix/api/generate \
-H "Content-Type: application/json" \
-d '{"description":"private auction","name":"SealedAuction","provider":"deepseek"}'
# List contract types
curl https://sunima.app/fhenix/api/contracts
# Health check
curl https://sunima.app/fhenix/api/health
See exactly how Fully Homomorphic Encryption changes what's possible in smart contracts.
| FEATURE | REGULAR SOLIDITY | WITH FHE | WHAT YOU GAIN |
|---|---|---|---|
| Store number | uint256 public value ⚠ visible to everyone |
euint64 private _value | ✓ encrypted on-chain |
| Compare values | a > b ⚠ leaks both values |
FHE.gte(a, b) | ✓ result without revealing inputs |
| Conditional logic | if (score > 50) ⚠ score is public |
FHE.select(cond, a, b) | ✓ branch without leaking condition |
| Accept input | function vote(uint8 choice) ⚠ choice is public |
function vote(inEuint8 calldata enc) | ✓ encrypted user input |
| Decrypt | N/A — always visible | FHE.decrypt(val) | ✓ controlled decryption |
| Per-user access | mapping(address=>uint256) ⚠ all balances public |
FHE.allow(ct, user) | ✓ only owner can read |
| Random number | block.timestamp % N ⚠ manipulable by miners |
FHE.randEuint64() | ✓ verifiable randomness |
Enter a number to see how CoFHE encrypts it on Fhenix — step by step.
Compare two numbers without revealing them — result decrypts to TRUE or FALSE.
Trade without exposing order sizes. Prevent MEV sandwich attacks. Confidential liquidity pools.
On-chain voting where ballots stay encrypted until tally. No vote buying, no coercion possible.
Payroll, salaries, and transfers fully encrypted. Only sender and receiver know the amount.
FHE.randEuint64() generates verifiable random numbers that miners cannot manipulate or predict.