Skip to Content
DocumentationAnalog GMPOverviewTransaction Lifecycle

Transaction Lifecycle

Transaction Lifecycle

The transaction flow for cross-chain message transmission involves three key components: Gateway, Executor, and GMP Receiver.

Source Chain

  1. Message Initiation: A user or contract on the source chain calls the submitMessage() function on the IGateway interface, providing:
    1. Destination address
    2. Destination network ID
    3. Execution gas limit
    4. Message payload data
  2. Message Processing: The Gateway:
    1. Calculates the gas cost using estimateMessageCost()
    2. Generates a unique message ID (EIP-712 hash)
    3. Assigns a sequential nonce to ensure uniqueness
    4. Emits a GmpCreated event with all message details
    5. Returns the message ID to the caller

Cross-Chain Transmission

  1. Message Relay: Behind the scenes, the message is picked up by the Timechain:
    1. The message details are observed by Timechain shards (Chronicle Nodes)
    2. Shards validate and sign the message using signatures
    3. The Timechain prepares the message for delivery to the destination chain

Destination Chain

  1. Message Execution: On the destination chain, the IExecutor interface:

    1. Receives the signed message via execute or batchExecute() with a signature and InboundMessage
    2. Verifies the signature against registered shards (TSS keys)
    3. Processes the message according to registered routes
    4. Forwards the message to the appropriate destination address
  2. Message Receipt: The destination contract (implementing IGmpReceiver):

    1. Receives the message via onGmpReceived() function
    2. Validates that the caller is the authorized Gateway contract
    3. Processes the message payload
    4. Returns a 32-byte result
  3. Execution Confirmation: The Executor:

    1. Captures the execution result
    2. Updates the message status
    3. Emits a GmpExecuted event with the message ID, source, destination, status, and result
    4. Emits a BatchExecuted event for the batch containing the message