How does oPortal work？
BoringDAO oPortal provides cross-chain bridging solutions that enable assets to be freely transferred between blockchains. There are two types of Smart Bridge: Two-Way Bridge and Native Bridge.
Two-Way Bridge allows users to move their assets between any L1s and L2s, in a cost efficient and timely manner.
Learn more about Two-Way Bridge
Native Bridge provides frictionless interoperability between different blockchain networks. It is characterized by directly mapping the token from one chain to another, without requiring the issuance of intermediate assets.
ETH to BSC
- 1.Let's say Alice calls the lock function of the CrossLock contract on Ethereum.
- 2.It will lock Token A in the contract, and then issue a Lock event. BoringDAO runs node1, and the team of Token A runs node2. These two nodes will monitor the Lock event of the Ethereum CrossLock contract.
- 3.The Bridge in the figure is a smart contract located on the BSC network. Once the Lock event is monitored, the crossMint function of the Bridge contract will be called respectively. Only the Crosser role can call crossMint because it uses openzeppelin's AcessControl for role assignment.
- 4.Roles will be assigned to node1 and node2 and when they call crossMint, they are actually voting on this cross-chain transaction. Only when both agreed, it can pass.
- 5.When the vote is passed, the bridge contract will call the mint function of the BSC Token A contract. The Token A team has to deploy the Token A contract on BSC in advance so that allows the Bridge contract to perform mint and burn operations on it.
- 6.If the mint function of the BSC Token A contract is called successfully, Token A will be sent to the BSC address of Alice.
BSC to ETH
- 1.Alice calls the crossBurn function of the Bridge contract
- 2.The Bridge contract calls the burn function of the BSC Token A contract to burn Alice's token.
- 3.The Bridge contract issues a CrossBurn event.
- 4.Node1 and node2 are runned and controlled by the BoringDAO and Token A team respectively, and they will monitor the CrossBurn event. When both nodes listen to the CrossBurn event, they will each call the unlock function of the CrossLock contract on Ethereum.
- 5.Only node1 and node2 can call the unlock function and their permission will be checked in the function. When the unlock function is called, both nodes will vote on this cross-chain transaction and it will only be passed when they both agree.
- 6.Once the vote is passed, Token A, originally locked in the contract, will be unlocked and transferred to Alice.
There will be cost associated with running Smart Bridge Node and calling related contracts, hence the charge for the Native Bridge will be determined by both BoringDAO and the partner team.
Learn more about Native Bridge