Bifröst: Securing the future of cross-chain swaps

The primary mission of decentralized exchanges (DEXs) is to provide financial freedom, not only in a permissionless manner but also by ensuring accessibility to make cryptocurrency a part of our everyday lives. This encompasses various aspects, with a major focus on connecting chains and making assets usable. THORChain and Maya stand out for their innovative approaches to enabling seamless exchanges, but what technology behind the scenes makes this possible?

August 26, 2024
  • Bifrost enables secure cross-chain swaps by connecting different blockchains within THORChain and Maya's infrastructure.
  • Key technologies like state pegs, state machines, and Threshold Signature Scheme (TSS) ensure secure and efficient transaction processing.
  • Churning keeps funds safe by migrating them to new vaults as the network evolves, maintaining overall security.

Introduction to Bifrost

The Bifrost is essential to the decentralized liquidity network, enabling cross-chain swaps between different blockchains. It acts as the connective tissue between various blockchains, ensuring that transactions are processed securely and efficiently.

The Bifrost protocol comprises several critical elements:

  1. 1-way state pegs: These allow Bifrost to sync states from external chains, facilitating the observation of inbound transactions. Once nodes are synced, they monitor vault addresses and convert detected inbound transactions into witness transactions. These transactions are then processed, and once consensus is reached among the nodes, they are finalized and executed.
  2. State Machines: Bifrost uses state machines to coordinate asset exchange logic. Once a transaction is finalized, the state machine orders transactions, computes state changes, and delegates them to the appropriate outbound vault. This process ensures that transactions are executed in a secure and orderly manner.
  3. Threshold Signature Scheme (TSS): TSS is a multiparty computation cryptographic protocol that enables distributed threshold key-signing. In essence, it allows multiple nodes to jointly manage a private key without any single node having complete control. This enhances the network's security by ensuring no single failure point exists.
  4. Bifrost Chain Clients: These clients are responsible for processing chain-specific transactions. Each chain client is designed to be lightweight, containing only the necessary logic to connect to and interact with a particular blockchain.

Archivo adjunto



Migrating Funds

As the network develops and grows, nodes come in and out of the validator set. In a normal cosmos-based chain this is trivial, but Maya and THORChain have to also manage the external funds in Asgard vaults and how to hand them over. This is what we call a “churn”. When the network churns (i.e., when it cycles validators), new public keys are created, and funds are migrated to the new vaults. This process is split into five transactions, per asset. Users & interfaces are instructed to send funds to the newest vaults, and once the migration is complete, the old vaults are discarded and the old validators are allowed to withdraw their collateral. This system ensures that the network remains secure and “fresh” and that funds do not end up lost in old vaults with inactive and unresponsive nodes.


Top 10 FAQs from the Crypto Community

  1. What is the Threshold Signature Scheme (TSS) in Bifrost?

TSS is a cryptographic protocol used by Bifrost to allow multiple nodes to jointly manage a private key. It ensures that no single node has complete control over any transaction, enhancing security.

  1. How do we ensure the security of assets in cross-chain swaps?

We use TSS, state machines, over-collateralization and a consensus mechanism to ensure that assets are securely transferred between chains. Double-signing protection and network consensus further safeguard the network.

  1. Can Bifrost support any blockchain?

In theory, yes. Bifrost is designed to be blockchain-agnostic, meaning it can be extended to support any blockchain, as long as the appropriate nodes and state machines are implemented. The only requirements for the blockchain to be supported is: 1. There are transactions 2. Transactions can have arbitrary data payload (think memos in Ethereum or OP_Return in Bitcoin), and 3. Full nodes need to be implemented so that validators in Maya and THORChain can independently and permissionlessly access chain data and relay messages to the blockchain.

  1. What are the risks involved with using Maya and Thorchain?

Risks include potential smart contract bugs, network attacks, and liquidity issues. However, the protocols’ design and security mechanisms are intended to minimize these risks. Also, these risks tend to lower over time as the protocols “harden” and are constantly improved by community developers and audits; while our counter-parties’ central exchanges risk gets higher over time by human capture risk and honeypot risk.

Additional resources

Docs

Website

X

Discord