signatory.proto 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. syntax = "proto3";
  2. package signatory;
  3. service Signatory {
  4. rpc BlindSign(BlindedMessage) returns (BlindSignature);
  5. rpc VerifyProof(Proof) returns (Empty);
  6. rpc AuthKeysets(Empty) returns (VecSignatoryKeySet);
  7. rpc Keysets(Empty) returns (VecSignatoryKeySet);
  8. rpc RotateKeyset(RotateKeyArguments) returns (MintKeySetInfo);
  9. }
  10. message Empty {}
  11. message VecSignatoryKeySet {
  12. repeated SignatoryKeySet keysets = 1;
  13. optional bool is_none = 2;
  14. }
  15. message SignatoryKeySet {
  16. KeySet key = 1;
  17. MintKeySetInfo info = 2;
  18. }
  19. message KeySet {
  20. Id id = 1;
  21. CurrencyUnit unit = 2;
  22. Keys keys = 3;
  23. }
  24. message Keys {
  25. map<uint64, bytes> keys = 1;
  26. }
  27. message RotateKeyArguments {
  28. CurrencyUnit unit = 1;
  29. optional uint32 derivation_path_index = 2;
  30. uint32 max_order = 3;
  31. uint64 input_fee_ppk = 4;
  32. }
  33. message CustomDerivationPath {
  34. CurrencyUnit unit = 1;
  35. repeated DerivationPath derivation_path = 2;
  36. }
  37. enum CurrencyUnitType {
  38. SAT = 0;
  39. MSAT = 1;
  40. USD = 2;
  41. EUR = 3;
  42. }
  43. message CurrencyUnit {
  44. oneof currency_unit {
  45. CurrencyUnitType unit = 1;
  46. string custom_unit = 2;
  47. }
  48. }
  49. message Proof {
  50. uint64 amount = 1;
  51. string keyset_id = 2;
  52. string secret = 3;
  53. bytes C = 4;
  54. optional Witness witness = 5;
  55. optional ProofDLEQ dleq = 6;
  56. }
  57. message ProofDLEQ {
  58. bytes e = 1;
  59. bytes s = 2;
  60. bytes r = 3;
  61. }
  62. message BlindSignature {
  63. uint64 amount = 1;
  64. string keyset_id = 2;
  65. bytes blinded_secret = 3;
  66. optional BlindSignatureDLEQ dleq = 4;
  67. }
  68. message BlindSignatureDLEQ {
  69. bytes e = 1;
  70. bytes s = 2;
  71. }
  72. message KeySetInfo {
  73. Id id = 1;
  74. CurrencyUnit unit = 2;
  75. bool active = 3;
  76. uint64 input_fee_ppk = 4;
  77. }
  78. // Witness type
  79. message Witness {
  80. oneof witness_type {
  81. P2PKWitness p2pk_witness = 1;
  82. HTLCWitness htlc_witness = 2;
  83. }
  84. }
  85. // P2PKWitness type
  86. message P2PKWitness {
  87. // List of signatures
  88. repeated string signatures = 1;
  89. }
  90. // HTLCWitness type
  91. message HTLCWitness {
  92. // Preimage
  93. string preimage = 1;
  94. // List of signatures
  95. repeated string signatures = 2;
  96. }
  97. message BlindedMessage {
  98. uint64 amount = 1;
  99. string keyset_id = 2;
  100. bytes blinded_secret = 3;
  101. optional Witness witness = 4; // This field is optional by default in proto3
  102. }
  103. message KeysResponse {
  104. repeated KeySet keysets = 1;
  105. }
  106. message Id {
  107. bytes inner = 1;
  108. }
  109. message DerivationPath {
  110. oneof child_number {
  111. uint32 normal = 1;
  112. uint32 hardened = 2;
  113. }
  114. }
  115. message MintKeySetInfo {
  116. Id id = 1;
  117. CurrencyUnit unit = 2;
  118. bool active = 3;
  119. uint64 valid_from = 4;
  120. optional uint64 valid_to = 5;
  121. repeated DerivationPath derivation_path = 6;
  122. optional uint32 derivation_path_index = 7;
  123. uint32 max_order = 8;
  124. uint64 input_fee_ppk = 9;
  125. }