/
util.proto
110 lines (89 loc) · 2.33 KB
/
util.proto
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
103
104
105
106
107
108
syntax = "proto3";
option java_multiple_files = true;
option java_package = "snowblossom.util.proto";
option java_outer_classname = "SnowBlossomUtilProto";
import "protolib/snowblossom.proto";
package snowblossom;
message TransactionFactoryConfig {
repeated TransactionOutput outputs = 1;
bool sign = 2;
int64 split_change_over = 3; // Split change outputs if over this many flakes
oneof change_mode
{
bool change_random_from_wallet = 4;
bool change_fresh_address = 5;
bool change_specific_addresses = 6;
}
repeated bytes change_addresses = 7;
oneof input_mode
{
bool input_specific_list = 8;
bool input_confirmed_then_pending = 9;
bool input_confirmed_only = 10;
}
repeated UTXOEntry inputs = 11;
oneof fee_mode
{
int64 fee_flat = 12;
bool fee_use_estimate = 13;
}
bytes extra = 14;
bool send_all = 15;
}
message UTXOEntry {
bytes spec_hash = 1;
bytes src_tx = 2;
int32 src_tx_out_idx = 3;
int64 value = 4;
}
message TransactionFactoryResult {
Transaction tx = 1;
bool all_signed = 2;
int64 fee = 3;
int32 signatures_added = 4;
}
message AuditLogReport {
repeated AuditLogChain chains = 1;
}
message AuditLogChain {
repeated AuditLogItem items = 1;
}
message AuditLogItem {
bytes tx_hash = 1;
int32 confirmed_height = 2;
bytes log_msg = 3;
}
message SymmetricKey {
// Keep the key size small by just using an identifier number here
// rather than something more long winded like AES/CBC/PKCS5PADDING
// See snowblossom.lib.CipherUtil
int32 algo_set = 1;
bytes key = 2;
bytes key_id = 3; // Randomly generated key id
}
message Offer
{
enum OfferMode {
UNDEFINED = 0;
FOREVER_ACCESS = 1;
}
OfferMode offer_mode = 10;
string offer_id = 11;
map<string, OfferCurrency> offer_price = 12;
}
message OfferCurrency
{
double price = 1;
string address = 2;
}
// To be stuffed in extra field of transaction
message OfferAcceptance {
string offer_id = 1; // Identifier of the offer accepted
oneof z {
// That that are doing PKI to sign messages for the recipient will need the full spec
AddressSpec for_address_spec = 2; // address spec of the beneficiary of the offer (if applicable)
// Things that just need to validate signatures only need the spec hash
bytes for_address_spec_hash = 3;
}
bytes refund_addr_spec_hash = 5;
}