Skip to content
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

[Refactor] MN operator key migration to BLS #2421

Merged
merged 9 commits into from
Oct 8, 2021

Conversation

random-zebra
Copy link

@random-zebra random-zebra commented Jun 14, 2021

This builds on top of:

As per title, introduce BLS keys/signatures for messages signed by the masternode operator (which is a requirement for DIP 6, and subsequent upgrades).

  • a new RPC command generateblskeypair returns a new publickey/secretkey BLS keypair.
  • CDeterministicMNState::keyIDOperator is now a CBLSLazyPublicKey (instead of a CKeyID), and it's renamed pubKeyOperator.
  • -mnoperatorprivatekey flag takes a BLS secret key in hex format.
  • CActiveMasternodeInfo stores a CBLSPublicKey/CBLSSecretKey
  • the BLS signature byte vector is serialized for legacy messages (mnw, fbv) in the compatibility code.

@random-zebra
Copy link
Author

Finally rebased on master. Ready to go.

@random-zebra random-zebra force-pushed the 202106_BLS_operatorkey branch 2 times, most recently from 104ee73 to d26563e Compare September 22, 2021 16:44
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed till d26563e, looking great ☕. Left few more comments

As we spoke via pm, would be better to move the last two mn payments related commits to another PR so this one is only scoped to the MN operator key migration to BLS.

Aside from that, i'm ready to ACK it :).

src/messagesigner.cpp Outdated Show resolved Hide resolved
src/messagesigner.cpp Outdated Show resolved Hide resolved
src/messagesigner.cpp Outdated Show resolved Hide resolved
src/rpc/rpcevo.cpp Outdated Show resolved Hide resolved
src/test/evo_deterministicmns_tests.cpp Show resolved Hide resolved
src/test/evo_deterministicmns_tests.cpp Show resolved Hide resolved
these will be used by mnw/fbv for deterministic masternodes, after
switching the operator keys to BLS
-BEGIN VERIFY SCRIPT-
sed -i 's/keyIDOperator/pubKeyOperator/g' src/*.h src/*.cpp src/*/*.h src/*/*.cpp;
sed -i 's/operatorAddress/operatorPubKey/g' src/*.h src/*.cpp src/*/*.h src/*/*.cpp;
-END VERIFY SCRIPT-
Also add methods to parse bls public/secret keys.
These will be used by the protx_* commands after the switch of operator
keys to BLS.
Only the secret key and the collateral out are needed to vote/sign
@random-zebra
Copy link
Author

Rebased on master, feedback tackled, and last 2 commits moved to #2584.

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, ACK d3843cd

@furszy furszy requested a review from Fuzzbawls October 6, 2021 14:38
Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d3843cd

@furszy furszy merged commit 295dabf into PIVX-Project:master Oct 8, 2021
furszy added a commit that referenced this pull request Nov 8, 2021
e8559fc [Refactor] make AddWinningMasternode a void function (random-zebra)
5aaa02a [Test] add mnwinner case for non-existent MN. (furszy)
e68773b [Refactor] Fix checks order for mnw processing (random-zebra)

Pull request description:

  Extracted from #2421 (and based on top of it) so #2550 can be merged in between.

ACKs for top commit:
  furszy:
    utACK e8559fc after rebase

Tree-SHA512: 659d4ca43502f8e1e8f6ddbf7c815f6a07a69625f00c8ab71b7d8e9c97b85e90d97b18ccc988dcfd4d345d5f79932128abdaa0f0634380be7d715d3a3e45c6fc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants