Metabridge

"Bridging Blockchains, Empowering Communication"

WhitePaper : https://docs.google.com/document/d/15DNy0d34iZXrxyT9GJbxaeHyZPQ-bcvj1vVOnnMf_sI/edit?usp=sharing

Presentation : https://www.canva.com/design/DAFkfS1AWdA/vpGMSckhkCLUGpcDLT_H9g/edit?utm_content=DAFkfS1AWdA&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton

Github: https://github.com/MetaBridgeT/

Bridge-Core-Contract : https://testnet-explorer.thetatoken.org/account/0xa6115196F79E6ee3B7990D3e0AcA0c3627C43743

Proxy-Contract : https://sepolia.etherscan.io/address/0xBa30579024448B979b6EE2f58d30D4e814dE2f7e

Genesis

Metabridge is built as a subchain on the Theta Metachain, serving as a powerful bridge that connects the Theta blockchain to every other blockchain in existence. By seamlessly facilitating cross-chain message passing, Metabridge opens up a world of possibilities for developers, users, and the entire blockchain ecosystem.

In today's blockchain landscape, numerous blockchain networks operate independently, leading to fragmentation and limited interoperability. Metabridge aims to break down these barriers by acting as a universal gateway, enabling efficient and secure communication between different blockchain networks.

With Metabridge, developers can leverage the power of the Theta Metachain infrastructure and utilize the easy-to-use metabridgeSDK. This software development kit empowers Solidity developers to integrate Metabridge seamlessly into their decentralized applications (dApps), making cross-chain calls with simplicity and ease.

Metabridge allows for the exchange of messages, data, and assets across connected blockchains, opening up new avenues for innovation and collaboration. Imagine decentralized finance (DeFi) applications that seamlessly interact with multiple blockchains, cross-chain token swaps that span various ecosystems, or accessing services and resources from different blockchain networks. Metabridge makes these scenarios a reality.

By inheriting the scalability and security features of the Theta Metachain, Metabridge ensures high-performance execution of cross-chain transactions while maintaining the integrity and immutability of the connected blockchains. This creates a reliable and efficient platform for seamless interoperability.

Features

  • Cross-Chain Bridge: Metabridge serves as a robust bridge that connects the Theta blockchain to every other supported blockchain network. It enables seamless communication and data transfer between disparate blockchains, fostering interoperability and expanding the capabilities of decentralized applications.

  • MetabridgeSDK: The project provides an intuitive and user-friendly software development kit (SDK) called metabridgeSDK. This SDK empowers Solidity developers to easily integrate Metabridge into their dApps, enabling them to make cross-chain calls and leverage the full potential of blockchain interoperability. The SDK abstracts the complexity of cross-chain communication, allowing developers to focus on their application logic.

  • Universal Interoperability: Metabridge breaks down the barriers of blockchain fragmentation by enabling the transfer of assets, data, and messages across different blockchain networks. It paves the way for cross-chain DeFi applications, seamless token swaps, and access to resources from various blockchain ecosystems.

  • Scalability and Security: As a subchain on the Theta Metachain, Metabridge benefits from the scalability and security features inherent in the underlying infrastructure. It leverages the robust consensus mechanisms of Theta, ensuring high-performance execution of cross-chain transactions while maintaining the integrity and immutability of connected blockchains.

  • Seamless Integration: Metabridge is designed to seamlessly integrate with existing blockchain networks and applications. It provides a standardized protocol for cross-chain communication, making it easier for developers to incorporate Metabridge into their projects. This enables a smooth transition towards a more interconnected blockchain ecosystem.

  • Enhanced Developer Experience: Metabridge focuses on providing a developer-friendly environment. The SDK offers comprehensive documentation, code samples, and developer tools, empowering Solidity developers to quickly understand and leverage the functionalities of Metabridge in their projects.

Technical Details

The Metabridge subchain is built on the Theta Metachain protocol, which allows developers to build their own subchains on top of the Theta network. The Metabridge subchain is designed to enable cross-chain communication and transactions between different blockchain networks, using a system of validators and block leaders.

The subchain consists of three main contracts - the Bridgecore, Proxycontract, and Queue contract. The Bridgecore and Proxycontracts are deployed on both the communicating chains, while the Queue contract is only deployed on the subchain. These contracts work together to enable two-way communication between the different blockchain networks and allow for the handling of cross-chain transactions.

When a user or smart contract wants to make a cross-contract call, they call the Bridgecall function via the Metabridge SDK. The Bridgecore contract then emits an event, which is listened to by the subchain validators. This event contains the details of the cross-chain transaction, including the address of the contract being called and the parameters of the call.

