@@ -2,167 +2,155 @@ syntax = "proto3";
22
33package signatory ;
44
5- /// TODO: research about the stream, to notify when RotateKeyset is triggered.
65service Signatory {
7- rpc BlindSign (BlindedMessages ) returns (BlindSignResponse );
8-
9- rpc VerifyProofs (Proofs ) returns (BooleanResponse );
10-
11- rpc Keysets (EmptyRequest ) returns (KeysResponse );
12-
13- rpc RotateKeyset (RotationRequest ) returns (KeyRotationResponse );
6+ rpc BlindSign (BlindedMessages ) returns (BlindSignResponse );
7+ rpc VerifyProofs (Proofs ) returns (BooleanResponse );
8+ // returns all the keysets for the mint
9+ rpc Keysets (EmptyRequest ) returns (KeysResponse );
10+ // rotates the keysets
11+ rpc RotateKeyset (RotationRequest ) returns (KeyRotationResponse );
1412}
1513
1614message BlindSignResponse {
17- oneof result {
18- BlindSignatures sigs = 1 ;
19- Error error = 2 ;
20- }
15+ Error error = 1 ;
16+ BlindSignatures sigs = 2 ;
2117}
2218
2319message BlindedMessages {
24- repeated BlindedMessage blinded_messages = 1 ;
20+ repeated BlindedMessage blinded_messages = 1 ;
2521}
2622
2723// Represents a blinded message
2824message BlindedMessage {
29- uint64 amount = 1 ;
30- string keyset_id = 2 ;
31- bytes blinded_secret = 3 ;
25+ uint64 amount = 1 ;
26+ string keyset_id = 2 ;
27+ bytes blinded_secret = 3 ;
3228}
3329
3430message BooleanResponse {
35- oneof result {
36- bool success = 1 ;
37- Error error = 2 ;
38- }
31+ Error error = 1 ;
32+ bool success = 2 ;
3933}
4034
4135message KeyRotationResponse {
42- oneof result {
43- KeySet keyset = 1 ;
44- Error error = 2 ;
45- }
36+ Error error = 1 ;
37+ KeySet keyset = 2 ;
4638}
4739
4840message KeysResponse {
49- oneof result {
50- SignatoryKeysets keysets = 1 ;
51- Error error = 2 ;
52- }
41+ Error error = 1 ;
42+ SignatoryKeysets keysets = 2 ;
5343}
5444
5545message SignatoryKeysets {
56- bytes pubkey = 1 ;
57- repeated KeySet keysets = 2 ;
46+ bytes pubkey = 1 ;
47+ repeated KeySet keysets = 2 ;
5848}
5949
6050message KeySet {
61- string id = 1 ;
62- CurrencyUnit unit = 2 ;
63- bool active = 3 ;
64- uint64 input_fee_ppk = 4 ;
65- Keys keys = 5 ;
51+ string id = 1 ;
52+ CurrencyUnit unit = 2 ;
53+ bool active = 3 ;
54+ uint64 input_fee_ppk = 4 ;
55+ Keys keys = 5 ;
6656}
6757
6858message Keys {
69- map <uint64 , bytes > keys = 1 ;
59+ map <uint64 , bytes > keys = 1 ;
7060}
7161
7262message RotationRequest {
73- CurrencyUnit unit = 1 ;
74- uint64 input_fee_ppk = 2 ;
75- uint64 max_order = 3 ;
63+ CurrencyUnit unit = 1 ;
64+ uint64 input_fee_ppk = 2 ;
65+ uint64 max_order = 3 ;
7666}
7767
7868enum CurrencyUnitType {
79- SAT = 0 ;
80- MSAT = 1 ;
81- USD = 2 ;
82- EUR = 3 ;
83- AUTH = 4 ;
69+ SAT = 0 ;
70+ MSAT = 1 ;
71+ USD = 2 ;
72+ EUR = 3 ;
73+ AUTH = 4 ;
8474}
8575
8676message CurrencyUnit {
87- oneof currency_unit {
88- CurrencyUnitType unit = 1 ;
89- string custom_unit = 2 ;
90- }
77+ oneof currency_unit {
78+ CurrencyUnitType unit = 1 ;
79+ string custom_unit = 2 ;
80+ }
9181}
9282
9383message Proofs {
94- repeated Proof proof = 1 ;
84+ repeated Proof proof = 1 ;
9585}
9686
9787message Proof {
98- uint64 amount = 1 ;
99- string keyset_id = 2 ;
100- bytes secret = 3 ;
101- bytes C = 4 ;
88+ uint64 amount = 1 ;
89+ string keyset_id = 2 ;
90+ bytes secret = 3 ;
91+ bytes C = 4 ;
10292}
10393
10494message ProofDLEQ {
105- bytes e = 1 ;
106- bytes s = 2 ;
107- bytes r = 3 ;
95+ bytes e = 1 ;
96+ bytes s = 2 ;
97+ bytes r = 3 ;
10898}
10999
110100message SigningResponse {
111- oneof result {
112- BlindSignatures blind_signatures = 1 ;
113- Error error = 2 ;
114- }
101+ Error error = 1 ;
102+ BlindSignatures blind_signatures = 2 ;
115103}
116104message BlindSignatures {
117- repeated BlindSignature blind_signatures = 1 ;
105+ repeated BlindSignature blind_signatures = 1 ;
118106}
119107
120108message BlindSignature {
121- uint64 amount = 1 ;
122- string keyset_id = 2 ;
123- bytes blinded_secret = 3 ;
124- optional BlindSignatureDLEQ dleq = 4 ;
109+ uint64 amount = 1 ;
110+ string keyset_id = 2 ;
111+ bytes blinded_secret = 3 ;
112+ optional BlindSignatureDLEQ dleq = 4 ;
125113}
126114
127115message BlindSignatureDLEQ {
128- bytes e = 1 ;
129- bytes s = 2 ;
116+ bytes e = 1 ;
117+ bytes s = 2 ;
130118}
131119
132120// Witness type
133121message Witness {
134- oneof witness_type {
135- P2PKWitness p2pk_witness = 1 ;
136- HTLCWitness htlc_witness = 2 ;
137- }
122+ oneof witness_type {
123+ P2PKWitness p2pk_witness = 1 ;
124+ HTLCWitness htlc_witness = 2 ;
125+ }
138126}
139127
140128// P2PKWitness type
141129message P2PKWitness {
142- // List of signatures
143- repeated string signatures = 1 ;
130+ // List of signatures
131+ repeated string signatures = 1 ;
144132}
145133
146134// HTLCWitness type
147135message HTLCWitness {
148- // Preimage
149- string preimage = 1 ;
150- // List of signatures
151- repeated string signatures = 2 ;
136+ // Preimage
137+ string preimage = 1 ;
138+ // List of signatures
139+ repeated string signatures = 2 ;
152140}
153141
154142enum 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 ;
143+ UNKNOWN = 0 ;
144+ AMOUNT_OUTSIDE_LIMIT = 1 ;
145+ DUPLICATE_INPUTS_PROVIDED = 2 ;
146+ DUPLICATE_OUTPUTS_PROVIDED = 3 ;
147+ KEYSET_NOT_KNOWN = 4 ;
148+ KEYSET_INACTIVE = 5 ;
149+ MINTING_DISABLED = 6 ;
150+ COULD_NOT_ROTATE_KEYSET = 7 ;
151+ INVALID_PROOF = 8 ;
152+ INVALID_BLIND_MESSAGE = 9 ;
153+ UNIT_NOT_SUPPORTED = 10 ;
166154}
167155
168156message Error {
0 commit comments