F3B: A Low-Overhead Blockchain Architecture with Per-Transaction Front-Running Protection

Haoqian Zhang, Louis-Henri Merino, Ziyan Qu, Mahsa Bastankhah, Vero Estrada-Galiñanes, Bryan Ford

TL;DR

Front-running attacks are a significant problem in decentralized finance (DeFi), causing financial losses and undermining ecosystem fairness. This paper introduces F3B, a novel blockchain architecture that uses per-transaction encryption with threshold cryptography to protect against these attacks. F3B achieves this with minimal overhead, making it practical for real-world deployment.

What Problem Does This Paper Address?

The rise of decentralized finance (DeFi) has unfortunately also led to a proliferation of front-running attacks. These attacks exploit the transparency of pending transactions on blockchains, allowing malicious actors to gain an advantage by observing a transaction before it's finalized and then submitting their own transaction to profit from it. This can lead to significant financial losses for honest users and erodes trust in the ecosystem. While existing solutions exist, they often suffer from high latency, are tied to specific consensus mechanisms, or introduce other security concerns. The authors aim to address these limitations by providing a low-overhead, general-purpose solution for per-transaction front-running protection.

Methods

F3B's core innovation lies in its use of threshold cryptography for per-transaction encryption. Here's how it works:

  • Transaction Encryption: Users encrypt their transactions using a symmetric key. This encrypted transaction is then sent to the blockchain.
  • Secret Management Committee (SMC): A decentralized committee of trustees holds shares of the decryption key.
  • Delayed Decryption and Execution: The underlying blockchain finalizes the encrypted transaction. Only after finalization does the SMC release the decryption shares.
  • Key Reconstruction and Execution: The consensus group reconstructs the symmetric key from the shares, decrypts the transaction, and then executes it.

This approach ensures that transactions remain confidential until they are irreversibly ordered on the blockchain, preventing attackers from gaining advance knowledge. F3B supports two specific threshold cryptographic schemes: TDH2 and PVSS, offering flexibility in how the secret management committee is structured and how keys are managed.

Datasets

Not discussed in the paper.

Key Insights and Ideas

  • Per-Transaction vs. Per-Block Encryption: A crucial insight is that per-transaction encryption is superior to per-block encryption. If a transaction fails to be included in a block as intended (e.g., due to network congestion), per-block encryption would reveal the transaction prematurely, making it vulnerable. F3B's per-transaction approach guarantees confidentiality until actual finalization.
  • Execution Layer Modification: F3B achieves its goals by modifying the blockchain's execution layer. This is a key design choice that makes it agnostic to the underlying consensus algorithm (PoW, PoS, etc.) and compatible with existing smart contracts without requiring code changes.
  • Low Latency Overhead: Despite adding encryption and decryption steps, F3B achieves a remarkably low latency overhead. This is because the primary cost is shifted to the secret management committee, and the sender only needs to submit one transaction.
  • Incentive Mechanisms: The paper highlights the importance of designing incentive structures for both users (to prevent spamming) and the secret management committee (to ensure honest behavior and prevent collusion).

Key Results

  • Negligible Latency Overhead: F3B introduces a latency overhead of only 0.026% to 0.027% on Ethereum with a 128-member secret-management committee. This is a significant improvement over existing solutions like Submarine, which can have a 200% latency overhead.
  • High Throughput: F3B can achieve a throughput of up to 359 transactions per second with batching, which is sufficient to support Ethereum's needs.
  • Storage Efficiency: The TDH2 protocol offers a storage overhead of only 80 bytes per transaction, while PVSS's overhead grows linearly with the committee size.
  • Compatibility: F3B is demonstrated to be compatible with existing smart contracts and various consensus algorithms.

Limitations and Future Work

  • Speculative Attacks: The authors acknowledge that attackers might still attempt speculative front-running attacks based on metadata (e.g., sender address, transaction size). They suggest using different addresses or privacy-enhancing techniques to mitigate this.
  • Epoch Transitions: While F3B handles epoch transitions better than some prior work, there's still a potential for user confusion when choosing keys. The paper suggests grace periods to mitigate this.
  • Gas Fees: Integrating F3B with Ethereum's gas fee mechanism presents challenges, particularly regarding spamming attacks and accurately estimating gas costs. The paper proposes solutions like burning unused gas or partial refunds.
  • Key Storage for New Nodes: For new nodes joining the network, obtaining historical decryption keys can be an issue. The paper suggests storing keys as metadata on the blockchain.
  • Future Work: The authors mention that a detailed analysis of deployment challenges and further optimizations are areas for future research.

Summary updated

Abstract

Front-running attacks, which benefit from advanced knowledge of pending transactions, have proliferated in the blockchain space since the emergence of decentralized finance. Front-running causes devastating losses to honest participants and continues to endanger the fairness of the ecosystem. We present Flash Freezing Flash Boys (F3B), a blockchain architecture that addresses front-running attacks by using threshold cryptography. In F3B, a user generates a symmetric key to encrypt their transaction, and once the underlying consensus layer has finalized the transaction, a decentralized secret-management committee reveals this key. F3B mitigates front-running attacks because, before the consensus group finalizes it, an adversary can no longer read the content of a transaction, thus preventing the adversary from benefiting from advanced knowledge of pending transactions. Unlike other mitigation systems, F3B properly ensures that all unfinalized transactions, even with significant delays, remain private by adopting per-transaction protection. Furthermore, F3B addresses front-running at the execution layer; thus, our solution is agnostic to the underlying consensus algorithm and compatible with existing smart contracts. We evaluated F3B on Ethereum with a modified execution layer and found only a negligible (0.026%) increase in transaction latency, specifically due to running threshold decryption with a 128-member secret-management committee after a transaction is finalized; this indicates that F3B is both practical and low-cost.
BibTeX
@inproceedings{zhang2023f,
  author = {Haoqian Zhang and Louis-Henri Merino and Ziyan Qu and Mahsa Bastankhah and Vero Estrada-Galiñanes and Bryan Ford},
  title = {{F3B: A Low-Overhead Blockchain Architecture with Per-Transaction Front-Running Protection}},
  booktitle = {Aft},
  year = {2023},
  doi = {10.4230/lipics.aft.2023.3},
}
Figure