The MN_RR hard fork, first included in Dash Core v20, will be activated after v21 is adopted by masternodes. This
hard fork enables the major feature included in this release: Masternode Reward Location Reallocation. The activation
will also initiate the launch of the Dash Platform Genesis Chain.
As the MN_RR hard fork is an [Enhanced Hard Fork](https://github.com/dashpay/dips/blob/master/dip-0023.md),
activation is dependent on both masternodes and miners. However, as this hard fork was first implemented in v20, only
masternodes are required to upgrade for the hard fork to activate. Once 85% of masternodes have upgraded to v21,
an EHF message will be signed by the `LLMQ_400_85` quorum, and mined into a block. This signature serves as proof that 85% of
active masternodes have upgraded.
Once the EHF signed message is mined and a cycle ends, the hard fork status will move from `defined` to `started`. At this point,
miners on v20 and v21 will begin to signal for activation of MN_RR. As such, nearly 100% of miners will
likely be signalling. If a sufficient number of mined blocks signal support for activation (starting at 80% and gradually decreasing to 60%)
by the end of a cycle, the hard fork will change status from `started` to `locked_in`. At this point, hard fork activation
will occur at the end of the next cycle.
Now that the hard fork is active, the new rules will be in effect.
Masternode Reward Location Reallocation
---------------------------------------
Once the MN_RR hard fork activates, some coinbase funds will be moved into the Credit Pool (i.e., to Platform) each time a block is mined.
Evonodes will then receive a single reward per payment cycle on the Core chain - not rewards from four sequential blocks
as in v19/v20. The remainder of evonode payments will be distributed by Platform from the credit pool. This is to
incentivize evonodes to upgrade to Platform because only nodes running Platform can receive these reward payments.
Mainnet Spork Hardening
-----------------------
This version hardens all sporks on mainnet. Sporks remain in effect on all devnets and testnet; however, on mainnet,
the value of all sporks are hard coded to 0, or 1 for the `SPORK_21_QUORUM_ALL_CONNECTED` spork. These hardened values match the
active values historically used on mainnet, so there is no change in the network's functionality.
Default Branch Changed
----------------------
The Dash Core repository (`github.com/dashpay/dash`) will now use `develop` as the default branch. New clones
of the repository will no longer default to the `master` branch. If you want to continue using a stable version of
Dash Core, you should manually checkout the `master` branch.
# Additional Changes
Wallet
------
### Avoid Partial Spends
The wallet will now avoid partial spends (APS) by default if this does not result
in a difference in fees compared to the non-APS variant. The allowed fee threshold
can be adjusted using the new `-maxapsfee` configuration option. (dash#5930)
### Experimental Descriptor Wallets
Please note that Descriptor Wallets are still experimental and not all expected functionality
is available. Additionally there may be some bugs and current functions may change in the future.
Bugs and missing functionality can be reported to the [issue tracker](https://github.com/dashpay/dash/issues).
v21 introduces a new experimental type of wallet - Descriptor Wallets. Descriptor Wallets store
scriptPubKey information using descriptors. This is in contrast to the Legacy Wallet
structure where keys are used to generate scriptPubKeys and addresses. Because of this
shift to being script-based instead of key-based, many of the confusing things that Legacy
Wallets do are not possible with Descriptor Wallets. Descriptor Wallets use a definition
of "mine" for scripts which is simpler and more intuitive than that used by Legacy Wallets.
Descriptor Wallets also uses different semantics for watch-only things and imports.
As Descriptor Wallets are a new type of wallet, their introduction does not affect existing wallets.
Users who already have a Dash Core wallet can continue to use it as they did before without
any change in behavior. Newly created Legacy Wallets (which is the default type of wallet) will
behave as they did in previous versions of Dash Core.
The differences between Descriptor Wallets and Legacy Wallets are largely limited to non user facing
things. They are intended to behave similarly except for the import/export and watchonly functionality
as described below.
#### Creating Descriptor Wallets
Descriptor Wallets are not created by default. They must be explicitly created using the
`createwallet` RPC or via the GUI. A `descriptors` option has been added to `createwallet`.
Setting `descriptors` to `true` will create a Descriptor Wallet instead of a Legacy Wallet.
In the GUI, a checkbox has been added to the Create Wallet Dialog to indicate that a
Descriptor Wallet should be created.
A Legacy Wallet will be created if those options have not been set.
#### `IsMine` Semantics
`IsMine` refers to the function used to determine whether a script belongs to the wallet.
This is used to determine whether an output belongs to the wallet. `IsMine` in Legacy Wallets
returns true if the wallet would be able to sign an input that spends an output with that script.
Since keys can be involved in a variety of different scripts, this definition for `IsMine` can
lead to many unexpected scripts being considered part of the wallet.
With Descriptor Wallets, descriptors explicitly specify the set of scripts that are owned by
the wallet. Since descriptors are deterministic and easily enumerable, users will know exactly
what scripts the wallet will consider to belong to it. Additionally the implementation of `IsMine`
in Descriptor Wallets is far simpler than for Legacy Wallets. Notably, in Legacy Wallets, `IsMine`
allowed for users to take one type of address (e.g. P2PKH), mutate it into another address type
and the wallet would still detect outputs sending to the new address type
even without that address being requested from the wallet. Descriptor Wallets do not
allow for this and will only watch for the addresses that were explicitly requested from the wallet.
These changes to `IsMine` will make it easier to understand what scripts the wallet will
actually be watching for in outputs. However, for the vast majority of users, this change is
transparent and will not have noticeable effects.
#### Imports and Exports
In Legacy Wallets, raw scripts and keys could be imported to the wallet. Those imported scripts
and keys are treated separately from the keys generated by the wallet. This complicates the `IsMine`
logic as it has to distinguish between spendable and watchonly.
Descriptor Wallets handle importing scripts and keys differently. Only complete descriptors can be
imported. These descriptors are then added to the wallet as if it were a descriptor generated by
the wallet itself. This simplifies the `IsMine` logic so that it no longer has to distinguish
between spendable and watchonly. As such, the watchonly model for Descriptor Wallets is also
different and described in more detail in the next section.
To import into a Descriptor Wallet, a new `importdescriptors` RPC has been added that uses a syntax
similar to that of `importmulti`.
As Legacy Wallets and Descriptor Wallets use different mechanisms for storing and importing scripts and keys,
the existing import RPCs have been disabled for descriptor wallets.
New export RPCs for Descriptor Wallets have not yet been added.
The following RPCs are disabled for Descriptor Wallets:
* importprivkey
* importpubkey
* importaddress
* importwallet
* importelectrumwallet
* dumpprivkey
* dumpwallet
* dumphdinfo
* importmulti
* addmultisigaddress
#### Watchonly Wallets
A Legacy Wallet contains both private keys and scripts that were being watched.
Those watched scripts would not contribute to your normal balance. In order to see the watchonly
balance and to use watchonly things in transactions, an `include_watchonly` option was added
to many RPCs that would allow users to do that. However, it is easy to forget to include this option.
Descriptor Wallets move to a per-wallet watchonly model. An entire wallet is considered to be
watchonly depending on whether or not it was created with private keys disabled. This eliminates the need
to distinguish between things that are watchonly and things that are not within a wallet.
This change does have a caveat. If a Descriptor Wallet with private keys *enabled* has
a multiple key descriptor without all of the private keys (e.g. `multi(...)` with only one private key),
then the wallet will fail to sign and broadcast transactions. Such wallets would need to use the PSBT
workflow but the typical GUI Send, `sendtoaddress`, etc. workflows would still be available, just
non-functional.
This issue is worse if the wallet contains both single key (e.g. `pkh(...)`) descriptors and such
multiple key descriptors. In this case some transactions could be signed and broadcast while others fail. This is
due to some transactions containing only single key inputs while others contain both single
key and multiple key inputs, depending on which are available and how the coin selection algorithm
selects inputs. However, this is not a supported use case; multisigs
should be in their own wallets which do not already have descriptors. Although users cannot export
descriptors with private keys for now as explained earlier.
Configuration
-------------
### New cmd-line options
-`-networkactive=` Enable all P2P network activity (default: 1). Can be changed by the `setnetworkactive` RPC command.
- A new configuration flag `-maxapsfee` has been added, which sets the max allowed
avoid partial spends (APS) fee. It defaults to 0 (i.e. fee is the same with
and without APS). Setting it to -1 will disable APS, unless `-avoidpartialspends`
is set. (dash#5930)
### Updated cmd-line options
- The `-debug=db` logging category, which was deprecated in v0.18 and replaced by
`-debug=walletdb` to distinguish it from `coindb`, has been removed. (#6033)
- The `-banscore` configuration option, which modified the default threshold for
disconnecting and discouraging misbehaving peers, has been removed as part of
changes in this release to the handling of misbehaving peers. (dash#5511)
- If `-proxy=` is given together with `-noonion` then the provided proxy will
not be set as a proxy for reaching the Tor network. So it will not be
possible to open manual connections to the Tor network, for example, with the
`addnode` RPC. To mimic the old behavior use `-proxy=` together with
`-onlynet=` listing all relevant networks except `onion`.
Remote Procedure Calls (RPCs)
-----------------------------
### New RPCs
- A new `listdescriptors` RPC is available to inspect the contents of descriptor-enabled wallets.
The RPC returns public versions of all imported descriptors, including their timestamp and flags.
For ranged descriptors, it also returns the range boundaries and the next index to generate addresses from. (dash#5911)
- A new `send` RPC with similar syntax to `walletcreatefundedpsbt`, including
support for coin selection and a custom fee rate. The `send` RPC is experimental
and may change in subsequent releases. Using it is encouraged once it's no
longer experimental: `sendmany` and `sendtoaddress` may be deprecated in a future release.
- A new `quorum signplatform` RPC is added for Platform needs. This composite command limits Platform to only request signatures from the Platform quorum type. It is equivalent to `quorum sign <platform type>`.
### RPC changes
-`createwallet` has an updated argument list: `createwallet "wallet_name" ( disable_private_keys blank "passphrase" avoid_reuse descriptors load_on_startup )`
`load_on_startup` used to be argument 5 but now is number 6.
-`createwallet` requires specifying the `load_on_startup` flag when creating descriptor wallets due to breaking changes in v21.
- To make `sendtoaddress` more consistent with `sendmany`, the following
`sendtoaddress` error codes were changed from `-4` to `-6`:
- Insufficient funds
- Fee estimation failed
- Transaction has too long of a mempool chain
- Backwards compatibility has been dropped for two `getaddressinfo` RPC
deprecations, as notified in the 19.1.0 and 19.2.0 release notes.
The deprecated `label` field has been removed as well as the deprecated `labels` behavior of
returning a JSON object containing `name` and `purpose` key-value pairs. Since
20.1, the `labels` field returns a JSON array of label names. (dash#5823)
-`getnetworkinfo` now returns fields `connections_in`, `connections_out`,