*This blog is a transcription of the December 2022 Pheasant blog here.
This is the second article of the Pheasant Network introduction series. Click here to read the first post.
2022 saw an explosion of Layer 2 technology despite the market downtown. Thanks to the dedicated engineers working on Layer 2 projects, the scalability issue, which used to be one of the main criticisms from blockchain opponents, is becoming yesterday’s problem. We, Pheasant Network, believe optimistic bridges have the potential to offer the most cost-efficient and secure way to boost scalability out of other Layer 2 solutions.
To help you learn the benefits of optimistic bridges, this post, a sequel to What are optimistic bridges? — Overview and what they offer, will cover how optimistic bridges work, citing Pheasant Network as an example. Let’s dive in!
🏁 Goal: Understanding how optimistic bridges and Pheasant Network work
👦 Target: Beginner to intermediate
📖 Summary:
We have already seen lots of bridge exploitations in the history of blockchain technology. What might be surprising is that in most cases, it takes the hacker only a single attack to snatch all of the protocol’s assets because most bridges employ a design that aggregates and keeps all of the tokens in one pool. This means that once malicious hackers find a way to access the pool in some way, they gain access to all of the assets and can easily exploit the entire pool, which makes bridges a juicy target for them. In addition, bridges with this “one-pool” design lead to lower resilience. It usually takes a long time to recover once they are hacked as the protocol loses all of its reserves, leading to a frustrating user experience.
Pheasant Network aims to solve this problem by making each relayer create an independent liquidity pool and protect and manage the liquidity in it with their own private keys so the network can prevent all the assets from being centralized in a single pool. This means that even if one of the relayers’ pools is compromised by a bad actor, the rest of the pools and protocol will keep operating as if nothing happened, and the network is safe from losing all of the assets. Furthermore, thanks to this system, even in the event of hacks there’s no need to halt the entire protocol.
Another safety feature unique to Pheasant’s bridge design is an actor named disputer, who monitors transactions and alerts the system when finding suspicious behaviors. Disputers discourage relayers from acting maliciously as relayers get slashed if disputers find a questionable transaction and can prove the invalidity of it. An optimistic bridge like Pheasant Network could not function without them.
At Pheasant Network, in the future, anyone can be a disputer including users. Users are often the first to spot any fraudulent-looking behavior since they can easily notice the absence of the sent assets in their address on the destination chain if a relayer steals the tokens and refuses to send them over. In addition to users, third parties can also serve as a disputer, preventing relayers from swindling and providing higher security and more resilience.
To achieve the aforementioned decentralized liquidity provision, Pheasant Network has chosen an optimistic approach as a communication method. In optimistic verification mechanisms, the protocol verifies transactions only when a suspicious transaction is found, resulting in lower calculation costs. This is much cheaper than burn-and-mint bridges, where they need to verify every burning transaction.
When users transfer tokens via burn-and-mint bridges, the value of wrapped tokens on the destination chain is collateralised by the tokens deposited on the origin chain. This means exploitation of the collateral on the origin chain could affect the value of the wrapped tokens on the target chain. Moreover, a transaction rollback, whether a burn or mint transaction, could cause a disrupting discrepancy in the total amount of tokens between the origin and target chain.
On the other hand, optimistic bridges like Pheasant Network, which do not adopt the “burn-and-mint” approach, are free from such intertwined disruptions, mitigating the risk of exploitation on one chain affecting the other. Although it is still possible for some bridging transactions to fail when a rollback occurs, Pheasant’s model hugely minimizes the overall effect on the whole ecosystem due to the compartmentalized structure.
As mentioned above, optimistic approaches offer safety and efficiency advantages over the burn-and-mint design. But how does it actually work? Now, let’s dive into how Pheasant Network achieves its advantages.
Pheasant Network consists of three participants — user, relayer and disputer.
Depending on which way assets are transferred, Pheasant Network employs two different communication mechanisms.
Click here to see the Sequence Diagram.
Pheasant Network has chosen a different mechanism for L1-to-L2 transfers from the L2-to-L1 design, which comes with a tradeoff of minor complexity because the L2-to-L1 model is not cost-effective enough for token transfers from Layer 1 to Layer 2 from the users’ perspective as it requires an escrow contract on Layer 1.
Unlike processing from Layer 2 to Layer 1, in the case of processing from Layer 1 to Layer 2, if the relayer does not send assets to the user on Layer 2 after a certain period of time has elapsed since the user sent assets to the relayer, it is possible to execute a slash.
Click here to see the Sequence Diagram.
In the current implementation, the disputing process is executed by the disputer-service client, which detects suspicious transactions and compares the submitted proof to the actual transaction. The disputing process follows the steps below.
After the verification process, if the disputer proves itself valid, the dishonest relayer will be slashed and the user’s compensation will be paid from the relayer’s bond, with the disputer receiving a reward for catching the malicious behavior.
The compartmentalized architecture and optimistic approach are the keys to Pheasant Network’s decentralized liquidity and safer, faster and more stable token transfers. We hope this article helps deepen your understanding of our network and optimistic bridges.
To achieve further decentralization, we would love your participation in the project. If you have any questions or suggestions, feel free to contact us via Twitter and Discord.
Pheasant Network offers an optimistic interoperability protocol designed to unify Layer 2 infrastructures with a comprehensive suite of solutions. Our optimistic Bridge-as-a-Service (BaaS) allows developers to seamlessly integrate native bridges and swap functionalities into their applications. A community-driven project, we focus on contributing long-term value to the Ethereum ecosystem and serving the public good.
Home | Website | Docs | Blog | GitHub | X | Discord | Telegram | L2 Learn
Intrigued by our blog and curious to learn more? Discover our product offerings.
Powered by its unique optimistic bridge protocol, Pheasant BaaS enables developers to seamlessly integrate a high-speed, cost-efficient bridge infrastructure directly into their applications.
Short on time or resources for bridge development? Try Pheasant Widget. It provides a user-friendly GUI to generate code for your custom bridge. No expertise needed.