@@ -2,57 +2,85 @@ syntax = "proto3";
22
33package signatory ;
44
5+ /// TODO: research about the stream, to notify when RotateKeyset is triggered.
56service Signatory {
6- rpc BlindSign ( BlindedMessage ) returns (BlindSignature );
7+ rpc BlindSign ( BlindedMessages ) returns (BlindSignResponse );
78
8- rpc VerifyProof ( Proof ) returns (Empty );
9+ rpc VerifyProofs ( Proofs ) returns (BooleanResponse );
910
10- rpc Keysets ( Empty ) returns (VecSignatoryKeySet );
11+ rpc Keysets ( EmptyRequest ) returns (KeysResponse );
1112
12- rpc RotateKeyset ( RotateKeyArguments ) returns (MintKeySetInfo );
13+ rpc RotateKeyset ( RotationRequest ) returns (KeyRotationResponse );
1314}
1415
15- message Empty {}
16+ message BlindSignResponse {
17+ oneof result {
18+ BlindSignatures sigs = 1 ;
19+ Error error = 2 ;
20+ }
21+ }
1622
17- message VecSignatoryKeySet {
18- repeated SignatoryKeySet keysets = 1 ;
23+ message BlindedMessages {
24+ repeated BlindedMessage blinded_messages = 1 ;
25+ }
1926
20- optional bool is_none = 2 ;
27+ // Represents a blinded message
28+ message BlindedMessage {
29+ uint64 amount = 1 ;
30+ string keyset_id = 2 ;
31+ bytes blinded_secret = 3 ;
2132}
2233
23- message SignatoryKeySet {
24- KeySet key = 1 ;
25- MintKeySetInfo info = 2 ;
34+ message BooleanResponse {
35+ oneof result {
36+ bool success = 1 ;
37+ Error error = 2 ;
38+ }
2639}
2740
28- message KeySet {
29- Id id = 1 ;
30- CurrencyUnit unit = 2 ;
31- Keys keys = 3 ;
41+ message KeyRotationResponse {
42+ oneof result {
43+ KeySet keyset = 1 ;
44+ Error error = 2 ;
45+ }
3246}
3347
34- message Keys {
35- map <uint64 , bytes > keys = 1 ;
48+ message KeysResponse {
49+ oneof result {
50+ SignatoryKeysets keysets = 1 ;
51+ Error error = 2 ;
52+ }
3653}
3754
55+ message SignatoryKeysets {
56+ bytes pubkey = 1 ;
57+ repeated KeySet keysets = 2 ;
58+ }
3859
39- message RotateKeyArguments {
40- CurrencyUnit unit = 1 ;
41- optional uint32 derivation_path_index = 2 ;
42- uint32 max_order = 3 ;
60+ message KeySet {
61+ string id = 1 ;
62+ CurrencyUnit unit = 2 ;
63+ bool active = 3 ;
4364 uint64 input_fee_ppk = 4 ;
65+ Keys keys = 5 ;
4466}
4567
46- message CustomDerivationPath {
47- CurrencyUnit unit = 1 ;
48- repeated DerivationPath derivation_path = 2 ;
68+ message Keys {
69+ map <uint64 , bytes > keys = 1 ;
70+ }
71+
72+ message RotationRequest {
73+ CurrencyUnit unit = 1 ;
74+ uint64 input_fee_ppk = 2 ;
75+ uint64 max_order = 3 ;
4976}
5077
5178enum CurrencyUnitType {
52- SAT = 0 ;
53- MSAT = 1 ;
54- USD = 2 ;
55- EUR = 3 ;
79+ SAT = 0 ;
80+ MSAT = 1 ;
81+ USD = 2 ;
82+ EUR = 3 ;
83+ AUTH = 4 ;
5684}
5785
5886message CurrencyUnit {
@@ -62,13 +90,15 @@ message CurrencyUnit {
6290 }
6391}
6492
93+ message Proofs {
94+ repeated Proof proof = 1 ;
95+ }
96+
6597message Proof {
6698 uint64 amount = 1 ;
6799 string keyset_id = 2 ;
68- string secret = 3 ;
100+ bytes secret = 3 ;
69101 bytes C = 4 ;
70- optional Witness witness = 5 ;
71- optional ProofDLEQ dleq = 6 ;
72102}
73103
74104message ProofDLEQ {
@@ -77,6 +107,16 @@ message ProofDLEQ {
77107 bytes r = 3 ;
78108}
79109
110+ message SigningResponse {
111+ oneof result {
112+ BlindSignatures blind_signatures = 1 ;
113+ Error error = 2 ;
114+ }
115+ }
116+ message BlindSignatures {
117+ repeated BlindSignature blind_signatures = 1 ;
118+ }
119+
80120message BlindSignature {
81121 uint64 amount = 1 ;
82122 string keyset_id = 2 ;
@@ -89,13 +129,6 @@ message BlindSignatureDLEQ {
89129 bytes s = 2 ;
90130}
91131
92- message KeySetInfo {
93- Id id = 1 ;
94- CurrencyUnit unit = 2 ;
95- bool active = 3 ;
96- uint64 input_fee_ppk = 4 ;
97- }
98-
99132// Witness type
100133message Witness {
101134 oneof witness_type {
@@ -114,42 +147,27 @@ message P2PKWitness {
114147message HTLCWitness {
115148 // Preimage
116149 string preimage = 1 ;
117-
118150 // List of signatures
119151 repeated string signatures = 2 ;
120152}
121153
122- message BlindedMessage {
123- uint64 amount = 1 ;
124- string keyset_id = 2 ;
125- bytes blinded_secret = 3 ;
126- optional Witness witness = 4 ; // This field is optional by default in proto3
127- }
128-
129- message KeysResponse {
130- repeated KeySet keysets = 1 ;
131- }
132-
133-
134- message Id {
135- bytes inner = 1 ;
154+ enum ErrorCode {
155+ UNKNOWN = 0 ;
156+ AMOUNT_OUTSIDE_LIMIT = 1 ;
157+ DUPLICATE_INPUTS_PROVIDED = 2 ;
158+ DUPLICATE_OUTPUTS_PROVIDED = 3 ;
159+ KEYSET_NOT_KNOWN = 4 ;
160+ KEYSET_INACTIVE = 5 ;
161+ MINTING_DISABLED = 6 ;
162+ COULD_NOT_ROTATE_KEYSET = 7 ;
163+ INVALID_PROOF = 8 ;
164+ INVALID_BLIND_MESSAGE = 9 ;
165+ UNIT_NOT_SUPPORTED = 10 ;
136166}
137167
138- message DerivationPath {
139- oneof child_number {
140- uint32 normal = 1 ;
141- uint32 hardened = 2 ;
142- }
168+ message Error {
169+ ErrorCode code = 1 ;
170+ string detail = 2 ;
143171}
144172
145- message MintKeySetInfo {
146- Id id = 1 ;
147- CurrencyUnit unit = 2 ;
148- bool active = 3 ;
149- uint64 valid_from = 4 ;
150- optional uint64 valid_to = 5 ;
151- repeated DerivationPath derivation_path = 6 ;
152- optional uint32 derivation_path_index = 7 ;
153- uint32 max_order = 8 ;
154- uint64 input_fee_ppk = 9 ;
155- }
173+ message EmptyRequest {}
0 commit comments