How does oPortal work?
Last updated
Last updated
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.
Let's say Alice calls the lock function of the CrossLock contract on Ethereum.
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.
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.
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.
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.
If the mint function of the BSC Token A contract is called successfully, Token A will be sent to the BSC address of Alice.
Alice calls the crossBurn function of the Bridge contract
The Bridge contract calls the burn function of the BSC Token A contract to burn Alice's token.
The Bridge contract issues a CrossBurn event.
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.
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.
Once the vote is passed, Token A, originally locked in the contract, will be unlocked and transferred to Alice.
Submit your request here and get your token added to the bridge → https://docs.google.com/forms/d/e/1FAIpQLSdNq8WIq8uafyrC1EpqXkug4iddzWtQou42sSlj14DyhFDnLw/viewform
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