Allbridge
Search…
Under the hood of Allbridge transfers

How Allbridge works from the User perspective?

The user needs to Complete 2 transactions: Send transaction on the Source blockchain and Receive transaction on the Destination blockchain.
The transfer steps are the following:
  1. 1.
    Connect wallet on Blockchain A.
  2. 2.
    Complete Send transaction.
  3. 3.
    Connect wallet on Blockchain B.
  4. 4.
    Complete Receive transaction.

How does Allbridge work under the hood?

There are several types of token transfer possible with Allbridge:
  1. 1.
    Send Native tokens and receive Native tokens.
  2. 2.
    Send Native tokens and receive Wrapped (or minted) tokens.
  3. 3.
    Send Wrapped (or minted) tokens and receive Native tokens.
  4. 4.
    Send Wrapped (or minted) tokens and Receive Wrapped (or minted) tokens.

4 entities in the cross-chain token transfer process

  1. 1.
    User - EOA (Externally Owned Account) / Wallet from which the token X is transferred from one chain to another.
  2. 2.
    Blockchain A smart contract - a smart contract on the Source blockchain which receives transfer requests from the User.
  3. 3.
    Blockchain B smart contract - a smart contract on the Destination blockchain, which accepts the input from the User.
  4. 4.
    Validator - a server that is responsible for verifying Lock, Unlock, Mint, and Burn transactions on the bridge smart contracts.

1. Send Native tokens from Blockchain A and receive Native tokens on Blockchain B

This works similar to the usual DEX swap with 2 liquidity pools when we lock tokens in one liquidity pool and receive from the other. Except, that the token is the same and on different blockchains.
  1. 1.
    With the Send transaction, the User sends a request to the Blockchain A smart contract, where specifies the address of the wallet on the Blockchain B and the X tokens that must be sent to Blockchain B.
  2. 2.
    Blockchain A smart contract locks the received tokens from the User and creates a request log.
  3. 3.
    With the Receive transaction, the User asks Validator to check the request log.
  4. 4.
    Validator checks if funds were actually locked in the Blockchain A smart contract.
    1. 1.
      If they were, the Validator sends its signature to the User.
    2. 2.
      If they were not, the Validator replies with the message "Transaction is not found".
  5. 5.
    User sends the signature to the Blockchain B smart contract.
  6. 6.
    Blockchain B smart contract unlocks the requested amount of X tokens and sends them to the User right away.

2. Send Native tokens from Blockchain A and receive Wrapped (or minted) tokens on Blockchain B

  1. 1.
    With the Send transaction, the User sends a request to the Blockchain A smart contract, where specifies the address of the wallet on the Blockchain B and the X tokens that must be sent to Blockchain B.
  2. 2.
    Blockchain A smart contract locks the received tokens from the User and creates a request log.
  3. 3.
    With the Receive transaction, the User asks Validator to check the request log.
  4. 4.
    Validator checks if funds were actually locked in the Blockchain A smart contract.
    1. 1.
      If they were, the Validator sends its signature to the User.
    2. 2.
      If they were not, the Validator replies with the message "Transaction is not found".
  5. 5.
    User sends the signature to the Blockchain B smart contract.
  6. 6.
    Blockchain B smart contract mints the requested amount of wX tokens and sends them to the User right away.

3. Send Wrapped (or minted) tokens from Blockchain B and receive Native tokens on Blockchain A

  1. 1.
    With the Send transaction, the User sends a request to the Blockchain B smart contract, where specifies the address of the wallet on Blockchain A and the wX tokens that must be sent to Blockchain A.
  2. 2.
    Blockchain B smart contract burns the received tokens from the User and creates a request log.
  3. 3.
    With the Receive transaction, the User asks Validator to check the request log.
  4. 4.
    Validator checks if funds were actually burnt in the Blockchain B smart contract.
    1. 1.
      If they were, the Validator sends its signature to the User.
    2. 2.
      If they were not, the Validator replies with the message "Transaction is not found".
  5. 5.
    User sends the signature to the Blockchain A smart contract.
  6. 6.
    Blockchain A smart contract unlocks the requested amount of X tokens and sends them to the User right away.

4. Send Wrapped (or minted) tokens from Blockchain A and Receive Wrapped (or minted) tokens on Blockchain B

  1. 1.
    With the Send transaction, the User sends a request to the Blockchain A smart contract, where specifies the address of the wallet on Blockchain B and the w1X tokens that must be sent to Blockchain B.
  2. 2.
    Blockchain A smart contract burns the received tokens from the User and creates a request log.
  3. 3.
    With the Receive transaction, the User asks Validator to check the request log.
  4. 4.
    Validator checks if funds were actually burnt in the Blockchain A smart contract.
    1. 1.
      If they were, the Validator sends its signature to the User.
    2. 2.
      If they were not, the Validator replies with the message "Transaction is not found".
  5. 5.
    User sends the signature to the Blockchain B smart contract.
  6. 6.
    Blockchain B smart contract mints the requested amount of w2X tokens and sends them to the User right away.
Last modified 1mo ago