diff --git a/dip-0003.md b/dip-0003.md
index 2359537e..6816fc90 100644
--- a/dip-0003.md
+++ b/dip-0003.md
@@ -22,6 +22,8 @@
1. [Masternode Rewards](#masternode-rewards)
1. [Selecting Quorums](#selecting-quorums)
1. [Appendix A: Reasons for Self Revocation of Operators](#appendix-a-reasons-for-self-revocation-of-operators)
+1. [Appendix B: Masternode Types](#appendix-b-masternode-types)
+1. [Appendix C: Network Information](#appendix-c-network-information)
1. [Copyright](#copyright)
## Special Mention
@@ -99,9 +101,9 @@ This signature is only required for external collaterals. If collateralOutpoint
the fact that the ProRegTx was able to move the collateral acts as an implicit proof of ownership. In this case the
payloadSig must be empty.
-The ProRegTx might have the IP address and port fields set to zero. This will result in the masternode being added to the masternode list in the PoSe-banned state and require the operator to issue a ProUpServTx. This is needed in case the owner wants to delegate the operator role to a hosting service without knowing the IP Address and port in advance.
+The ProRegTx might have an empty masternode addresses field. This will result in the masternode being added to the masternode list in the PoSe-banned state and require the operator to issue a ProUpServTx. This is needed in case the owner wants to delegate the operator role to a hosting service without knowing the IP Address and port in advance.
-The ProRegTx also defines the masternode's type and mode. Default masternodes are of type 0, and future types will be defined in an [annex document](dip-0003/masternode-types.md). Different types would introduce additional or different consensus rules towards the masternodes based on future Dash improvement proposals. Masternode types are not updatable, however each type can have multiple operation modes. The operation modes are updatable.
+The ProRegTx also defines the masternode's type and mode. Regular masternodes are of type 0, and future types will be defined in an [annex document](dip-0003/masternode-types.md). Different types would introduce additional or different consensus rules towards the masternodes based on future Dash improvement proposals. Masternode types are not updatable, however each type can have multiple operation modes. The operation modes are updatable.
The ProRegTx also specifies the reward for the operator. The percentage of the masternode reward paid to the operator is calculated by dividing the operatorReward field by 100. When the field is set to zero, the owner will get the full reward for every block. If set to a non-zero value, the masternode operator may specify his operator reward payee script in a ProUpServTx. If he does not do so, the full reward goes to the masternode owner.
@@ -117,8 +119,7 @@ The transaction consists of the following data in the payload area:
| type | uint_16 | 2 | Masternode type. Default set to 0. |
| mode | uint_16 | 2 | Masternode mode. Default set to 0. |
| collateralOutpoint | COutpoint | 36 | The collateral outpoint. |
-| ipAddress | byte[] | 16 | IPv6 address in network byte order. Only IPv4 mapped addresses are allowed (to be extended in the future) |
-| port | uint_16 | 2 | Port (network byte order) |
+| networkInfo | byte[] | variable | Masternode addresses (see [appendix](#appendix-c-network-information)) |
| KeyIdOwner | CKeyID | 20 | The public key hash used for owner related signing (ProTx updates, governance voting) |
| PubKeyOperator | BLSPubKey | 48 | The public key used for operational related signing (network messages, ProTx updates) |
| KeyIdVoting | CKeyID | 20 | The public key hash used for voting. |
@@ -127,8 +128,7 @@ The transaction consists of the following data in the payload area:
| scriptPayout | Script | Variable | Payee script (p2pkh/p2sh) |
| inputsHash | uint256 | 32 | The SHA256 hash of all the outpoints of the transaction inputs |
| platformNodeID | byte[] | 0 or 20 | Dash Platform P2P node ID, derived from P2P public key. Only present for masternode type 1. |
-| platformP2PPort | uint_16 | 0 or 2 | TCP port of Dash Platform peer-to-peer communication between nodes (network byte order). Only present for masternode type 1. |
-| platformHTTPPort | uint_16 | 0 or 2 | TCP port of Platform HTTP/API interface (network byte order). Only present for masternode type 1. |
+| platformNetInfo | byte[] | variable | Platform addresses (see [appendix](#appendix-c-network-information)) |
| payloadSigSize | compactSize uint | 1-9 | Size of the Signature |
| payloadSig | unsigned char[] | Variable | Signature of the hash of the ProTx fields. Signed with the key corresponding to the collateral outpoint in case the collateral is not part of the ProRegTx itself, empty otherwise. |
@@ -145,7 +145,7 @@ There are multiple ways to update masternodes. The table below details the data
| Update Type | Transaction | Issued by | Data updated |
| ----------- | ----------- | --------- | ------------ |
-| Service | ProUpServTx | Operator Only | IP Address / Port |
+| Service | ProUpServTx | Operator Only | Masternode addresses |
| Registration | ProUpRegTx | Owner Only | Mode / Payout Script / Voting Key / Operator Key |
| Operator Revocation | ProUpRevTx | Operator Only | \* No data updated / * Only used to signal the owner that a new ProUpRegTx is required |
@@ -153,7 +153,7 @@ There are multiple ways to update masternodes. The table below details the data
To service update a masternode, the masternode operator must submit another special transaction (DIP2) to the network. This special transaction is called a Provider Update Service Transaction and is abbreviated as ProUpServTx. It can only be done by the operator.
-An operator can update the IP address and port fields of a masternode entry. If a non-zero operatorReward was set in the initial ProRegTx, the operator may also set the scriptOperatorPayout field in the ProUpServTx. If scriptOperatorPayout is not set and operatorReward is non-zero, the owner gets the full masternode reward.
+An operator can update the masternode addresses of a masternode entry. If a non-zero operatorReward was set in the initial ProRegTx, the operator may also set the scriptOperatorPayout field in the ProUpServTx. If scriptOperatorPayout is not set and operatorReward is non-zero, the owner gets the full masternode reward.
A ProUpServTx is only valid for masternodes in the registered masternodes subset. When processed, it updates the metadata of the masternode entry and revives the masternode if it was previously marked as PoSe-banned.
@@ -166,14 +166,12 @@ The transaction consists of the following data in the payload area:
| version | uint_16 | 2 | ProUpServTx version number. Set to 2 once v19 fork activates |
| type | uint_16 | 0 or 2 | Masternode type. Only present for version 2. |
| proTXHash | uint256 | 32 | The hash of the initial ProRegTx |
-| ipAddress | byte[] | 16 | IPv6 address in network byte order. Only IPv4 mapped addresses are allowed (to be extended in the future) |
-| port | uint_16 | 2 | Port (network byte order) |
+| networkInfo | byte[] | variable | Masternode addresses (see [appendix](#appendix-c-network-information)) |
| scriptOperatorPayoutSize | compactSize uint | 1-9 | Size of the Payee Script. |
| scriptOperatorPayout | Script | Variable | Payee script (p2pkh/p2sh) |
| inputsHash | uint256 | 32 | The SHA256 hash of all the outpoints of the transaction inputs |
| platformNodeID | byte[] | 0 or 20 | Dash Platform P2P node ID, derived from P2P public key. Only present for masternode type 1. |
-| platformP2PPort | uint_16 | 0 or 2 | TCP port of Dash Platform peer-to-peer communication between nodes (network byte order). Only present for masternode type 1. |
-| platformHTTPPort | uint_16 | 0 or 2 | TCP port of Platform HTTP/API interface (network byte order). Only present for masternode type 1. |
+| platformNetInfo | byte[] | variable | Platform addresses (see [appendix](#appendix-c-network-information)) |
| payloadSig | BLSSig | 96 | Signature of the hash of the ProUpServTx fields. Signed by the Operator. |
The different versions are:
@@ -246,7 +244,7 @@ Updating is done on the so called chain-tips list, which is the list valid at th
The chain-tips list is updated for every new block that is processed. The rules to update the list are the following:
- 1. If a valid ProRegTx is encountered, a masternode entry (identified by the hash of the ProRegTx) is added to the registered set. The entry also contains metadata (IP address, public keys, etc.) found in the ProTx.
+ 1. If a valid ProRegTx is encountered, a masternode entry (identified by the hash of the ProRegTx) is added to the registered set. The entry also contains metadata (masternode addresses, public keys, etc.) found in the ProTx.
2. If any transaction in the block spends the collateral of an existing entry in the registered masternode set, the corresponding masternode is removed from the list
3. PoSe verification is performed for all masternodes in the valid subset. If the verification for a masternode fails, it is marked as PoSe-banned and thus will be excluded from the valid masternode subset. PoSe verification is defined by DIP 006 and only relies on data available on-chain up to the current chain-tip.
4. If a ProUpServTx is found in the block and the referenced masternode is not marked as PoSe-banned, its metadata is updated.
@@ -280,14 +278,12 @@ Applicable to any type:
2. KeyIdOwner or PubKeyOperator was already used by any entry in the registered masternodes set
3. scriptPayout is not a P2PKH or P2SH script
4. When scriptPayout is P2PKH script and the public key hash equals any of KeyIdOwner or KeyIdVoting
- 5. ipAddress is set and port is not set to the default mainnet port
- 6. ipAddress is set and not routable or not an IPv4 mapped address
- 7. ipAddress is set and already used in the registered masternodes set
- 8. operatorReward > 10000
- 9. The inputsHash does not match the calculated hash
- 10. collateralOutpoint `hash` is null and payloadSig is not empty (zero size)
- 11. collateralOutpoint `hash` is not null and payloadSig is not a valid signature signed with the collateral key
- 12. collateralOutpoint `hash` is not null and the referenced collateral is not a P2PKH output
+ 5. networkInfo fails validation [(see rules)](dip-0003/network-info.md#mninfo_rules)
+ 6. operatorReward > 10000
+ 7. The inputsHash does not match the calculated hash
+ 8. collateralOutpoint `hash` is null and payloadSig is not empty (zero size)
+ 9. collateralOutpoint `hash` is not null and payloadSig is not a valid signature signed with the collateral key
+ 10. collateralOutpoint `hash` is not null and the referenced collateral is not a P2PKH output
Please note that while deploying DIP3, additional and temporary validation rules will apply. The details of these temporary rules will be described in the deployment plan.
@@ -296,13 +292,11 @@ Please note that while deploying DIP3, additional and temporary validation rules
A ProUpServTx is invalid if any of these conditions are true:
1. proTxHash can not be found in the registered masternode set
- 2. ipAddress is set and port is not set to the default mainnet port
- 3. ipAddress is set and not routable or not an IPv4 mapped address
- 4. ipAddress is set and already used in another masternode from the registered masternodes set
- 5. scriptOperatorPayout is set and operatorReward of the masternode is 0
- 6. scriptOperatorPayout is set and not a P2PKH or P2SH script
- 7. The inputsHash does not match the calculated hash
- 8. payloadSig is invalid
+ 2. networkInfo fails validation [(see rules)](dip-0003/network-info.md#mninfo_rules)
+ 3. scriptOperatorPayout is set and operatorReward of the masternode is 0
+ 4. scriptOperatorPayout is set and not a P2PKH or P2SH script
+ 5. The inputsHash does not match the calculated hash
+ 6. payloadSig is invalid
Please note that while deploying DIP3, additional and temporary validation rules will apply. The details of these temporary rules will be described in the deployment plan.
@@ -310,7 +304,7 @@ Please note that while deploying DIP3, additional and temporary validation rules
A ProRegTx or ProUpServTx is invalid if any of these conditions are true (applicable only when type is 1):
- 1. platformP2PPort, platformHTTPPort and port from ipAddress are not distinct.
+ 1. platformNetInfo fails validation [(see rules)](dip-0003/network-info.md#plinfo_rules).
2. platformNodeID is null or is a non-hex string.
3. platformNodeID is not unique in the network.
@@ -365,6 +359,14 @@ The individual quorum types present in Dash are not subject to this DIP and shou
| 2 | Compromised Keys |
| 3 | Change of Keys (Not compromised) |
+## Appendix B: Masternode Types
+
+See [masternode types table](dip-0003/masternode-types.md)
+
+## Appendix C: Network Information
+
+Masternode and Platform network information are defined in the [appendix](dip-0003/network-info.md)
+
## Copyright
Copyright (c) 2018 Dash Core Group, Inc. [Licensed under the MIT License](https://opensource.org/licenses/MIT)
diff --git a/dip-0003/masternode-types.md b/dip-0003/masternode-types.md
index 722dd328..2683a57e 100644
--- a/dip-0003/masternode-types.md
+++ b/dip-0003/masternode-types.md
@@ -1,6 +1,6 @@
-# Masternode Types
+# Appendix B: Masternode Types
-| Masternode Type | Description |
-| --- | --- |
-| 0 | Default (1000 DASH collateral) |
-| 1 | Evolution masternode (evonode) (4000 DASH collateral) |
+| Masternode Type | Description | Collateral |
+| --------------- | ------------------------------ | ---------- |
+| 0 | Regular | 1000 DASH |
+| 1 | Evolution masternode (evonode) | 4000 DASH |
diff --git a/dip-0003/network-info.md b/dip-0003/network-info.md
new file mode 100644
index 00000000..67ebac2d
--- /dev/null
+++ b/dip-0003/network-info.md
@@ -0,0 +1,43 @@
+# Appendix C: Network Information
+
+## Masternode Information
+
+The fields below are represented as `networkInfo` and are applicable to all masternodes types as defined in
+[Appendix B](masternode-types.md)
+
+| Field | Type | Size | Description |
+| --------- | ------- | ---- | -------------------------------------------------------------------------- |
+| ipAddress | byte[] | 16 | IPv6 address in network byte order. Only IPv4 mapped addresses are allowed |
+| port | uint_16 | 2 | Port (network byte order) |
+
+### Validation Rules
+
+* `ipAddress` MUST be a valid IPv4 address that is routable on the global internet
+* `ipAddress` MUST NOT be already used in the registered masternodes set
+* `port` MUST be within the valid port range [1, 65535]
+* On mainnet, `port` MUST be set to the following value
+
+ | Field | Value |
+ | -------| ------ |
+ | port | 9999 |
+
+## Platform Information
+
+The fields below are represented as `platformNetInfo` and are only applicable for evonodes as defined in
+[Appendix B](masternode-types.md)
+
+| Field | Type | Size | Description |
+| ---------------- | ------- | ------ | ------------------------------------------------------------------- |
+| platformP2PPort | uint_16 | 0 or 2 | TCP port of Dash Platform peer-to-peer communication between nodes. |
+| platformHTTPPort | uint_16 | 0 or 2 | TCP port of Platform HTTP/API interface. |
+
+### Validation Rules
+
+* `platformP2PPort` and `platformHTTPPort` MUST be within the valid port range [1, 65535]
+* `platformP2PPort`, `platformHTTPPort`, and [`port`](#masternode-information) from `networkInfo` MUST be distinct
+* On mainnet, `platformP2PPort` and `platformHTTPPort` MUST be set to the following values
+
+ | Field | Value |
+ | ------------------ | ------ |
+ | platformP2PPort | 26656 |
+ | platformHTTPPort | 443 |
diff --git a/dip-0004.md b/dip-0004.md
index 568b69be..99c7c517 100644
--- a/dip-0004.md
+++ b/dip-0004.md
@@ -96,40 +96,26 @@ A SML entry is used to calculate the hashes for the merkleRootMNList. It is also
A SML entry consists of the following fields:
-| Field | Type | Size | Description |
-| --- | --- | --- | --- |
-| proRegTxHash | uint256 | 32 | The hash of the ProRegTx that identifies the masternode |
-| confirmedHash | uint256 | 32 | The hash of the block at which the masternode got confirmed |
-| ipAddress | byte[] | 16 | IPv6 address in network byte order. Only IPv4 mapped addresses are allowed (to be extended in the future) |
-| port | uint_16 | 2 | Port (network byte order) |
-| pubKeyOperator | BLSPubKey | 48 | The operators public key |
-| keyIDVoting | CKeyID | 20 | The public key hash used for voting. |
-| isValid | bool | 1 | True if a masternode is not PoSe-banned |
-
-Clients with protocol version greater than or equal to 70227 will receive the following fields just after `isValid`.
-
-| Field | Type | Size | Description |
-|---------------------| ---- | ---- |-----------------------------------|
-| type | uint_16 | 0 or 2 | Masternode type. 0 for regular masternode, 1 for evonode. |
-| platformHTTPPort | uint_16 | 0 or 2 | TCP port of Platform HTTP/API interface (network byte order). Only present for masternode type 1. |
-| platformNodeID | byte[] | 0 or 20 | Dash Platform P2P node ID, derived from P2P public key. Only present for masternode type 1. |
-
-The new `type`, `platformHTTPPort` and `platformNodeID` fields will be serialised only when v19 activates and only for entries with `nVersion` equals to 2.
-
-Clients with protocol version greater than or equal to 70228 will receive the following field just before `proRegTxHash`.
-
-| Field | Type | Size | Description |
-|---------------------| -------- | ---- |-----------------------------------|
-| nVersion | uint16_t | 2 | Version of the SML entry |
+| Field | Type | Size | Description | Presence condition |
+| ---------------- | --------- | -------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
+| nVersion | uint16_t | 2 | Version of the SML entry | `PROTOCOL_VERSION` >= `70228` |
+| proRegTxHash | uint256 | 32 | The hash of the ProRegTx that identifies the masternode | _Always present_ |
+| confirmedHash | uint256 | 32 | The hash of the block at which the masternode got confirmed | _Always present_ |
+| networkInfo | byte[] | variable | Masternode addresses (see [appendix](dip-0003.md#appendix-c-network-information)) | _Always present_ |
+| pubKeyOperator | BLSPubKey | 48 | The operators public key | _Always present_ |
+| keyIDVoting | CKeyID | 20 | The public key hash used for voting. | _Always present_ |
+| isValid | bool | 1 | True if a masternode is not PoSe-banned | _Always present_ |
+| type | uint_16 | 0 or 2 | Masternode type. 0 for regular masternode, 1 for evonode. | `PROTOCOL_VERSION` >= `70227` and `nVersion` == 2 |
+| platformHTTPPort | uint_16 | 0 or 2 | TCP port of Platform HTTP/API interface (network byte order). Only present for masternode type 1. | `PROTOCOL_VERSION` >= `70227` and `nVersion` == 2 |
+| platformNodeID | byte[] | 0 or 20 | Dash Platform P2P node ID, derived from P2P public key. Only present for masternode type 1. | `PROTOCOL_VERSION` >= `70227` and `nVersion` == 2 |
The `nVersion` field indicates which BLS scheme is used to serialise each SML entries' `pubKeyOperator` field.
-| Version | Value Description |
-|---------|-----------------------------------------------------------|
+| Version | Value Description |
+| ------- | --------------------------------------------------------- |
| 1 | Serialisation of `pubKeyOperator` using legacy BLS scheme |
| 2 | Serialisation of `pubKeyOperator` using basic BLS scheme |
-
### Calculating the merkle root of the active LLMQs
The CbTx contains the “merkleRootQuorums” field. This is the merkle root of all the hashes of the final quorum commitments
diff --git a/dip-0028.md b/dip-0028.md
index c4a6d1b2..38a3107b 100644
--- a/dip-0028.md
+++ b/dip-0028.md
@@ -231,15 +231,13 @@ type 1 requires a 4000 DASH collateral.
A ProRegTx with masternode type 1 indicates registration of a 4000 DASH collateral evonode.
-If the `version` is 2 and the `type` is 1, then the `platformNodeID`, `platformP2PPort`, and
-`platformHTTPPort` fields are serialized in that order between the `inputsHash` and `payloadSigSize`
-fields.
+If the `version` is 2 and the `type` is 1, then the `platformNodeID` and `platformNetInfo`
+fields are serialized in that order between the `inputsHash` and `payloadSigSize` fields.
| Field | Type | Size | Description | Serialized |
| --- | --- | --- | --- | --- |
| platformNodeID | byte[] | 0 or 20 bytes | Dash Platform node ID, derived from P2P public key. Only present for masternode type 1. | Only when `version` is 2 and `type` is 1. |
-| platformP2PPort | uint_16 | 0 or 2 bytes | TCP port of Dash Platform peer-to-peer communication between nodes (network byte order). Only present for masternode type 1. | Only when `version` is 2 and `type` is 1. |
-| platformHTTPPort | uint_16 | 0 or 2 bytes | TCP port of Platform HTTP/API interface (network byte order). Only present for masternode type 1. | Only when `version` is 2 and `type` is 1. |
+| platformNetInfo | byte[] | variable | Platform addresses (see [appendix](dip-0003.md#appendix-c-network-information)). Only present for masternode type 1. | Only when `version` is 2 and `type` is 1. |
#### Changes in ProUpServTx
@@ -247,16 +245,14 @@ Since the ProUpServTx does not currently include the `type` field, version 2 of
it and serializes it right after the `version` field. A ProUpServTx of masternode type 1 indicates
an update registrar of a 4000 Dash collateral evonode.
-Also, if the `version` is 2 and the `type` is 1, then the `platformNodeID`, `platformP2PPort`, and
-`platformHTTPPort` fields are serialized in that order between the `inputsHash` and `payloadSig`
-fields.
+Also, if the `version` is 2 and the `type` is 1, then the `platformNodeID` and `platformNetInfo`
+fields are serialized in that order between the `inputsHash` and `payloadSig` fields.
| Field | Type | Size | Description | Serialized |
| --- | --- | --- | --- | --- |
| type | uint_16 | 0 or 2 bytes | Masternode type. 0 for regular masternode, 1 for evonode. | Only when `version` is 2. |
| platformNodeID | byte[] | 0 or 20 bytes | Dash Platform node ID, derived from P2P public key. Only present for masternode type 1. | Only when `version` is 2 and `type` is 1. |
-| platformP2PPort | uint_16 | 0 or 2 bytes | TCP port of Dash Platform peer-to-peer communication between nodes (network byte order). Only present for masternode type 1. | Only when `version` is 2 and `type` is 1. |
-| platformHTTPPort | uint_16 | 0 or 2 bytes | TCP port of Platform HTTP/API interface (network byte order). Only present for masternode type 1. | Only when `version` is 2 and `type` is 1. |
+| platformNetInfo | byte[] | variable | Platform addresses (see [appendix](dip-0003.md#appendix-c-network-information)). Only present for masternode type 1. | Only when `version` is 2 and `type` is 1. |
#### Added validation rules
@@ -270,11 +266,7 @@ The following new ProRegTx rules are added and are only applicable when `type` i
The following new rules are added for both ProRegTx and ProUpServTx and are only applicable when
type is 1:
-* `platformP2PPort` and `platformHTTPPort` MUST be valid port values [1, 65535]
-* `platformP2PPort`, `platformHTTPPort`, and port from ipAddress MUST be distinct
-* For mainnet evonodes, `platformP2PPort` and `platformHTTPPort` MUST be set to the default values
- * Default Platform P2P port: 26656
- * Default Platform HTTP port: 443
+* `platformNetInfo` MUST pass validation [(see rules)](dip-0003/network-info.md#plinfo_rules).
* `platformNodeID` MUST be a non-empty Hex string
* `platformNodeID` MUST be unique network-wide