mirror of
https://github.com/hanzoai/papers.git
synced 2026-10-30 14:58:42 +00:00
73 lines
2.1 KiB
TeX
73 lines
2.1 KiB
TeX
\section{MEV Resistance}
|
|
|
|
|
|
\subsection{The MEV Problem}
|
|
|
|
\textbf{Maximal Extractable Value (MEV)}: Profit extracted by reordering/censoring transactions.
|
|
|
|
\textbf{Common attacks}:
|
|
\begin{enumerate}
|
|
\item \textbf{Frontrunning}: See large buy, place order ahead
|
|
\item \textbf{Sandwich attack}: Place orders before and after victim
|
|
\item \textbf{Just-in-time liquidity}: Add liquidity right before large trade
|
|
\end{enumerate}
|
|
|
|
\textbf{Cost to users}: \$1.2B in 2023 \cite{flashbots2024}.
|
|
|
|
\subsection{Lux Protection Mechanisms}
|
|
|
|
\subsubsection{Threshold Encryption}
|
|
|
|
Orders are encrypted until block finalization:
|
|
|
|
\begin{equation}
|
|
\text{Encrypted}(order) = \text{ThresholdEncrypt}(order, \{pk_1, \ldots, pk_n\})
|
|
\end{equation}
|
|
|
|
\textbf{Decryption}: Requires $t$ of $n$ validators to cooperate (e.g., $t = 2n/3$).
|
|
|
|
\textbf{Timeline}:
|
|
\begin{itemize}
|
|
\item $t=0$: Trader submits encrypted order
|
|
\item $t=10$ms: Block finalized via GPU BLS (order revealed)
|
|
\item $t=11$ms: Matching executed
|
|
\end{itemize}
|
|
|
|
\textbf{Result}: No one can see order contents before finalization --- no frontrunning.
|
|
|
|
\subsubsection{Fair Ordering}
|
|
|
|
We enforce \textbf{price-time priority} with cryptographic timestamps:
|
|
|
|
\begin{equation}
|
|
\text{Priority}(order) = (price, \text{GPS-timestamp})
|
|
\end{equation}
|
|
|
|
\textbf{GPS synchronization}: Validators use atomic clocks ($\pm$1$\mu$s accuracy).
|
|
|
|
\textbf{Verification}: Validators provide zk-SNARK proof of correct ordering:
|
|
|
|
\begin{equation}
|
|
\pi_{\text{order}} = \text{zk-SNARK}(\text{orders sorted by (price, time)})
|
|
\end{equation}
|
|
|
|
\textbf{Fraud detection}: If validator deviates, proof fails --- slashed stake.
|
|
|
|
\subsubsection{Batch Auctions}
|
|
|
|
Instead of continuous matching, we use \textbf{frequent batch auctions} (FBA):
|
|
|
|
\begin{enumerate}
|
|
\item Collect orders for 10ms (GPU BLS finality window)
|
|
\item Match all orders simultaneously at uniform clearing price
|
|
\item Settle atomically
|
|
\end{enumerate}
|
|
|
|
\textbf{Advantages}:
|
|
\begin{itemize}
|
|
\item No timing games (all orders in batch treated equally)
|
|
\item Better price discovery
|
|
\item Eliminates latency arbitrage
|
|
\end{itemize}
|
|
|