Underlying Technology
Wormhole NTT (M Portal)
M Portal (Standard) is built using the Wormhole Native Token Transfer (NTT) framework.
- Integration:
HubPortalandSpokePortalinherit from Wormhole'sNttManagerabstract contract. This provides the base functionality for interacting with Wormhole Transceivers, encoding/decoding messages, and handling standard NTT flows. - Customization: M0 extends this base functionality to:
- Implement the specific Lock/Release (Hub) and Mint/Burn (Spoke) logic.
- Handle the automatic unwrap/wrap mechanism for $M extensions.
- Inject the M0-specific metadata (like
$M Earning Index) into theadditionalPayloadfield of standard NTT messages. - Define and handle custom message types for explicit metadata propagation.
- Abstraction: Using the NTT framework allows M Portals to leverage Wormhole's established messaging infrastructure while focusing on M0-specific logic.
Hyperlane (M Portal Lite)
M Portal Lite uses Hyperlane as its messaging layer and features a more modular design.
- Integration: The
Portalcontracts do not inherit from a bridge-specific contract. Instead, they hold an address of a contract that implements the genericIBridgeinterface. TheHyperlaneBridge.solcontract is the concrete implementation that connects the Portals to the Hyperlane protocol. - Decoupling: This design decouples the token bridging logic from the cross-chain messaging logic. The Portals are only aware of the
IBridgeinterface, making the system potentially adaptable to other messaging bridges in the future. -
Message Flow:
- A
Portalcontract callssendMessage()on the configuredHyperlaneBridge. HyperlaneBridgeformats the message and dispatches it through the HyperlaneIMailboxcontract.- On the destination chain, the Hyperlane network delivers the message to the destination
HyperlaneBridgeby calling itshandle()function. - The destination
HyperlaneBridgeauthenticates the message (verifying it comes from the Mailbox and a known peer) and then callsreceiveMessage()on its localPortalcontract, delivering the payload.
- A

