As the world moves from outdated centralised finance to the freedom of DeFi, cross-chain bridges play a crucial role by enabling people to access new blockchains using the funds they’ve already bought and earned. Each blockchain is an island with its own code and rules; bridges allow these ecosystems to communicate.
As mentioned in an earlier edition of RhinoLearn, DeFi bridges come in several different structures and vary significantly according to their transfer type and trust assumptions. Although the concept of ‘locking and minting’ (locking up tokens on one side of the bridges and creating new ones on the other side) is now relatively well-known, there are several other ways to transfer data and value between different chains.
At rhino.fi, we’ve developed a system based on collateralised bridges and liquidity outposts, pools of tokens we’ve established on different chains from our own funds. This facilitates a simple bridging process, triggered by smart contracts: essentially, a user supplies rhino.fi with funds on one chain and then rhino.fi provides funds from our own pool on another chain, via StarkEx.
The reason we have chosen this approach is because the methodology can be applied to any chain, which means it is simple to on-board new chains. It’s also quick: as soon as the user deposits, we give them funds on Rhino, and as soon as they withdraw we give them something on-chain. Deposits may take a minute, while withdrawals can take just a few seconds.
What role do smart contracts play?
Smart contracts are software programmes trained to provide certain DeFi services automatically once their specific criteria are met. Once the user has made their request, and provided they have sufficient funds, the contract may execute a trade, carry out a swap or invest in a yield opportunity.
These contracts are fundamental to the whole of DeFi, and particularly to rhino.fi. Our smart contracts enable our users to trigger each of the key services on our platform, providing they have the requisite funds to do so.
Here’s a simple overview of how our smart contracts work for bridges:
- Rhino.fi builds a bespoke smart contract to move funds between our platform and each new chain we add.
- These contracts enable users to deposit their funds on the bridge, and rhino.fi then provides an equivalent value of the same token on their chain of choice.
What role does StarkEx play?
Rhino.fi is built on StarkEx, a Layer 2 scalability rollup which takes transactions off the main Ethereum blockchain, processes them in bulk using zero-knowledge validation, before posting a single proof of all the transactions back on Layer 1.
Transactions can be processed far more quickly than would be possible on Layer 1, while inheriting the same security features as the main blockchain. Furthermore, StarkEx’s zero-knowledge validation system can prove a transaction without revealing the details of either party, which provides added privacy and security.
For bridging, StarkEx provides the central hub in this system. Users supply tokens to StarkEx and receive tokens in return, rather than interacting with their chosen chain directly.
This results in greater efficiency for the user, and avoids the need to pay native gas tokens when moving between chains.
How we protect our bridges
Our bridge is authorised, which means that only rhino.fi can issue withdrawals to our bridges.
Also, we use our own funds as collateral. In the brief history of DeFi, cross-chain bridges have suffered a small number of security exploits. But even if this were to happen on rhino.fi (and, as we’ll mention below, we’ve put robust measures in place against this), the liquidity would come from rhino.fi, not our users.
The trusted elements to our bridges
Self-custody is crucial to rhino.fi. Unlike centralised crypto exchanges, we allow you to keep full control of your funds, and our system of smart contracts and user signatures is fundamental to this.
Nonetheless, there is a small trusted element in the bridging process.
As mentioned, our users give rhino.fi assets on their origin chain and rhino.fi provides their desired assets on their destination chain. In other words, the user gives us tokens and trusts that we will give them tokens on another chain.
This trusted element is necessary to ensure speed: if the process were totally trustless, it could take as much as 20 minutes to move from one side of the bridge to the other.
What are the risks of our bridges?
The risks of bridging on rhino.fi are the same as those of any other contract that has control over users’ funds, notably the risk of hacks.
To minimise these risks, rhino.fi has put rigorous checks in place and we attempt to avoid pushing any unnecessary changes. Our contract changes are rigorously audited internally prior to release, and receive regular external audits from industry-leading blockchain security experts, such as PeckShield.
And…. that’s it!
We hope we’ve answered all your questions and given you a full account of how bridging works on rhino.fi.
We’re not saying we’ve got the best cross-chain bridge in crypto (that’s for our users to decide, not us) but we think our structure is simple yet reliable, and provides transparency at both ends (as well as all points in between).
If you’d like some more information, check out our ‘What are bridges in crypto?’ post for a basic guide. And, as we mentioned above, our post on the safety of DeFi bridges is worth a read if you want something more advanced.
And if you’d like to discuss any topic related to bridges in DeFi with us, please reach out via Twitter or Discord.