From d59d4570a8306487109e0b4e22d371f0f8de4a3e Mon Sep 17 00:00:00 2001 From: thephez Date: Wed, 25 Oct 2017 12:50:37 -0400 Subject: [PATCH] P2P Guide - Update to masternode payment section. Included link to official doc Misc minor cleanup - glossary terms, etc. --- _data/glossary/en/denominations.yaml | 2 +- _data/glossary/en/node.yaml | 2 +- _includes/devdoc/guide_p2p_network.md | 15 +++++++++++++-- _includes/devdoc/ref_p2p_networking.md | 6 +++--- _includes/references.md | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/_data/glossary/en/denominations.yaml b/_data/glossary/en/denominations.yaml index 53c55bda..7faf5f94 100644 --- a/_data/glossary/en/denominations.yaml +++ b/_data/glossary/en/denominations.yaml @@ -31,6 +31,6 @@ optional: - Binary bits, a unit of data with two possible values links_html_or_markdown_style_capitalize_first_letter: - - "[Bitcoin Units](https://en.bitcoin.it/wiki/Units) --- Bitcoin Wiki" + #- "[Bitcoin Units](https://en.bitcoin.it/wiki/Units) --- Bitcoin Wiki" --- diff --git a/_data/glossary/en/node.yaml b/_data/glossary/en/node.yaml index f329f862..d83285fa 100644 --- a/_data/glossary/en/node.yaml +++ b/_data/glossary/en/node.yaml @@ -7,7 +7,7 @@ required: title_max_40_characters_no_formatting: Node summary_max_255_characters_no_formatting: > - A computer that connects to the Bitcoin network. + A computer that connects to the Dash network. synonyms_shown_in_glossary_capitalize_first_letter: - Node diff --git a/_includes/devdoc/guide_p2p_network.md b/_includes/devdoc/guide_p2p_network.md index 0890c33c..bd5a5138 100644 --- a/_includes/devdoc/guide_p2p_network.md +++ b/_includes/devdoc/guide_p2p_network.md @@ -598,8 +598,19 @@ Earlier versions of Bitcoin Core allowed developers and trusted community member Masternode payment uses a verifiable process to determine which masternode is paid in each block. When a new block is processed, a quorum of `MNPAYMENTS_SIGNATURES_TOTAL` (10) masternodes vote on the next masternode -payee. Each member of the quorum issues a 'mnw' message that is relayed to the -network. +payee. The quorum is calculated deterministically based on the distance between +masternode's hash and the block's proof of work. + +Each member of the quorum issues a 'mnw' message that is relayed to the +network. The payee is selected from a subset of masternodes made up of 10% +of eligible nodes that have been waiting the longest since their last payment. +The winner is then determined based on a number of parameters including the +distance between the its hash and the block's proof of work. For additional +detail, reference this [Official Documentation Payment Logic page](https://dashpay.atlassian.net/wiki/spaces/DOC/pages/8880184/Payment+Logic). + +Nodes receiving a `mnw` message verify the validity of the message before +relaying it to their peers. If the message is invalid, the sending node may be +treated as misbehaving and have its ban score increased. {% endautocrossref %} diff --git a/_includes/devdoc/ref_p2p_networking.md b/_includes/devdoc/ref_p2p_networking.md index 390a117a..4ebd1593 100644 --- a/_includes/devdoc/ref_p2p_networking.md +++ b/_includes/devdoc/ref_p2p_networking.md @@ -1944,9 +1944,9 @@ entry and how to validate messages from it. | ---------- | ----------- | --------- | -------- | -------- | | 41 | vin | txIn | Required | The unspent output which is holding 1000 DASH | # | addr | CService | Required | IPv4 address of the masternode -| 33-65 | pubKeyCollateralAddress | CPubKey | Required | CPubKey of the main 1000 DASH unspent output -| 33-65 | pubKeyMasternode | CPubKey | Required | CPubKey of the secondary signing key (For all other messaging other than announce message) -| 66* | sig | char[] | Required | Signature of this message verifiable via pubKeyMasternode (66 bytes in most cases. Length (1 byte) + Signature (65 bytes)) +| 33-65 | pubKeyCollateralAddress | CPubKey | Required | CPubKey of the main 1000 DASH unspent output. Length determined by if it is a compressed public key or not. +| 33-65 | pubKeyMasternode | CPubKey | Required | CPubKey of the secondary signing key (For all messaging other than the announce message). Length determined by if it is a compressed public key or not. +| 66 | sig | char[] | Required | Signature of this message verifiable via pubKeyMasternode (Length (1 byte) + Signature (65 bytes)) | 8 | sigTime | int64_t | Required | Time which the signature was created | 4 | nProtocolVersion | int | Required | The protocol version of the masternode | # | lastPing | `mnp` message | Required | The last known ping of the masternode diff --git a/_includes/references.md b/_includes/references.md index 6a8267db..8f970c97 100644 --- a/_includes/references.md +++ b/_includes/references.md @@ -39,7 +39,7 @@ http://opensource.org/licenses/MIT. [msg_governance_object_vote]: /en/developer-reference#term-msg_governance_object_vote "Governance object vote data type identifier of an inventory on the P2P network" [msg_masternode_verify]: /en/developer-reference#term-msg_masternode_verify "Masternode Verify data type identifier of an inventory on the P2P network" -[network]: /en/developer-guide#term-network "The Bitcoin P2P network which broadcasts transactions and blocks" +[network]: /en/developer-guide#term-network "The Dash P2P network which broadcasts transactions and blocks" [op_checkmultisig]: /en/developer-reference#term-op-checkmultisig "Opcode which returns true if one or more provided signatures (m) sign the correct parts of a transaction and match one or more provided public keys (n)" [op_checksig]: /en/developer-reference#term-op-checksig "Opcode which returns true if a signature signs the correct parts of a transaction and matches a provided public key" [op_dup]: /en/developer-reference#term-op-dup "Operation which duplicates the entry below it on the stack"