-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: add bls verification #239
Conversation
x/staking/keeper/msg_server.go
Outdated
@@ -628,3 +656,23 @@ func (ms msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdatePara | |||
|
|||
return &types.MsgUpdateParamsResponse{}, nil | |||
} | |||
|
|||
// CheckBlsProof checks the BLS signature of the validator | |||
func (ms msgServer) CheckBlsProof(goCtx context.Context, blsPk, sig []byte, valAddr sdk.Address) (bool, error) { |
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.
why not return error only, error means failed to verify.
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.
goctx and valAddr is useless.
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.
fixed
// SignMsgKeysCmd returns the Cobra Command for signing messages with the private key of a given name. | ||
func SignMsgKeysCmd() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "sign [message]", |
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.
This is a dangerous action, please note user to take care.
And give an example, it can be used to do possesion of proof
..
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.
fixed
@@ -93,6 +93,10 @@ func (pubKey *PubKey) VerifySignature(msg, sig []byte) bool { | |||
sig = sig[:len(sig)-1] | |||
} | |||
|
|||
if len(msg) != crypto.DigestLength { |
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.
why we add this? I did not expect any changes of ethsecp256k1.
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.
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.
Anyways, I would remove these changes first to avoid causing other errors.
Description
add signature verification for
BLS
key when creating, editing the validator.Rationale
add a
Proof of Possession
to ensure the validator holds theBLS
key.Example
add an example CLI or API response...
Changes
Notable changes: