Halborn Logo

// Blog

Blockchain Security

Fully Homomorphic Encryption (FHE) and the Blockchain


profile

Rob Behnke

November 27th, 2023


Fully homomorphic encryption (FHE) is a special type of encryption algorithm that allows computation to be performed on encrypted data. This solves one of the main challenges of protecting sensitive data that needs to be decrypted in order to be used.

FHE has many potential applications, but one of the most promising is for blockchain technology. Blockchain’s digital ledgers are publicly visible, and FHE has the potential to improve the privacy and security of data of blockchain transaction data and smart contracts.

What is Fully Homomorphic Encryption?

Data encryption is always a security best practice. With a strong encryption algorithm, it’s infeasible for anyone without the correct encryption key to read or use the data.

In general, data can be in one of 3 states:

  1. At Rest: Stored in a database, on a hard drive, on the blockchain, etc.

  2. In Transit: Traveling over the network from one location to another.

  3. In Use: Used as an input to some algorithm, program, etc.

In the first two cases, the data is in a static state with no changes being made. This makes encrypting the data easy. For this reason, encryption of data at rest and in transit is commonplace. For example, many computers offer full-disk encryption (FDE), and the transport layer security (TLS) protocol is used to protect the majority of network traffic.

Encryption of data in use is more complex because — for most encryption algorithms — calculations performed on the encrypted ciphertext do not translate to the decrypted plaintext. 

For example, with the Advanced Encryption Standard (AES) — a widely used encryption algorithm — adding the ciphertexts C1 and C2 does not provide the encrypted form of the sum of their plaintexts (i.e. C1 + C2 ≠ AES(P1+P2)).

Fully homomorphic encryption algorithms are the exception to this rule. A fully homomorphic encryption algorithm can perform certain mathematical operations on ciphertexts and have the same operations performed on the corresponding plaintexts. As a result, an FHE algorithm enables encryption of data at rest, in transit, and in use.

Applications of Fully Homomorphic Encryption for Blockchain

FHE offers the ability to keep data encrypted while processing it. This capability has multiple potential use cases for blockchain projects, including the following:

  • Data Privacy: Blockchain technology creates public distributed ledgers where anyone can see the data posted to the blockchain. With FHE, data can be stored encrypted on the blockchain and used by smart contracts while only being accessible to legitimate users.

  • Private Transactions: Transaction data is public on most blockchains because the nodes of the blockchain network require the ability to verify the authenticity and correctness of a transaction. FHE makes it possible for transactions to be validated without revealing details such as the amount of value being transferred from one party to another.

  • Private Smart Contracts: Like transaction data, smart contracts are stored publicly on the blockchain’s digital ledger, creating the potential for reverse engineering. FHE offers the potential of private, encrypted smart contracts that can be accessed only by legitimate users and protect intellectual property.

  • Secure Multi-Party Computation (MPC): MPC breaks computation into multiple pieces, each of which is performed by a different party. With FHE, each of these pieces can remain encrypted as calculations are performed, providing additional protection against the disclosure of sensitive information.

  • Confidential Voting: Decentralized autonomous organizations (DAOs) are increasingly used to manage projects on the blockchain. With FHE, vote data can be encrypted, preserving the confidentiality of each voter’s choices.

  • Frontrunning Protection: Frontrunning bots seek out potentially high-value transactions and attempt to submit their own transactions before these are processed, earning a profit. With FHE and encrypted transactions, it may be infeasible for frontrunners to analyze transaction data and identify viable targets.

  • Regulatory Compliance: Many data privacy laws require data encryption, and the lack of encryption for blockchain data is a major regulatory hurdle. FHE offers the potential to streamline compliance while still enabling distributed computation on protected data.

Downsides of Fully Homomorphic Encryption

FHE is a promising technology with multiple potential applications in the blockchain space. However, most blockchain protocols and projects aren’t using the technology. The reason for this is that FHE — as it currently exists — has significant downsides, including the following:

  • Performance Overhead: FHE provides various useful features, but its encryption and decryption process is much more computationally expensive than other encryption algorithms. As a result, it currently isn’t a great fit for blockchain applications which are already very inefficient due to decentralized processing where the same operations are run on every node in the network when a block is created.

  • Ciphertext Size: In addition to computational overhead, FHE algorithms also generate extremely large ciphertexts. This can be problematic for blockchain applications where space in blocks on the distributed ledger is already at a premium.

  • Lack of Standardization: Many encryption algorithms are standardized with a particular algorithm — such as AES — recommended for each potential use case. While FHE has been around for some time, it is a less mature type of encryption and lacks the same standardized, usable algorithms.

  • Complex Algorithms: FHE algorithms are complex, and standardized implementations may not exist for all algorithms and languages. As a result, it can be difficult to implement for various applications.

Conclusion

Most encryption algorithms can only be used for data at rest or in transit. When data is actually used, it needs to be decrypted, opening it up to potential exposure or abuse.

Fully homomorphic encryption (FHE) algorithms make it possible to perform computations on encrypted data. This has numerous potential applications in the blockchain space such as encrypting data on the blockchain or developing private smart contracts that are only visible or usable by authorized users.

However, widespread adoption of FHE is limited because it has significant limitations. For example, the additional computational overhead and size of FHE ciphertexts make it unsuitable for many blockchain applications at this time.

FHE algorithms are under active development, and significant progress has been made toward improving their efficiency and the size of the ciphertexts that they generate. Once FHE becomes more feasible, it has significant promise to improve the privacy and security of blockchain-based projects.