From 44c55257a8aeb234fe1795e4440d6c09a7c2b6e5 Mon Sep 17 00:00:00 2001 From: thephez Date: Thu, 28 Jun 2018 12:58:23 -0400 Subject: [PATCH] [Content] - P2P - Update PrivateSend messages to include input counts (#73) - Updated `dsa` and `dsq` messages with nInputCount field - Updated notes in Guide Closes #70 --- _includes/devdoc/guide_dash_features.md | 2 ++ _includes/devdoc/ref_p2p_networking.md | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/_includes/devdoc/guide_dash_features.md b/_includes/devdoc/guide_dash_features.md index 5aaa81a1..c612bdfe 100644 --- a/_includes/devdoc/guide_dash_features.md +++ b/_includes/devdoc/guide_dash_features.md @@ -203,10 +203,12 @@ mixing pool. * The `dsa` message contains a collateral transaction * This transaction uses a collateral input created in the [Wallet Preparation](#privatesend-wallet-preparation) phase * The collateral is a signed transaction that pays the collateral back to a client address minus a fee of 0.001 DASH + * As of protocol version 70209, the `dsa` message indicates how many inputs will be provided to the pool when Spork 6 is active _**Step 3 - Queue**_ * A masternode broadcasts `dsq` messages when it starts a new queue. These message are relayed by all peers. + * As of protocol version 70209, when Spork 6 is active the `dsq` message indicates how many inputs must be provided to participate in the pool. * Once the masternode has received valid `dsa` messages from 3 clients (`nPoolMaxTransactions`), it sends a `dsq` message with the ready bit set ([Dash Core Reference](https://github.com/dashpay/dash/blob/e596762ca22d703a79c6880a9d3edb1c7c972fd3/src/chainparams.cpp#L173)) * Clients must respond to the Queue ready within 30 seconds or risk forfeiting the collateral they provided in the `dsa` message (Step 1) ([Dash Core Reference](https://github.com/dashpay/dash/blob/e596762ca22d703a79c6880a9d3edb1c7c972fd3/src/privatesend.h#L22)) diff --git a/_includes/devdoc/ref_p2p_networking.md b/_includes/devdoc/ref_p2p_networking.md index 62448ada..6043e675 100644 --- a/_includes/devdoc/ref_p2p_networking.md +++ b/_includes/devdoc/ref_p2p_networking.md @@ -1819,14 +1819,18 @@ queue the remainder of the time. | Bytes | Name | Data type | Required | Description | | ---------- | ----------- | --------- | -------- | -------- | | 4 | nDenom | int | Required | Denomination that will be exclusively used when submitting inputs into the pool +| 4 | nInputCount | int | Required | *Added in protocol version 70209. Only present when Spork 6 is active.*

Number of inputs required to join the queue | 216+ | txCollateral | `tx` message | Required | Collateral TX that will be charged if this client acts maliciously The following annotated hexdump shows a `dsa` message. (The message header has -been omitted.) +been omitted.) Note that the 'Required inputs' bytes will only be preset if +Spork 6 is active and protocol version => 70209. {% highlight text %} 02000000 ................................... Denomination: 1 Dash (2) +03000000 ................................... Inputs required: 3 + Collateral Transaction | Previous Output | | @@ -2148,6 +2152,7 @@ message. | Bytes | Name | Data type | Required | Description | | ---------- | ----------- | --------- | -------- | -------- | | 4 | nDenom | int | Required | Denomination allowed in this mixing session +| 4 | nInputCount | int | Required | *Added in protocol version 70209. Only present when Spork 6 is active.*

Number of inputs required to participate in this mixing session | 36 | masternodeOutPoint | outPoint | Required | The unspent outpoint of the masternode (holding 1000 DASH) which is hosting this session | 8 | nTime | int64_t | Required | Time this `dsq` message was created | 1 | fReady | bool | Required | Indicates if the mixing pool is ready to be executed @@ -2163,11 +2168,14 @@ Denominations (per [`src/privatesend.cpp`][privatesend denominations]) | 8 | 0.01 Dash The following annotated hexdump shows a `dsq` message. (The -message header has been omitted.) +message header has been omitted.) Note that the 'Required inputs' bytes will only +be preset if Spork 6 is active and protocol version => 70209. {% highlight text %} 08000000 ............................. Denomination: 0.01 Dash (8) +03000000 ............................. Required input(s): 3 + Masternode Outpoint | aeed0e77c6db30a616507a37a129bc88 | 1811f08afc51dd485d5322f36c1f04c5 ... Outpoint TXID