Files
papers/lux-universal-threshold-signatures/sections/04-multi-chain-adapter-architecture.tex
zeekay abf99d05fc papers: reorganize into per-paper dirs, add Antje Worring as co-author
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.
2026-04-18 21:50:07 -07:00

159 lines
4.6 KiB
TeX

\section{Multi-Chain Adapter Architecture}
\subsection{Unified Interface}
We define a chain-agnostic interface abstracting signature operations:
\begin{algorithmic}[1]
\State \textbf{function} \textsc{SignerAdapter}()
\State \textbf{Digest}$(tx) \to$ hash: Compute chain-specific message digest
\State \textbf{SignEC}$(hash, share) \to$ partial: Generate partial signature
\State \textbf{AggregateEC}$(partials) \to$ signature: Combine partial signatures
\State \textbf{Encode}$(signature) \to$ bytes: Format for blockchain submission
\State \textbf{FormatPublicKey}$(point) \to$ address: Derive chain address
\end{algorithmic}
\subsection{Chain-Specific Adapters}
\subsubsection{XRPL Adapter}
XRP Ledger requires specific hash prefixes and signature normalization:
\paragraph{Hash Prefixes}
\begin{itemize}
\item \textbf{Single-signing}: STX prefix (0x53545800)
\item \textbf{Multi-signing}: SMT prefix (0x534D5400)
\end{itemize}
\paragraph{Hash Function} SHA-512Half (first 256 bits of SHA-512):
\begin{align*}
\text{digest} = \text{SHA-512Half}(\text{prefix} || \text{tx\_blob})
\end{align*}
\paragraph{Signature Normalization} XRPL requires low-S values:
\begin{algorithmic}[1]
\If{$s > q/2$}
\State $s \leftarrow q - s$
\EndIf
\end{algorithmic}
\paragraph{Public Key Format}
\begin{itemize}
\item ECDSA: 33-byte compressed (0x02/0x03 prefix)
\item EdDSA: ED prefix (0xED) + 32-byte public key
\end{itemize}
\subsubsection{Ethereum Adapter}
Support for legacy and modern transaction types:
\paragraph{Transaction Types}
\begin{itemize}
\item \textbf{Legacy}: RLP encoding, EIP-155 chain ID in signature
\item \textbf{EIP-1559}: Base fee + priority fee, type 0x02
\item \textbf{EIP-4844}: Blob transactions, type 0x03
\end{itemize}
\paragraph{Signature Encoding}
\begin{align*}
v &= \begin{cases}
27 + \text{recovery\_id} & \text{(pre-EIP-155)} \\
35 + 2 \cdot \text{chainID} + \text{recovery\_id} & \text{(EIP-155)}
\end{cases}
\end{align*}
\paragraph{Contract Wallet Support} EIP-1271 signature verification for smart contract wallets via \texttt{isValidSignature} interface.
\subsubsection{Bitcoin Adapter}
Support for legacy, SegWit, and Taproot:
\paragraph{Signature Hash Types}
\begin{itemize}
\item SIGHASH\_ALL (0x01): Sign all inputs and outputs
\item SIGHASH\_SINGLE (0x03): Sign corresponding output
\item SIGHASH\_ANYONECANPAY (0x80): Sign only one input
\end{itemize}
\paragraph{Taproot (BIP-340)} Schnorr signatures with:
\begin{itemize}
\item x-only public keys (32 bytes, even y)
\item Tagged hashes: $H(\text{tag} || \text{tag} || m)$
\item Signature: $(R_x, s)$ where $R_x$ is x-coordinate
\end{itemize}
\paragraph{PSBT Support} Partially Signed Bitcoin Transactions enable collaborative signing workflow.
\subsubsection{Solana Adapter}
EdDSA signatures with Program Derived Addresses (PDAs):
\paragraph{Message Format}
\begin{algorithmic}[1]
\State Header: numSignatures, numReadonly, numReadonlyUnsigned
\State Account keys: $[\text{pubkey}_1, \ldots, \text{pubkey}_n]$
\State Recent blockhash (32 bytes)
\State Instructions: program ID, accounts, data
\end{algorithmic}
\paragraph{PDA Derivation}
\begin{align*}
\text{PDA} = H(\text{seeds} || \text{program\_id} || \text{``ProgramDerivedAddress''})
\end{align*}
where $H$ outputs a point off the Ed25519 curve.
\paragraph{Versioned Transactions} Support for address lookup tables (v0 transactions).
\subsubsection{TON Adapter}
Bag of Cells (BOC) serialization with EdDSA:
\paragraph{Cell Structure}
\begin{itemize}
\item Hash: SHA-256 of cell representation
\item Depth: Maximum reference depth
\item References: Up to 4 child cells
\item Data: Up to 1023 bits
\end{itemize}
\paragraph{Workchain Support} TON uses multiple workchains (basechain = 0, masterchain = -1).
\subsubsection{Cardano Adapter}
Multi-era support (Byron, Shelley, Allegra, Mary, Alonzo, Babbage):
\paragraph{Signature Schemes}
\begin{itemize}
\item EdDSA: Standard signing
\item ECDSA: secp256k1 for interoperability
\item Schnorr: Taproot-style signatures
\end{itemize}
\paragraph{Plutus Scripts} Smart contracts require witness sets with redeemers and datums.
\paragraph{Multi-Signature} Native multi-sig scripts with AND/OR logic.
\subsection{Performance Comparison}
\begin{table}[h]
\centering
\small
\begin{tabular}{@{}lcccc@{}}
\toprule
\textbf{Chain} & \textbf{Sig Type} & \textbf{Hash} & \textbf{Encode} & \textbf{Total} \\
\midrule
XRPL & ECDSA & 1.2ms & 0.3ms & 1.5ms \\
Ethereum & ECDSA & 0.8ms & 0.4ms & 1.2ms \\
Bitcoin & Schnorr & 0.9ms & 0.2ms & 1.1ms \\
Solana & EdDSA & 1.1ms & 0.5ms & 1.6ms \\
TON & EdDSA & 1.4ms & 0.6ms & 2.0ms \\
Cardano & EdDSA & 1.0ms & 0.4ms & 1.4ms \\
\bottomrule
\end{tabular}
\label{tab:adapter_performance}
\end{table}