Parent header commitment (PHDR)
Protocol and consensus12.5.1+

Parent header commitment (PHDR)

The coinbase commitment to the parent-chain headers a block records.

A Lotus block can record headers of its parent chains in metadata field 5. The coinbase commits to them with one eMPP segment. It is a consensus rule of merged mining (MMv3), active where merged mining is.

Byte layout #

OffsetSizeField
04LOKAD PHDR (50 48 44 52)
41version, 1
51number of groups, 1 to the number of tracked chains

Then, for each group (35 bytes), in ascending order of chain id:

SizeField
1parent chain id (1 btc, 2 xec, 3 bch, 16 ltc)
2number of headers, little-endian
32SHA256d of the headers of the group, one after the other

6 + 35 x groups bytes: 41 for one chain, 146 for four. A block builder puts it as one more push in the output that carries the UTXO commitment; any eMPP output of the coinbase but output 0 is accepted.

Rules #

Reject reasonRule
bad-phdr-commitment-duplicateat most one version-1 segment
bad-phdr-commitment-malformedthe length is right and the groups are in order
bad-phdr-commitment-missing, bad-phdr-commitment-unexpectedthe segment is there if and only if field 5 is
bad-phdr-commitment-mismatchits groups equal those of field 5: chains, counts and digests

A segment of another version is ignored.

Source files #

  • src/consensus/parentcommitment.h, src/consensus/parentcommitment.cpp, doc/design/mmv3-parent-anchoring.md
Source doc/protocols/phdr.md in the lotusd repository