# Block binary format
Learn more about block.
Blocks are stored on the blockchain in a binary format (byte representation). Node extensions such as gRPC server can work directly with data in binary format.
# Version 5
Binary format of block version 5 is defined in block.proto protobuf scheme. For more information about protobuf see Protocol Buffers Developer Guide.
Version 5 is enabled by feature #15 “Ride V4, VRF, Protobuf, Failed transactions”.
message Block {
message Header {
message ChallengedHeader {
int64 base_target = 1;
bytes generation_signature = 2;
repeated uint32 feature_votes = 3;
int64 timestamp = 4;
bytes generator = 5;
int64 reward_vote = 6;
bytes state_hash = 7;
bytes header_signature = 8;
}
int32 chain_id = 1;
bytes reference = 2;
int64 base_target = 3;
bytes generation_signature = 4;
repeated uint32 feature_votes = 5;
int64 timestamp = 6;
int32 version = 7;
bytes generator = 8;
int64 reward_vote = 9;
bytes transactions_root = 10;
bytes state_hash = 11;
ChallengedHeader challenged_header = 12;
}
Header header = 1;
bytes signature = 2;
repeated SignedTransaction transactions = 3;
}
Field | Description |
---|---|
chain_id | Chain ID |
reference | • For the first block of version 5, that is, at the height of activation of feature #15 “Ride V4, VRF, Protobuf, Failed transactions”: signature of the previous block.• For the next blocks: BLAKE2b-256 hash of the previous block header |
base_target | Base target: a variable that is used in the block generation algorithm |
generation_signature | Generation signature: a variable that is used in the block generation algorithm (64 bytes) |
feature_votes | List of features for which the block generator votes. See the Features |
timestamp | Block timestamp: Unix time in milliseconds |
version | Block version: 5 |
generator | Block generator’s account public key (32 bytes) |
reward_vote | Block reward for which the block generator votes. -1 means that block generator votes for the current reward size |
transactions_root | Transactions Root Hash (32 bytes) |
signature | Block header signature (64 bytes) |
transactions | For each transaction: • Body bytes: up to 165,487 bytes • Proofs: up to 531 bytes. See the Transaction Binary Format article |
state_hash | Hash of the blockchain state changes resulting from the block's transactions. See details in the Waves 1.5: Light Node article. The field is enabled by feature #22 “Light Node” |
challenged_header | Header fields of the block being challenged, in case the current block challenges another one. See details in the Waves 1.5: Light Node article. The field is enabled by feature #22 “Light Node” |
# Version 4
# | Field | Field type | Field size in bytes | Comments |
---|---|---|---|---|
1 | Block version | Byte | 1 | The value must be 4 |
2 | Block timestamp | Long | 8 | Unix time in milliseconds |
3 | Signature of the previous block | Array[Byte] | 64 | |
4 | Base target | Long | 8 | |
5 | Genaration signature | Array[Byte] | 32 | |
6 | Number of transactions in the block | Integer | 4 | |
7.1 | Transaction 1 | Array[Byte] | Body bytes: up to 165,996 bytes Proofs: up to 531 bytes | Bytes of the 1st transaction in binary format |
7.2 | Transaction 2 | Array[Byte] | Body bytes: up to 165,996 bytes Proofs: up to 531 bytes | Bytes of the 2nd transaction in binary format |
... | ... | ... | ... | ... |
7.[N] | Transaction N | Array[Byte] | Body bytes: up to 165,996 bytes Proofs: up to 531 bytes | Bytes of the Nth transaction in binary format |
8 | Number of features for which the block generator votes | 4 | Integer | |
9.1 | Feature 1 | 2 | Short | |
... | ... | ... | ... | ... |
9.[M] | Feature M | 2 | Short | |
10 | Block reward for which the block generator votes | 8 | Long | -1 means that block generator votes for the current reward size |
11 | Block generator’s account public key | 32 | Array[Byte] | |
12 | Block signature | 64 | Array[Byte] |
# Version 3
# | Field | Field type | Field size in bytes | Comments |
---|---|---|---|---|
1 | Block version | Byte | 1 | The value must be 3 |
2 | Block timestamp | Long | 8 | Unix time in milliseconds |
3 | Signature of the previous block | Array[Byte] | 64 | |
4 | Base target | Long | 8 | |
5 | Generation signature | Array[Byte] | 32 | |
6 | Number of transactions in the block | Integer | 4 | |
7.1 | Transaction 1 | Array[Byte] | Body bytes: up to 165,996 bytes Proofs: up to 531 bytes | Bytes of the 1st transaction in binary format |
7.2 | Transaction 2 | Array[Byte] | Body bytes: up to 165,996 bytes Proofs: up to 531 bytes | Bytes of the 2nd transaction in binary format |
... | ... | ... | ... | ... |
7.[N] | Transaction N | Array[Byte] | Body bytes: up to 165,996 bytes Proofs: up to 531 bytes | Bytes of the Nth transaction in binary format |
8 | Block generator’s account public key | Array[Byte] | 32 | |
9 | Block signature | Array[Byte] | 64 |