Balanced Transactions

This page explains balanced transactions and how they can be formed.

Balanced transactions are characterized by a zero transaction delta. They can be executed if they are valid and comply with the resource machine rules. One way of obtaining balanced transactions is through composition of matching, unbalanced transactions, a.k.a. as intents. However, a single party can often directly produce a balanced transaction without requiring any counterparty.

In the following, we show examples of transactions that can be sent by a single party, here Alice.

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.

  • Blue coloring indicates ephemeral resources.

Resource Property Changes

Often, transactions and actions within aim to change one or multiple properties of existing resource objects. Most of the time, a single, authorized party (i.e., the owner) can unilaterally execute the transaction. Actions can include, for example,

  • Transferring a resource, which changes the owner

  • Splitting and merging resources, which changes the quantity

Examples

Alice owns an apple resource ๐Ÿ and wants to transfer it to Bob.

Alice's balanced transaction

Alice consumes her 3๐Ÿโ€‰Alice resource and creates a 3๐Ÿโ€‰Bob resource for Bob.

Consume
Create

3๐Ÿโ€‰Alice

3๐Ÿโ€‰Bob

After execution, Alice has transferred 3๐Ÿ to Bob but the total quantity hasn't changed.

Resource Supply Changes

Changing resource properties requires resource to exist in the first place. However, immediately after the genesis of a resource controller (e.g., the launch of a new blockchain or the deployment of a protocol adapter) the associated commitment tree is empty. The question is how resources can be initially created but also finally consumed.

We call the process of initially creating a resource out of nothing initialization, and the process of finally consuming a resource finalization. The former and latter result in inflation and deflation of the supply (i.e., the total quantity) of the associated resource kind, respectively. Both require utilizing ephemeral resources to balance the transaction.

Constraining the Supply

Resource logics can include constraints and mechanisms fixing the supply (i.e., the total quantity of all resources) of a given resource kind after initialization or allowing only a specific originator identity to inflate or deflate the supply.

Examples

Alice wants to initiallly create an apple resource (without consuming an existing one) and inflate the total ๐Ÿ supply by 3. To balance the transaction she uses an ephemeral resource.

Alice's balanced transaction

Alice consumes an ephemeral 3๐Ÿโ€‰Alice resource and creates a non-ephemeral 3๐Ÿโ€‰Alice resource.

Consume
Create

3๐Ÿโ€‰Alice

3๐Ÿโ€‰Alice

After execution, Alice has created a new 3๐Ÿ resource for herself and inflated the total supply by 3.

Last updated