Composite Phasing

From Nxt Wiki
Jump to: navigation, search
This page contains changes which are not marked for translation.

1 What is Composite Phasing

Composite Phasing ("Smart Phasing") is a very powerful new feature that allows approval models for conditional transactions to be defined in terms of a Boolean Expression of other approval models, i.e. allows joining the current primitive approval models such as by whitelist, by asset balance, by hash, etc, using the AND, OR, and NOT operators.

This allows the new Asset Control feature to be used in combination with the Account Control feature when required, the transaction execution being made conditional on satisfying both the Asset Control and Account Control settings. It also allows for example combining the existing by hash or by transaction approval models with by whitelist, by balance, etc, approvals, which enables doing atomic coupling of transactions (including cross-blockchain) even for multisignature accounts (i.e. subject to Account Control), or with assets subject to Asset Control.

The NOT operator allows for dead-man-switch type conditions, where a transaction is executed only if some condition (e.g. revealing a secret) is not satisfied.

2 Defining a Boolean Expression

To define the boolean expression used by composite phasing, first define the basic approval models then reference them using the AND(&), OR(|) and NOT(!) operators which can be composed to form a valid true/false expression. For example, to define that a transaction is executed only if condition A is not met and and condition B is met, define the expression as !A & B

3 Setting up an Approval Model

1. From the Dashboard menu choose Approval Models.
2. Click on Add Approval Modal and define your voting modal (figure 1) and (figure 2).
thumb figure 1
thumb figure 2
3. Similarly define a Composite voting modal by entering a Boolean Expression referencing the defined voting models where & represents AND, | to represent OR and ! represents NOT (figure 3).
thumb figure 3
4. The list of approval models is saved in your browser's local storage (figure 4)
thumb figure 4

4 Use your Approval Model

Setting up transaction phasing has changed in Ardor, instead of choosing the voting model when submitting the transaction. You simply choose an existing voting model.

To use the defined approval model, select it as Phasing Approval Model from the advanced area of the transaction dialog (figure 5)
thumb figure 5