Relayers in the Evolving Modular Blockchain Stack
Note: This is a summary of Jim's talk at Modular Summit 2023 in Paris. Watch it here.
In the dynamic world of blockchain technology, the concept of cross-chain interoperability has emerged as a critical piece of the puzzle. At the heart of this concept lie the unsung heroes known as relayers.
As the modular blockchain thesis evolves, relayers are gaining newfound significance in ensuring seamless communication between disparate blockchain networks. In this blog post, we'll delve into the reasons why relayers have become so crucial and how they are adapting to the changing landscape.
The Growing Importance of Relayers
Traditionally, blockchain systems consisted of three layers: execution, data availability, and settlement.
However, the landscape has evolved into a more intricate modular stack with additional layers. One noteworthy addition is the transaction ordering layer popularized by shared sequencers like Espresso and Astria.
Polygon 2.0's release further exemplifies this trend by introducing more layers that can be modularized, such as proving, staking, and interoperability, expanding the stack to encompass six to seven layers.
The veracity of each layer's state within this modular structure needs to be verified. This verification process necessitates native verification through light clients. Consequently, sending a transaction now involves the verification of multiple layers–often ranging from six to seven–each of which relies on relayers to facilitate packet transfer across domains.
The Complex Role of Relayers
Amidst this intricate web of layers and verification processes, Catalyst is acutely aware of the escalating complexity within the modular blockchain stack. The verification of cross-chain transactions is becoming a more intricate endeavor, elevating the role of relayers to a new level of importance.
Current relayer systems, while functional, have room for improvement. Catalyst identifies three essential components that constitute an efficient relayer system:
- Calls Always Arrive: The timeliness of message delivery is of paramount importance. Ensuring that messages arrive within a reasonable time frame is a critical factor in maintaining a functional system.
- Transparent and Fair Pricing: Pricing structures should be clear, equitable, and easily understandable.
- Decentralized Relaying: Achieving sufficient decentralization in relaying is crucial. This involves reevaluating assumptions about the number of relayers required and addressing potential bottlenecks.
Calls Always Arrive
In a blockchain, messages or transactions are often relayed from one participant to another. These messages can include smart contract interactions, data transfers, or any other actions that need to be executed on a different blockchain.
In order to ensure a healthy cross-chain economy, these messages must be delivered promptly. Delays in message delivery can have significant implications, especially in time-sensitive operations or transactions. For example, consider a scenario where a user wants to perform a transaction to prevent liquidation or participate in a time-bound event on another blockchain. If the message isn't delivered in a timely manner, the user could miss out on important opportunities or even face financial losses.
Incentivizing Timely Delivery
To ensure that messages are delivered promptly, incentivization mechanisms are often put in place. Relayers are encouraged to prioritize the delivery of messages quickly by offering them incentives for doing so. These incentives can be in the form of transaction fees, rewards, or other tokens.
However, incentivizing timely delivery isn't just about offering rewards. It also involves creating a system where relayers are motivated to act promptly. This could involve designing economic models that align relayers' interests with the needs of users. For example, relayers might receive higher rewards for delivering urgent messages quickly.
Challenges and Considerations
Ensuring that calls always arrive is not without its challenges:
- Network Congestion: High network congestion can lead to delays in message propagation and confirmation, impacting the timely delivery of messages.
- Message Cancellation: There's also the possibility that messages might need to be canceled or timed out if they're no longer relevant. This introduces the challenge of managing message cancellations and designing recovery systems.
- Round-Trip Relaying: In some cases, a message might require a response to be sent back to the originating chain. Ensuring that both the outgoing and incoming messages arrive promptly adds complexity to the relaying process.
- Relayer Availability: The availability of relayers can also impact the timeliness of message delivery. A decentralized and robust network of relayers is essential to avoid bottlenecks.
- Coordination Across Blockchains: Coordinating the delivery of messages across different blockchains with varying consensus mechanisms and network speeds can be challenging.
Transparent and Fair Pricing
Transparency starts with providing users and participants with a clear understanding of how pricing is determined. The pricing structure should be communicated in a straightforward and user-friendly manner, enabling users to make informed decisions about utilizing relayer services. This might involve publishing pricing information on a user interface or platform, detailing the different components that contribute to the overall cost.
Pricing Algorithms
To achieve fairness and transparency, relayer systems often incorporate pricing algorithms. These algorithms use various factors to calculate the cost of relaying a message or transaction. Factors could include network congestion, the complexity of the message, gas costs, and other relevant metrics. By using algorithms, pricing can be dynamically adjusted based on the current network conditions, ensuring that users pay a reasonable fee regardless of the blockchain's state.
Bid-Ask System
A bid-ask system is another approach to pricing that allows users to set their desired price for relayer services. Users willing to pay a higher fee can submit bids, while relayers looking to provide their services can specify the minimum amount they are willing to accept (the ask price). This dynamic system enables market-driven pricing, where relayers compete for users' transactions based on their willingness to pay.
User-Determined Bounties and Escrows
In some cases, users might be allowed to set their own bounties or escrows to incentivize relayers to prioritize their transactions. This empowers users to have a direct influence on the pricing of their interactions with the blockchain network. The concept of user-determined bounties and escrows adds a layer of customization and control over the costs associated with their actions.
Handling Gas Costs
Gas costs are a fundamental part of blockchain transactions. Transparent pricing includes addressing how gas costs are handled. This could involve estimating the gas needed for both the source and destination chains and providing a breakdown of how these costs contribute to the overall fee. Additionally, any excess gas should ideally be refunded to users to ensure they're only charged for what was actually consumed.
Trust in Pricing Algorithms
While pricing algorithms can contribute to transparency, there's also a need to address trust in these algorithms. Users should have confidence that the algorithms are not biased or manipulated to their disadvantage. Clearly explaining how pricing is determined and potentially involving external audits or governance mechanisms can help establish this trust.
Incorporating these elements into the relayer system ensures that users are well-informed about the costs associated with their interactions and that pricing is fair and reasonable for both users and relayers. Transparent and fair pricing promotes a healthy and sustainable relayer ecosystem, where participants are motivated to engage in cross-chain transactions with confidence and clarity.
Decentralized Relaying
Sufficient decentralization is pivotal for the health of the modular blockchain world. While some interoperability protocols adopt 1/1 relaying, others lean towards 1/N, albeit with a limited number of N. Many core teams and validators within the interoperability protocol ecosystem operate their own relayers, highlighting the value of a decentralized approach.
A decentralized relaying component contributes to a more robust and democratic cross-chain ecosystem. It minimizes the concentration of power, reduces the risk of censorship, enhances network security, and fosters innovation. As a result, users can engage in cross-chain transactions with the confidence that their interactions are facilitated by a diverse and distributed network of relayers.
Avoiding Centralization and Bottlenecks
Centralization can lead to inefficiencies, vulnerabilities, and the potential for abuse or manipulation. To counter these issues, the decentralized relaying component focuses on distributing the responsibility of relaying transactions among many participants, thereby preventing any single entity from having undue control or influence.
Bottlenecks occur when a limited number of relayers handle a high volume of transactions, causing congestion and delays. A decentralized approach encourages a larger number of relayers to participate, spreading the workload and enhancing the system's capacity to handle more transactions simultaneously.
Permissionless Participation
Decentralized relaying promotes permissionless participation, meaning that anyone can become a relayer without requiring explicit authorization. This openness encourages a diverse range of participants to join the network, fostering competition, innovation, and resilience.
Incentives for Participation
To ensure a healthy decentralized relaying ecosystem, incentives are provided to encourage individuals or entities to become relayers. These incentives might come in the form of transaction fees, rewards, or tokens. Well-designed incentive mechanisms align participants' interests with the broader goals of the network.
Resilience and Security
A decentralized network is inherently more resilient to attacks, failures, and disruptions. If one relayer experiences issues, others can step in to continue processing transactions. This helps maintain the overall functionality of the system, especially during times of high demand or network congestion.
Challenges and Considerations
Creating a truly decentralized relaying ecosystem comes with its own set of challenges:
- Relayer Quality: Ensuring the reliability and quality of decentralized relayers is crucial. Mechanisms for evaluating relayer performance and reputation might be necessary.
- Network Coordination: Coordinating the actions of decentralized relayers across different blockchains requires effective protocols and standards.
- Incentive Alignment: Designing incentives that strike a balance between attracting participants and preventing malicious behavior can be complex.
- Ease of Participation: Simplifying the process for becoming a relayer can encourage broader participation and reduce barriers to entry.
- Governance and Upgrades: Implementing decentralized decision-making mechanisms for upgrades, changes, and improvements to the relayer system is important to ensure ongoing network health.
Towards an Ideal User Experience
A user-centric approach to relaying is essential for a robust and seamless cross-chain experience. Catalyst envisions an ideal user experience centered around conditional payments.
The concept of conditional payments revolves around providing users with a clear and transparent pricing structure while ensuring that the relayed transaction is successfully executed. Here's how it works:
- Price Quote Generation: The process begins with generating a price quote for the relayer's services. This involves estimating the cost of relaying the message across different chains, factoring in elements like gas fees and network conditions.
- Catalyst Integration: Catalyst, a tool or algorithm, is used to determine the estimated gas costs associated with the transaction on both the source and destination chains. This provides a more accurate estimation of the overall costs involved.
- Escrow on Source Chain: The user's payment is escrowed on the source chain. This escrow ensures that the user is committed to the transaction, and the funds are available for the relayer's services.
- Time Decay Incentive: To encourage prompt and cost-effective relaying, the escrow is designed with a time decay mechanism. As time passes, the incentive for the relayer to execute the transaction quickly and efficiently increases, as they receive a larger reward.
- Release Upon Successful Relaying: The relayer must provide evidence of successfully relaying the transaction to the destination chain. This evidence triggers the release of the escrowed funds to the relayer, completing the conditional payment.
The user-centric approach to conditional payments offers several advantages:
- Transparency: Users have a clear understanding of the costs associated with their transactions, as the pricing is based on objective estimates and calculations.
- Incentivized Relaying: Time decay incentivizes relayers to process transactions promptly, enhancing the efficiency of the cross-chain ecosystem.
- Trust-Minimized Design: The conditional payment model reduces the need for users to trust relayers blindly. Payments are released only upon successful execution, ensuring that relayers fulfill their responsibilities.
- Reduced Friction: The streamlined process simplifies user interactions, reducing friction and potential confusion.
Exploring MEV as a Compensation Mechanism
An intriguing possibility in the realm of relaying is the utilization of Miner Extractable Value (MEV) as a compensation mechanism. This involves an order flow auction (OFA) where relayers bid to relay packets and bundle them for submission to the destination chain.
Relayers can bid to relay packets and bundle them in a specific order for submission to the destination chain. This auction-style mechanism rewards relayers who can efficiently arrange transactions to maximize their extracted value.
While this introduces a degree of complexity around censorship resistance and rewards time-sensitive transactions, it necessitates a sufficient volume of transactions to remain viable.
In addition, in scenarios where certain transactions are time-sensitive, relayers can prioritize transactions to prevent liquidation or facilitate other urgent actions. This censorship MEV ensures that users' critical transactions are processed swiftly.