mirror of
https://github.com/lux-apps/papers.git
synced 2026-11-03 05:07:46 +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.
64 lines
2.0 KiB
TeX
64 lines
2.0 KiB
TeX
\section{SwapSigTx: On-Chain Signature Proof}
|
|
|
|
|
|
The core innovation of M-Chain is the \textbf{SwapSigTx} transaction type, which provides cryptographic proof that a threshold quorum has authorized a swap.
|
|
|
|
\subsection{Transaction Format}
|
|
|
|
|
|
|
|
\begin{algorithmic}[1]
|
|
\State \textbf{struct} SwapSigTx:
|
|
\State \quad $SwapID$: Transaction ID from X-Chain
|
|
\State \quad $AssetID$: Asset being transferred (BTC, ETH, etc.)
|
|
\State \quad $MPCAlgo$: Signature algorithm (0=MuSig2, 1=CGG21, 2=FROST)
|
|
\State \quad $Signature$: Threshold signature bytes
|
|
\State \quad $SigBitmap$: Bitmap of participating signers
|
|
\State \quad $ProofHash$: Hash of signing transcripts (audit trail)
|
|
\end{algorithmic}
|
|
|
|
|
|
\subsection{Validation Rules}
|
|
|
|
|
|
|
|
\begin{algorithmic}[1]
|
|
\State \textbf{function} \textsc{ValidateSwapSigTx}($tx, state$)
|
|
\State \textbf{Check 1:} Retrieve aggregate public key
|
|
\State $PK \gets state.KeyRegistry[tx.AssetID]$
|
|
\State
|
|
\State \textbf{Check 2:} Verify threshold met
|
|
\State $signerCount \gets \text{PopCount}(tx.SigBitmap)$
|
|
\State $threshold \gets state.Threshold[tx.AssetID]$
|
|
\If{$signerCount < threshold$}
|
|
\State \Return $\texttt{INVALID\_THRESHOLD}$
|
|
\EndIf
|
|
\State
|
|
\State \textbf{Check 3:} Verify signature
|
|
\State $msgHash \gets \text{Hash}(tx.SwapID)$
|
|
\State $valid \gets \text{AggVerify}(PK, tx.SigBitmap, tx.Signature, msgHash)$
|
|
\If{not $valid$}
|
|
\State \Return $\texttt{INVALID\_SIGNATURE}$
|
|
\EndIf
|
|
\State
|
|
\State \textbf{Check 4:} Prevent double-signing
|
|
\If{$state.SwapState[tx.SwapID] = \texttt{SIGNED}$}
|
|
\State \Return $\texttt{ALREADY\_SIGNED}$
|
|
\EndIf
|
|
\State
|
|
\State \Return $\texttt{VALID}$
|
|
\State \textbf{end function}
|
|
\end{algorithmic}
|
|
|
|
|
|
\subsection{State Transition}
|
|
|
|
Upon successful validation:
|
|
\begin{enumerate}
|
|
\item Credit \texttt{rewardPerSig} to each signer in bitmap
|
|
\item Mark $\texttt{swapState}[SwapID] = \texttt{SIGNED}$
|
|
\item Generate Warp message proof for X-Chain
|
|
\item Emit \texttt{SwapSigned} event
|
|
\end{enumerate}
|
|
|