🥷 Private Transactions

Overview of how private transactions work to secure your trades.

Private transactions offer a reliable mechanism to protect your trades from being exploited by malicious actors such as front-runners and sandwich attackers. By leveraging private transaction pools and specialized endpoints, we can ensure that your transaction details remain confidential until they are confirmed on the blockchain.

Benefits of Private Transactions

  1. Increased Security: By keeping your transaction data private, you reduce the risk of MEV bots and other malicious entities from exploiting your trades.

  2. Reduced Front-Running: Front-runners cannot see your transactions in the public mempool, which prevents them from placing orders ahead of yours to gain an unfair advantage.

  3. Protection Against Sandwich Attacks: Private transactions make it difficult for attackers to manipulate the price by placing large buy and sell orders around your transaction.

Example: Private Transaction vs. Normal Transaction

Normal Transaction

In a normal transaction, the details are broadcasted to the public mempool, where they are visible to all network participants, including miners and malicious actors such as front-runners and sandwich attackers.

  1. Broadcast: When you submit a trade, it is broadcasted to the public mempool.

  2. Visibility: All network participants can see your transaction details, including the token being traded, the amount, and the gas price.

  3. Risk: Front-runners can place orders ahead of yours, and sandwich attackers can manipulate the price by placing large buy and sell orders around your transaction.

Private Transaction

In a private transaction, the details are kept confidential and only revealed to miners who will include the transaction in the next block. This method prevents malicious actors from exploiting the transaction.

  1. Broadcast: When you submit a trade, it is sent directly to a private transaction pool, such as Flashbots, instead of the public mempool.

  2. Visibility: The transaction details are only visible to the miners who have access to the private pool.

  3. Execution: Miners include the transaction in the next block without broadcasting it to the public mempool.

  4. Protection: This process prevents front-runners and sandwich attackers from seeing and exploiting your transaction.

Step-by-Step Example

Normal Transaction

  1. Submit Transaction: You decide to buy 10 ETH worth of a new token.

  2. Broadcast to Mempool: Your transaction is broadcasted to the public mempool.

  3. Visibility: Malicious actors see your transaction and place their own orders to front-run or sandwich your trade.

  4. Execution: Your transaction is mined, but you end up paying a higher price due to front-running, or you get a worse execution due to sandwich attacks.

Private Transaction

  1. Submit Transaction: You decide to buy 10 ETH worth of a new token.

  2. Send to Private Pool: Your transaction is sent to a private transaction pool using Flashbots.

  3. Visibility: Only the miners in the private pool see your transaction.

  4. Execution: Your transaction is included in the next block without being exposed to the public mempool.

  5. Protection: Your trade is executed at the expected price without interference from front-runners or sandwich attackers.