Child chains and notarization
Chains that left Lotus at a block: what a node checks, what a notarization says and does not say, the peers, the routes and the options.
A child chain shares the Lotus history up to one block and continues under other rules. Lotus nodes check its blocks; Lotus never depends on them. Mainnet has one child chain: Child chain 1, since block 1,428,770.
Three things hold at every step:
- The work of a child chain is displayed, never counted in the Lotus chain's work.
- No Lotus block is ever invalid because child chain data is missing.
- Nothing is created or spent on behalf of a child chain. One of its transactions is in Lotus only when it is an ordinary Lotus transaction.
What a node checks #
A node learns of a child chain from its own peers. When a peer serves a header that descends from the child chain's first block, the node checks it by the child chain's rules (height, epoch, difficulty, proof of work, time) and asks for the block. What it keeps is its own view, labelled "seen by this node". It sends no child chain block or header to anyone.
From Napoleon a Lotus block may also record child chain headers and transaction lists; every node then checks what a block records. Until then a child block is "seen by this node" only.
Notarization #
From 12.5.12 a Lotus block may notarize a block of Child chain 1: its coinbase carries the child chain's id, the height and the hash of a block that the node which built it checked. A notarized child block existed when that Lotus block was mined, and Lotus nodes had checked it. It does not say that every transaction of that block is valid.
- It is not a consensus rule: no node requires an anchor, and an anchor never enters chain work or the choice of a chain.
- Any miner can write an anchor with any hash. Your node counts an anchor as a notarization only when it checked the child block itself; otherwise it is a claim (
claimed_unchecked). - A node that builds blocks notarizes the child block 6 blocks below the tip it checked (
childchainanchordepth). - If Child chain 1 reorganises, an anchor stays: the block existed and was checked at that height. The index says that the branch was left, and at which height, while this node still holds that branch (288 blocks); after that the anchor is listed as
claimed_unchecked, unless a Lotus block recorded its header. - The record of a range of blocks (type 2) is reserved and not built: the blocks before the first anchor are not notarized one by one.
The format of an anchor: Child chain anchors (CNOT).
Peers #
A peer that serves a child chain the node checks is not scored for serving it (an invalid header, or many useless ones, still is). Such peers take slots of their own: maxchildchainpeers (4) inbound and 2 outbound. Headers that leave this chain at the fork block of a child chain, with the work of that chain, never enter the block index.
Peers added with addnode or connect, and noban peers, are not counted. When a side is full, a newcomer that brings child chain work this node did not hold takes the place of the peer idle the longest; any other newcomer is disconnected, without a score.
A node that builds blocks records and notarizes only what it has seen: give it at least one peer on the child chain with addnode.
Pages and routes #
Explorer, Child chains (/dashboard/children) shows the overview, the blocks, the transactions that are not in a Lotus block, and, from 12.5.13, the Notarization tab and the peer slots.
Route under /api/v1 | Content |
|---|---|
childchains, childchains/<name> | What this node sees, what Lotus recorded, notarization counters; one chain also has peers (12.5.13) |
childchains/<name>/peers | The peers that serve it |
childchains/<name>/blocks, block/<hash or height>, diff | Blocks, one block, transactions not in Lotus |
childchains/<name>/anchors?limit=&before= | The anchors, highest Lotus height first |
childchains/<name>/notarized/<hash or height> | Whether a child block is notarized: notarized_by, covered_by (through a later block of its branch), claimed_by |
childchains/anchors/by-block/<height or hash> (12.5.13) | The anchors one Lotus block writes |
The <name> of a chain is the id the route childchains lists. The commands are in JSON-RPC.
Options #
| Option | Default | Meaning |
|---|---|---|
childchainfollow | 1 | Check the child chains from what peers serve, and show them |
childchainanchors | 1 | Notarize child chain blocks in the blocks this node builds |
childchainanchordepth | 6 | How many blocks below the checked tip (0 to 1000) |
childchainrecord | 1 | Record child chain blocks in the blocks this node builds, once the chain accepts them |
childchainannounce | 0 | Announce and serve this chain's blocks above the fork block to peers that check a child chain |
maxchildchainpeers | 4 | Inbound child chain peers kept at once (12.5.13) |
