Technical Definition

Front-running

Front-running occurs when someone observes a pending action and gets a strategically related transaction executed before it to capture an advantage.

By Crypto University Editorial
MEVMempoolSlippage

Key Insight

Front-running can worsen prices, increase costs, or cause users' transactions to fail. It is especially relevant in decentralized trading, liquidations, NFT mints, and other applications where execution order changes economic outcomes.

Common Misconceptions

Not every earlier transaction is malicious front-running. Normal arbitrage and independent users can also compete for execution. The key issue is whether someone uses knowledge of another pending action to gain an ordering advantage.

Detailed Explanation

Aliases and acronyms: Frontrunning; transaction front-running; priority transaction attack

In one sentence: Front-running occurs when someone observes a pending action and gets a strategically related transaction executed before it to capture an advantage.

Plain-English explanation: On public blockchains, pending transactions can reveal what a user is about to do. A searcher may submit a competing or related transaction with ordering incentives so it executes first. Front-running is one form of transaction-ordering behavior associated with MEV.

Analogy: It is like seeing someone reach for the last discounted item and quickly stepping ahead in line to buy it first.

How it works: A searcher monitors pending transactions or other order flow, detects a profitable opportunity, and submits its own transaction designed to execute earlier. Ordering may be influenced by fees, private builder relationships, bundles, or protocol-specific mechanisms.

FAQs

Q: Is front-running illegal?

A: Legal treatment depends on jurisdiction and facts. In blockchain discussions, the term primarily describes transaction-ordering behavior, not a universal legal classification.

Q: Can private transactions reduce front-running exposure?

A: They can reduce exposure to the public mempool, but they introduce different trust, routing, and infrastructure considerations.

Q: Is front-running the same as a sandwich attack?

A: No. A sandwich attack typically combines a transaction before and another after the victim's trade. Front-running is the earlier-ordering component.

Sources

Ethereum.org - Maximal extractable value

EIP-8209 - Mempool ordering motivation

In Practice

A trader's pending purchase would move a thin DEX market upward. A searcher buys the asset first, so the user's trade executes at a less favorable price.

Dig Deeper