Files

71 lines
2.9 KiB
TeX

\section{Warp Messaging Protocol}
This section describes the Warp 1.x bare BLS-aggregate format. The
current shipping protocol is \textbf{Lux Warp 2.0} (LP-021v2 /
LP-6022), a hybrid envelope that carries the Warp 1.x message intact
(the \emph{Beam} lane below) alongside an ML-DSA cert set and a
Pulsar Pulse (Lux's Corona variant, see LP-073) for post-quantum
verification --- all three lanes bound to a common source-chain
transcript. Reference implementation:
\texttt{github.com/luxfi/warp} (\texttt{envelope.go},
\texttt{pulsar/}). The remainder of this section is the Beam
specification.
\subsection{Message Envelope}
Every cross-chain message has a fixed envelope:
\begin{verbatim}
WarpMessage {
networkID: uint32 // Lux network identifier
srcChainID: [32]byte // Source chain hash
dstChainID: [32]byte // Destination chain hash
epoch: uint64 // Source chain epoch at emission
nonce: uint64 // Per-source-chain monotonic nonce
payload: []byte // Typed payload (see below)
blsSignature: [48]byte // BLS aggregate over message hash
signerBitmap: []byte // Which validators signed
}
\end{verbatim}
\subsection{Payload Types}
\begin{center}
\begin{tabular}{lll}
\toprule
\textbf{Type ID} & \textbf{Name} & \textbf{Purpose} \\
\midrule
\texttt{0x01} & \texttt{ASSET\_TRANSFER} & Move native assets between chains \\
\texttt{0x02} & \texttt{CONTRACT\_CALL} & Cross-chain contract invocation \\
\texttt{0x03} & \texttt{VALIDATOR\_UPDATE} & Validator set change notification \\
\texttt{0x04} & \texttt{FINALITY\_PROOF} & Epoch finality propagation \\
\bottomrule
\end{tabular}
\end{center}
\subsection{Message Hash}
The message hash used for BLS signing is computed as:
$$H = \text{SHA-256}(\text{domainSeparator} \| \text{typeHash} \| \text{abi.encode}(\text{msg}))$$
where $\text{domainSeparator} = \text{SHA-256}(\text{``LuxWarp''} \| \text{networkID} \| \text{srcChainID})$.
\subsection{Verification Rules}
On the destination chain, every Warp message must pass:
\begin{enumerate}[leftmargin=2em]
\item \textbf{Network ID match}: $\text{msg.networkID} = \text{local.networkID}$
\item \textbf{Destination match}: $\text{msg.dstChainID} = \text{local.chainID}$
\item \textbf{Epoch freshness}: $\text{msg.epoch} \geq \text{current.epoch} - \text{stalenessWindow}$
\item \textbf{Nonce ordering}: $\text{msg.nonce} = \text{lastNonce}[\text{srcChainID}] + 1$
\item \textbf{Validator set}: Signers in $\text{msg.signerBitmap}$ are valid at $\text{msg.epoch}$
\item \textbf{Quorum}: Total stake of signers $> 2/3$ of source chain total stake
\item \textbf{BLS verification}: $\text{Verify}(\text{aggPK}, H, \text{msg.blsSignature}) = \text{true}$
\item \textbf{Not consumed}: $\text{consumedBitmap}[\text{srcChainID}][\text{nonce}] = 0$
\end{enumerate}
If any check fails, the message is rejected. There is no partial acceptance.