Intent Lifecycle

In practice, an intent is an authenticated structured message that describes a desired state outcome., specified by a conjunction of constraints on the pre- and post-execution state.

  1. Creation: The user creates an intent at the application level, specifying the action to be fulfilled.

  2. Signing: The user signs the intent, and it is added to the Specular intent pool.

  3. Solving: A solver monitors the intent pool and attempts to solve the intent with another that is submitted.

  4. Fulfillment: The solver fulfills the intent and places it into a transaction bundle that is sequenced.

  5. Verification: Specular verifies the correctness of the intent by checking the state of the blockchain.

Example:

The user wants to swap 1 ETH for 3000 USDC. This would be specified as a data struct like so:

// simple intent structure, as JS pseudocode
{
    inToken:        0x0,   // ERC20 contract, here ETH is specified by 0's contract
    inTokenAmount:  1,     // 1ETH
    outToken:       0x..., // ERC20 contract for USDC
    outTokenAmount: 3000   // 3000USDC
}

The user would then sign the intent, using EIP-712, to guarantee integrity and authenticity. This intent is registered and propagated through the intentpool. Solvers see this and will construct--if possible to satisfy--a solution:

// Solution transaction block in JS pseudocode
[
TX {},
TX {},
// ...
// There may be additional intents solved as a part of a submitted solution
// ...
]

This transaction bundle/block is then proposed as (part of) the next block, which is then validated through validator consensus:

Last updated