From 314fec1122bb2ae6f5cb2d2be111a8a76e6c23ab Mon Sep 17 00:00:00 2001 From: Elias Datler <46360620+fxgst@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:15:23 +0100 Subject: [PATCH] chore: Add Schnorr to management idl (#4086) * Add schnorr stuff to management idl * Changelog --- CHANGELOG.md | 2 ++ src/dfx/src/util/assets.rs | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2c1010885..9e2ccc69a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -166,6 +166,8 @@ Log visibility: controllers ### feat!: Print error traces only in verbose (`-v`) mode or if no proper error message is available +### chore: Add Schnorr types and methods to management canister IDL + ## Dependencies ### Frontend canister diff --git a/src/dfx/src/util/assets.rs b/src/dfx/src/util/assets.rs index aa6d032236..23f1addfe5 100644 --- a/src/dfx/src/util/assets.rs +++ b/src/dfx/src/util/assets.rs @@ -167,6 +167,11 @@ type ecdsa_curve = variant { secp256k1; }; +type schnorr_algorithm = variant { + bip340secp256k1; + ed25519; +}; + type satoshi = nat64; type bitcoin_network = variant { @@ -384,6 +389,34 @@ type sign_with_ecdsa_result = record { signature : blob; }; +type schnorr_public_key_args = record { + canister_id : opt canister_id; + derivation_path : vec blob; + key_id : record { algorithm : schnorr_algorithm; name : text }; +}; + +type schnorr_public_key_result = record { + public_key : blob; + 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 { + signature : blob; +}; + type node_metrics_history_args = record { subnet_id : principal; start_at_timestamp_nanos : nat64; @@ -444,6 +477,10 @@ service ic : { ecdsa_public_key : (ecdsa_public_key_args) -> (ecdsa_public_key_result); sign_with_ecdsa : (sign_with_ecdsa_args) -> (sign_with_ecdsa_result); + // Threshold Schnorr signature + schnorr_public_key : (schnorr_public_key_args) -> (schnorr_public_key_result); + sign_with_schnorr : (sign_with_schnorr_args) -> (sign_with_schnorr_result); + // bitcoin interface bitcoin_get_balance : (bitcoin_get_balance_args) -> (bitcoin_get_balance_result); bitcoin_get_balance_query : (bitcoin_get_balance_query_args) -> (bitcoin_get_balance_query_result) query;