Skip to main content
v0.2 · Confidential EVM

Smart contracts that compute on ciphertext, not plaintext.

FHETransform brings Fully Homomorphic Encryption to EVM-compatible chains. Inputs, state, and outputs stay encrypted end-to-end — while you keep writing Solidity the way you always have.

Encrypted ints
8 – 256 bit
On-chain cost
symbolic
Scheme
quantum-safe
License
Apache-2.0
02 Why FHETransform

Privacy as a primitive, not a workaround.

Most "private" chains either hide a permissioned ledger or move trust into a single enclave. FHETransform keeps the chain public and verifiable — the data is just encrypted while it computes.

01

Privacy by design

Inputs, state, and outputs are encrypted at every step. The chain manipulates only handles.

02

Write Solidity as usual

Encrypted types behave like normal ints. The Preprocessor handles operator rewriting.

03

Complete operator set

Arithmetic, bitwise, comparisons, boolean logic, ternary select — composable, unbounded.

04

Programmable ACL

Decide per-value who can decrypt. Access control is part of the contract, not a side channel.

05

High-precision integers

Encrypted unsigned integers up to 256 bits, with no operation-count ceiling.

06

Symbolic on-chain

Heavy cryptography runs off-chain. On-chain calls cost roughly what plain Solidity costs.

07

Quantum-resistant

Built on a lattice-based FHE scheme with long-horizon security assumptions.

08

Verifiable off-chain

AlphaTrion outputs are anchored via SpaceBridge consensus and ciphertext digests.

03 Code

Conditional logic, without revealing the condition.

Branch on encrypted state with FHE.select

You can't if on an encrypted comparison — the EVM has no plaintext to read. Instead you compute both possible results and pass them through FHE.select. The chain doesn't learn which branch was taken; only an authorized party, after decryption, ever does.

ve_uint64ve_boolFHE.geFHE.subFHE.selectaccessPolicy

Result handles return immediately; the actual ciphertext is filled in once AlphaTrion has run the real homomorphic computation off-chain.

1// SPDX-License-Identifier: MIT
2pragma solidity ^0.8.24;
3
4import {FHE, ve_uint64, uve_uint64, ve_bool}
5 from "@primuslabs/fhe-contracts/contracts/lib/FHE.sol";
6import {PrimusConfig} from "@primuslabs/fhe-contracts/contracts/config/PrimusConfig.sol";
7
8contract Vault is PrimusConfig {
9 ve_uint64 private _balance;
10
11 function withdraw(uve_uint64 calldata amount) external payable chargeFee {
12 ve_uint64 amt = FHE.fromUnverified(amount);
13 ve_bool canPay = FHE.ge(_balance, amt);
14 ve_uint64 debited = FHE.sub(_balance, amt);
15 _balance = FHE.select(canPay, debited, _balance);
16
17 FHE.accessPolicy(_balance, address(this));
18 FHE.accessPolicy(_balance, msg.sender);
19 }
20}
solidity · 20 linescopy · raw · open in playground
04 Start building

Five minutes from clone to a confidential counter.

Local setup

Clone the starter template

A ready-to-use Hardhat project wired to FHETransform tooling, with example contracts and deploy scripts you can iterate on immediately.

npx degit primus-labs/fhe-contract-startup my-vault
cd my-vault && npm install
Networks

Deploy on EVM-compatible testnets

FHETransform runs against the standard Ethereum toolchain. Point RPC_URL at any supported network and the system contracts are already deployed.

npx hardhat deploy --network sepolia
Ethereum SepoliaBase SepoliaArbitrum SepoliaBNB Testnet