What is fhEVM?
The Fully Homomorphic Encryption Ethereum Virtual Machine (fhEVM) is a specialized extension of the standard Ethereum Virtual Machine (EVM) integrated into Cypher. This enhanced EVM supports the execution of smart contracts over encrypted data, leveraging Fully Homomorphic Encryption (FHE) to enable privacy-preserving computation. By allowing computations directly on encrypted data without requiring decryption, fhEVM ensures that sensitive information remains confidential throughout the computational lifecycle, even in adversarial or untrusted environments.
Key Technical Features
1. Fully Homomorphic Encryption (FHE) Integration
fhEVM leverages state-of-the-art FHE technology, allowing arbitrary computations on encrypted data. The integration ensures that:
Data remains encrypted during computation: Preventing exposure of plaintext values at any stage.
Confidentiality is preserved: Ensuring inputs, outputs, and intermediate states are never revealed, even to validators or nodes executing the smart contracts.
2. Encrypted Data Type Support
fhEVM introduces encrypted data types to the EVM runtime, enabling seamless integration of FHE computations into smart contracts.
Supported Data Types:
Encrypted Integers (euint64, euint32, euint16, euint8): For arithmetic operations.
Encrypted Booleans (ebool): For logical operations and conditional flows.
Encrypted Arrays: For structured data, such as lists of encrypted integers.
Key Features
Encrypted values are handled natively within fhEVM.
Fully integrated with Solidity to allow for standard syntax and development patterns.
3. Extended EVM Runtime for Encrypted Operations
The fhEVM runtime includes native support for encrypted computations using the TFHE library. Key capabilities include:
Arithmetic Operations: Encrypted addition (TFHE.add), subtraction (TFHE.sub), multiplication (TFHE.mul), and division (TFHE.div).
Logical and Bitwise Operations: Encrypted AND (TFHE.and), OR (TFHE.or), XOR (TFHE.xor), and NOT (TFHE.not).
Comparison Operations: Encrypted greater-than (TFHE.gt), less-than (TFHE.lt), equality (TFHE.eq), and inequality (TFHE.ne).
Ternary Operations: Conditional selection using TFHE.select.
Random Number Generation: On-chain generation of fully encrypted random values (TFHE.randEuintX()).
Shift and Rotate: Encrypted shift right/left (TFHE.shr, TFHE.shl) and rotate right/left (TFHE.rotr, TFHE.rotl).
4. Modified Geth Client
Cypher’s Geth client has been customized to natively support encrypted computations. Enhancements include:
Encrypted Instruction Execution: Extends the EVM opcode set to handle encrypted data types.
Homomorphic Computation Optimization: Ensures high-performance execution of FHE operations with minimal overhead.
Seamless Tooling Integration: Maintains compatibility with standard Ethereum tools while adding FHE-specific functionality.
5. Compatibility with Existing Ethereum Ecosystem
fhEVM retains full compatibility with the Ethereum toolchain, making it accessible to existing developers:
Solidity Integration: Existing Solidity contracts can be deployed to fhEVM without modifications.
Ethereum Development Tools: Fully compatible with Hardhat, Truffle, Remix, and other tools for smart contract deployment and testing.
Ecosystem Compatibility: Interoperates seamlessly with standard Ethereum contracts, enabling encrypted and non-encrypted smart contracts to coexist.
6. Access Control and Security
fhEVM ensures strict access control and secure execution of encrypted workflows:
Access Control Lists (ACLs): Define permissions for encrypted data at both contract and address levels.
Permanent Access: Long-term permission granted to specific entities.
Transient Access: Temporary permissions for specific transactions to reduce gas costs.
Error Handling: Encapsulates encrypted error states, ensuring robust execution without revealing sensitive contract details.
Re-encryption Support: Allows ciphertext ownership to be securely transferred, enabling collaborative encrypted workflows.
Last updated