You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: learn/infrastructure/relayer.md
+21-30
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,8 @@
1
1
---
2
2
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.
4
4
---
5
5
6
-
<!--
7
-
[link](#){target=\_blank}
8
-
`
9
-
!!! note
10
-
```js
11
-
--8<-- 'code/learn/infrastructure/VAAs/header.js'
12
-
```
13
-
-->
14
-
15
6
# Relayers
16
7
17
8
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
21
12
There are three primary types of relayers discussed:
22
13
23
14
-**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)
25
16
-**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
26
17
27
18
## Fundamentals
@@ -39,48 +30,48 @@ Key characteristics of VAAs include:
39
30
40
31
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.
41
32
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 computationpassed into the destination contract. These strategies can optimize gas costs but also create attack vectors if not used correctly.
43
34
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.
45
36
46
37
## Client-side Relaying
47
38
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.
49
40
50
-
### Key Features
41
+
**Key Features**
51
42
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
54
45
55
-
### Implementation
46
+
**Implementation**
56
47
57
48
Users themselves carry out the three steps of the cross-chain process:
58
49
59
50
1. Perform an action on chain A
60
51
2. Retrieve the resulting VAA from the Guardian Network
61
52
3. Perform an action on chain B using the VAA
62
53
63
-
### Considerations
54
+
**Considerations**
64
55
65
56
!!! 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 highlypolished user experience. It can, however, be useful for getting a Minimum Viable Product (MVP) up and running.
67
58
68
59
- Users must sign all required transactions with their own wallet
69
60
- Users must have funds to pay the transaction fees on every chain involved
70
61
- The user experience may be cumbersome due to the manual steps involved
71
62
72
63
## Specialized Relayers
73
64
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 usecases.
75
66
76
-
### Key Features
67
+
**Key Features**
77
68
78
69
-**Optimization** - capable of performing untrusted off-chain computations which can optimize gas costs
79
70
-**Customizability** - allows for specific strategies like batching, conditional delivery, multi-chain deliveries, and more
80
71
-**Incentive Structure** - developers have the freedom to design an incentive structure suitable for their application
81
72
-**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
82
73
83
-
### Implementation
74
+
**Implementation**
84
75
85
76
!!! note
86
77
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:
90
81
-**Spy Relaying** - involves listening directly to the Guardian Network via a spy
91
82
-**REST Relaying** - provides a REST endpoint to accept a VAA that should be relayed
92
83
93
-
### Considerations
84
+
**Considerations**
94
85
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."
96
87
97
88
- Development work and hosting of relayers are required
98
89
- 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 crosschain application
90
+
- Relayers are responsible for liveness, adding dependency for the cross-chain application
100
91
101
92
## Standard Relayers
102
93
103
94
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.
104
95
105
-
### Key Features
96
+
**Key Features**
106
97
107
98
-**Lower Operational Costs** - no need to develop, host, or maintain individual relayers
108
99
-**Simplified Integration** - because there is no need to run a relayer, integration is as simple as calling a function and implementing an interface
109
100
110
-
### Implementation
101
+
**Implementation**
111
102
112
103
The standard relayer integration involves two key steps:
113
104
114
105
-**Delivery Request** - request delivery from the Wormhole Relay Ecosystem Contract
115
106
-**Relay Reception** - implement a [receiveWormholeMessages](#){target=\_blank} function within their contracts. This function is invoked upon successful relay of the VAA
116
107
117
-
### Considerations
108
+
**Considerations**
118
109
119
110
!!! 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.
121
112
122
113
- All computations are performed on-chain
123
114
- Potentially less gas-efficient compared to specialized relayers
0 commit comments