forked from trezor/trezor-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessages-lisk.proto
151 lines (141 loc) · 4.16 KB
/
messages-lisk.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
syntax = "proto2";
package hw.trezor.messages.lisk;
// Sugar for easier handling in Java
option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageLisk";
/**
* Request: Ask device for Lisk address corresponding to address_n path
* @start
* @next LiskAddress
* @next Failure
*/
message LiskGetAddress {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bool show_display = 2; // Optionally show on display before sending the result
}
/**
* Response: Contains Lisk address derived from device private seed
* @end
*/
message LiskAddress {
optional string address = 1; // Lisk address
}
/**
* Request: Ask device for Lisk public key corresponding to address_n path
* @start
* @next LiskPublicKey
*/
message LiskGetPublicKey {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bool show_display = 2; // Optionally show on display before sending the result
}
/**
* Response: Contains Lisk public key derived from device private seed
* @end
*/
message LiskPublicKey {
optional bytes public_key = 1; // Lisk public key
}
/**
* Request: Ask device to sign Lisk transaction
* @start
* @next LiskSignedTx
* @next Failure
*/
message LiskSignTx {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional LiskTransactionCommon transaction = 2; // Lisk transaction structure
/**
* Structure representing the common part for Lisk transactions
*/
message LiskTransactionCommon {
optional LiskTransactionType type = 1;
optional uint64 amount = 2;
optional uint64 fee = 3;
optional string recipient_id = 4;
optional bytes sender_public_key = 5;
optional bytes requester_public_key = 6;
optional bytes signature = 7;
optional uint32 timestamp = 8;
optional LiskTransactionAsset asset = 9;
/**
* Type of Lisk transaction
*/
enum LiskTransactionType {
Transfer = 0;
RegisterSecondPassphrase = 1;
RegisterDelegate = 2;
CastVotes = 3;
RegisterMultisignatureAccount = 4;
CreateDapp = 5;
TransferIntoDapp = 6;
TransferOutOfDapp = 7;
}
/**
* Structure representing the asset field in the Lisk transaction
*/
message LiskTransactionAsset {
optional LiskSignatureType signature = 1;
optional LiskDelegateType delegate = 2;
repeated string votes = 3;
optional LiskMultisignatureType multisignature = 4;
optional string data = 5;
/**
* Structure representing the signature field in the Lisk transaction asset field
*/
message LiskSignatureType {
optional bytes public_key = 1;
}
/**
* Structure representing the delegate field in the Lisk transaction asset field
*/
message LiskDelegateType {
optional string username = 1;
}
/**
* Structure representing the multisignature field in the Lisk transaction asset field
*/
message LiskMultisignatureType {
optional uint32 min = 1;
optional uint32 life_time = 2;
repeated string keys_group = 3;
}
}
}
}
/**
* Response: Contains Lisk transaction signature
* @end
*/
message LiskSignedTx {
optional bytes signature = 1;
}
/**
* Request: Ask device to sign message
* @start
* @next LiskMessageSignature
* @next Failure
*/
message LiskSignMessage {
repeated uint32 address_n = 1;
optional bytes message = 2;
}
/**
* Response: Signed message
* @end
*/
message LiskMessageSignature {
optional bytes public_key = 1;
optional bytes signature = 2;
}
/**
* Request: Ask device to verify message
* @start
* @next Success
* @next Failure
*/
message LiskVerifyMessage {
optional bytes public_key = 1;
optional bytes signature = 2;
optional bytes message = 3;
}