Skip to content

Core Bridging Process

The transfer of $M (or its extensions like Wrapped $M) between the Hub and Spoke chains follows specific processes orchestrated by the Portals and Wormhole NTT.

Transfer: Hub Chain -> Spoke Chain

Hub & Spoke Architecture
  1. User Interaction (Steps 1 & 2): The user initiates a transfer by calling a function on the HubPortal contract on Ethereum, specifying the destination Spoke chain and amount. This typically involves approving the HubPortal to spend their $M or Wrapped $M, followed by the transfer call.
  2. Token Handling (Steps 2.1 & 3):
    • If the user transferred Wrapped $M (or another $M extension with an unwrap function), the HubPortal first unwraps it to the native $M token
    • The native $M tokens are then transferred from the user and locked within the HubPortal contract.
  3. Message Creation & Sending (Steps 4 & 5):
    • The HubPortal constructs a Wormhole NTT message containing transfer details (amount, recipient, destination chain) and potentially additional metadata (like the current $M Index).
    • It interacts with the Wormhole Transceiver (IWormholeTransceiver) component via the inherited NttManager logic (e.g., _sendTransfer) to publish this message to the Wormhole network.
  4. Wormhole Relaying (Off-Chain): Wormhole Guardians observe the message, attest to its validity, and relayers (potentially standard Wormhole relayers) pick up the attested message (VAA) for delivery to the destination Spoke chain.
  5. Message Reception & Processing (Step 6):
    • The Wormhole Transceiver on the Spoke chain receives the attested message.
    • It verifies the message and passes it to the SpokePortal (via receiveMessage or similar entry point in the NttManager).
  6. Token Minting & Delivery (Steps 7, 7.1 & 8):
    • The SpokePortal processes the NTT message (e.g., within _receiveMToken or _handleAttestedTransfer).
    • It mints the corresponding amount of the $M token representation on the Spoke chain.
    • If the original transfer initiated on the Hub was for Wrapped $M, the SpokePortal wraps the newly minted $M back into Wrapped $M.
    • The minted $M (or its wrapped form) is transferred to the recipient address on the Spoke chain.

Transfer: Spoke Chain -> Hub Chain

  1. User Interaction: The user initiates a transfer on the Spoke chain by calling the SpokePortal, approving the token spend first.
  2. Token Handling:
    • If transferring Wrapped $M, the SpokePortal unwraps it to the Spoke chain's native $M representation.
    • The native $M tokens are then burned by the SpokePortal.
  3. Message Creation & Sending: The SpokePortal constructs and sends a Wormhole NTT message back to the Hub Chain (Ethereum) via its Wormhole Transceiver.
  4. Wormhole Relaying: The message is observed, attested, and relayed back to Ethereum.
  5. Message Reception & Processing: The Wormhole Transceiver on Ethereum receives the message and passes it to the HubPortal.
  6. Token Releasing & Delivery:
    • The HubPortal processes the message.
    • It releases (unlocks) the equivalent amount of native $M tokens previously locked during the initial Hub -> Spoke transfer.
    • If the transfer initiated on the Spoke was for Wrapped $M, the HubPortal wraps the released $M back into Wrapped $M.
    • The released $M (or its wrapped form) is transferred to the recipient address on Ethereum.

Transfer: Spoke Chain -> Spoke Chain

This process combines the two flows:

  1. Tokens are burned on the source Spoke chain.
  2. A Wormhole message is sent to the destination Spoke chain.
  3. Tokens are minted on the destination Spoke chain. (Note: This flow does not directly involve the HubPortal's lock/release mechanism but relies on messages relayed via Wormhole).