waves_logo Docs
  • Why Waves
    Why Waves
  • Waves Basics
    Waves Basics
  • Account
    • Creating Account
      Creating Account
    • Address
      Address
    • Account Balance
      Account Balance
    • Account Data Storage
      Account Data Storage
    • Alias
      Alias
    • dApp and Smart Account
      dApp and Smart Account
    Account
  • Token (Asset)
    • Non-Fungible Token
      Non-Fungible Token
    • Smart Asset
      Smart Asset
    • Token ID
      Token ID
    • WAVES
      WAVES
    Token (Asset)
  • Transaction
    • Transaction Fee
      • Sponsored Fee
        Sponsored Fee
      Transaction Fee
    • Signature and Proofs
      Signature and Proofs
    • Transaction Types
      • Burn Transaction
        Burn Transaction
      • Create Alias Transaction
        Create Alias Transaction
      • Data Transaction
        Data Transaction
      • Exchange Transaction
        • Order
          Order
        Exchange Transaction
      • Genesis Transaction
        Genesis Transaction
      • Invoke Script Transaction
        Invoke Script Transaction
      • Issue Transaction
        Issue Transaction
      • Lease Cancel Transaction
        Lease Cancel Transaction
      • Lease Transaction
        Lease Transaction
      • Mass Transfer Transaction
        Mass Transfer Transaction
      • Reissue Transaction
        Reissue Transaction
      • Set Asset Script Transaction
        Set Asset Script Transaction
      • Set Script Transaction
        Set Script Transaction
      • Sponsor Fee Transaction
        Sponsor Fee Transaction
      • Transfer Transaction
        Transfer Transaction
      • Update Asset Info Transaction
        Update Asset Info Transaction
      • Ethereum-like Transaction
        Ethereum-like Transaction
      Transaction Types
    • Transaction Validation
      Transaction Validation
    Transaction
  • Block
    • Transactions Root Hash
      Transactions Root Hash
    • Genesis Block
      Genesis Block
    Block
  • Node
    • Leasing
      Leasing
    • Generator’s Income
      Generator’s Income
    • Monetary Policy
      Monetary Policy
    Node
  • Mainnet, Testnet, Stagenet
    Mainnet, Testnet, Stagenet
  • Unit Zero
    Unit Zero
  • Oracle
    Oracle
  • Protocols & Data formats
    • Cryptographic Practical Details
      Cryptographic Practical Details
    • Leased Proof of Stake
      Leased Proof of Stake
    • Waves-NG Solution
      Waves-NG Solution
    • Waves-NG Protocol
      Waves-NG Protocol
    • Waves 1.5
      Waves 1.5
    • Blockchain Data Types
      Blockchain Data Types
    • Binary Format
      • Address Binary Format
        Address Binary Format
      • Alias Binary Format
        Alias Binary Format
      • Block Binary Format
        Block Binary Format
      • Network Message Binary Format
        • Block Message Binary Format
          Block Message Binary Format
        • Checkpoint Message Binary Format
          Checkpoint Message Binary Format
        • Get Block Message Binary Format
          Get Block Message Binary Format
        • Get Peers Message Binary Format
          Get Peers Message Binary Format
        • Get Signatures Message Binary Format
          Get Signatures Message Binary Format
        • Handshake Message Binary Format
          Handshake Message Binary Format
        • Peers Message Binary Format
          Peers Message Binary Format
        • Score Message Binary Format
          Score Message Binary Format
        • Signatures Message Binary Format
          Signatures Message Binary Format
        • Transaction Message Message Binary Format
          Transaction Message Message Binary Format
        Network Message Binary Format
      • Order Binary Format
        Order Binary Format
      • Transaction Binary Format
        • Burn Transaction Binary Format
          Burn Transaction Binary Format
        • Create Alias Transaction Binary Format
          Create Alias Transaction Binary Format
        • Data Transaction Binary Format
          Data Transaction Binary Format
        • Exchange Transaction Binary Format
          Exchange Transaction Binary Format
        • Genesis Transaction Binary Format
          Genesis Transaction Binary Format
        • Invoke Script Transaction Binary Format
          Invoke Script Transaction Binary Format
        • Issue Transaction Binary Format
          Issue Transaction Binary Format
        • Lease Cancel Transaction Binary Format
          Lease Cancel Transaction Binary Format
        • Lease Transaction Binary Format
          Lease Transaction Binary Format
        • Mass Transfer Transaction Binary Format
          Mass Transfer Transaction Binary Format
        • Reissue Transaction Binary Format
          Reissue Transaction Binary Format
        • Set Asset Script Transaction Binary Format
          Set Asset Script Transaction Binary Format
        • Set Script Transaction Binary Format
          Set Script Transaction Binary Format
        • Sponsor Fee Transaction Binary Format
          Sponsor Fee Transaction Binary Format
        • Transfer Transaction Binary Format
          Transfer Transaction Binary Format
        • Update Asset Info Transaction Binary Format
          Update Asset Info Transaction Binary Format
        • Ethereum-like Transaction Binary Format
          Ethereum-like Transaction Binary Format
        Transaction Binary Format
      • Transaction Proof Binary Format
        Transaction Proof Binary Format
      Binary Format
    • Validation Rules
      Validation Rules
    Protocols & Data formats
  • Glossary
    Glossary
      • English
      • Русский
      On this page
        • Version 5
        • Version 4
        • Version 3
      waves_logo Docs

          # 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
          Alias Binary Format
          Network Message Binary Format
          Alias Binary Format
          Network Message Binary Format