Any statements valid for a computation are valid for a step. However, some additional statements are allowed.
A local step statement is written
PART.only(() => BLOCK), where
PART is a participant identifier and
BLOCK is a block. Any bindings defined within the block of a local step are available in the statement’s tail as new local state. For example,
is a valid program where
Alice’s local state includes the private values
x (bound to
y (bound to
4). However, such bindings are not consensus state, so they are purely local state. For example,
is an invalid program, because
Bob does not know
An each local step statement can be written as
each(PART_TUPLE () => BLOCK), where
PART_TUPLE is a tuple of participants and
BLOCK is a block.
It is an abbreviation of many local step statements that could have been written with
A consensus transfer is written
PART.publish(ID_0, ..., ID_n).pay(PAY_EXPR).timeout(DELAY_EXPR, () => TIMEOUT_BLOCK), where
PART is a participant identifier,
ID_n are identifiers for
PART’s public local state,
PAY_EXPR is a public expression evaluating to an amount of network tokens,
DELAY_EXPR is a public expression that depends on only consensus state and evaluates to a time delta represented by a natural number,
TIMEOUT_BLOCK is a timeout block, which will be executed after
DELAY_EXPR units of time have passed from the end of the last consensus step without
PART executing this consensus transfer.
The continuation of a consensus transfer statement is a consensus step, which is finalized with a commit statement.
The continuation of a timeout block is the same as the continuation as the continuation as the function the timeout occurs within.
See the guide section on non-participation to undertand when to use timeouts and how to use them most effectively.
publish component exclusive-or the
pay component may be omitted, if either there is no publication or no transfer of network tokens to accompany this consensus transfer.
timeout component may always be omitted.
Each component may occur in any order.
For example, the following are all valid:
Any expressions valid for a computation are valid for a step. However, some additional expressions are allowed.