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¶
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);
After each configured number of blocks
height-range
the node saves information about the block at thecurrent-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;After transaction broadcast, the node receives its height in the Targetnet;
The node checks the Targetnet blockchain each 30 seconds, until the height achieves the value height of a created transaction +
height-above
.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.
Code |
Error message |
Possible reason |
---|---|---|
0 |
|
Unknown error has occurred while broadcasting a transaction into a Targetnet |
1 |
|
Creating of a transaction for broadcasting into a Targetnet has not been completed and returned an error |
2 |
|
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 |
|
Broadcasting of a transaction into the Targetnet returned a code other than 200 |
4 |
|
Broadcasting of a transaction into a Targetnet returned an unrecognizable JSON query |
5 |
|
Broadcasting of a transaction into a Targetnet returned an identifier that differs from the first transaction |
6 |
|
A Targetnet has not responded to a query on transaction information |
7 |
|
The current height of a Targetnet has not been obtained |
8 |
|
Anchoring transaction has not been found in a Targetnet after increase of height to the |
9 |
|
Failed to broadcast an anchoring transaction in a private blockchain |
10 |
|
While waiting for acknowledgement of a transaction in a Targetnet, a rollback occurred in a private blockchain, a transaction identifier has been changed |