Files
papers/lux-fhe-mpc-hybrid/sections/06-application-private-orderbook-matching.tex
zeekay de41e5d072 papers: replace fabricated DEX perf claims with measured numbers; document decomplected architecture
Retract the fabricated '581M/597ns / 100M+/s / 434M GPU / planet-scale' headline (a
time.Sleep sim + x40 fudge that measured nothing) across the corpus. Flagship lux-lightspeed-dex
rewritten (decomplected d-chain engine / dexvm atomic proxy / Go wrapper / 0x9010 CLOB facade;
measured GB10 104-126M & M4 Max ~250M fills/s byte-parity-gated; Knuth-D division lever; Block-STM
settlement; P3Q->starkfri rollup to Z-Chain). Technical papers (precompile-engineering, gpu-crypto-stack,
evmgpu-benchmark, p3q-corona, smart-order-routing, fhe-mpc-hybrid) carry the measured impl + cross-ref
the flagship. >1B/s framed honestly as N-node aggregation, never single-GPU. All compile.
2026-06-17 17:15:10 -07:00

83 lines
4.1 KiB
TeX

\section{Application: Private Orderbook Matching}
We instantiate the FHE+MPC hybrid for a private orderbook matching engine deployed on the Lux network.
\subsection{Problem Statement}
$N$ market participants submit limit orders (buy/sell, price, quantity, asset pair). The matching engine must:
\begin{enumerate}[leftmargin=2em]
\item Match overlapping buy/sell orders at the intersection price.
\item Reveal only matched trades to the relevant counterparties.
\item Never reveal the full order book to any single party---including the matching engine itself.
\end{enumerate}
\subsection{Protocol}
\begin{enumerate}[leftmargin=2em]
\item \textbf{Order submission.} Each participant encrypts their order $(side, price, quantity)$ under the FHE public key and submits the ciphertext on-chain.
\item \textbf{Homomorphic matching.} The matching engine (a smart contract or off-chain coprocessor) evaluates the matching logic on encrypted data:
\begin{itemize}
\item Compare encrypted prices: $\text{FHE.Compare}(\text{bid}_i, \text{ask}_j) \to \text{ct}_{match}$
\item Compute matched quantity: $\text{FHE.Min}(\text{qty}_i, \text{qty}_j) \to \text{ct}_{fill}$
\item Generate encrypted trade receipts for matched pairs.
\end{itemize}
\item \textbf{Selective decryption.} Only matched trade receipts are submitted to the MPC committee for threshold decryption. Unmatched orders remain encrypted and are never decrypted.
\item \textbf{Settlement.} Decrypted trade receipts are executed on-chain. The MPC attestation proves correct decryption.
\end{enumerate}
\subsection{Security Properties}
\begin{center}
\begin{tabular}{ll}
\toprule
\textbf{Property} & \textbf{Guarantee} \\
\midrule
Order privacy & Unmatched orders are never decrypted by anyone \\
Matching integrity & FHE evaluation is deterministic and verifiable \\
No front-running & Matching engine cannot read encrypted prices \\
Selective disclosure & Only counterparties learn trade details \\
Threshold trust & $t$-of-$n$ MPC nodes must collude to break privacy \\
\bottomrule
\end{tabular}
\end{center}
\subsection{Throughput: The Bootstrap Is the Bottleneck}
Privacy is not free, and the price is throughput. Every comparison and
minimum in the homomorphic matching step is a sequence of boolean gates,
and each gate requires a programmable bootstrap (PBS) to refresh
ciphertext noise. The PBS rate is therefore the hard ceiling on the
private path. At this paper's parameters---$\sim$12ms per bootstrapped
gate on a single core---a GPU bootstrap kernel sustains only
\textbf{single- to double-digit full PBS operations per second per GPU}.
This is six to seven orders of magnitude below a cleartext CLOB matcher,
which fills at $\sim$100--250 million orders per second per GPU on the
public D-Chain path (Lux Lightspeed DEX). The privacy multiple is the
gap between those two rates.
Two engineering consequences follow:
\begin{itemize}[leftmargin=2em,nosep]
\item \textbf{Batched per market.} Bootstraps are amortized by
batching all encrypted orders for a single market into one
homomorphic matching pass, rather than evaluating order-by-order.
The PBS kernel processes the batch; the per-order cost falls toward
the per-gate floor as the batch fills the GPU.
\item \textbf{P3Q-attested receipts.} Each matched trade receipt that
leaves the FHE+MPC pipeline is attested with a P3Q ML-DSA-65
threshold signature before settlement, so the settlement chain
verifies correctness without re-running the homomorphic matcher. The
ML-DSA-65 verify path is measured at $\sim$4{,}714 verifies per
second; verification is not the bottleneck---the bootstrap is.
\end{itemize}
The operative conclusion for system design: the FHE+MPC private path is
\emph{not} a drop-in replacement for the public CLOB. It is the correct
substrate for low-frequency, value-bearing private markets (dark-pool
crossing, treasury rebalancing, confidential securities) where the
seven-order-of-magnitude throughput cost buys order-book secrecy that no
cleartext matcher can offer. High-frequency markets stay on the public
cleartext D-Chain path.