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 #
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | LOKAD PHDR (50 48 44 52) |
| 4 | 1 | version, 1 |
| 5 | 1 | number of groups, 1 to the number of tracked chains |
Then, for each group (35 bytes), in ascending order of chain id:
| Size | Field |
|---|---|
| 1 | parent chain id (1 btc, 2 xec, 3 bch, 16 ltc) |
| 2 | number of headers, little-endian |
| 32 | SHA256d 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 reason | Rule |
|---|---|
bad-phdr-commitment-duplicate | at most one version-1 segment |
bad-phdr-commitment-malformed | the length is right and the groups are in order |
bad-phdr-commitment-missing, bad-phdr-commitment-unexpected | the segment is there if and only if field 5 is |
bad-phdr-commitment-mismatch | its 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
