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 participants, blocks and transactions, that can cause 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 occurrences.

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 anchoring scheme
  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 the Targetnet;

  • targetnet-tx-timestamp – date and time of creation of the Targetnet anchoring transaction.

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 occurred while broadcasting a transaction into a Targetnet

1

failed to create a data transaction for targetnet

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

2

failed to send the transaction to targetnet

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

3

invalid http status of response from targetnet transaction broadcast: $responseStatus

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

4

failed to parse http body of response from targetnet transaction broadcast

Broadcasting of a transaction into a Targetnet returned an unrecognizable JSON query

5

targetnet returned transaction with id='$targetnetTxId', but it differs from the transaction that was sent (id='$sentTxId')

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

6

targetnet didn't respond to the transaction info request

A Targetnet has not responded to a query on transaction information

7

failed to get current height in targetnet

The current height of a Targetnet has not been obtained

8

anchoring transaction in targetnet disappeared after the height rose enough

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

9

failed to create sidechain anchoring transaction

Failed to broadcast an anchoring transaction in a private blockchain

10

anchored block in sidechain was changed while waiting for targetnet height rise, looks like a rollback has happened

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

See also