Intents

This page explains how intents and solving works within the Anoma protocol.

Intents, which are unbalanced transactions, can be become balanced transactions through composition with matching intents by other counterparties.

Anoma users submit their intents to an intent pool in the form of unbalanced transactions, which are received and processed by solvers that output balanced transactions. These transactions are then ordered and finally sent to the executor node, which verifies and executes the transactions in the determined order, updating the state.

Below, we show examples of a balanced transaction that can directly be executed and two flavors of intents (unbalanced transactions) requiring counterparty discovery.

Legend

  • Symbols, e.g., 🍏 , indicate resource objects of specific kind that can contain arbitrary data and logic.

  • Numbers Preceeding numbers, e.g., 4🍏  indicate the quantity of resources.

  • Names following a resource, e.g., 4🍏 Alice , indicate who is authorized to consume it.

  • Blue coloring indicates ephemeral resources.

  • Speech bubbles 💬 indicate ephemeral, constraint-carrying resources.

Alice and Bob own apple 🍏 and banana 🍌 resources. Both want to swap their fruits and know exactly what they want. Both don't need to know each other.

Alice's intent

"I want to give 3🍏 for 2🍌."

Consume
Create

3🍏 Alice

2🍌 Alice

Bob's intent

"I want to give 2🍌 for 3🍏."

Consume
Create

2🍌 Bob

3🍏 Bob

Balanced txn (composition of Alice's and Bob's unbalanced txns)

Anyone seeing the two transactions (including Alice and Bob themselves) can compose the unbalanced transactions to obtain a balanced transaction containing two actions.

Consume
Create

3🍏 Alice

2🍌 Alice

// Action Separator

2🍌 Bob

3🍏 Bob

After execution,

  • Alice has swapped her 3🍏 Alice resource for a 2🍌 Alice resource,

  • Bob has swapped his 2🍌 Bob for a 3🍏 Bob resource.

This outcome is equivalent to two balanced transactions (see the previous tab) where both, Alice and Bob, transfer resources to one another.

Last updated