Message (Application)
The message is the raw, original content or instruction as defined by the application inbytes. It represents the core data that the sender intends to deliver to the recipient via the LayerZero Endpoint:
Packet (Endpoint)
The Packet is the protocol-level container that wraps the application’s message along with additional metadata necessary for secure and reliable crosschain communication. The standard Packet structure is defined as follows in the LayerZero Endpoint:Payload (Message Libraries)
The payload is the encoded representation of the key components of the Packet that the messaging libraries operate on. In many library implementations (for example, in the Ultra Light Node), the payload is created by serializing specific elements of the Packet (typically the GUID followed by the actual application message) into a compact binary format:Packet Structure and Its Benefits
Standardizing the Packet structure brings several advantages:-
Ordering and Routing:
Fields likenonce,srcEid,dstEid, andreceiverensure that messages are delivered in the correct order to the proper destination, while also mitigating replay attacks. -
Traceability:
The inclusion of a uniqueguidalong with source and destination identifiers allows each message to be tracked across chains, providing a robust audit trail that enhances debugging and system trust. -
Payload Integrity:
Themessagefield carries the actual application data, and when the Packet is processed by a messaging library, its contents are split into two parts:- Packet Header: Contains essential routing and identification metadata.
- Payload: Comprises the encoded version of the GUID and the application’s message.
Summary
-
Message:
The raw application data or instruction that needs to be communicated. -
Packet:
The complete protocol container that encapsulates the message along with metadata (nonce, endpoint IDs, sender, receiver, and a global identifier) required for secure and orderly crosschain communication. -
Payload:
The encoded portion (typically a serialization of the GUID and message) that is generated by the messaging library and used for efficient data transmission and processing.