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(crypto): Add support for Schnorr auxiliary inputs #344

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

randombit
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Oct 2, 2024

🤖 Here's your preview: https://qlapq-syaaa-aaaak-qcq2a-cai.icp0.io/docs

@@ -2447,6 +2447,8 @@ The encoding of the signature depends on the key ID's `algorithm`:

This call requires that a Schnorr key with ID `key_id` was generated by the IC and the signing functionality for that key was enabled. Otherwise, the call is is rejected.

This call accepts an optional auxiliary parameter `aux`. The auxiliary parameter type `schnorr_aux` is a variant. The only currently supported variant is `bip341` which allows passing a Merkle tree root hash, which is required to implement Taproot signatures as defined in [BIP341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki). The `bip341` variant is anly allowed for `bip340secp256k1` signatures, and if provided the `merkle_root_hash` blob must be exactly 32 bytes long, and should be generated in accordance with BIP341's specification for `taproot_output_script`. If no auxiliary parameter is provided, then `bip340secp256k1` signatures are generated in accordance with BIP340.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This call accepts an optional auxiliary parameter `aux`. The auxiliary parameter type `schnorr_aux` is a variant. The only currently supported variant is `bip341` which allows passing a Merkle tree root hash, which is required to implement Taproot signatures as defined in [BIP341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki). The `bip341` variant is anly allowed for `bip340secp256k1` signatures, and if provided the `merkle_root_hash` blob must be exactly 32 bytes long, and should be generated in accordance with BIP341's specification for `taproot_output_script`. If no auxiliary parameter is provided, then `bip340secp256k1` signatures are generated in accordance with BIP340.
This call accepts an optional auxiliary parameter `aux`. The auxiliary parameter type `schnorr_aux` is a variant. The only currently supported variant is `bip341` which allows passing a Merkle tree root hash, which is required to implement Taproot signatures as defined in [BIP341](https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki). The `bip341` variant is only allowed for `bip340secp256k1` signatures, and if provided the `merkle_root_hash` blob must be exactly 32 bytes long, and should be generated in accordance with BIP341's specification for `taproot_output_script`. If no auxiliary parameter is provided, then `bip340secp256k1` signatures are generated in accordance with BIP340.

Copy link
Contributor

Choose a reason for hiding this comment

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

It also may be better to reference taproot_sign_key instead of taproot_output_script because we are tweaking the secret key, although the procedure is essentially the same. It may also be reasonable to say that merkle_root_hash corresponds to h in taproot_sign_key of BIP341.

@@ -2447,6 +2447,8 @@ The encoding of the signature depends on the key ID's `algorithm`:

This call requires that a Schnorr key with ID `key_id` was generated by the IC and the signing functionality for that key was enabled. Otherwise, the call is is rejected.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This call requires that a Schnorr key with ID `key_id` was generated by the IC and the signing functionality for that key was enabled. Otherwise, the call is is rejected.
This call requires that a Schnorr key with ID `key_id` was generated by the IC and the signing functionality for that key was enabled. Otherwise, the call is rejected.

@altkdf
Copy link
Contributor

altkdf commented Oct 9, 2024

LGTM! Left some small improvement suggestions.

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