The Gravity Mass Protocol is a set of smart contracts that allows users to create, execute, and settle intents on different blockchains.
An intent has three main components:
- Offer: the reward for fulfiller for performing a specific on-chain action. Examples are tokens, NFTs, and any assets that can be escrowed by the protocol.
- Action: the action to be performed on the blockchain. Examples are token transfer, NFT transfer, and any general contract calling.
- Verifier: the verification of the action. Verifiers can be implemented by cross-chain messaging protocols:
- ZK-powered bridges
- Brevis
- PoS bridges
- Layerzero
- Celer cBridge
- Eigenlayer AVS
- User-defined bridge
- Proof of Authority implementations like MPC/TSS, and multi-sig.
- ZK-powered bridges
This diagram illustrates the workflow of an intent initiated by user on Gravity chain, for executing an action on Arbitrum.
- Mass protocol contract will be deployed on multiple chains. Those contract will supervise intent creation, execution, and settlement.
- The Mass protocol establishes interfaces for Escrow, Action, and Verifier contracts. It includes standard implementations such as ERC20 token escrow, token transfer actions, and verifiers based on cross-chain messaging protocols, while also allowing users to define custom implementations. In this framework, any object that can be placed in escrow can be an intent offer, any "checkable" action can be designated as an Action, and any verifier with logics that are mutually accepted by creators and fulfillers can be assigned.
- Purple boxes are Mass protocol smart contracts deployed on Gravity chain, and arrows between them representing their call relations.
- Blue boxes are contract deployed on Arbitrum.
- Intent network is an off-chain communication channel for creators to match intents for fulfillers.
The lifecycle of an intent is as follows:
- User publishes an intent to Mass Contract on Gravity.
- User locks the offer in the escrow contract.
- User specifies the action that he want the fulfiller to perform by providing an action contract address and function calling arguments, destination chain id, and expiration time.
- User specifies the verifier that he wants to use for this intent.
- Mass Contract generates an intent ID and returns it to the user.
- Conditional, continuous, and state-driven intents are supported by allowing a smart contract to generate intents based on the user's preferences.
- User signals fulfillers to fulfill the intent, by either broadcasting the intent ID on the Intent Network or directly contacting the fulfiller.
- Fulfiller fulfills the intent by executing the action on destination chain using the intent ID.
- Expiration time, destination chain id, execution results will be checked.
- Intent ID will be marked as fulfilled by the fulfiller.
- Fulfiller (any user) settles the intent by calling Mass Contract.
- Mass contract will use the specified verifier of the intent to check the execution results.
- Verifier can be implemented by cross-chain message passing protocols, external off-chain services like EigenLayer AVS and oracles, and any user-defined verification logic.
- Mass Contract checks the proof and releases the offer to the fulfiller.