fhEVM v0.4: New Encrypted Types and Asynchronous Decryption
This new version of fhEVM introduces new encrypted types and the new asynchronous decryption API. Additionally, we’ve published the first version of our standard fhEVM contracts library.
These new features aim to improve the overall performance of fhEVM, enhance efficiency, and unlock the potential of new use cases.
Encrypted boolean, 4 bits, 64 bits, and addresses
fhEVM v0.4 expands the types of encrypted data supported:
- [.c-inline-code]ebool[.c-inline-code]: Encrypted booleans. [.c-inline-code]ebool[.c-inline-code]allows users to perform boolean operations at lower gas fees, compared to the previous use of 8-bit integers to represent encrypted booleans.
- [.c-inline-code]euint4[.c-inline-code]: Encrypted 4-bit integers.
- [.c-inline-code]euint64[.c-inline-code]: Encrypted 64-bit integers.
- [.c-inline-code]eaddress[.c-inline-code]: Encrypted address. [.c-inline-code]eaddress[.c-inline-code] unlocks a wide range of new use cases in privacy-preserving decentralized applications, such as confidential asset transfer, address verification, and many others. [.c-inline-code]eaddress[.c-inline-code] is compatible with [.c-inline-code]eq[.c-inline-code](equal to) and [.c-inline-code]ne[.c-inline-code](not equal to).
New asynchronous decryption
Zama’s fhEVM v0.4 introduces a new asynchronous decryption API - fhEVM smart contracts can now initiate decryption requests via an oracle, and receive answers through callbacks.
Compared to the previous synchronous decryption within the blockchain network, the new asynchronous decryption enables fhEVM smart contracts to offload decryption tasks, freeing up resources and improving overall performance. With the possibility to request multiple decryptions at once and handle callback parameters, this improvement optimizes the efficiency and scalability of operations on the blockchain.
Here is a simple example of asynchronous decryption:
New fhEVM standard library
In this release, the Zama team introduces a new package that provides a foundational suite of standard contracts including ERC20 and DAO – the fhevm-contracts. This library is designed to be easily extended and customized. It aims to help developers save significant development time so they can focus more on fostering innovation. To use the fhEVM standard library, simply install it with [.c-inline-code]npm install fhevm-contracts[.c-inline-code]. For a more detailed explanation and code examples, visit the fhEVM documentation.
Additional links
- Star the fhEVM Github repository to endorse our work.
- Read the fhEVM documentation.
- Get support on our community channels.