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

crypto: add tz4 to aggregate PK,PKH types #78

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Conversation

emturner
Copy link
Collaborator

No description provided.

@rafoo
Copy link

rafoo commented Jun 28, 2024

Thanks for doing this, this will be useful in Michelson-in-Rust.

@rafoo
Copy link

rafoo commented Jun 28, 2024

As a sanity check, I've compared the values being tested with Octez:

$ alias mockup-client
alias mockup-client='octez-client --mode mockup --base-dir /tmp/mockup'
$ mockup-client create mockup
Base directory /tmp/mockup does not exist.
Create it with:
./octez-client --mode mockup --base-dir /tmp/mockup create mockup
Some commands (e.g., transfer) might not work correctly.
No protocol specified: using Alpha as default protocol.
Created mockup client base dir in /tmp/mockup
Tezos address added: tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx
Tezos address added: tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN
Tezos address added: tz1faswCTDciRzE4oJ9jn2Vm2dvjeyA9fUzU
Tezos address added: tz1b7tUupMgCNw2cCLpKTkSD1NZzB5TkP2sv
Tezos address added: tz1ddb9NMYHZi5UzPdzTZMYQQZoMub195zgv
$ mockup-client import secret key alice unencrypted:BLsk2wHXLW6gN9sbEN2rU84mmCSNZKn9KRKrw74LwHqEaLGwL3qQ31
Tezos address added: tz4DWZXsrP3bdPaZ5B3M3iLVoRMAyxw9oKLH
$ mockup-client show address alice
Hash: tz4DWZXsrP3bdPaZ5B3M3iLVoRMAyxw9oKLH
Public Key: BLpk1yE462s3cPX5t2HhvGPg3HSEUgqLi9q9Knwx7mbN4VuhEsvBYFvEz5Eu9shR7vZRY1k5PCtV
$ mockup-client normalize data '"BLpk1yE462s3cPX5t2HhvGPg3HSEUgqLi9q9Knwx7mbN4VuhEsvBYFvEz5Eu9shR7vZRY1k5PCtV"' of type key --unparsing-mode Optimized
0x03b46a862ef09f7f994c3d3570464dd8ab39305161e27b144ef900fc57e92c9429878b81af9678478d63f2eb36b01b2418
$ mockup-client check that bytes 0x68656c6c6f2c20626c73 were signed by alice to produce BLsig9WknWnGmPcJw1q9oCBr53UyjAWxxYNS5wz5HBKmCcuxCfK1Hwhs92YDFocvxUhXfUosgcTuzAEuAAjKzjy7isNhU3o2e8snmZyo9E85oRudCpM1MNtkeAAYEkSXUPLKtRYa9yFwni
Signature check successful.

From the same private key, message and signature we indeed get the same public key (in both b58 and binary formats) and the signature check succeeds.

Copy link

@rafoo rafoo left a comment

Choose a reason for hiding this comment

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

LGTM

@emturner emturner merged commit b3524fc into master Jun 28, 2024
7 checks passed
@emturner emturner deleted the emturner-rv-11 branch June 28, 2024 12:13
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.

2 participants