Skip to content

Commit 3b37b0a

Browse files
Ilaria EnacheIlaria Enache
Ilaria Enache
authored and
Ilaria Enache
committed
grammarly check and minor fixes
1 parent f98adbd commit 3b37b0a

File tree

1 file changed

+21
-30
lines changed

1 file changed

+21
-30
lines changed

learn/infrastructure/relayer.md

+21-30
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
---
22
title: Relayers
3-
description:
3+
description: Discover the role and types of relayers in the Wormhole network, including client-side, specialized, and standard relayers, facilitating secure cross-chain communication.
44
---
55

6-
<!--
7-
[link](#){target=\_blank}
8-
`
9-
!!! note
10-
```js
11-
--8<-- 'code/learn/infrastructure/VAAs/header.js'
12-
```
13-
-->
14-
156
# Relayers
167

178
This documentation provides a comprehensive guide to Relayers within the Wormhole network, describing their role, types, and benefits in facilitating cross-chain processes.
@@ -21,7 +12,7 @@ Relayers in the Wormhole context are processes that deliver Verifiable Action Ap
2112
There are three primary types of relayers discussed:
2213

2314
- **Client-side Relaying** - a cost-efficient, no-backend-infrastructure approach relying on user-facing front ends. It provides a simple solution, although it can complicate the user experience due to the manual steps involved
24-
- **Specialized Relayers** - they are backend components that handle parts of the cross-chain process, offering a smoother user experience and allowing off-chain calculations to reduce gas costs. These relayers could operate through direct listening to the Guardian Network (Spy Relaying) or by providing a REST endpoint to accept VAAs to be relayed (REST Relaying)
15+
- **Specialized Relayers** - backend components that handle parts of the cross-chain process, offering a smoother user experience and allowing off-chain calculations to reduce gas costs. These relayers could operate through direct listening to the Guardian Network (Spy Relaying) or by providing a REST endpoint to accept VAAs to be relayed (REST Relaying)
2516
- **Standard Relayers** - a decentralized relayer network that can deliver arbitrary VAAs, reducing the developer's need to develop, host, or maintain relayers. However, they require all calculations to be done on-chain and might be less gas-efficient
2617

2718
## Fundamentals
@@ -39,48 +30,48 @@ Key characteristics of VAAs include:
3930

4031
When designing contracts, it's crucial to only trust information contained within your contract or a VAA. Relying on information from a relayer could expose you to untrusted input attacks.
4132

42-
Advanced strategies can involve having relayers perform untrusted off-chain computation, which is passed into the destination contract. These strategies can optimize gas costs but can also create attack vectors if not used correctly.
33+
Advanced strategies can involve relayers performing untrusted off-chain computation passed into the destination contract. These strategies can optimize gas costs but also create attack vectors if not used correctly.
4334

44-
In summary, the design of a relayer should ensure there's a single, deterministic way that messages in your protocol can be processed. In an optimally designed protocol, relayers should have a 'correct' implementation, mirroring "crank turner" processes used elsewhere in blockchain.
35+
In summary, the design of a relayer should ensure that there's a single, deterministic way to process messages in your protocol. In an optimally designed protocol, relayers should have a 'correct' implementation, mirroring "crank turner" processes used elsewhere in blockchain.
4536

4637
## Client-side Relaying
4738

48-
Client-side relaying relies on user-facing front ends, such as a webpage or a wallet, to carry out the complete cross-chain process.
39+
Client-side relaying relies on user-facing front ends, such as a webpage or a wallet, to complete the cross-chain process.
4940

50-
### Key Features
41+
**Key Features**
5142

52-
- **Cost-Efficiency** - Users only pay for the transaction fee for the second transaction, eliminating any additional costs.
53-
- **No Backend Infrastructure** - The process is completely client-based, eliminating the need for a backend relaying infrastructure.
43+
- **Cost-Efficiency** - users only pay the transaction fee for the second transaction, eliminating any additional costs
44+
- **No Backend Infrastructure** - the process is completely client-based, eliminating the need for a backend relaying infrastructure
5445

55-
### Implementation
46+
**Implementation**
5647

5748
Users themselves carry out the three steps of the cross-chain process:
5849

5950
1. Perform an action on chain A
6051
2. Retrieve the resulting VAA from the Guardian Network
6152
3. Perform an action on chain B using the VAA
6253

63-
### Considerations
54+
**Considerations**
6455

6556
!!! note
66-
Though simple, this type of relaying is generally not recommended if your aim is a highly-polished user experience. It can, however, be useful for getting a Minimum Viable Product (MVP) up and running.
57+
Though simple, this type of relaying is generally not recommended if your aim is a highly polished user experience. It can, however, be useful for getting a Minimum Viable Product (MVP) up and running.
6758

6859
- Users must sign all required transactions with their own wallet
6960
- Users must have funds to pay the transaction fees on every chain involved
7061
- The user experience may be cumbersome due to the manual steps involved
7162

7263
## Specialized Relayers
7364

74-
Specialized relayers are purpose-built components within the Wormhole protocol, designed to relay messages for specific applications. They are capable of performing off-chain computations and can be customized to suit a variety of use-cases.
65+
Specialized relayers are purpose-built components within the Wormhole protocol, designed to relay messages for specific applications. They are capable of performing off-chain computations and can be customized to suit a variety of use cases.
7566

76-
### Key Features
67+
**Key Features**
7768

7869
- **Optimization** - capable of performing untrusted off-chain computations which can optimize gas costs
7970
- **Customizability** - allows for specific strategies like batching, conditional delivery, multi-chain deliveries, and more
8071
- **Incentive Structure** - developers have the freedom to design an incentive structure suitable for their application
8172
- **Enhanced UX** - the ability to perform steps 2 and 3 of the cross-chain process on behalf of the user can simplify the user experience
8273

83-
### Implementation
74+
**Implementation**
8475

8576
!!! note
8677
To make the development of specialized relayers easier, a plugin relayer is available in the [main Wormhole repository](#){target=\_blank}. This sets up the basic infrastructure for relaying, allowing developers to focus on implementing the specific logic for their application.
@@ -90,34 +81,34 @@ There are two main methods of setting up a specialized relayer:
9081
- **Spy Relaying** - involves listening directly to the Guardian Network via a spy
9182
- **REST Relaying** - provides a REST endpoint to accept a VAA that should be relayed
9283

93-
### Considerations
84+
**Considerations**
9485

95-
Remember, despite their name, specialized relayers are still considered untrusted. VAAs are public and can be submitted by anyone, so developers should not rely on off-chain relayers to perform any computation which is considered "trusted".
86+
Remember, despite their name, specialized relayers still need to be considered untrusted. VAAs are public and can be submitted by anyone, so developers should not rely on off-chain relayers to perform any computation considered "trusted."
9687

9788
- Development work and hosting of relayers are required
9889
- The fee-modeling can become complex, as relayers are responsible for paying target chain fees
99-
- Relayers are responsible for liveness, adding an additional dependency for the cross chain application
90+
- Relayers are responsible for liveness, adding dependency for the cross-chain application
10091

10192
## Standard Relayers
10293

10394
Standard relayers are a component of a decentralized network in the Wormhole protocol, facilitating the delivery of Verifiable Action Approvals (VAAs) to recipient contracts compatible with the standard relayer API.
10495

105-
### Key Features
96+
**Key Features**
10697

10798
- **Lower Operational Costs** - no need to develop, host, or maintain individual relayers
10899
- **Simplified Integration** - because there is no need to run a relayer, integration is as simple as calling a function and implementing an interface
109100

110-
### Implementation
101+
**Implementation**
111102

112103
The standard relayer integration involves two key steps:
113104

114105
- **Delivery Request** - request delivery from the Wormhole Relay Ecosystem Contract
115106
- **Relay Reception** - implement a [receiveWormholeMessages](#){target=\_blank} function within their contracts. This function is invoked upon successful relay of the VAA
116107

117-
### Considerations
108+
**Considerations**
118109

119110
!!! note
120-
Developers should note that the choice of relayers depends on the specific requirements and constraints of their project. Standard relayers offer simplicity and convenience but might limit customization and optimization opportunities compared to specialized relayers.
111+
Developers should note that the choice of relayers depends their project's specific requirements and constraints. Standard relayers offer simplicity and convenience but limit customization and optimization opportunities compared to specialized relayers.
121112

122113
- All computations are performed on-chain
123114
- Potentially less gas-efficient compared to specialized relayers

0 commit comments

Comments
 (0)