Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Feat bridge v3.1 update #1044

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 33 additions & 12 deletions docs/bridge/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,50 @@ id: architecture
title: Architecture
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import ThemedImage from '@theme/ThemedImage';

[comment]: # (mx-abstract)

Ad-Astra Bridge is a system that allows for the transfer of ERC20 tokens between the Ethereum and MultiversX networks. The system is composed of several contracts and relayers that work together to facilitate the transfer of tokens.
Ad-Astra Bridge is a system that allows the transfer of ERC20 tokens between EVM-compatible chains and MultiversX network.
Currently, there are 2 bridges available: between the Ethereum and MultiversX networks and between the BSC and MultiversX networks.
The system is composed of several contracts and relayers that work together to facilitate the transfer of tokens.

Without entering in too much details regarding the smart-contracts interactions, this is a simplified view of the entire bridge architecture.

<!--- source file reference: /static/xbridge/xbridge-dark/light.drawio --->
<ThemedImage
alt="Docusaurus themed image"
sources={{
light: useBaseUrl('/xbridge/general-architecture-light.png'),
dark: useBaseUrl('/xbridge/general-architecture-dark.png'),
}}
/>

[comment]: # (mx-context-auto)

## Ethereum Contracts
- **Repo**: https://github.com/multiversx/mx-bridge-eth-sc-sol
- **Safe (1)**: A contract that allows users to deposit ERC20 tokens that they want to transfer to the MultiversX network.
- **Bridge(2)**: A contract that facilitates the transfer of tokens from Ethereum to MultiversX.
The repository for the Solidity contracts used on the EVM-compatible side can be found here: https://github.com/multiversx/mx-bridge-eth-sc-sol
The main contracts are described below:
1. **Safe**: A contract that allows users to deposit ERC20 tokens that they want to transfer to the MultiversX network.
2. **Bridge**: A contract that facilitates the transfer of tokens from MultiversX to EVM-compatible chain. Only the relayers are allowed to use this contract.

[comment]: # (mx-context-auto)

## MultiversX Contracts
- **Repo**: https://github.com/multiversx/mx-bridge-eth-sc-rs
- **Safe (3)**: A contract that allows users to deposit ESDT tokens that they want to transfer to the Ethereum network.
- **Bridge (4)**: A contract that facilitates the transfer of tokens from MultiversX to Ethereum.
- **MultiTransfer (5)**: A helper contract that is used to perform multiple token transfers at once.
- **BridgedTokensWrapper (6)**: A helper contract that is used to support wrapping the same token from multiple chains into a single ESDT token.
The repository for the Rust contracts used on MultiversX side can be found here: https://github.com/multiversx/mx-bridge-eth-sc-rs
1. **Safe**: A contract that allows users to deposit ESDT tokens that they want to transfer to the EVM-compatible networks.
2. **Bridge**: A contract that facilitates the transfer of tokens from EVM-compatible chain to MultiversX. As the Bridge contract on the EVM-compatible chain side, this
contract is allowed to be operated by the registered relayers.
3. **MultiTransfer**: A helper contract that is used to perform multiple token transfers at once.
4. **BridgedTokensWrapper**: A helper contract that is used to support wrapping the same token from multiple chains into a single ESDT token.
5. **BridgeProxy**: A helper contract that is used to store and handle the smart-contract execution and the possible refund operation after the swap is done.

[comment]: # (mx-context-auto)

## Relayers
- **Repo**: https://github.com/multiversx/mx-bridge-eth-go
- **5 Relayers**: Managed by the MultiversX Foundation.
- **5 Relayers**: Distributed to the MultiversX validators community, with each validator having one relayer.
The repository for the code that the relayers use can be found here: https://github.com/multiversx/mx-bridge-eth-go

For each existing bridge, the following list applies:
- **5 Relayers** are managed by the MultiversX Foundation.
- **5 Relayers** are distributed to the MultiversX validators community, with each validator having one relayer.
Binary file added static/xbridge/general-architecture-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/xbridge/general-architecture-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading