Underlyin Technology: Wormhole NTT
M Portals are built using the Wormhole Native Token Transfer (NTT) framework.
- Integration:
HubPortal
andSpokePortal
inherit from Wormhole'sNttManager
abstract 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 current $M Earning Index and the specific destination token address into the
additionalPayload
field of standard NTT token transfer messages. This allows the receiving Portal to process the transfer correctly for the intended token and potentially update its local MToken index. - Define and handle custom message types (distinct from token transfers) to explicitly propagate metadata like the $M Earning Index (
sendMTokenIndex
), individual TTG Registrar key-value pairs (sendRegistrarKey
), and TTG Registrar list inclusion statuses (sendRegistrarListStatus
) from the Hub to Spoke chains.
- Abstraction: Using the NTT framework allows M Portals to leverage Wormhole's established messaging infrastructure while focusing on M0-specific logic. Developers interacting with M Portals generally do not need to interact directly with the lowest levels of Wormhole Core or Guardians.