forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat!: implement Decentralized Masternode Shares DIP #7437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
PastaPastaPasta
wants to merge
35
commits into
dashpay:develop
Choose a base branch
from
PastaPastaPasta:claude/masternode-shares-dip-c40ac2
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
2860d23
consensus: add shared collateral template script and new special tx t…
PastaPastaPasta 59d7512
evo: extend extended-address ProRegTx payload with collateral shares
PastaPastaPasta d56c85b
evo: shared masternode consensus rules, state, and special transactions
PastaPastaPasta 4c003c5
masternode: split shared masternode rewards by share amounts
PastaPastaPasta 93539fc
mempool: conflict tracking and eviction for shared masternode transac…
PastaPastaPasta 2ef43b4
policy: relay carve-outs for the shared collateral template
PastaPastaPasta 0aef863
filters: match shared masternode fields in bloom and compact filters
PastaPastaPasta f724e47
rpc: shared masternode registration, dissolution and update commands
PastaPastaPasta 04b23c2
test: unit and functional coverage for decentralized masternode shares
PastaPastaPasta fb121cb
doc: release notes for decentralized masternode shares
PastaPastaPasta 3c5bcad
rpc: preflight shared registration terms and document standby dissolu…
PastaPastaPasta c048336
evo: disallow same-block registration and dissolution of a shared mas…
PastaPastaPasta be39090
rpc: fail clearly when special transaction inputs cannot be signed at…
PastaPastaPasta 4b079ef
test: filter matching and reorg coverage for shared masternodes
PastaPastaPasta 3da9193
test: cover shared masternode revival and pre-activation rejection
PastaPastaPasta f4878a3
rpc, gui: surface shared masternodes in payee displays and wallet fil…
PastaPastaPasta 55d67cd
evo: cap dissolution fees and unilateral penalty overpayment
PastaPastaPasta 562287f
evo: enforce the ProUpShareTx signature size statelessly
PastaPastaPasta e2d6d72
miner: recheck the shared-collateral covenant for every packaged tran…
PastaPastaPasta 896e192
rpc: guard shared_sign against unnoticed dissolution time locks
PastaPastaPasta 5a27443
test: backfill DIP test-list coverage for shared masternodes
PastaPastaPasta 7b3754a
fix: close shared masternode ownership and mempool gaps
PastaPastaPasta 6ad9302
refactor: simplify shared masternode payout helpers
PastaPastaPasta 7318a26
test: cover shared masternodes across participant wallets
PastaPastaPasta a23c27b
test: reject adversarial shared masternode transactions
PastaPastaPasta bf7cc7a
fix(qt): classify shared masternode updates in transaction history
PastaPastaPasta a7a2c50
fix: require explicit shared masternode reward scripts
PastaPastaPasta 0cddf15
test: repair pre-activation gate check after requiring explicit rewar…
PastaPastaPasta df1fc9e
evo: reject a nonzero early penalty without an early period
PastaPastaPasta 1b96c46
rpc: reject unilateral dissolutions in protx shared_combine
PastaPastaPasta 5f75ed2
rpc: warn about time locks on shared registrations in protx shared_sign
PastaPastaPasta 5d0d9ce
evo: fail loudly when a share or signature count exceeds the wire field
PastaPastaPasta 38faee2
evo: use share reward scripts as the default fee source for shared ma…
PastaPastaPasta fbccdc0
rpc: group shared masternode commands in help
PastaPastaPasta 23a51f0
rpc: prefix shared masternode commands consistently
PastaPastaPasta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # Decentralized Masternode Shares | ||
|
|
||
| This release implements the Decentralized Masternode Shares DIP, activating | ||
| together with DIP-0026 multi-party payouts as part of the v24 hard fork | ||
| (`DEPLOYMENT_V24`). Before activation there is no behavior change. | ||
|
|
||
| ## Consensus changes (active with v24) | ||
|
|
||
| - A version 3 (extended addresses) ProRegTx may carry a collateral share table: 2 to 8 participants | ||
| fund the masternode collateral atomically in one registration, each recording | ||
| an immutable amount, refund script and share owner key, plus an updatable | ||
| reward script. Every participant consents by signing a digest that binds the | ||
| exact funding inputs, all outputs, the share table, the penalty terms and the | ||
| registrar configuration. The early-period penalty must be below the smallest | ||
| share and must be zero when no early period is configured. | ||
| - The shared collateral is paid to the 7-byte template script | ||
| `04445348437551` (`0x04 "DSHC" OP_DROP OP_TRUE`). From activation, an output | ||
| paying this exact script is valid only as the collateral of a valid shared | ||
| registration, and spending such an output is valid only via a ProDisTx. | ||
| Template outputs mined before activation become permanently unspendable. | ||
| - Three new special transaction types: | ||
| - **ProDisTx (type 10)** dissolves a shared masternode, refunding every | ||
| participant's principal to its immutable refund script. Exactly one | ||
| signature (unilateral, penalized during the configured early period) or one | ||
| per share (unanimous, penalty-free). Validity is monotone: a ProDisTx that | ||
| is valid at some height is valid at every later height, which makes offline | ||
| "standby dissolutions" safe. The transaction fee is capped at 1000000 duffs | ||
| and a unilateral dissolution may not pay bonuses beyond the configured | ||
| early penalty, bounding what a stolen share owner key can drain from its | ||
| own share. | ||
| - **ProUpShareTx (type 11)** lets one share owner update their reward script. | ||
| - **ProUpSharedRegTx (type 12)** updates the operator key and/or voting key | ||
| with a signature from every share owner. A plain ProUpRegTx is invalid for | ||
| shared masternodes. | ||
| - The owner reward of a shared masternode is split across the share table | ||
| proportionally to the recorded contributions (sequential floor, remainder to | ||
| the last entry), paying each share's reward script (or its refund script when | ||
| none is set). Operator rewards are unchanged. | ||
| - Withdrawal (asset unlock) transactions may not pay the template script. | ||
|
|
||
| ## Relay policy changes | ||
|
|
||
| - The template output relays only as the declared collateral output of a shared | ||
| registration, and a template prevout is accepted only inside a ProDisTx; both | ||
| remain nonstandard everywhere else. | ||
|
|
||
| ## New RPCs | ||
|
|
||
| - `protx shared_register_prepare` builds an unsigned shared registration from a | ||
| caller-supplied funding transaction. | ||
| - `protx shared_sign` signs a shared registration, dissolution or shared | ||
| registrar update with every share owner key the wallet holds. It refuses a | ||
| registration or dissolution carrying an unsatisfied lock time or a relative | ||
| input lock unless `allowTimeLocks` is set. | ||
| - `protx shared_combine` combines collected signatures and optionally submits. | ||
| A dissolution combined here requires a signature from every share; unilateral | ||
| dissolutions come fully signed from `protx shared_dissolve`. | ||
| - `protx shared_dissolve` creates, signs and submits a unilateral ProDisTx (or, with | ||
| `submit=false`, returns hex suitable for offline standby storage). | ||
| - `protx shared_dissolve_prepare` builds an unsigned unanimous ProDisTx. | ||
| - `protx shared_update_share` updates one share's reward address. To restore rewards to the immutable refund address, pass that address explicitly; empty reward scripts are not valid in update transactions. | ||
| - `protx shared_update_registrar_prepare` builds an unsigned ProUpSharedRegTx. | ||
|
|
||
| Updated RPCs | ||
| ------------ | ||
|
|
||
| - `masternodelist` and `masternode list` report comma-separated share owner | ||
| addresses in `owneraddress` for shared masternodes. The `json` and `recent` | ||
| modes can be filtered by any share owner address. Shared registrations and | ||
| masternode state omit the singular `ownerAddress` field in `protx` and decoded | ||
| transaction output; each participant's owner address is in `shares`. (#7437) | ||
|
|
||
| GUI changes | ||
| ----------- | ||
|
|
||
| - The owned-masternode filter includes shared masternodes when the wallet holds | ||
| a participant's refund destination, including when rewards go to a different | ||
| wallet. (#7437) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.