Repository navigation
feat(wallet): derive masternode operator keys from seed #7594
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
Closed
PastaPastaPasta
wants to merge
3
commits into
dashpay:develop
from
PastaPastaPasta:feat/wallet-derived-mn-operator-keys
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
37ebd7e
feat(evo): expose whether an operator key is in use at the chain tip
PastaPastaPasta 4d143f4
test: move FailDatabase wallet test helper into wallet/test/util.h
PastaPastaPasta e70ba4a
feat(wallet): derive masternode operator keys from seed
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // Copyright (c) 2026 The Dash Core developers | ||
| // Distributed under the MIT software license, see the accompanying | ||
| // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
|
||
| #ifndef BITCOIN_INTERFACES_MASTERNODE_OPERATOR_H | ||
| #define BITCOIN_INTERFACES_MASTERNODE_OPERATOR_H | ||
|
|
||
| #include <support/allocators/secure.h> | ||
|
|
||
| #include <cstdint> | ||
| #include <string> | ||
| #include <vector> | ||
|
|
||
| namespace interfaces { | ||
|
|
||
| //! Result of a deterministic masternode operator-key operation. | ||
| enum class MasternodeOperatorKeyStatus : uint8_t { | ||
| SUCCESS, | ||
| NOT_SUPPORTED, | ||
| WALLET_LOCKED, | ||
| EXHAUSTED, | ||
| INVALID_KEY, | ||
| NOT_FOUND, | ||
| DATABASE_ERROR, | ||
| DERIVATION_ERROR, | ||
| }; | ||
|
|
||
| //! A deterministic masternode operator key returned by the wallet. The public | ||
| //! key uses the canonical basic-scheme serialization. | ||
| struct MasternodeOperatorKey { | ||
| SecureVector secret_key; | ||
| std::vector<unsigned char> public_key; | ||
| std::string path; | ||
| }; | ||
|
|
||
| struct MasternodeOperatorKeyResult { | ||
| MasternodeOperatorKeyStatus status{MasternodeOperatorKeyStatus::DERIVATION_ERROR}; | ||
| MasternodeOperatorKey key; | ||
| }; | ||
|
|
||
| } // namespace interfaces | ||
|
|
||
| #endif // BITCOIN_INTERFACES_MASTERNODE_OPERATOR_H |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a mnemonic-only backup is restored after a compromised operator key was rotated or revoked, this current-tip lookup returns false for the old key, so
GetNewMasternodeOperatorKey()can issue the same secret again and an attacker retaining it can sign service or revocation updates for the new masternode. Fresh evidence after the prior report is that the final counter redesign andoperator_key_in_use_follows_current_listtest explicitly make rotated and revoked keys reusable. Include active-chain provider-key history, or a durable recoverable used-index marker, before issuing.AGENTS.md reference: AGENTS.md:L233-L237
Useful? React with 👍 / 👎.