HyphaBFT: A Chain-Agnostic Cross-Chain Swap Infrastructure

Yosui
Yosui
Cover Image for HyphaBFT: A Chain-Agnostic Cross-Chain Swap Infrastructure

The world still lacks a state machine that can serve as truly chain-agnostic cross-chain swap infrastructure. Bitcoin as digital gold and Ethereum as a world computer each have their own ecosystems, but the question "How do we exchange Bitcoin and Ethereum?" remains unclear when it comes to genuinely Web3, decentralized, and trustless approaches. HyphaBFT solves this problem.

HyphaBFT enables cross-chain swaps not just between Bitcoin and Ethereum, but across all state machines—including EVM ecosystems, Tron, XRP, Cardano, Celo, IBC ecosystems, Hyperliquid, and more.

What is HyphaBFT?

HyphaBFT is infrastructure designed to enable truly chain-agnostic cross-chain swaps. It consists of four main components: a customized CometBFT, HyphaP2P, Core (which coordinates communication between these components), and Storage (which maintains data).

How HyphaBFT Works

HyphaBFT has the following architecture:

HyphaBFT architecture

Core

Core is the central component that receives external requests and coordinates communication with CometBFT, HyphaP2P, and Storage based on the type of request.

Core acts as the system's orchestrator. When it receives an external transaction request, Core validates it, converts it to the appropriate format, and passes it to CometBFT. For TSS operations, it coordinates distributed key generation and signing processes through the HyphaP2P network. For governance operations, it handles vote tallying and slashing condition evaluation, recording the results on the blockchain.

Requests handled by Core:

  • Transactions
  • TSS (DKG + Signing)
  • Governance (Voting, Slashing, etc.)

Storage

Storage maintains all information handled by Core. While only critical TSS results are recorded on the blockchain, Storage keeps both blockchain transaction information and complete TSS data.

Blockchain data storage requires balancing transparency with efficiency. Recording everything on-chain maximizes transparency but is inefficient in terms of storage costs and network bandwidth. HyphaBFT's Storage adopts a hybrid approach.

The blockchain records only the minimum information needed for verification—transaction results and final TSS outputs. Storage, meanwhile, keeps detailed information needed for debugging and traceability, such as intermediate TSS protocol states and complete transaction processing logs. This maintains system transparency while minimizing on-chain data.

Storage data is structured so nodes can independently sync and verify it. New nodes joining the network can retrieve historical data from Storage and cross-reference it with CometBFT's blockchain to restore the complete system state.

CometBFT

CometBFT is the core library for blockchain data. It records only transaction and order information, with TSS data limited to final results.

HyphaBFT's CometBFT implementation is a customized and optimized version of standard CometBFT for cross-chain swap use cases. Each block records information about cross-chain transactions executed during that block period (order information and TSS information) along with their execution order. Transaction ordering is crucial for maintaining state consistency across different chains.

While TSS protocol execution happens primarily on the HyphaP2P network, the final results—generated signatures and DKG completion confirmations—are recorded on the CometBFT blockchain. This allows the validity of TSS operations to be verified later.

HyphaP2P

HyphaP2P is a P2P network layer that uses LibP2P to perform TSS (FROST) DKG and signing off-chain (from CometBFT's perspective) for distributed key management. Since both CometBFT and HyphaP2P handle P2P communication between nodes, HyphaBFT operates two separate P2P networks.

LibP2P is a modular, extensible network stack used by IPFS, Filecoin, and others. HyphaP2P leverages LibP2P's flexibility to build a communication layer optimized for the FROST protocol.

The reason for HyphaP2P's independent existence lies in the nature of TSS protocols. FROST execution requires multiple rounds of interactive communication between participants, occurring at different timings and patterns than blockchain consensus processes. While the CometBFT network is optimized for block generation and verification, the HyphaP2P network is optimized for low-latency interactive communication required by TSS protocols.

This two-layer network structure allows HyphaBFT to efficiently execute blockchain consensus and TSS operations in parallel. Since each network operates independently, issues in one network don't directly affect the other, improving overall system robustness.

Summary

HyphaBFT's architecture represents a specialized approach to building truly decentralized and trustless cross-chain swap infrastructure. Just as Bitcoin specializes in storing value, Ethereum in being a world computer, and Hyperliquid in perpetual DEX functionality, HyphaBFT is a blockchain specialized for decentralized and trustless cross-chain swaps.

By adding the Ownership Transfer Protocol module as an execution layer on top of HyphaBFT, we create a simpler and more elegant cross-chain swap infrastructure.