forked from shipstone-labs/vetkd-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchainkey_testing_canister.did
102 lines (82 loc) · 2.47 KB
/
chainkey_testing_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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
type canister_id = principal;
type ecdsa_curve = variant {
secp256k1;
};
type schnorr_algorithm = variant {
bip340secp256k1;
ed25519;
};
type vetkd_curve = variant { bls12_381_g2 };
type ecdsa_public_key_args = record {
canister_id : opt canister_id;
derivation_path : vec blob;
key_id : record { curve : ecdsa_curve; name : text };
};
type ecdsa_public_key_result = record {
public_key : blob;
chain_code : blob;
};
type sign_with_ecdsa_args = record {
message_hash : blob;
derivation_path : vec blob;
key_id : record { curve : ecdsa_curve; name : text };
};
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 sign_with_schnorr_args = record {
message : blob;
derivation_path : vec blob;
key_id : record { algorithm : schnorr_algorithm; name : text };
aux: opt schnorr_aux;
};
type schnorr_aux = variant {
bip341: record {
merkle_root_hash: blob;
}
};
type sign_with_schnorr_result = record {
signature : blob;
};
type vetkd_public_key_args = record {
canister_id : opt canister_id;
derivation_path : vec blob;
key_id : record { curve : vetkd_curve; name : text };
};
type vetkd_public_key_result = record {
public_key : blob;
};
type vetkd_derive_encrypted_key_args = record {
derivation_id : blob;
encryption_public_key : blob;
derivation_path : vec blob;
key_id : record { curve : vetkd_curve; name : text };
};
type vetkd_derive_encrypted_key_result = record {
encrypted_key : blob;
};
type call_counts_result = record {
call_counts : vec record { method_name : text; call_count : nat64 };
};
service : {
// Threshold ECDSA signature
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);
// Threshold key derivation
vetkd_public_key : (vetkd_public_key_args) -> (vetkd_public_key_result);
vetkd_derive_encrypted_key : (vetkd_derive_encrypted_key_args) -> (vetkd_derive_encrypted_key_result);
// Statistics: call counts
call_counts : () -> (call_counts_result);
};