Skip to content

Commit f08e7cb

Browse files
Ilaria EnacheIlaria Enache
Ilaria Enache
authored and
Ilaria Enache
committed
grammarly fixes
1 parent 214dd61 commit f08e7cb

File tree

1 file changed

+16
-21
lines changed

1 file changed

+16
-21
lines changed

learn/infrastructure/vaas.md

+16-21
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
---
22
title: VAAs
3-
description: Learn about Verified Action Approvals (VAAs) in Wormhole, their structure, validation, and role in cross-chain communication.
3+
description: Learn about Verified Action Approvals (VAAs) in Wormhole, their structure, validation, and role in cross-chain communication.
44
---
55

6-
<!--
7-
code boxes need to be displayed in another way
8-
[link](#){target=\_blank}
9-
-->
10-
116
# Verified Action Approvals
127

138
VAAs are Wormhole's core messaging primitive. They are packets of cross-chain data that are emitted any time a cross-chain application contract interacts with the Core Contract.
@@ -42,20 +37,20 @@ Where each `signature` is:
4237

4338
### Body
4439

45-
The body is _deterministically_ derived from an on-chain message. Any two Guardians must derive the exact same body. This requirement exists so that there is always a one-to-one relationship between VAAs and messages to avoid double processing of messages.
40+
The body is _deterministically_ derived from an on-chain message. Any two Guardians must derive the same body. This requirement exists so that there is always a one-to-one relationship between VAAs and messages to avoid double-processing of messages.
4641

4742
- `timestamp` ++"u32"++ - the timestamp of the block this message was published in
4843
- `nonce` ++"u32"++
4944
- `emitter_chain` ++"u16"++ - the id of the chain that emitted the message
5045
- `emitter_address` ++"[32]byte"++ - the contract address (wormhole formatted) that called the core contract
51-
- `sequence` ++"u64"++ - the auto incrementing integer that represents the number of messages published by this emitter
46+
- `sequence` ++"u64"++ - the auto-incrementing integer that represents the number of messages published by this emitter
5247
- `consistency_level` ++"u8"++ - the consistency level (finality) required by this emitter
5348
- `payload` ++"[]byte"++ - arbitrary bytes containing the data to be acted on
5449

55-
The body is the relevant information for consumers and is handed back from a call like `parseAndVerifyVAA`. Because the `emitterAddress` is included as part of the body, the developer is able to tell if this VAA originated from a trusted contract.
50+
The body contains relevant information for consumers and is handed back from a call like `parseAndVerifyVAA`. Because the `emitterAddress` is included as part of the body, the developer can tell if this VAA originated from a trusted contract.
5651

5752
!!! note
58-
Because VAAs have no destination, they are effectively multicast. They will be verified as authentic by any Core Contract on any chain in the network. If a VAA has a specific destination, it is entirely the responsibility of relayers to complete that delivery appropriately.
53+
Because VAAs have no destination, they are effectively multicast. Any Core Contract on any chain in the network will verify them as authentic. If a VAA has a specific destination, relayers are entirely responsible for completing that delivery appropriately.
5954

6055
## Signatures
6156

@@ -72,11 +67,11 @@ The body of the VAA is hashed twice with `keccak256` to produce the signed diges
7267

7368
## Payload Types
7469

75-
Different applications that are built on Wormhole may specify a format for the payloads attached to a VAA. This payload provides information on the target chain and contract so it can take some action (e.g., minting tokens to a receiver address).
70+
Different applications built on Wormhole may specify a format for the payloads attached to a VAA. This payload provides information on the target chain and contract so it can take action (e.g., minting tokens to a receiver address).
7671

7772
### Token Transfer
7873

79-
Tokens are transferred from one chain to another using a lockup/mint and burn/unlock mechanism. While many bridges work on this basic premise, this implementation achieves this by relying on the generic message-passing protocol provided by Wormhole to support routing the lock and burn events from one chain to another. This makes Wormhole's token bridge ultimately chain-agnostic. An implementation can be quickly incorporated into the network as long as a wormhole contract exists on the chain we wish to transfer to. Due to the generic message-passing nature of Wormhole, programs emitting messages do not need to know anything about the implementation details of any other chain.
74+
Tokens are transferred from one chain to another using a lockup/mint and burn/unlock mechanism. While many bridges work on this basic premise, this implementation achieves this by relying on the generic message-passing protocol provided by Wormhole to support routing the lock and burn events from one chain to another. This makes Wormhole's token bridge ultimately chain-agnostic. An implementation can be quickly incorporated into the network if a wormhole contract exists on the chain we wish to transfer to. Due to the generic message-passing nature of Wormhole, programs emitting messages do not need to know anything about the implementation details of any other chain.
8075

8176
To transfer tokens from A to B, we must lock the tokens on A and mint them on B. The tokens on A must be proven to be locked before the minting can occur on B. To facilitate this process, chain A first locks the tokens and emits a message indicating that the locking has been completed. This message has the following structure and is referred to as a transfer message:
8277

@@ -96,7 +91,7 @@ Note that Chain B is agnostic regarding how the tokens on the sending side were
9691

9792
The Transfer event above needs an important detail added. While the program on Chain B can trust the message to inform it of token lockup events, it has no way of knowing what the token being locked up actually is. The address alone is a meaningless value to most users. To solve this, the Token Bridge supports token attestation.
9893

99-
For a token attestation, Chain A emits a message containing metadata about a token which Chain B may use to preserve the name, symbol, and decimal precision of a token address.
94+
For a token attestation, Chain A emits a message containing metadata about a token, which Chain B may use to preserve the name, symbol, and decimal precision of a token address.
10095

10196
The message format for this action is as follows:
10297

@@ -110,23 +105,23 @@ The message format for this action is as follows:
110105
Attestations use a fixed-length byte array to encode UTF8 token name and symbol data.
111106

112107
!!! note
113-
Because the byte array is fixed length, the data contained may truncate multibyte unicode characters.
108+
Because the byte array is fixed length, the data contained may truncate multibyte Unicode characters.
114109

115110
When sending an attestation VAA, we recommend sending the longest UTF8 prefix that does NOT truncate a character and right-padding it with 0 bytes.
116111

117112
When parsing an attestation VAA, we recommend trimming all trailing 0 bytes and converting the remainder to UTF8 via any lossy algorithm.
118113

119114
!!! note
120-
Be mindful that different on-chain systems may have different VAA parsers, which may result in different names/symbols on different chains if the string is long or contains invalid UTF8.
115+
Be mindful that different on-chain systems may have different VAA parsers, resulting in different names/symbols on different chains if the string is long or contains invalid UTF8.
121116

122-
An essential detail of the token bridge is that an attestation is required before a token can be transferred. This is because without knowing a token's decimal precision, it is not possible for Chain B to correctly mint the correct amount of tokens when processing a transfer.
117+
An essential detail of the token bridge is that an attestation is required before a token can be transferred. Without knowing a token's decimal precision, Chain B cannot correctly mint the correct amount of tokens when processing a transfer.
123118

124119
### Token + Message
125120

126121
!!! note
127122
This VAA type is also referred to as a payload3 message or a Contract Controlled Transfer.
128123

129-
The Token + Message data structure is identical to the token-only data structure with the addition of a `payload` field that contains arbitrary bytes. This arbitrary byte field is where an app may include additional data in the transfer to inform some application-specific behavior.
124+
The Token + Message data structure is identical to the token-only data structure with the addition of a `payload` field containing arbitrary bytes. In this arbitrary byte field, an app may include additional data in the transfer to inform some application-specific behavior.
130125

131126
- `payload_id = 3` ++"u8"++ - token transfer with wessage
132127
- `amount` ++"u256"++ - amount of tokens being transferred
@@ -150,7 +145,7 @@ Governance messages contain pre-defined actions, which can target the various Wo
150145
- `chain` ++"u16"++ - chain the action is targeting, 0 = all chains
151146
- `args` ++"..."++ - arguments to the action
152147

153-
Here is an example message containing a governance action triggering a code upgrade to the Solana core contract. The module field here is a right-aligned encoding of the ASCII "Core", represented as a 32-byte hex string.
148+
Below is an example message containing a governance action triggering a code upgrade to the Solana core contract. The module field here is a right-aligned encoding of the ASCII "Core", represented as a 32-byte hex string.
154149

155150
```js
156151
--8<-- 'code/learn/infrastructure/VAAs/snippet-2.js'
@@ -161,7 +156,7 @@ Here is an example message containing a governance action triggering a code upgr
161156
The meaning of each numeric action is pre-defined and documented in the Wormhole design documents. For each application, the relevant definitions can be found via these links:
162157

163158
- Core governance actions are documented in the their [whitepaper](https://github.com/wormhole-foundation/wormhole/blob/main/whitepapers/0002_governance_messaging.md){target=\_blank}
164-
- Token Bridge governance actions are documented in the their [whitepaper](https://github.com/wormhole-foundation/wormhole/blob/main/whitepapers/0003_token_bridge.md){target=\_blank}
159+
- Token Bridge governance actions are documented in their [whitepaper](https://github.com/wormhole-foundation/wormhole/blob/main/whitepapers/0003_token_bridge.md){target=\_blank}
165160
- NFT Bridge governance actions are documented in their [whitepaper](https://github.com/wormhole-foundation/wormhole/blob/main/whitepapers/0006_nft_bridge.md){target=\_blank}
166161

167162
## Lifetime of a Message
@@ -172,6 +167,6 @@ The meaning of each numeric action is pre-defined and documented in the Wormhole
172167
With the concepts now defined, we can illustrate what a full flow for a message passing between two chains looks like. The following stages demonstrate each stage of processing the Wormhole network performs in order to route a message.
173168

174169
1. **A message is emitted by a contract running on chain A** - any contract can emit messages, and the Guardians are programmed to observe all chains for these events. Here, the Guardians are represented as a single entity to simplify the graphics, but the observation of the message must be performed individually by each of the 19 Guardians
175-
2. **Signatures are aggregated** - Guardians observe and sign the message independently. Once enough Guardians have signed the message, the collection of signatures are combined with the message and metadata to produce a VAA
176-
3. **VAA submitted to target chain** - the VAA acts as proof that the Guardians have collectively attested the existence of the message payload; in order to complete the final step, the VAA itself is submitted (or relayed) to the target chain to be processed by a receiving contract
170+
2. **Signatures are aggregated** - Guardians observe and sign the message independently. Once enough Guardians have signed the message, the collection of signatures is combined with the message and metadata to produce a VAA
171+
3. **VAA submitted to target chain** - the VAA acts as proof that the Guardians have collectively attested the existence of the message payload; to complete the final step, the VAA itself is submitted (or relayed) to the target chain to be processed by a receiving contract
177172

0 commit comments

Comments
 (0)