# Mass Transfer Transaction Binary Format
Learn more about Mass Transfer transaction.
# Version 2
Binary format of version 2 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 2 is enabled by feature #15 “Ride V4, VRF, Protobuf, Failed transactions”.
message MassTransferTransactionData {
message Transfer {
Recipient recipient = 1;
int64 amount = 2;
};
bytes asset_id = 1;
repeated Transfer transfers = 2;
bytes attachment = 3;
};
message Recipient {
oneof recipient {
bytes public_key_hash = 1;
string alias = 2;
};
}
| Field | Size | Description |
|---|---|---|
| asset_id | 32 bytes | ID of token to transfer |
| transfers.recipient.public_key_hash | 20 bytes | Recipient's account public key hash (a component of an address, see the Address binary format article) |
| transfers.recipient.alias | From 4 to 30 bytes | Recipient's alias |
| transfers.amount | 8 bytes | Amount of token to transfer, specified in the minimum fraction (“cents”) |
| attachment | Up to 140 bytes | Arbitrary data (typically a comment to transfer) |
The maximim number of transfers is 100.
# Version 1
| # | Field | JSON field name | Field type | Field size in bytes | Comment |
|---|---|---|---|---|---|
| 1 | Transaction type ID | type | Byte | 1 | Value must be 11 |
| 2 | Transaction version | version | Byte | 1 | Value must be 1 |
| 3 | Public key of the transaction sender | senderPublicKey | Array[Byte] | 32 | |
| 4.1 | Flag WAVES/token | Byte | 1 | Value is 0 for transferring WAVES. Value is 1 for transferring other tokens | |
| 4.2 | Token ID | assetId | Array[Byte] | S | S = 0 if the value of the "flag WAVES/token" field is 0.S = 32 if the value of the "flag WAVES/token" field is 1 |
| 5.1 | Number of transfers | transferCount | Short | 2 | |
| 5.2 | 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 |
| 5.3 | Amount of tokens in the transfer 1 | amount | Long | 8 | |
| 5.4 | 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 |
| 5.5 | Amount of tokens in the transfer 2 | amount | Long | 8 | |
| ... | ... | ... | ... | ... | ... |
| ... | ... | ... | ... | ... | ... |
5.[2 × N] | 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 |
5.[2 × N + 1] | Amount of tokens in the transferN | amount | Long | 8 | |
| 6 | Transaction timestamp | timestamp | Long | 8 | |
| 7 | Transaction fee | fee | Long | 8 | |
| 8.1 | Attachment length | Short | 2 | ||
| 8.2 | Attachment | Array[Byte] | 2 | Arbitrary data attached to the transaction | |
| 9 | 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.