mirror of
https://github.com/lux-apps/papers.git
synced 2026-10-30 18:15:21 +00:00
Restructured from flat .tex/.pdf files into per-paper subdirectories. Added Antje Worring as co-author on all papers. Synced PDFs to pdfs/ for download site.
54 lines
2.0 KiB
TeX
54 lines
2.0 KiB
TeX
\section{Verification Rules}
|
|
|
|
|
|
Every \texttt{RELEASE} message on the destination chain must pass all 8 checks. Failure of any single check causes the entire message to be rejected.
|
|
|
|
\begin{center}
|
|
\begin{tabular}{rll}
|
|
\toprule
|
|
\textbf{\#} & \textbf{Check} & \textbf{Rejects} \\
|
|
\midrule
|
|
1 & Domain separator matches local config & Cross-protocol confusion \\
|
|
2 & \texttt{dstChain} matches \texttt{local.chainID} & Cross-chain replay \\
|
|
3 & \texttt{version} is supported & Protocol downgrade \\
|
|
4 & \texttt{nonce} $=$ \texttt{lastNonce[srcChain]} $+ 1$ & Replay \& nonce skip \\
|
|
5 & \texttt{expiry} $>$ \texttt{block.timestamp} & Stale messages \\
|
|
6 & MPC signature valid for current key & Forgery \& old key replay \\
|
|
7 & Nonce not in consumed bitmap & Double spend \\
|
|
8 & Backing attestation covers minted supply & Undercollateralization \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\end{center}
|
|
|
|
\subsection{Solidity Implementation}
|
|
|
|
\begin{lstlisting}[language=Solidity,caption={Verification function (simplified)}]
|
|
function verifyAndExecute(Message calldata msg, bytes calldata sig) external {
|
|
// Check 1: Domain separator
|
|
require(msg.domainSeparator == DOMAIN_SEPARATOR, "domain");
|
|
// Check 2: Destination chain
|
|
require(msg.dstChain == block.chainid, "chain");
|
|
// Check 3: Version
|
|
require(msg.version == PROTOCOL_VERSION, "version");
|
|
// Check 4: Nonce ordering
|
|
require(msg.nonce == lastNonce[msg.srcChain] + 1, "nonce");
|
|
// Check 5: Expiry
|
|
require(msg.expiry > block.timestamp, "expired");
|
|
// Check 6: MPC signature
|
|
require(verifyMPCSignature(msg, sig), "sig");
|
|
// Check 7: Not consumed
|
|
require(!consumed[msg.srcChain][msg.nonce], "consumed");
|
|
// Check 8: Backing check
|
|
require(totalMinted[msg.asset] + msg.amount
|
|
<= backingAttestation[msg.asset], "backing");
|
|
|
|
// Mark consumed and update nonce
|
|
consumed[msg.srcChain][msg.nonce] = true;
|
|
lastNonce[msg.srcChain] = msg.nonce;
|
|
|
|
// Execute
|
|
_release(msg.asset, msg.amount, msg.recipient);
|
|
}
|
|
\end{lstlisting}
|
|
|