-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmessages-tron.proto
More file actions
83 lines (75 loc) · 3.29 KB
/
messages-tron.proto
File metadata and controls
83 lines (75 loc) · 3.29 KB
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
/*
* Messages (TRON specific) for KeepKey Communication
*
*/
syntax = "proto2";
// Sugar for easier handling in Java
option java_package = "com.keepkey.deviceprotocol";
option java_outer_classname = "KeepKeyMessageTron";
/**
* Request: Ask device for TRON address corresponding to address_n path
* @next PassphraseRequest
* @next TronAddress
* @next Failure
*/
message TronGetAddress {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional string coin_name = 2 [default='Tron'];
optional bool show_display = 3; // optionally show on display before sending the result
}
/**
* Response: Contains a TRON address derived from device private seed
* @prev TronGetAddress
*/
message TronAddress {
optional string address = 1; // TRON address in Base58Check encoding
}
/**
* Structured TransferContract for reconstruct-then-sign
*/
message TronTransferContract {
optional string to_address = 1; // Base58 "T..." destination (max 35)
optional uint64 amount = 2; // Amount in SUN
}
/**
* Structured TriggerSmartContract for reconstruct-then-sign
*/
message TronTriggerSmartContract {
optional string contract_address = 1; // Base58 smart contract address (max 35)
optional bytes data = 2; // ABI-encoded call data (max 512)
optional uint64 call_value = 3; // TRX sent with call (in SUN)
}
/**
* Request: ask device to sign TRON transaction
* @start
* @next TronSignedTx
*
* Two modes:
* 1. Legacy blind-sign: provide raw_data (shows warning)
* 2. Structured reconstruct-then-sign: provide transfer or trigger_smart
* plus ref_block_bytes, ref_block_hash, expiration, timestamp
*/
message TronSignTx {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional string coin_name = 2 [default='Tron'];
optional bytes raw_data = 3; // Legacy: raw transaction data (blind-sign with warning)
optional bytes ref_block_bytes = 4; // Reference block bytes (2 bytes)
optional bytes ref_block_hash = 5; // Reference block hash (8 bytes)
optional uint64 expiration = 6; // Transaction expiration timestamp (ms)
optional string contract_type = 7; // DEPRECATED: use transfer/trigger_smart instead
optional string to_address = 8; // DEPRECATED: use transfer/trigger_smart instead
optional uint64 amount = 9; // DEPRECATED: use transfer/trigger_smart instead
optional TronTransferContract transfer = 10; // Structured: TRX transfer
optional TronTriggerSmartContract trigger_smart = 11; // Structured: smart contract call
optional uint64 fee_limit = 12; // Fee limit for smart contracts (in SUN)
optional uint64 timestamp = 13; // Transaction creation timestamp (ms)
optional bytes data = 14; // Transaction memo/note (max 256 bytes)
}
/**
* Response: signature for transaction
* @end
*/
message TronSignedTx {
optional bytes signature = 1; // ECDSA signature (65 bytes: r + s + recovery_id)
optional bytes serialized_tx = 2; // Reconstructed raw_data bytes (for host verification)
}