The subchain validators are responsible for selecting a block leader to process the transaction. The selection process is done using a round-robin algorithm, where each validator takes a turn being the block leader. The selected block leader is responsible for verifying the transaction and ensuring that it is valid before it is executed.

Once the block leader has verified the transaction, they call the Proxycontract on the other blockchain network to execute the transaction. The Proxycontract acts as an intermediary between the different blockchain networks and ensures that the transaction is executed correctly.

After the transaction is complete, the Proxycontract reimburses the validator who called it for the cost of executing the transaction. The validator then calls the Queue contract with the transaction details, including the address of the contract being called and the parameters of the call.

Other validators on the subchain then vote on whether the transaction is valid or not. This voting process ensures that the transaction is verified by multiple validators and helps prevent fraud and malicious behavior. If the transaction is deemed to be valid, the selected validator receives a fee for processing the transaction.

In summary, the Metabridge subchain is designed to enable seamless cross-chain communication and transactions between different blockchain networks. The use of validators and block leaders helps ensure the security and integrity of the network, while the Bridgecore, Proxycontract, and Queue contract work together to handle cross-chain transactions and ensure that validators are properly compensated for their work.

Metabridge Explorer

We have built a custom explorer for the Metabridge Subchain, As the main propose of this project is to be a bridge, we have created a 3D explorer in which you can view the transactions live with the animation and even query old transactions and build video NFT's of them to preserve the proof of transaction as well as showcase them.

Metabridge SDK

Add cross contract calls in your own contract

To use the Metabridge SDK in your Solidity contracts, you must first import the BridgeSDK.sol file from the contracts directory:

import "./BridgeSdk.sol";

Next, you can inherit from the BridgeSDK contract in your own contract:

contract MyContract is BridgeSDK { // ... }

Once you have inherited from the BridgeSDK contract, you can use the bridgeCall function to call functions on contracts that exist on different blockchain networks.

The bridgeCall function takes the following parameters:

  • uint256 _destChainId: The chain ID of the destination blockchain network.
  • address _destContract: The address of the contract on the destination blockchain network.
  • bytes memory _data: The function signature and parameters to be passed to the contract on the destination blockchain network.

Here is an example of how to use the bridgeCall function:

`

function myFunction() public returns (bytes memory datas) {
// Call bridgeCall function on BridgeSDK contract
// 11155111 is the chain id of the destination chain
// 0x5C3159dDD2fe0F9862bC7b7D60C1875fa8F81337 is the contract address on the destination chain
// abi.encodeWithSignature("callme()") is the function signature and parameters
bytes memory datas = bridgeCall(11155111, 0x5C3159dDD2fe0F9862bC7b7D60C1875fa8F81337, abi.encodeWithSignature("callme()"));
return datas;

Metabridge Demo Dapp

We have a demo Dapp deployed on here : test.metabridge.network/

This demo Dapp passes message between the theta testnet and Eth Sepolia chain, try now !

Future Improvements

Metabridge is a dynamic project with numerous possibilities for future improvements and enhancements. Here are some potential areas for future development:

  1. Expanded Blockchain Support: While Metabridge aims to connect Theta with various blockchains, continuous efforts can be made to expand the range of supported blockchains. Adding compatibility with more blockchain networks will increase the reach and potential of cross-chain communication.

  2. Smart Contract Interoperability: In addition to message passing, enabling interoperability at the smart contract level would be a significant advancement. This would allow smart contracts on different blockchains to interact directly, unlocking new use cases and expanding the capabilities of decentralized applications.

  3. Cross-Chain Asset Transfers: Facilitating seamless and secure cross-chain asset transfers would be an important improvement. This would enable the transfer of digital assets, such as tokens or NFTs, between different blockchain networks, fostering liquidity and interoperability in the decentralized finance (DeFi) space.

  4. Standardization and Interoperability Protocols: Collaborating with other projects and initiatives in the blockchain space to develop and promote standardization and interoperability protocols can be beneficial. Establishing common protocols and standards would streamline cross-chain communication and foster compatibility across multiple blockchain networks.

  5. Enhanced Security Measures: As blockchain technology evolves, it is essential to stay proactive in implementing robust security measures. Continual improvements in security protocols, auditing processes, and consensus mechanisms will ensure the integrity and trustworthiness of cross-chain transactions and data transfers.

  6. User-Friendly Interfaces and Documentation: Further improvements can be made in developing intuitive user interfaces, documentation, and educational resources. This will enable developers and users to more easily understand and integrate Metabridge into their projects, fostering broader adoption and community growth.

  7. Cross-Chain Data Oracles: Integrating reliable and decentralized data oracles into Metabridge would provide a trusted source of off-chain data for cross-chain applications. This would enhance the accuracy and integrity of data utilized in various decentralized applications and smart contracts.

Built With

Share this project:

Updates