Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
feat(crypto): Add support for Schnorr auxiliary inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit committed Oct 2, 2024
1 parent ac416ec commit 623e1db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/_attachments/ic.did
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,17 @@ type schnorr_public_key_result = record {
chain_code : blob;
};

type schnorr_aux = variant {
bip341: record {
merkle_root_hash: blob;
}
};

type sign_with_schnorr_args = record {
message : blob;
derivation_path : vec blob;
key_id : record { algorithm : schnorr_algorithm; name : text };
aux: opt schnorr_aux;
};

type sign_with_schnorr_result = record {
Expand Down
2 changes: 2 additions & 0 deletions spec/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Cycles to pay for the call must be explicitly transferred with the call, i.e., they are not automatically deducted from the caller's balance implicitly (e.g., as for inter-canister calls).

### IC method `http_request` {#ic-http_request}
Expand Down

0 comments on commit 623e1db

Please sign in to comment.