-
Notifications
You must be signed in to change notification settings - Fork 425
add BIP341 to Motoko basic_bitcoin
#1080
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
Conversation
/// Returns the ECDSA public key of this canister at the given derivation path. | ||
public func ecdsa_public_key(key_name : Text, derivation_path : [Blob]) : async Blob { | ||
public func ecdsa_public_key(ecdsa_canister_actor: EcdsaCanisterActor, key_name : Text, derivation_path : [Blob]) : async Blob { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since dfx
/ pocket IC doesn't support key tweaking yet, we need to use the mock canister. Previously, the actor was defined as actor ("aaaaa-aa")
in the module, but now we need to change it dynamically based on the canister API, but Motoko doesn't allow for non-static variables in modules. Therefore, defining EcdsaCanisterActor
in the top-level actor and passing it down as an argument is the best way to make it work that I could find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly that once dfx+pocketIC support key tweaking, we don't need to pass the actor as argument any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily. It seems useful for testing to be able to change the management canister actor easily.
Motoko style actually uses camel case for variables and function names, but I will leave this change for another PR... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @altkdf! LGTM, not an expert on the topic, however. Quite some code was moved to new files: I only glanced over this code and didn't do an in-depth review.
rust/threshold-schnorr/src/schnorr_example_rust/src/wasm_only.rs
Outdated
Show resolved
Hide resolved
/// Returns the ECDSA public key of this canister at the given derivation path. | ||
public func ecdsa_public_key(key_name : Text, derivation_path : [Blob]) : async Blob { | ||
public func ecdsa_public_key(ecdsa_canister_actor: EcdsaCanisterActor, key_name : Text, derivation_path : [Blob]) : async Blob { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand correctly that once dfx+pocketIC support key tweaking, we don't need to pass the actor as argument any more?
This reverts commit 4a48587.
It would also make sense if someone except me would check that this example works with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
No description provided.