Mails constitute a request made from chain A over to chain B. A mail consists of an envelope, a letter, and a stamp, each entailing details specifying the request.

Mail Lifecycle
The lifecycle of a mail can be compared to the lifecycle of a real-world post office mail.
The mail sender prepares an envelope specifying the letter details such as the destination, package type, who has the authority to open the envelope, etc.
A letter encompassing data or execution instructions is packaged in the envelope and sent to a xAccount (analogous to a post office).
The xAccount stamps the enclosed envelope with the mail sender and xAccount's credentials, which then the mail is then reformatted to a structure transmissible through a messaging bridge.
Structure
pub struct Mail {
envelope: Envelope,
letter: Letter,
stamp: Option<Stamp>,
status: MailingStatus,
response: Option<MailId>
}
envelope
Envelope
Envelope of mail
letter
Letter
Letter of mail
stamp
*
Stamp
Stamp of mail. Filled in after stamped by xAccount.
status
MailingStatus
Status of mail. Can be one of Pending, Complete, or Failed.
response
*
MailId
Unique identifier of the mail who is the response of this mail. Filled in once response mail is received.
* = optional
MailingStatus
MailingStatus
Defines which status the mail is currently in.
pub enum MailingStatus {
Pending,
Complete,
Failed
}
Pending
Mail is on its way to destination.
Complete
Mail has either been sent out without expecting a response, or a successful response has been received.
Failed
Mail has either failed to be sent, or a failed response has been received.
MailId
MailId
Acts as a unique identifier key for individual mails (there can only exist 1 unique VAA sequence number per chain).
pub struct MailId {
pub wormhole_id: u64,
pub sequence: u64,
}
chain_id
u64
Wormhole chain ID of blockchain (e.g. 2 for Ethereum mainnet)
sequence
u64
Sequence number of mail's Wormhole VAA
AccountInfo
AccountInfo
Struct that holds wormhole-compatible account information.
pub struct AccountInfo{
pub wormhole_id: u64, // 2 for ethereum
pub address_byte_length: u8, // 20 for evm addresses, 32 for some cosmos addresses
pub address: Binary, // 000000000000000000000000d34db33f... for 20-byte addresses
}}
wormhole_id
u64
Wormhole chain ID of blockchain (e.g. 2 for Ethereum mainnet)
address_byte_length
u8
number of non-padded-zero bytes in the address
address
Bin
bytes representation of address; left-padded with zeros to fixed length of 32
Last updated