forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 715
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
[Validation] [Masternode] [Test] SDMN (Shield Deterministic Masternodes) #2876
Open
panleone
wants to merge
12
commits into
PIVX-Project:master
Choose a base branch
from
panleone:shield_dmns
base: master
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.
Conversation
This file contains 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
Note: this PR depends on #2870 which is not merged yet |
panleone
force-pushed
the
shield_dmns
branch
2 times, most recently
from
August 3, 2023 09:14
dd1478f
to
8622e36
Compare
ready for review |
panleone
force-pushed
the
shield_dmns
branch
3 times, most recently
from
August 31, 2023 18:46
33a4d83
to
11c0550
Compare
panleone
force-pushed
the
shield_dmns
branch
6 times, most recently
from
September 1, 2023 20:23
7c87dfe
to
1618dea
Compare
panleone
force-pushed
the
shield_dmns
branch
from
September 5, 2023 12:41
fa43c68
to
ff58178
Compare
Update: Added 3 new commits that implement the voting system for SDMNs and the corresponding functional test coverage. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The aim of this PR is adding the possibility to create Shield Deterministic Masternodes:
Note: a masternode is shielded if the collateral is pointing to a shielded note (Rewards are still normal utxos)
Validation rules:
shieldCollateral
which contains the necessary info to prove the ownership and unspendness of the collateral;vchSig
must be left empty since the proof of ownership is already contained in the new field.RPC changes:
protx_register
andprotx_register_prepare
now take as third parameter the booleantransparent
which isTrue
for normal masternodes andFalse
for shielded masternodes;sig
inprotx_register_submit
is now optional (since it is required ONLY for transparent masternodes and not for shielded one);Proof of Validity:
As collateral the masternode creator must provide a sapling nullifier
nf
(so peers can check thatnf
is unspent) and he also must provide a "proof" which is basically a fake transaction in which they de-shield the note (10000 shield PIVS -> 10000 transparent PIVS). From this proof peers can check that the creator has the authority to spend the collateral and the value of the note is the required one.shieldCollateral
Functional tests:
Governance and Vote system:
We currently map masternodes to their vote to a given proposal through their collateral outpoint, which is stored inside a
CTxIn
, see classesCBudgetVote
andCFinalizedBudgetVote
(I guess due to retro compatibility with an older system).This map cannot be built for SDMNs since their (shield) collateral is private!
To overcome this problem I decided that this map will be done not with the collateral of the masternode but with the hash of the
ProRegTx
(which is enough since it uniquely identify a deterministic masternode). However to keep things compatible with the current system, we have still to provide a full outpoint to store a vote, so we can just pick a defaultnIn = 0
, the full outpoint then becomes:Coutpoint(ProRegTxHash, 0)
For future PRs:
Other special txs
ProUpServTx
,ProUpRegTx
andProUpRevTx
will be added in a future PR since they are not mandatory: A user can get rid of his masternode simply by spending the SDMN collateral.