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 intent resources expressing constraints over the transaction.
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๐."
3๐โAlice
2๐โAlice
Bob's intent
"I want to give 2๐ for 3๐."
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.
3๐โAlice
2๐โAlice
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