forked from domwoe/schnorr_canister
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schnorr_canister.did
34 lines (34 loc) · 1.01 KB
/
schnorr_canister.did
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
type HttpRequest = record {
url : text;
method : text;
body : vec nat8;
headers : vec record { text; text };
certificate_version : opt nat16;
};
type HttpResponse = record {
body : vec nat8;
headers : vec record { text; text };
status_code : nat16;
};
type SchnorrAlgorithm = variant { Ed25519; Bip340Secp256k1 };
type SchnorrKeyId = record { algorithm : SchnorrAlgorithm; name : text };
type SchnorrPublicKeyArgs = record {
key_id : SchnorrKeyId;
canister_id : opt principal;
derivation_path : vec vec nat8;
};
type SchnorrPublicKeyResult = record {
public_key : vec nat8;
chain_code : vec nat8;
};
type SignWithSchnorrArgs = record {
key_id : SchnorrKeyId;
derivation_path : vec vec nat8;
message : vec nat8;
};
type SignWithSchnorrResult = record { signature : vec nat8 };
service : () -> {
http_request : (HttpRequest) -> (HttpResponse) query;
schnorr_public_key : (SchnorrPublicKeyArgs) -> (SchnorrPublicKeyResult);
sign_with_schnorr : (SignWithSchnorrArgs) -> (SignWithSchnorrResult);
}