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

feat: use recoverable signature #116

Merged
merged 6 commits into from
Jun 18, 2019
Merged

Conversation

classicalliu
Copy link
Contributor

@classicalliu classicalliu commented Jun 12, 2019

nervosnetwork/ckb-system-scripts#15

TODO:

  • update code_hash after ckb replaced binary
  • update README for enable recoverable module

@@ -29,10 +29,10 @@ def initialize(privkey)
def sign(data)
privkey_bin = Utils.hex_to_bin(privkey)
secp_key = Secp256k1::PrivateKey.new(privkey: privkey_bin)
signature_bin = secp_key.ecdsa_serialize(
secp_key.ecdsa_sign(Utils.hex_to_bin(data), raw: true)
signature_bin, recid = secp_key.ecdsa_recoverable_serialize(
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest we add a new recoverable sign instead of changing the current sign. Just in case we need to use both in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@classicalliu classicalliu marked this pull request as ready for review June 18, 2019 09:18
@classicalliu classicalliu merged commit 87cf54c into develop Jun 18, 2019
@classicalliu classicalliu deleted the sign-with-recoverable branch June 18, 2019 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants