Technical description of the platform

Anchoring

In a private blockchain, transactions are processed by a definite list of participants, each of participants is familiar for the network in advance. In comparison with the public network, private blockchains contain less participantsm blocks and transactions, that carries a threat of information replacement. This situation, in turn, creates a risk of blockchain override, especially in case the PoS consensus algorithm is used - because this algorithm is not protected from such occurencies.

In order to increase trust of private blockchain participants to the data broadcasted in it, the anchoring mechanism has been developed. Anchoring allows to check consistency of data. Consistency of data is guaranteed through broadcasting of data from a private blockchain into a larger network where data replacement is less possible because of larger number of participants and blocks. Block signatures and blockchain height are published from the private network. The mutual connectivity of two or more networks increases their resilience, since all connected networks must be attacked to forge or change data as a result of a long-range attack.

How the Waves Enterprise anchoring works

Схема анкоринга в Targetnet
  1. Anchoring configuration is performed in the private blockchain configuration file (set the corresponding parameters in accordance with the recommendations listed in the article in order to exclude complexities while working with anchoring);

  2. After each configured number of blocks height-range the node saves information about the block at the current-height - threshold in the form of a transaction into the Targetnet. To do this, the Data Transaction 12 containing the ‘key-value’ pairs is used. This pairs are described below;

  3. After transaction broadcast, the node receives its height in the Targetnet;

  4. The node checks the Targetnet blockchain each 30 seconds, until the height achieves the value height of a created transaction + height-above.

  5. Upon achieving this Targetnet blockchain height and acknowledgement of presence of the first transaction in the blockchain, the node in the Targetnet creates a second transaction with data for anchoring in the private blockchain.

Anchoring data transaction structure

Transaction for broadcasting in a Targetnet contains following fields:

  • height - height of a private blockchain block to be saved;

  • signature - signature of a private blockchain block to be saved;

Transaction for a private blockchain contains following fields:

  • height - height of a private blockchain block to be saved;

  • signature - signature of a private blockchain block to be saved;

  • targetnet-tx-id - identifier of a transaction for anchoring into a Targetnet;

  • targetnet-tx-timestamp - date and time of creation of a Targetnet anchoring tranaction.

Errors that can occur during anchoring

Anchoring errors can occur at any stage. In case of errors in a private blockchain, a Data Transaction 12 with an error code and description is published. This transaction contains following fields:

  • height - height of a private blockchain block to be saved;

  • signature - signature of a private blockchain block to be saved;

  • error-code - code of an error;

  • error-message - description of an error.

Anchoring error types

Code

Error message

Possible reason

0

Unknown error

Unknown error has occured while broadcasting a transaction into a Targetnet

1

Fail to create data transaction for Targetnet

Creating of a transaction for broadcasting into a Targetnet has not been completed and returned an error

2

Fail send transaction to Targetnet

Broadcasting of a transaction into a Targetnet has not been completed and returned an error (that can occur |br| due to a JSON query error)

3

Invalid http status of response from Targetnet |br| transaction broadcast

Broadcasting of a transaction into the Targetnet returned a code |br| other than 200

4

Fail to parse http body of response from Targetnet |br| transaction broadcast

Broadcasting of a transaction into a Targetnet returned a |br| unrecognizable JSON query

5

Targetnet return transaction with id='$TargetnetTxId' |br| but it differ from transaction that we sent |br| id='$sentTxId

Broadcasting of a transaction into a Targetnet returned an identifier |br| that differs from a first transaction

6

Targetnet didn't respond on transaction info request

A Targetnet has not responded to a query on transaction information

7

Fail to get current height in Targetnet

The current height of a Targetnet has not been obtained

8

Anchoring transaction in Targetnet disappeared after |br| height rise enough

Anchoring transaction has has not been found in a Targetnet after increase of height |br| to the height-above value

9

Fail to create sidechain anchoring transaction

Failed to broadcast an anchoring transaction in a private blockchain

10

Anchored transaction in sidechain was changed during |br| Targetnet height arise await, looks like |br| a rollback has happened

While waiting for acknowledgement of a transaction in a Targetnet, a rollback occured |br| in a private blockchain, a transaction identifier has been changed

See also