Child chain anchors (CNOT)
Child chain blocks notarized in the coinbase of a Lotus block: layout, index rules and routes.
A Lotus block may notarize a block of a child chain: its coinbase carries the child chain's id, the height and the hash of a block that the node which built it checked. What an anchor says, and does not say: the Child chains and notarization page. It is not consensus: a block without an anchor, or with one that does not decode, is valid like any other.
Byte layout #
One eMPP segment, in an OP_RETURN OP_RESERVED <push> output of the coinbase of its own. Integers are little-endian.
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | LOKAD CNOT (43 4e 4f 54) |
| 4 | 1 | version, 1 |
| 5 | 1 | type, 1 = tip anchor |
| 6 | 1 | child chain id (1 = Child chain 1) |
| 7 | 4 | child block height |
| 11 | 32 | child block hash |
43 bytes; the output is 55 bytes. Type 2 (a range of blocks with a Merkle root) is reserved and not built.
Rules of the index #
- A coinbase carries at most one tip anchor. With two or more, or one of the wrong length, of a chain the network does not have, at or below the fork block, or with a null hash, the index records none for that block.
- A segment of another version, or of an unknown type, is ignored.
- An anchor counts as a notarization only on a node that checked the child block it names (
statusnotarized); otherwise it isclaimed_unchecked. - A Lotus reorganisation removes the anchors of the disconnected blocks. After a child chain reorganisation an anchor stays:
branchisleftwhile the node holds that branch (288 blocks), thenunknownandclaimed_unchecked, unless a Lotus block recorded the header.
Database: childchains.sqlite, in the data directory. Routes: childchains/<name>/anchors, childchains/<name>/notarized/<block>, childchains/anchors/by-block/<block> (12.5.13).
Source files #
doc/child-chains.md,src/childchain/,src/api/childchain_handler.cpp
