# Lease Transaction Binary Format
Learn more about Lease transaction.
# Version 3
Binary format of version 3 is defined in transaction.proto protobuf scheme. The fields that are common to all types of transactions are described in the Transaction Binary Format article.
Version 3 is enabled by feature #15 “Ride V4, VRF, Protobuf, Failed transactions”.
message LeaseTransactionData {
Recipient recipient = 1;
int64 amount = 2;
};
message Recipient {
oneof recipient {
bytes public_key_hash = 1;
string alias = 2;
};
};
Field | Size | Description |
---|---|---|
recipient.public_key_hash | 20 bytes | Recipient's account public key hash (a component of an address, see the Address binary format article) |
recipient.alias | From 4 to 30 bytes | Recipient's alias |
amount | 8 bytes | Amount of WAVELETs to lease (that is, amount of WAVES multiplied by 108) |
# Version 2
# | Field | JSON field name | Field type | Field size in bytes | Comment |
---|---|---|---|---|---|
1 | Version flag | Byte | 1 | Indicates the transaction version is 2 or higher. Value must be 0 | |
2 | Transaction type ID | type | Byte | 1 | Value must be 8 |
3 | Transaction version | version | Byte | 1 | Value must be 2 |
4 | Reserved field | Byte | 1 | Value must be equal to 0 | |
5 | Public key of the transaction sender | senderPublicKey | Array[Byte] | 32 | |
6 | Address or alias of the recipient | recipient | See Address Binary Format, Alias Binary Format | S | If the first byte of the field is 1, then it is followed by address. S in this case equals 26If the first byte of the field is 2, then it is followed by alias. In this case 8 <= S <= 34 |
7 | Amount of WAVES that will be leased to the account | amount | Long | 8 | |
8 | Transaction fee | fee | Long | 8 | |
9 | Transaction timestamp | timestamp | Long | 8 | |
10 | Transaction proofs | proofs | See Transaction Proofs Binary Format | S | If the array is empty, then S = 3. If the array is not empty, then S = 3 + 2 × N + 64 × N , where N is the number of proofs in the array.The maximum number of proofs in the array is 8. The size of each proof is 64 bytes |
The fields numbered in bold are the transaction body bytes.
# JSON Representation of Transaction
See the example in Node API.
# Version 1
# | Field | Field type | Field size in bytes | Comment |
---|---|---|---|---|
1 | Transaction type ID | Byte | 1 | Value must be 8 |
2 | Public key of the transaction sender | Array[Byte] | 32 | |
3 | Address or alias of the recipient | See Address Binary Format, Alias Binary Format | S | If the first byte of the field is 1, then it is followed by address. S in this case equals 26.If the first byte of the field is 2, then it is followed by alias. In this case 8 <= S <= 34 |
4 | Amount of WAVES that will be leased to the account | Long | 8 | |
5 | Transaction fee | Long | 8 | |
6 | Transaction timestamp | Long | 8 | |
7 | Transaction signature | Array[Byte] | 64 |
The fields numbered in bold are the transaction body bytes.