Sandwich attacks, or "sandwich attacks" in Spanish, are a type of transaction manipulation in the context of cryptocurrencies. Although sandwich attacks are difficult to detect and completely prevent, there are some steps users can take to reduce the risk. Let's see what sandwich attacks are and how we can prevent them.
What are sandwich attacks:
In the exciting world of cryptocurrencies, users are constantly facing various cyber threats and attacks. One of the most intriguing and sophisticated attacks that have emerged recently are sandwich attacks. These attacks have caught the attention of the blockchain community due to their cunning nature and potential dire consequences. Sandwich attacks, or "sandwich attacks" in Spanish, are a type of transaction manipulation in the context of cryptocurrencies. This type of attack is carried out by inserting a malicious transaction between two legitimate transactions, so that the attacker can gain an improper financial advantage.
Process of a sandwich attack. Source: cmichel.
How sandwich attacks work:
The basic operation of a sandwich attack involves three main stages:
- Observation and analysis: The attacker monitors transactions on a specific blockchain network and looks for opportunities to intervene. Look for transactions that involve a large volume of tokens and are publicly visible.
- Time of intervention: When the attacker detects a transaction in progress, it generates a new transaction that is strategically placed before or after the original transaction. This new transaction usually has a higher transaction cost or a less favorable buy/sell price, depending on the attacker's intent.
- Attack execution: The malicious transaction is placed between the two legitimate transactions, creating a "sandwich." This can result in economic harm to the parties involved, as the attacker gains benefits at the expense of other participants.
Steps of a sandwich attack. Source: Tarlogic.
How to prevent sandwich attacks:
Although sandwich attacks are difficult to detect and completely prevent, there are some steps users can take to reduce the risk:
- Use trusted exchanges and platforms: When choosing a platform to carry out transactions, it is important to opt for those that have good security measures and have proven to be trustworthy.
- Carefully review transactions: Before confirming any transaction, it is recommended that you carefully review details such as prices and fees for any anomalies or suspicious changes.
- Be aware of market volatility: Sandwich attacks are more common during times of high volatility in the cryptocurrency market. Users should be aware of sharp price movements and exercise caution during such periods.
Famous examples of sandwich attacks:
Over the years, there have been some famous cases of sandwich attacks that have raised concerns in the crypto community. Below are two notable examples:
-
- The Uniswap attack: In 2021, a case of a sandwich attack was reported on Uniswap, one of the most popular decentralized exchange protocols. During this attack, the attacker placed a malicious transaction between two legitimate transactions, taking advantage of the lack of liquidity in certain token pairs. As a result, the attacker managed to manipulate prices and make significant profits at the expense of other users.
- The Binance Smart Chain attack: In 2022, a sandwich attack was discovered on Binance Smart Chain, a public blockchain and platform for the creation of smart contracts. In this case, the attacker took advantage of a network congestion and placed a malicious transaction between two legitimate transactions. This allowed him to gain an economic advantage by manipulating the prices of certain tokens and making trades unfavorable to other users.
Forensic analysis of the sandwich attack carried out on Uniswap in 2021. Source: @Lookonchain Twitter.
These examples illustrate how sandwich attacks can impact popular platforms and how attackers can exploit weaknesses in security and liquidity to gain unfair benefits.