From 0fbaf409c04975402ea40f0f05c47701e46fe948 Mon Sep 17 00:00:00 2001 From: thephez Date: Mon, 17 Dec 2018 16:41:30 -0500 Subject: [PATCH] P2P - Add qfcommit message (no hexdump example) DIP6 quorum final commitment (dashpay/dash#2477) --- _autocrossref.yaml | 3 ++ _config.yml | 1 + _includes/devdoc/ref_p2p_networking.md | 43 ++++++++++++++++++++++++++ _includes/references.md | 2 ++ 4 files changed, 49 insertions(+) diff --git a/_autocrossref.yaml b/_autocrossref.yaml index 5cd39bcf..67d06204 100644 --- a/_autocrossref.yaml +++ b/_autocrossref.yaml @@ -170,6 +170,9 @@ protocol version 70012: section protocol versions protocol version 70013: section protocol versions protocol version 70014: section protocol versions public key infrastructure: pki +'Quorum Commitment': quorum commitment special tx +'`qfcommit` message': qfcommit message +'`qfcommit` messages': qfcommit message '`r`': r receipt: DO NOT AUTOCROSSREF recurrent rebilling: diff --git a/_config.yml b/_config.yml index b4fab8d2..85d553d9 100644 --- a/_config.yml +++ b/_config.yml @@ -572,6 +572,7 @@ devsearches: - "mnw": "/en/developer-reference#mnw" - "mnwb": "/en/developer-reference#mnwb" - "ssc": "/en/developer-reference#ssc" + - "qfcommit": "/en/developer-reference#qfcommit" # Dash - governance - "govobj": "/en/developer-reference#govobj" diff --git a/_includes/devdoc/ref_p2p_networking.md b/_includes/devdoc/ref_p2p_networking.md index 63924542..0cdbefc4 100644 --- a/_includes/devdoc/ref_p2p_networking.md +++ b/_includes/devdoc/ref_p2p_networking.md @@ -3057,6 +3057,49 @@ bf110000 ................................... Count: 4543 {% endautocrossref %} +#### qfcommit +{% include helpers/subhead-links.md %} + +{% autocrossref %} + +The `qfcommit` message is used to finalize a long-living masternode quorum setup +by aggregating the information necessary to mine the on-chain Quorum Commitment +special transaction. The message contains all the necessary information required +to validate the long-living masternode quorum's signing results. + +It is possible to receive multiple valide final commitments for the same DKG +session. These should only differ in the number of signers, which can be ignored +as long as there are at least `quorumThreshold` number of signers. The set of +valid members for these final commitments should always be the same, as each +member only creates a single premature commitment. This means that only one set +of valid members (and thus only one quorum verification vector and quorum public +key) can gain a majority. If the threshold is not reached, there will be no +valid final commitment. + +| Bytes | Name | Data type | Description | +| --- | --- | --- | --- | +| 2 | version | uint16_t | Version of the final commitment message +| 1 | llmqType | uint8_t | Version of the final commitment message +| 32 | quorumHash | uint256 | The quorum identifier +| 1-9 | signersSize | compactSize uint | Bit size of the signers bitvector +| (bitSize + 7) / 8 | signers | byte[] | Bitset representing the aggregated signers of this final commitment +| 1-9 | validMembersSize | compactSize uint | Bit size of the `validMembers` bitvector +| (bitSize + 7) / 8 | validMembers | byte[] | Bitset of valid members in this commitment +| 48 | quorumPublicKey | BLSPubKey | The quorum public key +| 32 | quorumVvecHash | uint256 | The hash of the quorum verification vector +| 96 | quorumSig | BLSSig | Recovered threshold signature +| 96 | sig | BLSSig | Aggregated BLS signatures from all included commitments + + +{% endautocrossref %} ### Governance Messages {% include helpers/subhead-links.md %} diff --git a/_includes/references.md b/_includes/references.md index 04d9fa05..821ff8e4 100644 --- a/_includes/references.md +++ b/_includes/references.md @@ -251,6 +251,7 @@ http://opensource.org/licenses/MIT. [notfound message]: /en/developer-reference#notfound "A P2P protocol message sent to indicate that the requested data was not available" [ping message]: /en/developer-reference#ping "A P2P network message used to see if the remote host is still connected" [pong message]: /en/developer-reference#pong "A P2P network message used to reply to a P2P network ping message" +[qfcommit message]: /en/developer-reference#qfcommit "A P2P network message used to finalize the members of a long-living masternode quorum (LLMQ)" [reject message]: /en/developer-reference#reject "A P2P network message used to indicate a previously-received message was rejected for some reason" [sendcmpct message]: /en/developer-reference#sendcmpct "A P2P network message used to request new blocks be announced as compact blocks" [sendheaders message]: /en/developer-reference#sendheaders "A P2P network message used to request new blocks be announced through headers messages rather than inv messages" @@ -458,6 +459,7 @@ http://opensource.org/licenses/MIT. [proupservtx special tx]: /en/developer-reference#proupservtx [python-bitcoinlib]: https://github.com/petertodd/python-bitcoinlib [python-blkmaker]: https://gitorious.org/bitcoin/python-blkmaker +[quorum commitment special tx]: /en/developer-reference#quorum-commitment [Satoshi Nakamoto]: https://en.bitcoin.it/wiki/Satoshi_Nakamoto [setup tor]: https://www.torproject.org/ [SHA256]: https://en.wikipedia.org/wiki/SHA-2