RPCs - Index

Shell

  • /
    • /chains
      • /chains/<chain_id>
        • /chains/<chain_id>/blocks (GET)
          • /chains/<chain_id>/blocks/<block_id> (<dyn>)
        • /chains/<chain_id>/chain_id (GET)
        • /chains/<chain_id>/invalid_blocks (GET)
          • /chains/<chain_id>/invalid_blocks/<block_hash> (GET DELETE)
        • /chains/<chain_id>/mempool (<dyn>)
    • /describe (GET)
    • /errors (GET)
    • /injection
      • /injection/block (POST)
      • /injection/operation (POST)
      • /injection/protocol (POST)
    • /monitor
      • /monitor/bootstrapped (GET)
      • /monitor/heads
        • /monitor/heads/<chain_id> (GET)
      • /monitor/protocols (GET)
      • /monitor/valid_blocks (GET)
    • /network
      • /network/connections (GET)
        • /network/connections/<peer_id> (GET DELETE)
      • /network/greylist
        • /network/greylist/clear (GET)
      • /network/log (GET)
      • /network/peers (GET)
        • /network/peers/<peer_id> (GET)
          • /network/peers/<peer_id>/ban (GET)
          • /network/peers/<peer_id>/banned (GET)
          • /network/peers/<peer_id>/log (GET)
          • /network/peers/<peer_id>/trust (GET)
      • /network/points (GET)
        • /network/points/<point> (GET PUT)
          • /network/points/<point>/ban (GET)
          • /network/points/<point>/banned (GET)
          • /network/points/<point>/log (GET)
          • /network/points/<point>/trust (GET)
      • /network/stat (GET)
      • /network/versions (GET)
    • /protocols (GET)
      • /protocols/<Protocol_hash> (GET)
    • /workers
      • /workers/block_validator (GET)
      • /workers/chain_validators (GET)
        • /workers/chain_validators/<chain_id> (GET)
          • /workers/chain_validators/<chain_id>/peers_validators (GET)
            • /workers/chain_validators/<chain_id>/peers_validators/<peer_id> (GET)
      • /workers/prevalidators (GET)
        • /workers/prevalidators/<chain_id> (GET)

Protocol Alpha

  • ../<block_id> (GET)
    • ../<block_id>/context
      • ../<block_id>/context/constants (GET)
        • ../<block_id>/context/constants/errors (GET)
      • ../<block_id>/context/contracts (GET)
        • ../<block_id>/context/contracts/<contract_id> (GET)
          • ../<block_id>/context/contracts/<contract_id>/balance (GET)
          • ../<block_id>/context/contracts/<contract_id>/big_map_get (POST)
          • ../<block_id>/context/contracts/<contract_id>/counter (GET)
          • ../<block_id>/context/contracts/<contract_id>/delegatable (GET)
          • ../<block_id>/context/contracts/<contract_id>/delegate (GET)
          • ../<block_id>/context/contracts/<contract_id>/manager (GET)
          • ../<block_id>/context/contracts/<contract_id>/manager_key (GET)
          • ../<block_id>/context/contracts/<contract_id>/script (GET)
          • ../<block_id>/context/contracts/<contract_id>/spendable (GET)
          • ../<block_id>/context/contracts/<contract_id>/storage (GET)
      • ../<block_id>/context/delegates (GET)
        • ../<block_id>/context/delegates/<pkh> (GET)
          • ../<block_id>/context/delegates/<pkh>/balance (GET)
          • ../<block_id>/context/delegates/<pkh>/deactivated (GET)
          • ../<block_id>/context/delegates/<pkh>/delegated_balance (GET)
          • ../<block_id>/context/delegates/<pkh>/delegated_contracts (GET)
          • ../<block_id>/context/delegates/<pkh>/frozen_balance (GET)
          • ../<block_id>/context/delegates/<pkh>/frozen_balance_by_cycle (GET)
          • ../<block_id>/context/delegates/<pkh>/grace_period (GET)
          • ../<block_id>/context/delegates/<pkh>/staking_balance (GET)
      • ../<block_id>/context/nonces
        • ../<block_id>/context/nonces/<block_level> (GET)
      • ../<block_id>/context/raw
        • ../<block_id>/context/raw/bytes (GET)
        • ../<block_id>/context/raw/json (<dyn>)
      • ../<block_id>/context/seed (POST)
    • ../<block_id>/hash (GET)
    • ../<block_id>/header (GET)
      • ../<block_id>/header/protocol_data (GET)
        • ../<block_id>/header/protocol_data/raw (GET)
      • ../<block_id>/header/raw (GET)
      • ../<block_id>/header/shell (GET)
    • ../<block_id>/helpers
      • ../<block_id>/helpers/baking_rights (GET)
      • ../<block_id>/helpers/complete
        • ../<block_id>/helpers/complete/<prefix> (GET)
      • ../<block_id>/helpers/current_level (GET)
      • ../<block_id>/helpers/endorsing_rights (GET)
      • ../<block_id>/helpers/forge
        • ../<block_id>/helpers/forge/operations (POST)
        • ../<block_id>/helpers/forge/protocol_data (POST)
      • ../<block_id>/helpers/forge_block_header (POST)
      • ../<block_id>/helpers/levels_in_current_cycle (GET)
      • ../<block_id>/helpers/parse
        • ../<block_id>/helpers/parse/block (POST)
        • ../<block_id>/helpers/parse/operations (POST)
      • ../<block_id>/helpers/preapply
        • ../<block_id>/helpers/preapply/block (POST)
        • ../<block_id>/helpers/preapply/operations (POST)
      • ../<block_id>/helpers/scripts
        • ../<block_id>/helpers/scripts/pack_data (POST)
        • ../<block_id>/helpers/scripts/run_code (POST)
        • ../<block_id>/helpers/scripts/run_operation (POST)
        • ../<block_id>/helpers/scripts/trace_code (POST)
        • ../<block_id>/helpers/scripts/typecheck_code (POST)
        • ../<block_id>/helpers/scripts/typecheck_data (POST)
    • ../<block_id>/live_blocks (GET)
    • ../<block_id>/metadata (GET)
    • ../<block_id>/operation_hashes (GET)
      • ../<block_id>/operation_hashes/<list_offset> (GET)
        • ../<block_id>/operation_hashes/<list_offset>/<operation_offset> (GET)
    • ../<block_id>/operations (GET)
      • ../<block_id>/operations/<list_offset> (GET)
        • ../<block_id>/operations/<list_offset>/<operation_offset> (GET)

RPCs - Full description

Shell

GET /chains/<chain_id>/blocks?[length=<int>]&(head=<block_hash>)*&[min_date=<date>]

Lists known heads of the blockchain sorted with decreasing fitness. Optional arguments allows to returns the list of predecessors for known heads or the list of predecessors for a given list of blocks.

Optional query arguments :

  • length = <int> : The requested number of predecessors to returns (per requested head).
  • head = <block_hash> : An empty argument requests blocks from the current heads. A non empty list allow to request specific fragment of the chain.
  • min_date = <date> : When `min_date` is provided, heads with a timestamp before `min_date` are filtered out

  [ [ $block_hash ... ] ... ]
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+

  

GET /chains/<chain_id>/chain_id

The chain unique identifier.

  $Chain_id
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    string
  +----------+---------+----------+
  | Name     | Size    | Contents |
  +==========+=========+==========+
  | Chain_id | 4 bytes | bytes    |
  +----------+---------+----------+


  

GET /chains/<chain_id>/invalid_blocks

Lists blocks that have been declared invalid along with the errors that led to them being declared invalid.

  [ { "block": $block_hash,
      "level": integer ∈ [-2^31-2, 2^31+2],
      "errors": $error } ... ]
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | block                    | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | level                    | 4 bytes  | signed 32-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+

  

GET /chains/<chain_id>/invalid_blocks/<block_hash>

The errors that appears during the block (in)validation.

  { "block": $block_hash,
    "level": integer ∈ [-2^31-2, 2^31+2],
    "errors": $error }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | block                    | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | level                    | 4 bytes  | signed 32-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  

DELETE /chains/<chain_id>/invalid_blocks/<block_hash>

Remove an invalid block for the tezos storage

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  

GET /describe?[recurse=<bool>]

RPCs documentation and input/output schema

Optional query arguments :

  • recurse = <bool>

  $service_tree
  $layout:
    { "kind": "Zero_width" }
    || { "size": "Int32" | "Int16" | "Uint16" | "Int64" | "Int8" | "Uint8",
         "kind": "Int" }
    || { "kind": "Bool" }
    || { "min": integer ∈ [-2^30-2, 2^30+2],
         "max": integer ∈ [-2^30-2, 2^30+2],
         "kind": "RangedInt" }
    || { "min": number,
         "max": number,
         "kind": "RangedFloat" }
    || { "kind": "Float" }
    || { "kind": "Bytes" }
    || { "kind": "String" }
    || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
         "reference": string,
         "kind": "Enum" }
    || { "layout": $layout,
         "kind": "Seq",
         "max_length"?: integer ∈ [-2^30-2, 2^30+2] }
    || { "name": string,
         "kind": "Ref" }
    || { "kind": "Padding" }
  $schema.field:
    { "name": string,
      "layout": $layout,
      "data_kind": $schema.kind,
      "kind": "named" }
    || { "layout": $layout,
         "kind": "anon",
         "data_kind": $schema.kind }
    || { "kind": "dyn",
         "name"?: string,
         "num_fields": integer ∈ [-2^30-2, 2^30+2],
         "size": "Uint30" | "Uint16" | "Uint8" }
    || { "kind": "option_indicator",
         "name": string }
  $schema.kind:
    { "size": integer ∈ [-2^30-2, 2^30+2],
      "kind": "Float" }
    || { "kind": "Dynamic" }
    || { "kind": "Variable" }
  $service_tree:
    { "static":
        { "get_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ string
                  || { "id": "single",
                       "name": string,
                       "descr"?: string }
                  || { "id": "multiple",
                       "name": string,
                       "descr"?: string } ... ],
              "description"?: string,
              "query":
                [ { "name": string,
                    "description"?: string,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": string,
                            "descr"?: string } }
                      || { "optional":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } } } ... ],
              "input"?:
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "output":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "error":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } } },
          "post_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ string
                  || { "id": "single",
                       "name": string,
                       "descr"?: string }
                  || { "id": "multiple",
                       "name": string,
                       "descr"?: string } ... ],
              "description"?: string,
              "query":
                [ { "name": string,
                    "description"?: string,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": string,
                            "descr"?: string } }
                      || { "optional":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } } } ... ],
              "input"?:
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "output":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "error":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } } },
          "delete_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ string
                  || { "id": "single",
                       "name": string,
                       "descr"?: string }
                  || { "id": "multiple",
                       "name": string,
                       "descr"?: string } ... ],
              "description"?: string,
              "query":
                [ { "name": string,
                    "description"?: string,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": string,
                            "descr"?: string } }
                      || { "optional":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } } } ... ],
              "input"?:
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "output":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "error":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } } },
          "put_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ string
                  || { "id": "single",
                       "name": string,
                       "descr"?: string }
                  || { "id": "multiple",
                       "name": string,
                       "descr"?: string } ... ],
              "description"?: string,
              "query":
                [ { "name": string,
                    "description"?: string,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": string,
                            "descr"?: string } }
                      || { "optional":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } } } ... ],
              "input"?:
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "output":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "error":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } } },
          "patch_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ string
                  || { "id": "single",
                       "name": string,
                       "descr"?: string }
                  || { "id": "multiple",
                       "name": string,
                       "descr"?: string } ... ],
              "description"?: string,
              "query":
                [ { "name": string,
                    "description"?: string,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": string,
                            "descr"?: string } }
                      || { "optional":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": string,
                               "descr"?: string } } } ... ],
              "input"?:
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "output":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } },
              "error":
                { "json_schema": any,
                  "binary_schema":
                    { "toplevel":
                        { "fields": [ $schema.field ... ] }
                        || { "tag_size": "Uint16" | "Uint8",
                             "kind": $schema.kind,
                             "cases": [ $union case ... ] }
                        || { "size": "Int16" | "Uint16" | "Int8" | "Uint8",
                             "cases":
                               [ [ integer ∈ [-2^30-2, 2^30+2], string ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": string,
                                "description"?: string },
                            "encoding":
                              { "fields": [ $schema.field ... ] }
                              || { "tag_size": "Uint16" | "Uint8",
                                   "kind": $schema.kind,
                                   "cases": [ $union case ... ] }
                              || { "size":
                                     "Int16" | "Uint16" | "Int8" | "Uint8",
                                   "cases":
                                     [ [ integer ∈ [-2^30-2, 2^30+2],
                                         string ] ... ] } } ... ] } } },
          "subdirs"?:
            { "suffixes": [ { "name": string,
                              "tree": $service_tree } ... ] }
            || { "dynamic_dispatch":
                   { "arg":
                       { "id": "single",
                         "name": string,
                         "descr"?: string },
                     "tree": $service_tree } } } }
    || { "dynamic": string || null }
  $union case:
    { "tag": integer ∈ [-2^30-2, 2^30+2],
      "fields": [ $schema.field ... ],
      "name"?: string }
  +-----------------+----------------------+---------------+
  | Name            | Size                 | Contents      |
  +=================+======================+===============+
  | Unnamed field 0 | Determined from data | $service_tree |
  +-----------------+----------------------+---------------+


  service_tree (Determined from data, 8-bit tag)
  **********************************************

  Static (tag 0)
  ==============

  +--------+----------------------+------------------------+
  | Name   | Size                 | Contents               |
  +========+======================+========================+
  | Tag    | 1 byte               | unsigned 8-bit integer |
  +--------+----------------------+------------------------+
  | static | Determined from data | $X_1                   |
  +--------+----------------------+------------------------+


  Dynamic (tag 1)
  ===============

  +---------+----------------------+------------------------+
  | Name    | Size                 | Contents               |
  +=========+======================+========================+
  | Tag     | 1 byte               | unsigned 8-bit integer |
  +---------+----------------------+------------------------+
  | dynamic | Determined from data | $X_0                   |
  +---------+----------------------+------------------------+


  X_1
  ***

  +--------------------------------------+----------------------+-------------------------------------+
  | Name                                 | Size                 | Contents                            |
  +======================================+======================+=====================================+
  | ? presence of field "get_service"    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------------+----------------------+-------------------------------------+
  | get_service                          | Determined from data | $X_2                                |
  +--------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "post_service"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------------+----------------------+-------------------------------------+
  | post_service                         | Determined from data | $X_2                                |
  +--------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delete_service" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------------+----------------------+-------------------------------------+
  | delete_service                       | Determined from data | $X_2                                |
  +--------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "put_service"    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------------+----------------------+-------------------------------------+
  | put_service                          | Determined from data | $X_2                                |
  +--------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "patch_service"  | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------------+----------------------+-------------------------------------+
  | patch_service                        | Determined from data | $X_2                                |
  +--------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "subdirs"        | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------------+----------------------+-------------------------------------+
  | subdirs                              | Determined from data | $X_936                              |
  +--------------------------------------+----------------------+-------------------------------------+


  X_936 (Determined from data, 8-bit tag)
  ***************************************

  Suffixes (tag 0)
  ================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | suffixes              | Variable | sequence of $X_935      |
  +-----------------------+----------+-------------------------+


  Arg (tag 1)
  ===========

  +------------------+----------------------+------------------------+
  | Name             | Size                 | Contents               |
  +==================+======================+========================+
  | Tag              | 1 byte               | unsigned 8-bit integer |
  +------------------+----------------------+------------------------+
  | dynamic_dispatch | Determined from data | $X_932                 |
  +------------------+----------------------+------------------------+


  X_935
  *****

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | name                  | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | tree                  | Determined from data | $service_tree           |
  +-----------------------+----------------------+-------------------------+


  X_932
  *****

  +------+----------------------+---------------+
  | Name | Size                 | Contents      |
  +======+======================+===============+
  | arg  | Determined from data | $X_10         |
  +------+----------------------+---------------+
  | tree | Determined from data | $service_tree |
  +------+----------------------+---------------+


  X_934
  *****

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_875
  *****

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | json_schema           | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | binary_schema         | Determined from data | $X_18                   |
  +-----------------------+----------------------+-------------------------+


  X_903
  *****

  +-------------+----------------------+----------+
  | Name        | Size                 | Contents |
  +=============+======================+==========+
  | description | Determined from data | $X_46    |
  +-------------+----------------------+----------+
  | encoding    | Determined from data | $X_44    |
  +-------------+----------------------+----------+


  X_921
  *****

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_32                   |
  +-----------------------+----------------------+-------------------------+


  schema.kind (Determined from data, 8-bit tag)
  *********************************************

  Dynamic (tag 0)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Variable (tag 1)
  ================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Fixed (tag 2)
  =============

  +------+---------+--------------------------------------------------------------+
  | Name | Size    | Contents                                                     |
  +======+=========+==============================================================+
  | Tag  | 1 byte  | unsigned 8-bit integer                                       |
  +------+---------+--------------------------------------------------------------+
  | size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------+---------+--------------------------------------------------------------+


  X_928 (Enumeration: unsigned 8-bit integer):
  ********************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | Int64          |
  +-------------+----------------+
  | 1           | Int32          |
  +-------------+----------------+
  | 2           | Int16          |
  +-------------+----------------+
  | 3           | Int8           |
  +-------------+----------------+
  | 4           | Uint16         |
  +-------------+----------------+
  | 5           | Uint8          |
  +-------------+----------------+


  X_927 (Enumeration: unsigned 8-bit integer):
  ********************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | Int16          |
  +-------------+----------------+
  | 1           | Int8           |
  +-------------+----------------+
  | 2           | Uint16         |
  +-------------+----------------+
  | 3           | Uint8          |
  +-------------+----------------+


  X_923 (Enumeration: unsigned 8-bit integer):
  ********************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | Uint30         |
  +-------------+----------------+
  | 1           | Uint16         |
  +-------------+----------------+
  | 2           | Uint8          |
  +-------------+----------------+


  X_909 (Enumeration: unsigned 8-bit integer):
  ********************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | Uint16         |
  +-------------+----------------+
  | 1           | Uint8          |
  +-------------+----------------+


  X_760 (Determined from data, 8-bit tag)
  ***************************************

  Single (tag 0)
  ==============

  +--------+----------------------+------------------------+
  | Name   | Size                 | Contents               |
  +========+======================+========================+
  | Tag    | 1 byte               | unsigned 8-bit integer |
  +--------+----------------------+------------------------+
  | single | Determined from data | $X_10                  |
  +--------+----------------------+------------------------+


  Optional (tag 1)
  ================

  +----------+----------------------+------------------------+
  | Name     | Size                 | Contents               |
  +==========+======================+========================+
  | Tag      | 1 byte               | unsigned 8-bit integer |
  +----------+----------------------+------------------------+
  | optional | Determined from data | $X_10                  |
  +----------+----------------------+------------------------+


  Flag (tag 2)
  ============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Multi (tag 3)
  =============

  +-------+----------------------+------------------------+
  | Name  | Size                 | Contents               |
  +=======+======================+========================+
  | Tag   | 1 byte               | unsigned 8-bit integer |
  +-------+----------------------+------------------------+
  | multi | Determined from data | $X_10                  |
  +-------+----------------------+------------------------+


  X_747 (Enumeration: unsigned 8-bit integer):
  ********************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | GET            |
  +-------------+----------------+
  | 1           | POST           |
  +-------------+----------------+
  | 2           | DELETE         |
  +-------------+----------------+
  | 3           | PUT            |
  +-------------+----------------+
  | 4           | PATCH          |
  +-------------+----------------+


  X_2
  ***

  +-----------------------------------+----------------------+------------------------------------------------------------+
  | Name                              | Size                 | Contents                                                   |
  +===================================+======================+============================================================+
  | meth                              | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_747) |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | # bytes in next field             | 4 bytes              | unsigned 30-bit integer                                    |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | path                              | Variable             | sequence of $X_6                                           |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | ? presence of field "description" | 1 byte               | boolean (0 for false, 255 for true)                        |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | description                       | Determined from data | $X_934                                                     |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | # bytes in next field             | 4 bytes              | unsigned 30-bit integer                                    |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | query                             | Variable             | sequence of $X_8                                           |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | ? presence of field "input"       | 1 byte               | boolean (0 for false, 255 for true)                        |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | input                             | Determined from data | $X_875                                                     |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | output                            | Determined from data | $X_875                                                     |
  +-----------------------------------+----------------------+------------------------------------------------------------+
  | error                             | Determined from data | $X_875                                                     |
  +-----------------------------------+----------------------+------------------------------------------------------------+


  X_18
  ****

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | toplevel              | Determined from data | $X_44                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | fields                | Variable             | sequence of $X_903      |
  +-----------------------+----------------------+-------------------------+


  X_46
  ****

  +-----------------------------------+----------------------+-------------------------------------+
  | Name                              | Size                 | Contents                            |
  +===================================+======================+=====================================+
  | # bytes in next field             | 4 bytes              | unsigned 30-bit integer             |
  +-----------------------------------+----------------------+-------------------------------------+
  | title                             | Variable             | bytes                               |
  +-----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "description" | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------------------+----------------------+-------------------------------------+
  | description                       | Determined from data | $X_934                              |
  +-----------------------------------+----------------------+-------------------------------------+


  X_44 (Determined from data, 8-bit tag)
  **************************************

  Obj (tag 0)
  ===========

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | fields                | Variable | sequence of $X_921      |
  +-----------------------+----------+-------------------------+


  Cases (tag 1)
  =============

  +-----------------------+----------------------+------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                   |
  +=======================+======================+============================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                     |
  +-----------------------+----------------------+------------------------------------------------------------+
  | tag_size              | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_909) |
  +-----------------------+----------------------+------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                    |
  +-----------------------+----------------------+------------------------------------------------------------+
  | kind                  | Determined from data | $schema.kind                                               |
  +-----------------------+----------------------+------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                    |
  +-----------------------+----------------------+------------------------------------------------------------+
  | cases                 | Variable             | sequence of $union case                                    |
  +-----------------------+----------------------+------------------------------------------------------------+


  Int_enum (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------------------+
  | Name                  | Size     | Contents                                                   |
  +=======================+==========+============================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                     |
  +-----------------------+----------+------------------------------------------------------------+
  | size                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_927) |
  +-----------------------+----------+------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                    |
  +-----------------------+----------+------------------------------------------------------------+
  | cases                 | Variable | sequence of $X_20                                          |
  +-----------------------+----------+------------------------------------------------------------+


  union case
  **********

  +----------------------------+----------------------+--------------------------------------------------------------+
  | Name                       | Size                 | Contents                                                     |
  +============================+======================+==============================================================+
  | tag                        | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------------+----------------------+--------------------------------------------------------------+
  | # bytes in next field      | 4 bytes              | unsigned 30-bit integer                                      |
  +----------------------------+----------------------+--------------------------------------------------------------+
  | fields                     | Variable             | sequence of $X_921                                           |
  +----------------------------+----------------------+--------------------------------------------------------------+
  | ? presence of field "name" | 1 byte               | boolean (0 for false, 255 for true)                          |
  +----------------------------+----------------------+--------------------------------------------------------------+
  | name                       | Determined from data | $X_934                                                       |
  +----------------------------+----------------------+--------------------------------------------------------------+


  X_32 (Determined from data, 8-bit tag)
  **************************************

  Named_field (tag 0)
  ===================

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | Tag                   | 1 byte               | unsigned 8-bit integer  |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | name                  | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | layout                | Determined from data | $layout                 |
  +-----------------------+----------------------+-------------------------+
  | data_kind             | Determined from data | $schema.kind            |
  +-----------------------+----------------------+-------------------------+


  Anonymous_field (tag 1)
  =======================

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | Tag                   | 1 byte               | unsigned 8-bit integer  |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | layout                | Determined from data | $layout                 |
  +-----------------------+----------------------+-------------------------+
  | data_kind             | Determined from data | $schema.kind            |
  +-----------------------+----------------------+-------------------------+


  Dynamic_field (tag 2)
  =====================

  +----------------------------+----------------------+--------------------------------------------------------------+
  | Name                       | Size                 | Contents                                                     |
  +============================+======================+==============================================================+
  | Tag                        | 1 byte               | unsigned 8-bit integer                                       |
  +----------------------------+----------------------+--------------------------------------------------------------+
  | ? presence of field "name" | 1 byte               | boolean (0 for false, 255 for true)                          |
  +----------------------------+----------------------+--------------------------------------------------------------+
  | name                       | Determined from data | $X_934                                                       |
  +----------------------------+----------------------+--------------------------------------------------------------+
  | num_fields                 | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------------+----------------------+--------------------------------------------------------------+
  | size                       | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_923)   |
  +----------------------------+----------------------+--------------------------------------------------------------+


  Optional_field (tag 3)
  ======================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | name                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  layout (Determined from data, 8-bit tag)
  ****************************************

  Zero_width (tag 0)
  ==================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Int (tag 1)
  ===========

  +------+--------+------------------------------------------------------------+
  | Name | Size   | Contents                                                   |
  +======+========+============================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                     |
  +------+--------+------------------------------------------------------------+
  | size | 1 byte | unsigned 8-bit integer encoding an enumeration (see X_928) |
  +------+--------+------------------------------------------------------------+


  Bool (tag 2)
  ============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  RangedInt (tag 3)
  =================

  +------+---------+--------------------------------------------------------------+
  | Name | Size    | Contents                                                     |
  +======+=========+==============================================================+
  | Tag  | 1 byte  | unsigned 8-bit integer                                       |
  +------+---------+--------------------------------------------------------------+
  | min  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------+---------+--------------------------------------------------------------+
  | max  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------+---------+--------------------------------------------------------------+


  RangedFloat (tag 4)
  ===================

  +------+---------+----------------------------------------+
  | Name | Size    | Contents                               |
  +======+=========+========================================+
  | Tag  | 1 byte  | unsigned 8-bit integer                 |
  +------+---------+----------------------------------------+
  | min  | 8 bytes | double-precision floating-point number |
  +------+---------+----------------------------------------+
  | max  | 8 bytes | double-precision floating-point number |
  +------+---------+----------------------------------------+


  Float (tag 5)
  =============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Bytes (tag 6)
  =============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  String (tag 7)
  ==============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Enum (tag 8)
  ============

  +-----------------------+----------+------------------------------------------------------------+
  | Name                  | Size     | Contents                                                   |
  +=======================+==========+============================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                     |
  +-----------------------+----------+------------------------------------------------------------+
  | size                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_927) |
  +-----------------------+----------+------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                    |
  +-----------------------+----------+------------------------------------------------------------+
  | reference             | Variable | bytes                                                      |
  +-----------------------+----------+------------------------------------------------------------+


  Seq (tag 9)
  ===========

  +----------------------------------+----------------------+--------------------------------------------------------------+
  | Name                             | Size                 | Contents                                                     |
  +==================================+======================+==============================================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer                                       |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | layout                           | Determined from data | $layout                                                      |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | ? presence of field "max_length" | 1 byte               | boolean (0 for false, 255 for true)                          |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | max_length                       | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------------------+----------------------+--------------------------------------------------------------+


  Ref (tag 10)
  ============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | name                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Padding (tag 11)
  ================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  X_20
  ****

  +-----------------+----------------------+--------------------------------------------------------------+
  | Name            | Size                 | Contents                                                     |
  +=================+======================+==============================================================+
  | Unnamed field 0 | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+----------------------+--------------------------------------------------------------+
  | Unnamed field 1 | Determined from data | $X_934                                                       |
  +-----------------+----------------------+--------------------------------------------------------------+


  X_8
  ***

  +-----------------------------------+----------------------+-------------------------------------+
  | Name                              | Size                 | Contents                            |
  +===================================+======================+=====================================+
  | # bytes in next field             | 4 bytes              | unsigned 30-bit integer             |
  +-----------------------------------+----------------------+-------------------------------------+
  | name                              | Variable             | bytes                               |
  +-----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "description" | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------------------+----------------------+-------------------------------------+
  | description                       | Determined from data | $X_934                              |
  +-----------------------------------+----------------------+-------------------------------------+
  | kind                              | Determined from data | $X_760                              |
  +-----------------------------------+----------------------+-------------------------------------+


  X_10
  ****

  +-----------------------------+----------------------+-------------------------------------+
  | Name                        | Size                 | Contents                            |
  +=============================+======================+=====================================+
  | # bytes in next field       | 4 bytes              | unsigned 30-bit integer             |
  +-----------------------------+----------------------+-------------------------------------+
  | name                        | Variable             | bytes                               |
  +-----------------------------+----------------------+-------------------------------------+
  | ? presence of field "descr" | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------------+----------------------+-------------------------------------+
  | descr                       | Determined from data | $X_934                              |
  +-----------------------------+----------------------+-------------------------------------+


  X_6 (Determined from data, 8-bit tag)
  *************************************

  PStatic (tag 0)
  ===============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  PDynamic (tag 1)
  ================

  +-----------------------------+----------------------+-------------------------------------+
  | Name                        | Size                 | Contents                            |
  +=============================+======================+=====================================+
  | Tag                         | 1 byte               | unsigned 8-bit integer              |
  +-----------------------------+----------------------+-------------------------------------+
  | # bytes in next field       | 4 bytes              | unsigned 30-bit integer             |
  +-----------------------------+----------------------+-------------------------------------+
  | name                        | Variable             | bytes                               |
  +-----------------------------+----------------------+-------------------------------------+
  | ? presence of field "descr" | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------------+----------------------+-------------------------------------+
  | descr                       | Determined from data | $X_934                              |
  +-----------------------------+----------------------+-------------------------------------+


  PDynamicTail (tag 2)
  ====================

  +-----------------------------+----------------------+-------------------------------------+
  | Name                        | Size                 | Contents                            |
  +=============================+======================+=====================================+
  | Tag                         | 1 byte               | unsigned 8-bit integer              |
  +-----------------------------+----------------------+-------------------------------------+
  | # bytes in next field       | 4 bytes              | unsigned 30-bit integer             |
  +-----------------------------+----------------------+-------------------------------------+
  | name                        | Variable             | bytes                               |
  +-----------------------------+----------------------+-------------------------------------+
  | ? presence of field "descr" | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------------+----------------------+-------------------------------------+
  | descr                       | Determined from data | $X_934                              |
  +-----------------------------+----------------------+-------------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  None (tag 0)
  ============

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Some (tag 1)
  ============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET /errors

Schema for all the RPC errors from the shell

  any
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

POST /injection/block?[async]&[force]&[chain=<chain_id>]

Inject a block in the node and broadcast it. The `operations` embedded in `blockHeader` might be pre-validated using a contextual RPCs from the latest block (e.g. '/blocks/head/context/preapply'). Returns the ID of the block. By default, the RPC will wait for the block to be validated before answering.

Optional query arguments :

  • async
  • force
  • chain = <chain_id>

  { "data": /^[a-zA-Z0-9]+$/,
    "operations":
      [ [ { "branch": $block_hash,
            "data": /^[a-zA-Z0-9]+$/ } ... ] ... ] }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | data                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | operations            | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | branch                   | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | data                     | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_0
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | # bytes in next field    | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | Unnamed field 0          | Variable | sequence of $X_1        |
  +--------------------------+----------+-------------------------+

  
  $block_hash
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  +------------+----------+----------+
  | Name       | Size     | Contents |
  +============+==========+==========+
  | block_hash | 32 bytes | bytes    |
  +------------+----------+----------+


  

POST /injection/operation?[async]&[chain=<chain_id>]

Inject an operation in node and broadcast it. Returns the ID of the operation. The `signedOperationContents` should be constructed using a contextual RPCs from the latest block and signed by the client. By default, the RPC will wait for the operation to be (pre-)validated before answering. See RPCs under /blocks/prevalidation for more details on the prevalidation context.

Optional query arguments :

  • async
  • chain = <chain_id>

  /^[a-zA-Z0-9]+$/
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  
  $Operation_hash
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    string
  +----------------+----------+----------+
  | Name           | Size     | Contents |
  +================+==========+==========+
  | Operation_hash | 32 bytes | bytes    |
  +----------------+----------+----------+


  

POST /injection/protocol?[async]&[force]

Inject a protocol in node. Returns the ID of the protocol.

Optional query arguments :

  • async
  • force

  { "expected_env_version": integer ∈ [-2^15, 2^15-1],
    "components":
      [ { "name": string,
          "interface"?: /^[a-zA-Z0-9]+$/,
          "implementation": /^[a-zA-Z0-9]+$/ } ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | expected_env_version  | 2 bytes  | signed 16-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | components            | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +---------------------------------+----------------------+-------------------------------------+
  | Name                            | Size                 | Contents                            |
  +=================================+======================+=====================================+
  | # bytes in next field           | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------+----------------------+-------------------------------------+
  | name                            | Variable             | bytes                               |
  +---------------------------------+----------------------+-------------------------------------+
  | ? presence of field "interface" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------+----------------------+-------------------------------------+
  | interface                       | Determined from data | $X_1                                |
  +---------------------------------+----------------------+-------------------------------------+
  | # bytes in next field           | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------+----------------------+-------------------------------------+
  | implementation                  | Variable             | bytes                               |
  +---------------------------------+----------------------+-------------------------------------+

  
  $Protocol_hash
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  +---------------+----------+----------+
  | Name          | Size     | Contents |
  +===============+==========+==========+
  | Protocol_hash | 32 bytes | bytes    |
  +---------------+----------+----------+


  

GET /monitor/bootstrapped

Wait for the node to have synchronized its chain with a few peers (configured by the node's administrator), streaming head updates that happen during the bootstrapping process, and closing the stream at the end. If the node was already bootstrapped, returns the current head immediately.

  { "block": $block_hash,
    "timestamp": $timestamp }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------+----------+-----------------------+
  | Name      | Size     | Contents              |
  +===========+==========+=======================+
  | block     | 32 bytes | bytes                 |
  +-----------+----------+-----------------------+
  | timestamp | 8 bytes  | signed 64-bit integer |
  +-----------+----------+-----------------------+


  

GET /monitor/heads/<chain_id>?(next_protocol=<Protocol_hash>)*

Monitor all blocks that are succesfully validated by the node and selected as the new head of the given chain.

Optional query arguments :

  • next_protocol = <Protocol_hash>

  { "hash": $block_hash,
    "level": integer ∈ [-2^31-2, 2^31+2],
    "proto": integer ∈ [0, 255],
    "predecessor": $block_hash,
    "timestamp": $timestamp,
    "validation_pass": integer ∈ [0, 255],
    "operations_hash": $Operation_list_list_hash,
    "fitness": $fitness,
    "context": $Context_hash,
    "protocol_data": /^[a-zA-Z0-9]+$/ }
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | hash                       | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | protocol_data              | Variable | bytes                     |
  +----------------------------+----------+---------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET /monitor/protocols

Monitor all economic protocols that are retrieved and succesfully loaded and compiled by the node.

  $Protocol_hash
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  +---------------+----------+----------+
  | Name          | Size     | Contents |
  +===============+==========+==========+
  | Protocol_hash | 32 bytes | bytes    |
  +---------------+----------+----------+


  

GET /monitor/valid_blocks?(protocol=<Protocol_hash>)*&(next_protocol=<Protocol_hash>)*&(chain=<chain_id>)*

Monitor all blocks that are succesfully validated by the node, disregarding whether they were selected as the new head or not.

Optional query arguments :

  • protocol = <Protocol_hash>
  • next_protocol = <Protocol_hash>
  • chain = <chain_id>

  { "chain_id": $Chain_id,
    "hash": $block_hash,
    "level": integer ∈ [-2^31-2, 2^31+2],
    "proto": integer ∈ [0, 255],
    "predecessor": $block_hash,
    "timestamp": $timestamp,
    "validation_pass": integer ∈ [0, 255],
    "operations_hash": $Operation_list_list_hash,
    "fitness": $fitness,
    "context": $Context_hash,
    "protocol_data": /^[a-zA-Z0-9]+$/ }
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    string
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | chain_id                   | 4 bytes  | bytes                     |
  +----------------------------+----------+---------------------------+
  | hash                       | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | protocol_data              | Variable | bytes                     |
  +----------------------------+----------+---------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET /network/connections

List the running P2P connection.

  [ { "incoming": boolean,
      "peer_id": $Crypto_box.Public_key_hash,
      "id_point": { "addr": string,
                    "port"?: integer ∈ [0, 2^16-1] },
      "remote_socket_port": integer ∈ [0, 2^16-1],
      "versions":
        [ { "name": string,
            "major": integer ∈ [0, 2^16-1],
            "minor": integer ∈ [0, 2^16-1] } ... ],
      "private": boolean,
      "local_metadata":
        { "disable_mempool": boolean,
          "private_node": boolean },
      "remote_metadata":
        { "disable_mempool": boolean,
          "private_node": boolean } } ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1
  ***

  +----------------------------+----------+-------------------------------------+
  | Name                       | Size     | Contents                            |
  +============================+==========+=====================================+
  | # bytes in next field      | 4 bytes  | unsigned 30-bit integer             |
  +----------------------------+----------+-------------------------------------+
  | addr                       | Variable | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | ? presence of field "port" | 1 byte   | boolean (0 for false, 255 for true) |
  +----------------------------+----------+-------------------------------------+
  | port                       | 2 bytes  | unsigned 16-bit integer             |
  +----------------------------+----------+-------------------------------------+


  X_2
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | name                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | major                 | 2 bytes  | unsigned 16-bit integer |
  +-----------------------+----------+-------------------------+
  | minor                 | 2 bytes  | unsigned 16-bit integer |
  +-----------------------+----------+-------------------------+


  X_4
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  X_0
  ***

  +-----------------------+----------------------+-------------------------------------+
  | Name                  | Size                 | Contents                            |
  +=======================+======================+=====================================+
  | incoming              | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------+----------------------+-------------------------------------+
  | peer_id               | 16 bytes             | bytes                               |
  +-----------------------+----------------------+-------------------------------------+
  | id_point              | Determined from data | $X_1                                |
  +-----------------------+----------------------+-------------------------------------+
  | remote_socket_port    | 2 bytes              | unsigned 16-bit integer             |
  +-----------------------+----------------------+-------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer             |
  +-----------------------+----------------------+-------------------------------------+
  | versions              | Variable             | sequence of $X_2                    |
  +-----------------------+----------------------+-------------------------------------+
  | private               | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------+----------------------+-------------------------------------+
  | local_metadata        | 2 bytes              | $X_4                                |
  +-----------------------+----------------------+-------------------------------------+
  | remote_metadata       | 2 bytes              | $X_4                                |
  +-----------------------+----------------------+-------------------------------------+

  

GET /network/connections/<peer_id>

Details about the current P2P connection to the given peer.

  { "incoming": boolean,
    "peer_id": $Crypto_box.Public_key_hash,
    "id_point": { "addr": string,
                  "port"?: integer ∈ [0, 2^16-1] },
    "remote_socket_port": integer ∈ [0, 2^16-1],
    "versions":
      [ { "name": string,
          "major": integer ∈ [0, 2^16-1],
          "minor": integer ∈ [0, 2^16-1] } ... ],
    "private": boolean,
    "local_metadata": { "disable_mempool": boolean,
                        "private_node": boolean },
    "remote_metadata":
      { "disable_mempool": boolean,
        "private_node": boolean } }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  +-----------------------+----------------------+-------------------------------------+
  | Name                  | Size                 | Contents                            |
  +=======================+======================+=====================================+
  | incoming              | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------+----------------------+-------------------------------------+
  | peer_id               | 16 bytes             | bytes                               |
  +-----------------------+----------------------+-------------------------------------+
  | id_point              | Determined from data | $X_0                                |
  +-----------------------+----------------------+-------------------------------------+
  | remote_socket_port    | 2 bytes              | unsigned 16-bit integer             |
  +-----------------------+----------------------+-------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer             |
  +-----------------------+----------------------+-------------------------------------+
  | versions              | Variable             | sequence of $X_1                    |
  +-----------------------+----------------------+-------------------------------------+
  | private               | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------+----------------------+-------------------------------------+
  | local_metadata        | 2 bytes              | $X_2                                |
  +-----------------------+----------------------+-------------------------------------+
  | remote_metadata       | 2 bytes              | $X_3                                |
  +-----------------------+----------------------+-------------------------------------+


  X_0
  ***

  +----------------------------+----------+-------------------------------------+
  | Name                       | Size     | Contents                            |
  +============================+==========+=====================================+
  | # bytes in next field      | 4 bytes  | unsigned 30-bit integer             |
  +----------------------------+----------+-------------------------------------+
  | addr                       | Variable | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | ? presence of field "port" | 1 byte   | boolean (0 for false, 255 for true) |
  +----------------------------+----------+-------------------------------------+
  | port                       | 2 bytes  | unsigned 16-bit integer             |
  +----------------------------+----------+-------------------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | name                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | major                 | 2 bytes  | unsigned 16-bit integer |
  +-----------------------+----------+-------------------------+
  | minor                 | 2 bytes  | unsigned 16-bit integer |
  +-----------------------+----------+-------------------------+


  X_3
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+

  

DELETE /network/connections/<peer_id>?[wait]

Forced close of the current P2P connection to the given peer.

Optional query arguments :

  • wait

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  

GET /network/greylist/clear

Clear all greylists tables.

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  

GET /network/log

Stream of all network events

  { "event": "too_few_connections" }
  || { "event": "too_many_connections" }
  || { "event": "new_point",
       "point": string }
  || { "event": "new_peer",
       "peer_id": $Crypto_box.Public_key_hash }
  || { "event": "incoming_connection",
       "point": string }
  || { "event": "outgoing_connection",
       "point": string }
  || { "event": "authentication_failed",
       "point": string }
  || { "event": "accepting_request",
       "point": string,
       "id_point": { "addr": string,
                     "port"?: integer ∈ [0, 2^16-1] },
       "peer_id": $Crypto_box.Public_key_hash }
  || { "event": "rejecting_request",
       "point": string,
       "id_point": { "addr": string,
                     "port"?: integer ∈ [0, 2^16-1] },
       "peer_id": $Crypto_box.Public_key_hash }
  || { "event": "request_rejected",
       "point": string,
       "identity"?:
         [ { "addr": string,
             "port"?: integer ∈ [0, 2^16-1] },
           $Crypto_box.Public_key_hash ] }
  || { "event": "connection_established",
       "id_point": { "addr": string,
                     "port"?: integer ∈ [0, 2^16-1] },
       "peer_id": $Crypto_box.Public_key_hash }
  || { "event": "disconnection",
       "peer_id": $Crypto_box.Public_key_hash }
  || { "event": "external_disconnection",
       "peer_id": $Crypto_box.Public_key_hash }
  || { "event": "gc_points" }
  || { "event": "gc_peer_ids" }
  || { "event": "swap_request_received",
       "source": $Crypto_box.Public_key_hash }
  || { "event": "swap_ack_received",
       "source": $Crypto_box.Public_key_hash }
  || { "event": "swap_request_sent",
       "source": $Crypto_box.Public_key_hash }
  || { "event": "swap_ack_sent",
       "source": $Crypto_box.Public_key_hash }
  || { "event": "swap_request_ignored",
       "source": $Crypto_box.Public_key_hash }
  || { "event": "swap_success",
       "source": $Crypto_box.Public_key_hash }
  || { "event": "swap_failure",
       "source": $Crypto_box.Public_key_hash }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_5     |
  +-----------------+----------------------+----------+


  X_1
  ***

  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_4     |
  +-----------------+----------------------+----------+
  | Unnamed field 1 | 16 bytes             | bytes    |
  +-----------------+----------------------+----------+


  X_4
  ***

  +----------------------------+----------+-------------------------------------+
  | Name                       | Size     | Contents                            |
  +============================+==========+=====================================+
  | # bytes in next field      | 4 bytes  | unsigned 30-bit integer             |
  +----------------------------+----------+-------------------------------------+
  | addr                       | Variable | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | ? presence of field "port" | 1 byte   | boolean (0 for false, 255 for true) |
  +----------------------------+----------+-------------------------------------+
  | port                       | 2 bytes  | unsigned 16-bit integer             |
  +----------------------------+----------+-------------------------------------+


  X_5 (Determined from data, 8-bit tag)
  *************************************

  Too_few_connections (tag 0)
  ===========================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Too_many_connections (tag 1)
  ============================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  New_point (tag 2)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | point                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  New_peer (tag 3)
  ================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  Incoming_connection (tag 4)
  ===========================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | point                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Outgoing_connection (tag 5)
  ===========================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | point                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Authentication_failed (tag 6)
  =============================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | point                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Accepting_request (tag 7)
  =========================

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | Tag                   | 1 byte               | unsigned 8-bit integer  |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | point                 | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | id_point              | Determined from data | $X_4                    |
  +-----------------------+----------------------+-------------------------+
  | peer_id               | 16 bytes             | bytes                   |
  +-----------------------+----------------------+-------------------------+


  Rejecting_request (tag 8)
  =========================

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | Tag                   | 1 byte               | unsigned 8-bit integer  |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | point                 | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | id_point              | Determined from data | $X_4                    |
  +-----------------------+----------------------+-------------------------+
  | peer_id               | 16 bytes             | bytes                   |
  +-----------------------+----------------------+-------------------------+


  Request_rejected (tag 9)
  ========================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | # bytes in next field          | 4 bytes              | unsigned 30-bit integer             |
  +--------------------------------+----------------------+-------------------------------------+
  | point                          | Variable             | bytes                               |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "identity" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | identity                       | Determined from data | $X_1                                |
  +--------------------------------+----------------------+-------------------------------------+


  Connection_established (tag 10)
  ===============================

  +----------+----------------------+------------------------+
  | Name     | Size                 | Contents               |
  +==========+======================+========================+
  | Tag      | 1 byte               | unsigned 8-bit integer |
  +----------+----------------------+------------------------+
  | id_point | Determined from data | $X_4                   |
  +----------+----------------------+------------------------+
  | peer_id  | 16 bytes             | bytes                  |
  +----------+----------------------+------------------------+


  Disconnection (tag 11)
  ======================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  External_disconnection (tag 12)
  ===============================

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | peer_id | 16 bytes | bytes                  |
  +---------+----------+------------------------+


  Gc_points (tag 13)
  ==================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Gc_peer_ids (tag 14)
  ====================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Swap_request_received (tag 15)
  ==============================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_ack_received (tag 16)
  ==========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_request_sent (tag 17)
  ==========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_ack_sent (tag 18)
  ======================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_request_ignored (tag 19)
  =============================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_success (tag 20)
  =====================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+


  Swap_failure (tag 21)
  =====================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | source | 16 bytes | bytes                  |
  +--------+----------+------------------------+

  

GET /network/peers?(filter=<p2p.point.state_filter>)*

List the peers the node ever met.

Optional query arguments :

  • filter = <p2p.point.state_filter>

  [ [ $Crypto_box.Public_key_hash,
      { "score": number,
        "trusted": boolean,
        "conn_metadata"?:
          { "disable_mempool": boolean,
            "private_node": boolean },
        "state": "running" | "accepted" | "disconnected",
        "reachable_at"?: { "addr": string,
                           "port"?: integer ∈ [0, 2^16-1] },
        "stat":
          { "total_sent": $int64,
            "total_recv": $int64,
            "current_inflow": integer ∈ [-2^30-2, 2^30+2],
            "current_outflow": integer ∈ [-2^30-2, 2^30+2] },
        "last_failed_connection"?:
          [ { "addr": string,
              "port"?: integer ∈ [0, 2^16-1] },
            $timestamp ],
        "last_rejected_connection"?:
          [ { "addr": string,
              "port"?: integer ∈ [0, 2^16-1] },
            $timestamp ],
        "last_established_connection"?:
          [ { "addr": string,
              "port"?: integer ∈ [0, 2^16-1] },
            $timestamp ],
        "last_disconnection"?:
          [ { "addr": string,
              "port"?: integer ∈ [0, 2^16-1] },
            $timestamp ],
        "last_seen"?:
          [ { "addr": string,
              "port"?: integer ∈ [0, 2^16-1] },
            $timestamp ],
        "last_miss"?:
          [ { "addr": string,
              "port"?: integer ∈ [0, 2^16-1] },
            $timestamp ] } ] ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | 16 bytes             | bytes    |
  +-----------------+----------------------+----------+
  | Unnamed field 1 | Determined from data | $X_1     |
  +-----------------+----------------------+----------+


  X_1
  ***

  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | Name                                              | Size                 | Contents                                                 |
  +===================================================+======================+==========================================================+
  | score                                             | 8 bytes              | double-precision floating-point number                   |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "conn_metadata"               | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | conn_metadata                                     | 2 bytes              | $X_2                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | state                                             | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_3) |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "reachable_at"                | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | reachable_at                                      | Determined from data | $X_17                                                    |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | stat                                              | 24 bytes             | $X_5                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_failed_connection                            | Determined from data | $X_6                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_rejected_connection                          | Determined from data | $X_6                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_established_connection                       | Determined from data | $X_6                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_disconnection                                | Determined from data | $X_6                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_seen                                         | Determined from data | $X_6                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_miss                                         | Determined from data | $X_6                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+


  X_17
  ****

  +----------------------------+----------+-------------------------------------+
  | Name                       | Size     | Contents                            |
  +============================+==========+=====================================+
  | # bytes in next field      | 4 bytes  | unsigned 30-bit integer             |
  +----------------------------+----------+-------------------------------------+
  | addr                       | Variable | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | ? presence of field "port" | 1 byte   | boolean (0 for false, 255 for true) |
  +----------------------------+----------+-------------------------------------+
  | port                       | 2 bytes  | unsigned 16-bit integer             |
  +----------------------------+----------+-------------------------------------+


  X_6
  ***

  +-----------------+----------------------+-----------------------+
  | Name            | Size                 | Contents              |
  +=================+======================+=======================+
  | Unnamed field 0 | Determined from data | $X_17                 |
  +-----------------+----------------------+-----------------------+
  | Unnamed field 1 | 8 bytes              | signed 64-bit integer |
  +-----------------+----------------------+-----------------------+


  X_5
  ***

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | total_sent      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | total_recv      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | current_inflow  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | current_outflow | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  X_3 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | accepted       |
  +-------------+----------------+
  | 1           | running        |
  +-------------+----------------+
  | 2           | disconnected   |
  +-------------+----------------+


  X_2
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+

  

GET /network/peers/<peer_id>

Details about a given peer.

  { "score": number,
    "trusted": boolean,
    "conn_metadata"?: { "disable_mempool": boolean,
                        "private_node": boolean },
    "state": "running" | "accepted" | "disconnected",
    "reachable_at"?: { "addr": string,
                       "port"?: integer ∈ [0, 2^16-1] },
    "stat":
      { "total_sent": $int64,
        "total_recv": $int64,
        "current_inflow": integer ∈ [-2^30-2, 2^30+2],
        "current_outflow": integer ∈ [-2^30-2, 2^30+2] },
    "last_failed_connection"?:
      [ { "addr": string,
          "port"?: integer ∈ [0, 2^16-1] }, $timestamp ],
    "last_rejected_connection"?:
      [ { "addr": string,
          "port"?: integer ∈ [0, 2^16-1] }, $timestamp ],
    "last_established_connection"?:
      [ { "addr": string,
          "port"?: integer ∈ [0, 2^16-1] }, $timestamp ],
    "last_disconnection"?:
      [ { "addr": string,
          "port"?: integer ∈ [0, 2^16-1] }, $timestamp ],
    "last_seen"?:
      [ { "addr": string,
          "port"?: integer ∈ [0, 2^16-1] }, $timestamp ],
    "last_miss"?:
      [ { "addr": string,
          "port"?: integer ∈ [0, 2^16-1] }, $timestamp ] }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | Name                                              | Size                 | Contents                                                 |
  +===================================================+======================+==========================================================+
  | score                                             | 8 bytes              | double-precision floating-point number                   |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "conn_metadata"               | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | conn_metadata                                     | 2 bytes              | $X_0                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | state                                             | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_1) |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "reachable_at"                | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | reachable_at                                      | Determined from data | $X_2                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | stat                                              | 24 bytes             | $X_3                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_failed_connection                            | Determined from data | $X_4                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_rejected_connection                          | Determined from data | $X_6                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_established_connection                       | Determined from data | $X_8                                                     |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_disconnection                                | Determined from data | $X_10                                                    |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_seen                                         | Determined from data | $X_12                                                    |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true)                      |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+
  | last_miss                                         | Determined from data | $X_14                                                    |
  +---------------------------------------------------+----------------------+----------------------------------------------------------+


  X_15
  ****

  +----------------------------+----------+-------------------------------------+
  | Name                       | Size     | Contents                            |
  +============================+==========+=====================================+
  | # bytes in next field      | 4 bytes  | unsigned 30-bit integer             |
  +----------------------------+----------+-------------------------------------+
  | addr                       | Variable | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | ? presence of field "port" | 1 byte   | boolean (0 for false, 255 for true) |
  +----------------------------+----------+-------------------------------------+
  | port                       | 2 bytes  | unsigned 16-bit integer             |
  +----------------------------+----------+-------------------------------------+


  X_4
  ***

  +-----------------+----------------------+-----------------------+
  | Name            | Size                 | Contents              |
  +=================+======================+=======================+
  | Unnamed field 0 | Determined from data | $X_15                 |
  +-----------------+----------------------+-----------------------+
  | Unnamed field 1 | 8 bytes              | signed 64-bit integer |
  +-----------------+----------------------+-----------------------+


  X_3
  ***

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | total_sent      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | total_recv      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | current_inflow  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | current_outflow | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  X_1 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | accepted       |
  +-------------+----------------+
  | 1           | running        |
  +-------------+----------------+
  | 2           | disconnected   |
  +-------------+----------------+


  X_0
  ***

  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | disable_mempool | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+
  | private_node    | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+

  

GET /network/peers/<peer_id>/ban

Blacklist the given peer.

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  

GET /network/peers/<peer_id>/banned

Check if a given peer is blacklisted or greylisted.

  boolean
  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  

GET /network/peers/<peer_id>/log?[monitor]

Monitor network events related to a given peer.

Optional query arguments :

  • monitor

  [ { "kind":
        "rejecting_request"
        | "incoming_request"
        | "disconnection"
        | "external_disconnection"
        | "connection_established"
        | "request_rejected",
      "timestamp": $timestamp,
      "addr": string,
      "port"?: integer ∈ [-2^15, 2^15-1] } ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+------------------------+
  | Case number | Encoded string         |
  +=============+========================+
  | 0           | incoming_request       |
  +-------------+------------------------+
  | 1           | rejecting_request      |
  +-------------+------------------------+
  | 2           | request_rejected       |
  +-------------+------------------------+
  | 3           | connection_established |
  +-------------+------------------------+
  | 4           | disconnection          |
  +-------------+------------------------+
  | 5           | external_disconnection |
  +-------------+------------------------+


  X_0
  ***

  +----------------------------+----------+----------------------------------------------------------+
  | Name                       | Size     | Contents                                                 |
  +============================+==========+==========================================================+
  | kind                       | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_1) |
  +----------------------------+----------+----------------------------------------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer                                    |
  +----------------------------+----------+----------------------------------------------------------+
  | # bytes in next field      | 4 bytes  | unsigned 30-bit integer                                  |
  +----------------------------+----------+----------------------------------------------------------+
  | addr                       | Variable | bytes                                                    |
  +----------------------------+----------+----------------------------------------------------------+
  | ? presence of field "port" | 1 byte   | boolean (0 for false, 255 for true)                      |
  +----------------------------+----------+----------------------------------------------------------+
  | port                       | 2 bytes  | signed 16-bit integer                                    |
  +----------------------------+----------+----------------------------------------------------------+

  

GET /network/peers/<peer_id>/trust

Trust a given peer permanently: the peer cannot be blocked (but its host IP still can).

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  

GET /network/points?(filter=<p2p.point.state_filter>)*

List the pool of known `IP:port` used for establishing P2P connections.

Optional query arguments :

  • filter = <p2p.point.state_filter>

  [ [ string,
      { "trusted": boolean,
        "greylisted_until"?: $timestamp,
        "state":
          { "event_kind": "requested" }
          || { "event_kind": "accepted",
               "p2p_peer_id": $Crypto_box.Public_key_hash }
          || { "event_kind": "running",
               "p2p_peer_id": $Crypto_box.Public_key_hash }
          || { "event_kind": "disconnected" },
        "p2p_peer_id"?: $Crypto_box.Public_key_hash,
        "last_failed_connection"?: $timestamp,
        "last_rejected_connection"?:
          [ $Crypto_box.Public_key_hash, $timestamp ],
        "last_established_connection"?:
          [ $Crypto_box.Public_key_hash, $timestamp ],
        "last_disconnection"?: [ $Crypto_box.Public_key_hash, $timestamp ],
        "last_seen"?: [ $Crypto_box.Public_key_hash, $timestamp ],
        "last_miss"?: $timestamp } ] ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_3 (Determined from data, 8-bit tag)
  *************************************

  Requested (tag 0)
  =================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Accepted (tag 1)
  ================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Running (tag 2)
  ===============

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Disconnected (tag 3)
  ====================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  X_7
  ***

  +-----------------+----------+-----------------------+
  | Name            | Size     | Contents              |
  +=================+==========+=======================+
  | Unnamed field 0 | 16 bytes | bytes                 |
  +-----------------+----------+-----------------------+
  | Unnamed field 1 | 8 bytes  | signed 64-bit integer |
  +-----------------+----------+-----------------------+


  X_2
  ***

  +---------------------------------------------------+----------------------+-------------------------------------+
  | Name                                              | Size                 | Contents                            |
  +===================================================+======================+=====================================+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | greylisted_until                                  | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | state                                             | Determined from data | $X_3                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "p2p_peer_id"                 | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | p2p_peer_id                                       | 16 bytes             | bytes                               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_failed_connection                            | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_rejected_connection                          | 24 bytes             | $X_7                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_established_connection                       | 24 bytes             | $X_7                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_disconnection                                | 24 bytes             | $X_7                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_seen                                         | 24 bytes             | $X_7                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_miss                                         | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+


  X_0
  ***

  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_1     |
  +-----------------+----------------------+----------+
  | Unnamed field 1 | Determined from data | $X_2     |
  +-----------------+----------------------+----------+

  

GET /network/points/<point>

Details about a given `IP:addr`.

  { "trusted": boolean,
    "greylisted_until"?: $timestamp,
    "state":
      { "event_kind": "requested" }
      || { "event_kind": "accepted",
           "p2p_peer_id": $Crypto_box.Public_key_hash }
      || { "event_kind": "running",
           "p2p_peer_id": $Crypto_box.Public_key_hash }
      || { "event_kind": "disconnected" },
    "p2p_peer_id"?: $Crypto_box.Public_key_hash,
    "last_failed_connection"?: $timestamp,
    "last_rejected_connection"?: [ $Crypto_box.Public_key_hash, $timestamp ],
    "last_established_connection"?:
      [ $Crypto_box.Public_key_hash, $timestamp ],
    "last_disconnection"?: [ $Crypto_box.Public_key_hash, $timestamp ],
    "last_seen"?: [ $Crypto_box.Public_key_hash, $timestamp ],
    "last_miss"?: $timestamp }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +---------------------------------------------------+----------------------+-------------------------------------+
  | Name                                              | Size                 | Contents                            |
  +===================================================+======================+=====================================+
  | trusted                                           | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | greylisted_until                                  | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | state                                             | Determined from data | $X_0                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "p2p_peer_id"                 | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | p2p_peer_id                                       | 16 bytes             | bytes                               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_failed_connection                            | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_rejected_connection                          | 24 bytes             | $X_1                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_established_connection                       | 24 bytes             | $X_2                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_disconnection                                | 24 bytes             | $X_3                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_seen                                         | 24 bytes             | $X_4                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_miss                                         | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Requested (tag 0)
  =================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Accepted (tag 1)
  ================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Running (tag 2)
  ===============

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Disconnected (tag 3)
  ====================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  X_4
  ***

  +-----------------+----------+-----------------------+
  | Name            | Size     | Contents              |
  +=================+==========+=======================+
  | Unnamed field 0 | 16 bytes | bytes                 |
  +-----------------+----------+-----------------------+
  | Unnamed field 1 | 8 bytes  | signed 64-bit integer |
  +-----------------+----------+-----------------------+

  

PUT /network/points/<point>?[timeout=<float>]

Connect to a peer

Optional query arguments :

  • timeout = <float>

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  
  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  

GET /network/points/<point>/ban

Blacklist the given address.

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  

GET /network/points/<point>/banned

Check is a given address is blacklisted or greylisted.

  boolean
  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  

GET /network/points/<point>/log?[monitor]

Monitor network events related to an `IP:addr`.

Optional query arguments :

  • monitor

  [ { "kind":
        { "event_kind": "outgoing_request" }
        || { "event_kind": "accepting_request",
             "p2p_peer_id": $Crypto_box.Public_key_hash }
        || { "event_kind": "rejecting_request",
             "p2p_peer_id": $Crypto_box.Public_key_hash }
        || { "event_kind": "request_rejected",
             "p2p_peer_id"?: $Crypto_box.Public_key_hash }
        || { "event_kind": "rejecting_request",
             "p2p_peer_id": $Crypto_box.Public_key_hash }
        || { "event_kind": "rejecting_request",
             "p2p_peer_id": $Crypto_box.Public_key_hash }
        || { "event_kind": "rejecting_request",
             "p2p_peer_id": $Crypto_box.Public_key_hash },
      "timestamp": $timestamp } ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1 (Determined from data, 8-bit tag)
  *************************************

  Outgoing_request (tag 0)
  ========================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Accepting_request (tag 1)
  =========================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Rejecting_request (tag 2)
  =========================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Rejecting_rejected (tag 3)
  ==========================

  +-----------------------------------+----------+-------------------------------------+
  | Name                              | Size     | Contents                            |
  +===================================+==========+=====================================+
  | Tag                               | 1 byte   | unsigned 8-bit integer              |
  +-----------------------------------+----------+-------------------------------------+
  | ? presence of field "p2p_peer_id" | 1 byte   | boolean (0 for false, 255 for true) |
  +-----------------------------------+----------+-------------------------------------+
  | p2p_peer_id                       | 16 bytes | bytes                               |
  +-----------------------------------+----------+-------------------------------------+


  Connection_established (tag 4)
  ==============================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  Disconnection (tag 5)
  =====================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  External_disconnection (tag 6)
  ==============================

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | p2p_peer_id | 16 bytes | bytes                  |
  +-------------+----------+------------------------+


  X_0
  ***

  +-----------+----------------------+-----------------------+
  | Name      | Size                 | Contents              |
  +===========+======================+=======================+
  | kind      | Determined from data | $X_1                  |
  +-----------+----------------------+-----------------------+
  | timestamp | 8 bytes              | signed 64-bit integer |
  +-----------+----------------------+-----------------------+

  

GET /network/points/<point>/trust

Trust a given address permanently. Connections from this address can still be closed on authentication if the peer is blacklisted or greylisted.

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  

GET /network/stat

Global network bandwidth statistics in B/s.

  { "total_sent": $int64,
    "total_recv": $int64,
    "current_inflow": integer ∈ [-2^30-2, 2^30+2],
    "current_outflow": integer ∈ [-2^30-2, 2^30+2] }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | total_sent      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | total_recv      | 8 bytes | signed 64-bit integer                                        |
  +-----------------+---------+--------------------------------------------------------------+
  | current_inflow  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | current_outflow | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  

GET /network/versions

Supported network layer versions.

  [ { "name": string,
      "major": integer ∈ [0, 2^16-1],
      "minor": integer ∈ [0, 2^16-1] } ... ]
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | name                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | major                 | 2 bytes  | unsigned 16-bit integer |
  +-----------------------+----------+-------------------------+
  | minor                 | 2 bytes  | unsigned 16-bit integer |
  +-----------------------+----------+-------------------------+

  

GET /protocols

  [ $Protocol_hash ... ]
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  

GET /protocols/<Protocol_hash>

  { "expected_env_version": integer ∈ [-2^15, 2^15-1],
    "components":
      [ { "name": string,
          "interface"?: /^[a-zA-Z0-9]+$/,
          "implementation": /^[a-zA-Z0-9]+$/ } ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | expected_env_version  | 2 bytes  | signed 16-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | components            | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +---------------------------------+----------------------+-------------------------------------+
  | Name                            | Size                 | Contents                            |
  +=================================+======================+=====================================+
  | # bytes in next field           | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------+----------------------+-------------------------------------+
  | name                            | Variable             | bytes                               |
  +---------------------------------+----------------------+-------------------------------------+
  | ? presence of field "interface" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------+----------------------+-------------------------------------+
  | interface                       | Determined from data | $X_1                                |
  +---------------------------------+----------------------+-------------------------------------+
  | # bytes in next field           | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------+----------------------+-------------------------------------+
  | implementation                  | Variable             | bytes                               |
  +---------------------------------+----------------------+-------------------------------------+

  

GET /workers/block_validator

Introspect the state of the block_validator worker.

  { "status":
      { "phase": "launching",
        "since": $timestamp }
      || { "phase": "running",
           "since": $timestamp }
      || { "phase": "closing",
           "birth": $timestamp,
           "since": $timestamp }
      || { "phase": "closed",
           "birth": $timestamp,
           "since": $timestamp }
      || { "phase": "crashed",
           "birth": $timestamp,
           "since": $timestamp,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp,
          "request":
            { "block": $block_hash,
              "chain_id": $Chain_id,
              "peer"?: $Crypto_box.Public_key_hash } } ... ],
    "backlog":
      [ { "level": string,
          "events":
            [ { "message": string }
              || { "successful_validation":
                     { "block": $block_hash,
                       "chain_id": $Chain_id,
                       "peer"?: $Crypto_box.Public_key_hash },
                   "status":
                     { "pushed": $timestamp,
                       "treated": $timestamp,
                       "completed": $timestamp } }
              || { "failed_validation":
                     { "block": $block_hash,
                       "chain_id": $Chain_id,
                       "peer"?: $Crypto_box.Public_key_hash },
                   "status":
                     { "pushed": $timestamp,
                       "treated": $timestamp,
                       "completed": $timestamp },
                   "errors"?: $error } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp,
        "treated": $timestamp,
        "request":
          { "block": $block_hash,
            "chain_id": $Chain_id,
            "peer"?: $Crypto_box.Public_key_hash } } }
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    string
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +---------------------------------------+----------------------+-------------------------------------+
  | Name                                  | Size                 | Contents                            |
  +=======================================+======================+=====================================+
  | status                                | Determined from data | $X_0                                |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | pending_requests                      | Variable             | sequence of $X_1                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | backlog                               | Variable             | sequence of $X_3                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "current_request" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------------------+-------------------------------------+
  | current_request                       | Determined from data | $X_11                               |
  +---------------------------------------+----------------------+-------------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | pushed                | 8 bytes              | signed 64-bit integer   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | request               | Determined from data | $X_12                   |
  +-----------------------+----------------------+-------------------------+


  X_9
  ***

  +-----------+---------+-----------------------+
  | Name      | Size    | Contents              |
  +===========+=========+=======================+
  | pushed    | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+
  | treated   | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+
  | completed | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+


  X_10 (Determined from data, 8-bit tag)
  **************************************

  Debug (tag 0)
  =============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | message               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Validation_success (tag 1)
  ==========================

  +-----------------------+----------------------+------------------------+
  | Name                  | Size                 | Contents               |
  +=======================+======================+========================+
  | Tag                   | 1 byte               | unsigned 8-bit integer |
  +-----------------------+----------------------+------------------------+
  | successful_validation | Determined from data | $X_12                  |
  +-----------------------+----------------------+------------------------+
  | status                | 24 bytes             | $X_9                   |
  +-----------------------+----------------------+------------------------+


  Validation_failure (tag 2)
  ==========================

  +--------------------------+----------------------+-------------------------+
  | Name                     | Size                 | Contents                |
  +==========================+======================+=========================+
  | Tag                      | 1 byte               | unsigned 8-bit integer  |
  +--------------------------+----------------------+-------------------------+
  | failed_validation        | Determined from data | $X_12                   |
  +--------------------------+----------------------+-------------------------+
  | status                   | 24 bytes             | $X_9                    |
  +--------------------------+----------------------+-------------------------+
  | # bytes in field "error" | 4 bytes              | unsigned 30-bit integer |
  +--------------------------+----------------------+-------------------------+
  | errors                   | Variable             | bytes                   |
  +--------------------------+----------------------+-------------------------+


  X_5
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_10                   |
  +-----------------------+----------------------+-------------------------+


  X_4
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_5        |
  +-----------------------+----------+-------------------------+


  X_3
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | level                 | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | events                | Determined from data | $X_4                    |
  +-----------------------+----------------------+-------------------------+


  X_12
  ****

  +----------------------------+----------+-------------------------------------+
  | Name                       | Size     | Contents                            |
  +============================+==========+=====================================+
  | block                      | 32 bytes | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | chain_id                   | 4 bytes  | bytes                               |
  +----------------------------+----------+-------------------------------------+
  | ? presence of field "peer" | 1 byte   | boolean (0 for false, 255 for true) |
  +----------------------------+----------+-------------------------------------+
  | peer                       | 16 bytes | bytes                               |
  +----------------------------+----------+-------------------------------------+


  X_11
  ****

  +---------+----------------------+-----------------------+
  | Name    | Size                 | Contents              |
  +=========+======================+=======================+
  | pushed  | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | treated | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | request | Determined from data | $X_12                 |
  +---------+----------------------+-----------------------+

  

GET /workers/chain_validators

Lists the chain validator workers and their status.

  [ { "chain_id": $Chain_id,
      "status":
        { "phase": "launching",
          "since": $timestamp }
        || { "phase": "running",
             "since": $timestamp }
        || { "phase": "closing",
             "birth": $timestamp,
             "since": $timestamp }
        || { "phase": "closed",
             "birth": $timestamp,
             "since": $timestamp }
        || { "phase": "crashed",
             "birth": $timestamp,
             "since": $timestamp,
             "errors": $error } } ... ]
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_0
  ***

  +----------+----------------------+----------+
  | Name     | Size                 | Contents |
  +==========+======================+==========+
  | chain_id | 4 bytes              | bytes    |
  +----------+----------------------+----------+
  | status   | Determined from data | $X_1     |
  +----------+----------------------+----------+

  

GET /workers/chain_validators/<chain_id>

Introspect the state of a chain validator worker.

  { "status":
      { "phase": "launching",
        "since": $timestamp }
      || { "phase": "running",
           "since": $timestamp }
      || { "phase": "closing",
           "birth": $timestamp,
           "since": $timestamp }
      || { "phase": "closed",
           "birth": $timestamp,
           "since": $timestamp }
      || { "phase": "crashed",
           "birth": $timestamp,
           "since": $timestamp,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp,
          "request": $block_hash } ... ],
    "backlog":
      [ { "level": string,
          "events":
            [ { "request": $block_hash,
                "status":
                  { "pushed": $timestamp,
                    "treated": $timestamp,
                    "completed": $timestamp },
                "outcome": "branch" | "ignored" | "increment",
                "fitness": $fitness }
              || $error ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp,
        "treated": $timestamp,
        "request": $block_hash } }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +---------------------------------------+----------------------+-------------------------------------+
  | Name                                  | Size                 | Contents                            |
  +=======================================+======================+=====================================+
  | status                                | Determined from data | $X_0                                |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | pending_requests                      | Variable             | sequence of $X_1                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | backlog                               | Variable             | sequence of $X_2                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "current_request" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------------------+-------------------------------------+
  | current_request                       | 48 bytes             | $X_8                                |
  +---------------------------------------+----------------------+-------------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | pushed                | 8 bytes  | signed 64-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | request               | 32 bytes | bytes                   |
  +-----------------------+----------+-------------------------+


  X_5
  ***

  +-----------+---------+-----------------------+
  | Name      | Size    | Contents              |
  +===========+=========+=======================+
  | pushed    | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+
  | treated   | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+
  | completed | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+


  X_6 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | ignored        |
  +-------------+----------------+
  | 1           | branch         |
  +-------------+----------------+
  | 2           | increment      |
  +-------------+----------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_7 (Determined from data, 8-bit tag)
  *************************************

  Processed_block (tag 0)
  =======================

  +----------------------------+----------+----------------------------------------------------------+
  | Name                       | Size     | Contents                                                 |
  +============================+==========+==========================================================+
  | Tag                        | 1 byte   | unsigned 8-bit integer                                   |
  +----------------------------+----------+----------------------------------------------------------+
  | request                    | 32 bytes | bytes                                                    |
  +----------------------------+----------+----------------------------------------------------------+
  | status                     | 24 bytes | $X_5                                                     |
  +----------------------------+----------+----------------------------------------------------------+
  | outcome                    | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_6) |
  +----------------------------+----------+----------------------------------------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer                                  |
  +----------------------------+----------+----------------------------------------------------------+
  | fitness                    | Variable | sequence of $fitness.elem                                |
  +----------------------------+----------+----------------------------------------------------------+


  Could_not_switch_testchain (tag 1)
  ==================================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_4
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_7                    |
  +-----------------------+----------------------+-------------------------+


  X_3
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_4        |
  +-----------------------+----------+-------------------------+


  X_2
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | level                 | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | events                | Determined from data | $X_3                    |
  +-----------------------+----------------------+-------------------------+


  X_8
  ***

  +---------+----------+-----------------------+
  | Name    | Size     | Contents              |
  +=========+==========+=======================+
  | pushed  | 8 bytes  | signed 64-bit integer |
  +---------+----------+-----------------------+
  | treated | 8 bytes  | signed 64-bit integer |
  +---------+----------+-----------------------+
  | request | 32 bytes | bytes                 |
  +---------+----------+-----------------------+

  

GET /workers/chain_validators/<chain_id>/peers_validators

Lists the peer validator workers and their status.

  [ { "peer_id": $Crypto_box.Public_key_hash,
      "status":
        { "phase": "launching",
          "since": $timestamp }
        || { "phase": "running",
             "since": $timestamp }
        || { "phase": "closing",
             "birth": $timestamp,
             "since": $timestamp }
        || { "phase": "closed",
             "birth": $timestamp,
             "since": $timestamp }
        || { "phase": "crashed",
             "birth": $timestamp,
             "since": $timestamp,
             "errors": $error } } ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_0
  ***

  +---------+----------------------+----------+
  | Name    | Size                 | Contents |
  +=========+======================+==========+
  | peer_id | 16 bytes             | bytes    |
  +---------+----------------------+----------+
  | status  | Determined from data | $X_1     |
  +---------+----------------------+----------+

  

GET /workers/chain_validators/<chain_id>/peers_validators/<peer_id>

Introspect the state of a peer validator worker.

  { "status":
      { "phase": "launching",
        "since": $timestamp }
      || { "phase": "running",
           "since": $timestamp }
      || { "phase": "closing",
           "birth": $timestamp,
           "since": $timestamp }
      || { "phase": "closed",
           "birth": $timestamp,
           "since": $timestamp }
      || { "phase": "crashed",
           "birth": $timestamp,
           "since": $timestamp,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp,
          "request":
            { "request": "new_head",
              "block": $block_hash }
            || { "request": "new_branch",
                 "block": $block_hash,
                 "locator_length": integer ∈ [0, 2^16-1] } } ... ],
    "backlog":
      [ { "level": string,
          "events":
            [ { "message": string }
              || { "request":
                     { "request": "new_head",
                       "block": $block_hash }
                     || { "request": "new_branch",
                          "block": $block_hash,
                          "locator_length": integer ∈ [0, 2^16-1] },
                   "status":
                     { "pushed": $timestamp,
                       "treated": $timestamp,
                       "completed": $timestamp } }
              || { "error": $error,
                   "failed_request":
                     { "request": "new_head",
                       "block": $block_hash }
                     || { "request": "new_branch",
                          "block": $block_hash,
                          "locator_length": integer ∈ [0, 2^16-1] },
                   "status":
                     { "pushed": $timestamp,
                       "treated": $timestamp,
                       "completed": $timestamp } } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp,
        "treated": $timestamp,
        "request":
          { "request": "new_head",
            "block": $block_hash }
          || { "request": "new_branch",
               "block": $block_hash,
               "locator_length": integer ∈ [0, 2^16-1] } } }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +---------------------------------------+----------------------+-------------------------------------+
  | Name                                  | Size                 | Contents                            |
  +=======================================+======================+=====================================+
  | status                                | Determined from data | $X_0                                |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | pending_requests                      | Variable             | sequence of $X_1                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                 | 4 bytes              | unsigned 30-bit integer             |
  +---------------------------------------+----------------------+-------------------------------------+
  | backlog                               | Variable             | sequence of $X_3                    |
  +---------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "current_request" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------------------+-------------------------------------+
  | current_request                       | Determined from data | $X_11                               |
  +---------------------------------------+----------------------+-------------------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_1
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | pushed                | 8 bytes              | signed 64-bit integer   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | request               | Determined from data | $X_12                   |
  +-----------------------+----------------------+-------------------------+


  X_9
  ***

  +-----------+---------+-----------------------+
  | Name      | Size    | Contents              |
  +===========+=========+=======================+
  | pushed    | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+
  | treated   | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+
  | completed | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+


  X_10 (Determined from data, 8-bit tag)
  **************************************

  Debug (tag 0)
  =============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | message               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Request (tag 1)
  ===============

  +---------+----------------------+------------------------+
  | Name    | Size                 | Contents               |
  +=========+======================+========================+
  | Tag     | 1 byte               | unsigned 8-bit integer |
  +---------+----------------------+------------------------+
  | request | Determined from data | $X_12                  |
  +---------+----------------------+------------------------+
  | status  | 24 bytes             | $X_9                   |
  +---------+----------------------+------------------------+


  Failed request (tag 2)
  ======================

  +--------------------------+----------------------+-------------------------+
  | Name                     | Size                 | Contents                |
  +==========================+======================+=========================+
  | Tag                      | 1 byte               | unsigned 8-bit integer  |
  +--------------------------+----------------------+-------------------------+
  | # bytes in field "error" | 4 bytes              | unsigned 30-bit integer |
  +--------------------------+----------------------+-------------------------+
  | error                    | Variable             | bytes                   |
  +--------------------------+----------------------+-------------------------+
  | failed_request           | Determined from data | $X_12                   |
  +--------------------------+----------------------+-------------------------+
  | status                   | 24 bytes             | $X_9                    |
  +--------------------------+----------------------+-------------------------+


  X_5
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_10                   |
  +-----------------------+----------------------+-------------------------+


  X_4
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_5        |
  +-----------------------+----------+-------------------------+


  X_3
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | level                 | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | events                | Determined from data | $X_4                    |
  +-----------------------+----------------------+-------------------------+


  X_12 (Determined from data, 8-bit tag)
  **************************************

  New_head (tag 0)
  ================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  New_branch (tag 1)
  ==================

  +----------------+----------+-------------------------+
  | Name           | Size     | Contents                |
  +================+==========+=========================+
  | Tag            | 1 byte   | unsigned 8-bit integer  |
  +----------------+----------+-------------------------+
  | block          | 32 bytes | bytes                   |
  +----------------+----------+-------------------------+
  | locator_length | 2 bytes  | unsigned 16-bit integer |
  +----------------+----------+-------------------------+


  X_11
  ****

  +---------+----------------------+-----------------------+
  | Name    | Size                 | Contents              |
  +=========+======================+=======================+
  | pushed  | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | treated | 8 bytes              | signed 64-bit integer |
  +---------+----------------------+-----------------------+
  | request | Determined from data | $X_12                 |
  +---------+----------------------+-----------------------+

  

GET /workers/prevalidators

Lists the Prevalidator workers and their status.

  [ { "chain_id": $Chain_id,
      "status":
        { "phase": "launching",
          "since": $timestamp }
        || { "phase": "running",
             "since": $timestamp }
        || { "phase": "closing",
             "birth": $timestamp,
             "since": $timestamp }
        || { "phase": "closed",
             "birth": $timestamp,
             "since": $timestamp }
        || { "phase": "crashed",
             "birth": $timestamp,
             "since": $timestamp,
             "errors": $error } } ... ]
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_1 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_0
  ***

  +----------+----------------------+----------+
  | Name     | Size                 | Contents |
  +==========+======================+==========+
  | chain_id | 4 bytes              | bytes    |
  +----------+----------------------+----------+
  | status   | Determined from data | $X_1     |
  +----------+----------------------+----------+

  

GET /workers/prevalidators/<chain_id>

Introspect the state of a prevalidator worker.

  { "status":
      { "phase": "launching",
        "since": $timestamp }
      || { "phase": "running",
           "since": $timestamp }
      || { "phase": "closing",
           "birth": $timestamp,
           "since": $timestamp }
      || { "phase": "closed",
           "birth": $timestamp,
           "since": $timestamp }
      || { "phase": "crashed",
           "birth": $timestamp,
           "since": $timestamp,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp,
          "request":
            { "request": "flush",
              "block": $block_hash }
            || { "request": "notify",
                 "peer": $Crypto_box.Public_key_hash,
                 "mempool":
                   { "known_valid": [ $Operation_hash ... ],
                     "pending": [ $Operation_hash ... ] } }
            || { "request": "inject",
                 "operation":
                   { "branch": $block_hash,
                     "data": /^[a-zA-Z0-9]+$/ } }
            || { "request": "arrived",
                 "operation_hash": $Operation_hash,
                 "operation":
                   { "branch": $block_hash,
                     "data": /^[a-zA-Z0-9]+$/ } }
            || { "request": "advertise" } } ... ],
    "backlog":
      [ { "level": string,
          "events":
            [ { "message": string }
              || { "request":
                     { "request": "flush",
                       "block": $block_hash }
                     || { "request": "notify",
                          "peer": $Crypto_box.Public_key_hash,
                          "mempool":
                            { "known_valid": [ $Operation_hash ... ],
                              "pending": [ $Operation_hash ... ] } }
                     || { "request": "inject",
                          "operation":
                            { "branch": $block_hash,
                              "data": /^[a-zA-Z0-9]+$/ } }
                     || { "request": "arrived",
                          "operation_hash": $Operation_hash,
                          "operation":
                            { "branch": $block_hash,
                              "data": /^[a-zA-Z0-9]+$/ } }
                     || { "request": "advertise" },
                   "status":
                     { "pushed": $timestamp,
                       "treated": $timestamp,
                       "completed": $timestamp } }
              || { "error": $error,
                   "failed_request":
                     { "request": "flush",
                       "block": $block_hash }
                     || { "request": "notify",
                          "peer": $Crypto_box.Public_key_hash,
                          "mempool":
                            { "known_valid": [ $Operation_hash ... ],
                              "pending": [ $Operation_hash ... ] } }
                     || { "request": "inject",
                          "operation":
                            { "branch": $block_hash,
                              "data": /^[a-zA-Z0-9]+$/ } }
                     || { "request": "arrived",
                          "operation_hash": $Operation_hash,
                          "operation":
                            { "branch": $block_hash,
                              "data": /^[a-zA-Z0-9]+$/ } }
                     || { "request": "advertise" },
                   "status":
                     { "pushed": $timestamp,
                       "treated": $timestamp,
                       "completed": $timestamp } } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp,
        "treated": $timestamp,
        "request":
          { "request": "flush",
            "block": $block_hash }
          || { "request": "notify",
               "peer": $Crypto_box.Public_key_hash,
               "mempool":
                 { "known_valid": [ $Operation_hash ... ],
                   "pending": [ $Operation_hash ... ] } }
          || { "request": "inject",
               "operation":
                 { "branch": $block_hash,
                   "data": /^[a-zA-Z0-9]+$/ } }
          || { "request": "arrived",
               "operation_hash": $Operation_hash,
               "operation":
                 { "branch": $block_hash,
                   "data": /^[a-zA-Z0-9]+$/ } }
          || { "request": "advertise" } } }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    string
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | status                | Determined from data | $X_0                    |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | pending_requests      | Variable             | sequence of $X_1        |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | backlog               | Variable             | sequence of $X_7        |
  +-----------------------+----------------------+-------------------------+
  | current_request       | Variable             | $X_23                   |
  +-----------------------+----------------------+-------------------------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Launching (tag 0)
  =================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Running (tag 1)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closing (tag 2)
  ===============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Closed (tag 3)
  ==============

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | birth | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+
  | since | 8 bytes | signed 64-bit integer  |
  +-------+---------+------------------------+


  Crashed (tag 4)
  ===============

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | birth                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | since                    | 8 bytes  | signed 64-bit integer   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | errors                   | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_4
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | known_valid           | Variable             | sequence of bytes       |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | pending               | Determined from data | $X_27                   |
  +-----------------------+----------------------+-------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | pushed                | 8 bytes  | signed 64-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | request               | Variable | $X_28                   |
  +-----------------------+----------+-------------------------+


  X_21
  ****

  +-----------+---------+-----------------------+
  | Name      | Size    | Contents              |
  +===========+=========+=======================+
  | pushed    | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+
  | treated   | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+
  | completed | 8 bytes | signed 64-bit integer |
  +-----------+---------+-----------------------+


  X_22 (Variable, 8-bit tag)
  **************************

  Debug (tag 0)
  =============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | message               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Request (tag 1)
  ===============

  +---------+----------+------------------------+
  | Name    | Size     | Contents               |
  +=========+==========+========================+
  | Tag     | 1 byte   | unsigned 8-bit integer |
  +---------+----------+------------------------+
  | request | Variable | $X_28                  |
  +---------+----------+------------------------+
  | status  | 24 bytes | $X_21                  |
  +---------+----------+------------------------+


  Failed request (tag 2)
  ======================

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | Tag                      | 1 byte   | unsigned 8-bit integer  |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | error                    | Variable | bytes                   |
  +--------------------------+----------+-------------------------+
  | failed_request           | Variable | $X_28                   |
  +--------------------------+----------+-------------------------+
  | status                   | 24 bytes | $X_21                   |
  +--------------------------+----------+-------------------------+


  X_9
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | $X_22                   |
  +-----------------------+----------+-------------------------+


  X_8
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_9        |
  +-----------------------+----------+-------------------------+


  X_7
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | level                 | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | events                | Determined from data | $X_8                    |
  +-----------------------+----------------------+-------------------------+


  X_25
  ****

  +--------+----------+----------+
  | Name   | Size     | Contents |
  +========+==========+==========+
  | branch | 32 bytes | bytes    |
  +--------+----------+----------+
  | data   | Variable | bytes    |
  +--------+----------+----------+


  X_27
  ****

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  X_28 (Variable, 8-bit tag)
  **************************

  Flush (tag 0)
  =============

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | block | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Notify (tag 1)
  ==============

  +---------+----------------------+------------------------+
  | Name    | Size                 | Contents               |
  +=========+======================+========================+
  | Tag     | 1 byte               | unsigned 8-bit integer |
  +---------+----------------------+------------------------+
  | peer    | 16 bytes             | bytes                  |
  +---------+----------------------+------------------------+
  | mempool | Determined from data | $X_4                   |
  +---------+----------------------+------------------------+


  Inject (tag 2)
  ==============

  +-----------+----------+------------------------+
  | Name      | Size     | Contents               |
  +===========+==========+========================+
  | Tag       | 1 byte   | unsigned 8-bit integer |
  +-----------+----------+------------------------+
  | operation | Variable | $X_25                  |
  +-----------+----------+------------------------+


  Arrived (tag 3)
  ===============

  +----------------+----------+------------------------+
  | Name           | Size     | Contents               |
  +================+==========+========================+
  | Tag            | 1 byte   | unsigned 8-bit integer |
  +----------------+----------+------------------------+
  | operation_hash | 32 bytes | bytes                  |
  +----------------+----------+------------------------+
  | operation      | Variable | $X_25                  |
  +----------------+----------+------------------------+


  Advertise (tag 4)
  =================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  X_23
  ****

  +---------+----------+-----------------------+
  | Name    | Size     | Contents              |
  +=========+==========+=======================+
  | pushed  | 8 bytes  | signed 64-bit integer |
  +---------+----------+-----------------------+
  | treated | 8 bytes  | signed 64-bit integer |
  +---------+----------+-----------------------+
  | request | Variable | $X_28                 |
  +---------+----------+-----------------------+

  

Protocol Alpha

GET ../<block_id>

All the information about a block.

  { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
    "chain_id": $Chain_id,
    "hash": $block_hash,
    "header": $raw_block_header,
    "metadata": $block_header_metadata,
    "operations": [ [ $operation ... ] ... ] }
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    string
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    string
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    string
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $block_header_metadata:
    { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
      "next_protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
      "test_chain_status": $test_chain_status,
      "max_operations_ttl": integer ∈ [-2^30-2, 2^30+2],
      "max_operation_data_length": integer ∈ [-2^30-2, 2^30+2],
      "max_block_header_length": integer ∈ [-2^30-2, 2^30+2],
      "max_operation_list_length":
        [ { "max_size": integer ∈ [-2^30-2, 2^30+2],
            "max_op"?: integer ∈ [-2^30-2, 2^30+2] } ... ],
      "baker": $Signature.Public_key_hash,
      "level":
        { "level": integer ∈ [-2^31-2, 2^31+2],
          "level_position": integer ∈ [-2^31-2, 2^31+2],
          "cycle": integer ∈ [-2^31-2, 2^31+2],
          "cycle_position": integer ∈ [-2^31-2, 2^31+2],
          "voting_period": integer ∈ [-2^31-2, 2^31+2],
          "voting_period_position": integer ∈ [-2^31-2, 2^31+2],
          "expected_commitment": boolean },
      "voting_period_kind":
        "proposal" || "testing_vote" || "testing" || "promotion_vote",
      "nonce_hash": $cycle_nonce || null,
      "consumed_gas": $positive_bignum,
      "deactivated": [ $Signature.Public_key_hash ... ],
      "balance_updates": $operation_metadata.alpha.balance_updates }
  $contract.big_map_diff:
    [ { "key_hash": $script_expr,
        "key": $micheline.michelson_v1.expression,
        "value"?: $micheline.michelson_v1.expression } ... ]
  $contract_id:
    /* A contract handle
       A contract notation as given to an RPC or inside scripts. Can be a
       base58 implicit contract hash or a base58 originated contract hash. */
    string
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  $error:
    /* The full list of RPC errors would be too long to include.
       It is available at RPC `/errors` (GET).
       Errors specific to protocol Alpha have an id that starts with
       `proto.alpha`. */
    any
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $inlined.endorsement:
    { "branch": $block_hash,
      "operations": $inlined.endorsement.contents,
      "signature"?: $Signature }
  $inlined.endorsement.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $operation:
    { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
      "chain_id": $Chain_id,
      "hash": $Operation_hash,
      "branch": $block_hash,
      "contents": [ $operation.alpha.operation_contents_and_result ... ],
      "signature"?: $Signature }
    || { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
         "chain_id": $Chain_id,
         "hash": $Operation_hash,
         "branch": $block_hash,
         "contents": [ $operation.alpha.contents ... ],
         "signature"?: $Signature }
  $operation.alpha.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
    || { "kind": "seed_nonce_revelation",
         "level": integer ∈ [-2^31-2, 2^31+2],
         "nonce": /^[a-zA-Z0-9]+$/ }
    || { "kind": "double_endorsement_evidence",
         "op1": $inlined.endorsement,
         "op2": $inlined.endorsement }
    || { "kind": "double_baking_evidence",
         "bh1": $block_header.alpha.full_header,
         "bh2": $block_header.alpha.full_header }
    || { "kind": "activate_account",
         "pkh": $Ed25519.Public_key_hash,
         "secret": /^[a-zA-Z0-9]+$/ }
    || { "kind": "proposals",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposals": [ $Protocol_hash ... ] }
    || { "kind": "ballot",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposal": $Protocol_hash,
         "ballot": "nay" | "yay" | "pass" }
    || { "kind": "reveal",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression }
    || { "kind": "origination",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts }
    || { "kind": "delegation",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "delegate"?: $Signature.Public_key_hash }
  $operation.alpha.internal_operation_result:
    { "kind": "reveal",
      "source": $contract_id,
      "nonce": integer ∈ [0, 2^16-1],
      "public_key": $Signature.Public_key,
      "result": $operation.alpha.operation_result.reveal }
    || { "kind": "transaction",
         "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression,
         "result": $operation.alpha.operation_result.transaction }
    || { "kind": "origination",
         "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts,
         "result": $operation.alpha.operation_result.origination }
    || { "kind": "delegation",
         "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "delegate"?: $Signature.Public_key_hash,
         "result": $operation.alpha.operation_result.delegation }
  $operation.alpha.operation_contents_and_result:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2],
      "metadata":
        { "balance_updates": $operation_metadata.alpha.balance_updates,
          "delegate": $Signature.Public_key_hash,
          "slots": [ integer ∈ [0, 255] ... ] } }
    || { "kind": "seed_nonce_revelation",
         "level": integer ∈ [-2^31-2, 2^31+2],
         "nonce": /^[a-zA-Z0-9]+$/,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates } }
    || { "kind": "double_endorsement_evidence",
         "op1": $inlined.endorsement,
         "op2": $inlined.endorsement,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates } }
    || { "kind": "double_baking_evidence",
         "bh1": $block_header.alpha.full_header,
         "bh2": $block_header.alpha.full_header,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates } }
    || { "kind": "activate_account",
         "pkh": $Ed25519.Public_key_hash,
         "secret": /^[a-zA-Z0-9]+$/,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates } }
    || { "kind": "proposals",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposals": [ $Protocol_hash ... ],
         "metadata": {  } }
    || { "kind": "ballot",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposal": $Protocol_hash,
         "ballot": "nay" | "yay" | "pass",
         "metadata": {  } }
    || { "kind": "reveal",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates,
             "operation_result": $operation.alpha.operation_result.reveal,
             "internal_operation_results"?:
               [ $operation.alpha.internal_operation_result ... ] } }
    || { "kind": "transaction",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates,
             "operation_result":
               $operation.alpha.operation_result.transaction,
             "internal_operation_results"?:
               [ $operation.alpha.internal_operation_result ... ] } }
    || { "kind": "origination",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates,
             "operation_result":
               $operation.alpha.operation_result.origination,
             "internal_operation_results"?:
               [ $operation.alpha.internal_operation_result ... ] } }
    || { "kind": "delegation",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "delegate"?: $Signature.Public_key_hash,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates,
             "operation_result": $operation.alpha.operation_result.delegation,
             "internal_operation_results"?:
               [ $operation.alpha.internal_operation_result ... ] } }
  $operation.alpha.operation_result.delegation:
    { "status": "applied" }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ] }
  $operation.alpha.operation_result.origination:
    { "status": "applied",
      "balance_updates"?: $operation_metadata.alpha.balance_updates,
      "originated_contracts"?: [ $contract_id ... ],
      "consumed_gas"?: $bignum,
      "storage_size"?: $bignum,
      "paid_storage_size_diff"?: $bignum }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ],
         "balance_updates"?: $operation_metadata.alpha.balance_updates,
         "originated_contracts"?: [ $contract_id ... ],
         "consumed_gas"?: $bignum,
         "storage_size"?: $bignum,
         "paid_storage_size_diff"?: $bignum }
  $operation.alpha.operation_result.reveal:
    { "status": "applied" }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ] }
  $operation.alpha.operation_result.transaction:
    { "status": "applied",
      "storage"?: $micheline.michelson_v1.expression,
      "big_map_diff"?: $contract.big_map_diff,
      "balance_updates"?: $operation_metadata.alpha.balance_updates,
      "originated_contracts"?: [ $contract_id ... ],
      "consumed_gas"?: $bignum,
      "storage_size"?: $bignum,
      "paid_storage_size_diff"?: $bignum }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ],
         "storage"?: $micheline.michelson_v1.expression,
         "big_map_diff"?: $contract.big_map_diff,
         "balance_updates"?: $operation_metadata.alpha.balance_updates,
         "originated_contracts"?: [ $contract_id ... ],
         "consumed_gas"?: $bignum,
         "storage_size"?: $bignum,
         "paid_storage_size_diff"?: $bignum }
  $operation_metadata.alpha.balance_updates:
    [ { "kind": "contract",
        "contract": $contract_id,
        "change": $int64 }
      || { "kind": "freezer",
           "category": "rewards",
           "delegate": $Signature.Public_key_hash,
           "level": integer ∈ [-2^31-2, 2^31+2],
           "change": $int64 }
      || { "kind": "freezer",
           "category": "fees",
           "delegate": $Signature.Public_key_hash,
           "level": integer ∈ [-2^31-2, 2^31+2],
           "change": $int64 }
      || { "kind": "freezer",
           "category": "deposits",
           "delegate": $Signature.Public_key_hash,
           "level": integer ∈ [-2^31-2, 2^31+2],
           "change": $int64 } ... ]
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $raw_block_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $script_expr:
    /* A script expression ID (Base58Check-encoded) */
    string
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  $test_chain_status:
    { "status": "not_running" }
    || { "status": "forking",
         "protocol": $Protocol_hash,
         "expiration": $timestamp }
    || { "status": "running",
         "chain_id": $Chain_id,
         "genesis": $block_hash,
         "protocol": $Protocol_hash,
         "expiration": $timestamp }
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | chain_id              | 4 bytes              | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | hash                  | 32 bytes             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | header                | Determined from data | $raw_block_header       |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | metadata              | Determined from data | $block_header_metadata  |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | operations            | Variable             | sequence of $X_7        |
  +-----------------------+----------------------+-------------------------+


  test_chain_status (Determined from data, 8-bit tag)
  ***************************************************

  Not_running (tag 0)
  ===================

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Forking (tag 1)
  ===============

  +------------+----------+------------------------+
  | Name       | Size     | Contents               |
  +============+==========+========================+
  | Tag        | 1 byte   | unsigned 8-bit integer |
  +------------+----------+------------------------+
  | protocol   | 32 bytes | bytes                  |
  +------------+----------+------------------------+
  | expiration | 8 bytes  | signed 64-bit integer  |
  +------------+----------+------------------------+


  Running (tag 2)
  ===============

  +------------+----------+------------------------+
  | Name       | Size     | Contents               |
  +============+==========+========================+
  | Tag        | 1 byte   | unsigned 8-bit integer |
  +------------+----------+------------------------+
  | chain_id   | 4 bytes  | bytes                  |
  +------------+----------+------------------------+
  | genesis    | 32 bytes | bytes                  |
  +------------+----------+------------------------+
  | protocol   | 32 bytes | bytes                  |
  +------------+----------+------------------------+
  | expiration | 8 bytes  | signed 64-bit integer  |
  +------------+----------+------------------------+


  X_1
  ***

  +------------------------------+---------+--------------------------------------------------------------+
  | Name                         | Size    | Contents                                                     |
  +==============================+=========+==============================================================+
  | max_size                     | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------------------------------+---------+--------------------------------------------------------------+
  | ? presence of field "max_op" | 1 byte  | boolean (0 for false, 255 for true)                          |
  +------------------------------+---------+--------------------------------------------------------------+
  | max_op                       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------------------------------+---------+--------------------------------------------------------------+


  X_0
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_1        |
  +-----------------------+----------+-------------------------+


  X_2
  ***

  +------------------------+---------+-------------------------------------+
  | Name                   | Size    | Contents                            |
  +========================+=========+=====================================+
  | level                  | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | level_position         | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | cycle                  | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | cycle_position         | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | voting_period          | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | voting_period_position | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | expected_commitment    | 1 byte  | boolean (0 for false, 255 for true) |
  +------------------------+---------+-------------------------------------+


  X_3 (1 byte, 8-bit tag)
  ***********************

  Proposal (tag 0)
  ================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Testing_vote (tag 1)
  ====================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Testing (tag 2)
  ===============

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Promotion_vote (tag 3)
  ======================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  X_4 (Determined from data, 8-bit tag)
  *************************************

  None (tag 0)
  ============

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Some (tag 1)
  ============

  +-------------+----------+------------------------+
  | Name        | Size     | Contents               |
  +=============+==========+========================+
  | Tag         | 1 byte   | unsigned 8-bit integer |
  +-------------+----------+------------------------+
  | cycle_nonce | 32 bytes | bytes                  |
  +-------------+----------+------------------------+


  X_5
  ***

  +-----------------+----------------------+-----------------------+
  | Name            | Size                 | Contents              |
  +=================+======================+=======================+
  | Unnamed field 0 | Determined from data | $X_136                |
  +-----------------+----------------------+-----------------------+
  | change          | 8 bytes              | signed 64-bit integer |
  +-----------------+----------------------+-----------------------+


  block_header_metadata
  *********************

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | Name                                                        | Size                 | Contents                                                     |
  +=============================================================+======================+==============================================================+
  | test_chain_status                                           | Determined from data | $test_chain_status                                           |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | max_operations_ttl                                          | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | max_operation_data_length                                   | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | max_block_header_length                                     | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer                                      |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | max_operation_list_length                                   | Determined from data | $X_0                                                         |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | baker                                                       | 21 bytes             | $public_key_hash                                             |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | level                                                       | 25 bytes             | $X_2                                                         |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | voting_period_kind                                          | 1 byte               | $X_3                                                         |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | nonce_hash                                                  | Determined from data | $X_4                                                         |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | consumed_gas                                                | Determined from data | $N.t                                                         |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer                                      |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | deactivated                                                 | Variable             | sequence of $public_key_hash                                 |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer                                      |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_5                                             |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------------+


  operation.alpha.contents (Determined from data, 8-bit tag)
  **********************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  Seed_nonce_revelation (tag 1)
  =============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | level | 4 bytes  | signed 32-bit integer  |
  +-------+----------+------------------------+
  | nonce | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Double_endorsement_evidence (tag 2)
  ===================================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op1                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op2                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+


  Double_baking_evidence (tag 3)
  ==============================

  +-----------------------+----------------------+---------------------------------+
  | Name                  | Size                 | Contents                        |
  +=======================+======================+=================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer          |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh1                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh2                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+


  Activate_account (tag 4)
  ========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | pkh    | 20 bytes | bytes                  |
  +--------+----------+------------------------+
  | secret | 20 bytes | bytes                  |
  +--------+----------+------------------------+


  Proposals (tag 5)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | source                | 21 bytes | $public_key_hash        |
  +-----------------------+----------+-------------------------+
  | period                | 4 bytes  | signed 32-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | proposals             | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  Ballot (tag 6)
  ==============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | source   | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | period   | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+
  | proposal | 32 bytes | bytes                  |
  +----------+----------+------------------------+
  | ballot   | 1 byte   | signed 8-bit integer   |
  +----------+----------+------------------------+


  Reveal (tag 7)
  ==============

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 22 bytes             | $contract_id           |
  +---------------+----------------------+------------------------+
  | fee           | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | counter       | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | gas_limit     | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | storage_limit | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | public_key    | Determined from data | $public_key            |
  +---------------+----------------------+------------------------+


  Transaction (tag 8)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | fee                              | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | counter                          | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | gas_limit                        | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | storage_limit                    | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                       |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 9)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 10)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+


  operation.alpha.operation_result.delegation (Determined from data, 8-bit tag)
  *****************************************************************************

  Applied (tag 0)
  ===============

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Failed (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | errors                | Variable | sequence of $error      |
  +-----------------------+----------+-------------------------+


  Skipped (tag 2)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Backtracked (tag 3)
  ===================

  +------------------------------+----------------------+----------------------------------------------------+
  | Name                         | Size                 | Contents                                           |
  +==============================+======================+====================================================+
  | Tag                          | 1 byte               | unsigned 8-bit integer                             |
  +------------------------------+----------------------+----------------------------------------------------+
  | ? presence of field "errors" | 1 byte               | boolean (0 for false, 255 for true)                |
  +------------------------------+----------------------+----------------------------------------------------+
  | errors                       | Determined from data | $X_125                                             |
  +------------------------------+----------------------+----------------------------------------------------+
  | Unnamed field 0              | 0 bytes              | placeholder (not actually present in the encoding) |
  +------------------------------+----------------------+----------------------------------------------------+


  X_22
  ****

  +-----------------------------+----------------------+-------------------------------------+
  | Name                        | Size                 | Contents                            |
  +=============================+======================+=====================================+
  | key_hash                    | 32 bytes             | bytes                               |
  +-----------------------------+----------------------+-------------------------------------+
  | key                         | Determined from data | $micheline.michelson_v1.expression  |
  +-----------------------------+----------------------+-------------------------------------+
  | ? presence of field "value" | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------------+----------------------+-------------------------------------+
  | value                       | Determined from data | $micheline.michelson_v1.expression  |
  +-----------------------------+----------------------+-------------------------------------+


  operation.alpha.internal_operation_result (Determined from data, 8-bit tag)
  ***************************************************************************

  reveal (tag 0)
  ==============

  +------------+----------------------+----------------------------------------------+
  | Name       | Size                 | Contents                                     |
  +============+======================+==============================================+
  | Tag        | 1 byte               | unsigned 8-bit integer                       |
  +------------+----------------------+----------------------------------------------+
  | source     | 22 bytes             | $contract_id                                 |
  +------------+----------------------+----------------------------------------------+
  | nonce      | 2 bytes              | unsigned 16-bit integer                      |
  +------------+----------------------+----------------------------------------------+
  | public_key | Determined from data | $public_key                                  |
  +------------+----------------------+----------------------------------------------+
  | result     | Determined from data | $operation.alpha.operation_result.delegation |
  +------------+----------------------+----------------------------------------------+


  transaction (tag 1)
  ===================

  +----------------------------------+----------------------+-----------------------------------------------+
  | Name                             | Size                 | Contents                                      |
  +==================================+======================+===============================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer                        |
  +----------------------------------+----------------------+-----------------------------------------------+
  | source                           | 22 bytes             | $contract_id                                  |
  +----------------------------------+----------------------+-----------------------------------------------+
  | nonce                            | 2 bytes              | unsigned 16-bit integer                       |
  +----------------------------------+----------------------+-----------------------------------------------+
  | amount                           | Determined from data | $N.t                                          |
  +----------------------------------+----------------------+-----------------------------------------------+
  | destination                      | 22 bytes             | $contract_id                                  |
  +----------------------------------+----------------------+-----------------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true)           |
  +----------------------------------+----------------------+-----------------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                                 |
  +----------------------------------+----------------------+-----------------------------------------------+
  | result                           | Determined from data | $operation.alpha.operation_result.transaction |
  +----------------------------------+----------------------+-----------------------------------------------+


  origination (tag 2)
  ===================

  +--------------------------------+----------------------+-----------------------------------------------+
  | Name                           | Size                 | Contents                                      |
  +================================+======================+===============================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer                        |
  +--------------------------------+----------------------+-----------------------------------------------+
  | source                         | 22 bytes             | $contract_id                                  |
  +--------------------------------+----------------------+-----------------------------------------------+
  | nonce                          | 2 bytes              | unsigned 16-bit integer                       |
  +--------------------------------+----------------------+-----------------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                              |
  +--------------------------------+----------------------+-----------------------------------------------+
  | balance                        | Determined from data | $N.t                                          |
  +--------------------------------+----------------------+-----------------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                              |
  +--------------------------------+----------------------+-----------------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | script                         | Determined from data | $scripted.contracts                           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | result                         | Determined from data | $operation.alpha.operation_result.origination |
  +--------------------------------+----------------------+-----------------------------------------------+


  delegation (tag 3)
  ==================

  +--------------------------------+----------------------+----------------------------------------------+
  | Name                           | Size                 | Contents                                     |
  +================================+======================+==============================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer                       |
  +--------------------------------+----------------------+----------------------------------------------+
  | source                         | 22 bytes             | $contract_id                                 |
  +--------------------------------+----------------------+----------------------------------------------+
  | nonce                          | 2 bytes              | unsigned 16-bit integer                      |
  +--------------------------------+----------------------+----------------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true)          |
  +--------------------------------+----------------------+----------------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                             |
  +--------------------------------+----------------------+----------------------------------------------+
  | result                         | Determined from data | $operation.alpha.operation_result.delegation |
  +--------------------------------+----------------------+----------------------------------------------+


  X_34
  ****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | Name                                                        | Size                 | Contents                                               |
  +=============================================================+======================+========================================================+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_5                                       |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | operation_result                                            | Determined from data | $operation.alpha.operation_result.origination          |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | internal_operation_results                                  | Variable             | sequence of $operation.alpha.internal_operation_result |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+


  X_64
  ****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | Name                                                        | Size                 | Contents                                               |
  +=============================================================+======================+========================================================+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_5                                       |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | operation_result                                            | Determined from data | $operation.alpha.operation_result.transaction          |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | internal_operation_results                                  | Variable             | sequence of $operation.alpha.internal_operation_result |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+


  scripted.contracts
  ******************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  operation.alpha.operation_result.origination (Determined from data, 8-bit tag)
  ******************************************************************************

  Applied (tag 0)
  ===============

  +-------------------------------------------------------------+----------------------+--------------------------+
  | Name                                                        | Size                 | Contents                 |
  +=============================================================+======================+==========================+
  | Tag                                                         | 1 byte               | unsigned 8-bit integer   |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer  |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | balance_updates                                             | Variable             | sequence of $X_5         |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer  |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | originated_contracts                                        | Variable             | sequence of $contract_id |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | consumed_gas                                                | Determined from data | $Z.t                     |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | storage_size                                                | Determined from data | $Z.t                     |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | paid_storage_size_diff                                      | Determined from data | $Z.t                     |
  +-------------------------------------------------------------+----------------------+--------------------------+


  Failed (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | errors                | Variable | sequence of $error      |
  +-----------------------+----------+-------------------------+


  Skipped (tag 2)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Backtracked (tag 3)
  ===================

  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | Name                                                        | Size                 | Contents                            |
  +=============================================================+======================+=====================================+
  | Tag                                                         | 1 byte               | unsigned 8-bit integer              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "errors"                                | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | errors                                                      | Determined from data | $X_125                              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_5                    |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | originated_contracts                                        | Variable             | sequence of $contract_id            |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | consumed_gas                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage_size                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | paid_storage_size_diff                                      | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  michelson.v1.primitives (Enumeration: unsigned 8-bit integer):
  **************************************************************

  +-------------+------------------+
  | Case number | Encoded string   |
  +=============+==================+
  | 0           | parameter        |
  +-------------+------------------+
  | 1           | storage          |
  +-------------+------------------+
  | 2           | code             |
  +-------------+------------------+
  | 3           | False            |
  +-------------+------------------+
  | 4           | Elt              |
  +-------------+------------------+
  | 5           | Left             |
  +-------------+------------------+
  | 6           | None             |
  +-------------+------------------+
  | 7           | Pair             |
  +-------------+------------------+
  | 8           | Right            |
  +-------------+------------------+
  | 9           | Some             |
  +-------------+------------------+
  | 10          | True             |
  +-------------+------------------+
  | 11          | Unit             |
  +-------------+------------------+
  | 12          | PACK             |
  +-------------+------------------+
  | 13          | UNPACK           |
  +-------------+------------------+
  | 14          | BLAKE2B          |
  +-------------+------------------+
  | 15          | SHA256           |
  +-------------+------------------+
  | 16          | SHA512           |
  +-------------+------------------+
  | 17          | ABS              |
  +-------------+------------------+
  | 18          | ADD              |
  +-------------+------------------+
  | 19          | AMOUNT           |
  +-------------+------------------+
  | 20          | AND              |
  +-------------+------------------+
  | 21          | BALANCE          |
  +-------------+------------------+
  | 22          | CAR              |
  +-------------+------------------+
  | 23          | CDR              |
  +-------------+------------------+
  | 24          | CHECK_SIGNATURE  |
  +-------------+------------------+
  | 25          | COMPARE          |
  +-------------+------------------+
  | 26          | CONCAT           |
  +-------------+------------------+
  | 27          | CONS             |
  +-------------+------------------+
  | 28          | CREATE_ACCOUNT   |
  +-------------+------------------+
  | 29          | CREATE_CONTRACT  |
  +-------------+------------------+
  | 30          | IMPLICIT_ACCOUNT |
  +-------------+------------------+
  | 31          | DIP              |
  +-------------+------------------+
  | 32          | DROP             |
  +-------------+------------------+
  | 33          | DUP              |
  +-------------+------------------+
  | 34          | EDIV             |
  +-------------+------------------+
  | 35          | EMPTY_MAP        |
  +-------------+------------------+
  | 36          | EMPTY_SET        |
  +-------------+------------------+
  | 37          | EQ               |
  +-------------+------------------+
  | 38          | EXEC             |
  +-------------+------------------+
  | 39          | FAILWITH         |
  +-------------+------------------+
  | 40          | GE               |
  +-------------+------------------+
  | 41          | GET              |
  +-------------+------------------+
  | 42          | GT               |
  +-------------+------------------+
  | 43          | HASH_KEY         |
  +-------------+------------------+
  | 44          | IF               |
  +-------------+------------------+
  | 45          | IF_CONS          |
  +-------------+------------------+
  | 46          | IF_LEFT          |
  +-------------+------------------+
  | 47          | IF_NONE          |
  +-------------+------------------+
  | 48          | INT              |
  +-------------+------------------+
  | 49          | LAMBDA           |
  +-------------+------------------+
  | 50          | LE               |
  +-------------+------------------+
  | 51          | LEFT             |
  +-------------+------------------+
  | 52          | LOOP             |
  +-------------+------------------+
  | 53          | LSL              |
  +-------------+------------------+
  | 54          | LSR              |
  +-------------+------------------+
  | 55          | LT               |
  +-------------+------------------+
  | 56          | MAP              |
  +-------------+------------------+
  | 57          | MEM              |
  +-------------+------------------+
  | 58          | MUL              |
  +-------------+------------------+
  | 59          | NEG              |
  +-------------+------------------+
  | 60          | NEQ              |
  +-------------+------------------+
  | 61          | NIL              |
  +-------------+------------------+
  | 62          | NONE             |
  +-------------+------------------+
  | 63          | NOT              |
  +-------------+------------------+
  | 64          | NOW              |
  +-------------+------------------+
  | 65          | OR               |
  +-------------+------------------+
  | 66          | PAIR             |
  +-------------+------------------+
  | 67          | PUSH             |
  +-------------+------------------+
  | 68          | RIGHT            |
  +-------------+------------------+
  | 69          | SIZE             |
  +-------------+------------------+
  | 70          | SOME             |
  +-------------+------------------+
  | 71          | SOURCE           |
  +-------------+------------------+
  | 72          | SENDER           |
  +-------------+------------------+
  | 73          | SELF             |
  +-------------+------------------+
  | 74          | STEPS_TO_QUOTA   |
  +-------------+------------------+
  | 75          | SUB              |
  +-------------+------------------+
  | 76          | SWAP             |
  +-------------+------------------+
  | 77          | TRANSFER_TOKENS  |
  +-------------+------------------+
  | 78          | SET_DELEGATE     |
  +-------------+------------------+
  | 79          | UNIT             |
  +-------------+------------------+
  | 80          | UPDATE           |
  +-------------+------------------+
  | 81          | XOR              |
  +-------------+------------------+
  | 82          | ITER             |
  +-------------+------------------+
  | 83          | LOOP_LEFT        |
  +-------------+------------------+
  | 84          | ADDRESS          |
  +-------------+------------------+
  | 85          | CONTRACT         |
  +-------------+------------------+
  | 86          | ISNAT            |
  +-------------+------------------+
  | 87          | CAST             |
  +-------------+------------------+
  | 88          | RENAME           |
  +-------------+------------------+
  | 89          | bool             |
  +-------------+------------------+
  | 90          | contract         |
  +-------------+------------------+
  | 91          | int              |
  +-------------+------------------+
  | 92          | key              |
  +-------------+------------------+
  | 93          | key_hash         |
  +-------------+------------------+
  | 94          | lambda           |
  +-------------+------------------+
  | 95          | list             |
  +-------------+------------------+
  | 96          | map              |
  +-------------+------------------+
  | 97          | big_map          |
  +-------------+------------------+
  | 98          | nat              |
  +-------------+------------------+
  | 99          | option           |
  +-------------+------------------+
  | 100         | or               |
  +-------------+------------------+
  | 101         | pair             |
  +-------------+------------------+
  | 102         | set              |
  +-------------+------------------+
  | 103         | signature        |
  +-------------+------------------+
  | 104         | string           |
  +-------------+------------------+
  | 105         | bytes            |
  +-------------+------------------+
  | 106         | mutez            |
  +-------------+------------------+
  | 107         | timestamp        |
  +-------------+------------------+
  | 108         | unit             |
  +-------------+------------------+
  | 109         | operation        |
  +-------------+------------------+
  | 110         | address          |
  +-------------+------------------+
  | 111         | SLICE            |
  +-------------+------------------+


  micheline.michelson_v1.expression (Determined from data, 8-bit tag)
  *******************************************************************

  Int (tag 0)
  ===========

  +------+----------------------+------------------------+
  | Name | Size                 | Contents               |
  +======+======================+========================+
  | Tag  | 1 byte               | unsigned 8-bit integer |
  +------+----------------------+------------------------+
  | int  | Determined from data | $Z.t                   |
  +------+----------------------+------------------------+


  String (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | string                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Sequence (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------+
  | Name                  | Size     | Contents                                       |
  +=======================+==========+================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                         |
  +-----------------------+----------+------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                        |
  +-----------------------+----------+------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of $micheline.michelson_v1.expression |
  +-----------------------+----------+------------------------------------------------+


  Prim (no args, annot) (tag 3)
  =============================

  +------+--------+------------------------------------------------------------------------------+
  | Name | Size   | Contents                                                                     |
  +======+========+==============================================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                                       |
  +------+--------+------------------------------------------------------------------------------+
  | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+--------+------------------------------------------------------------------------------+


  Prim (no args + annot) (tag 4)
  ==============================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Prim (1 arg, no annot) (tag 5)
  ==============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg  | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (1 arg + annot) (tag 6)
  ============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg                   | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args, no annot) (tag 7)
  ===============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg1 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg2 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args + annot) (tag 8)
  =============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg1                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg2                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Generic prim (any number of args with or without annot) (tag 9)
  ===============================================================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | args                  | Variable | sequence of $micheline.michelson_v1.expression                               |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Bytes (tag 10)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | bytes                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  contract.big_map_diff
  *********************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_22       |
  +-----------------------+----------+-------------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  operation.alpha.operation_result.transaction (Determined from data, 8-bit tag)
  ******************************************************************************

  Applied (tag 0)
  ===============

  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | Name                                                        | Size                 | Contents                            |
  +=============================================================+======================+=====================================+
  | Tag                                                         | 1 byte               | unsigned 8-bit integer              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "storage"                               | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage                                                     | Determined from data | $micheline.michelson_v1.expression  |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "big_map_diff"                          | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | big_map_diff                                                | Determined from data | $contract.big_map_diff              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_5                    |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | originated_contracts                                        | Variable             | sequence of $contract_id            |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | consumed_gas                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage_size                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | paid_storage_size_diff                                      | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  Failed (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | errors                | Variable | sequence of $error      |
  +-----------------------+----------+-------------------------+


  Skipped (tag 2)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Backtracked (tag 3)
  ===================

  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | Name                                                        | Size                 | Contents                            |
  +=============================================================+======================+=====================================+
  | Tag                                                         | 1 byte               | unsigned 8-bit integer              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "errors"                                | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | errors                                                      | Determined from data | $X_125                              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "storage"                               | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage                                                     | Determined from data | $micheline.michelson_v1.expression  |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "big_map_diff"                          | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | big_map_diff                                                | Determined from data | $contract.big_map_diff              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_5                    |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | originated_contracts                                        | Variable             | sequence of $contract_id            |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | consumed_gas                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage_size                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | paid_storage_size_diff                                      | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  public_key (Determined from data, 8-bit tag)
  ********************************************

  Ed25519 (tag 0)
  ===============

  +--------------------+----------+------------------------+
  | Name               | Size     | Contents               |
  +====================+==========+========================+
  | Tag                | 1 byte   | unsigned 8-bit integer |
  +--------------------+----------+------------------------+
  | Ed25519.Public_key | 32 bytes | bytes                  |
  +--------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | Secp256k1.Public_key | 33 bytes | bytes                  |
  +----------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | P256.Public_key | 33 bytes | bytes                  |
  +-----------------+----------+------------------------+


  X_125
  *****

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $error      |
  +-----------------------+----------+-------------------------+


  error
  *****

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | # bytes in next field    | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | Unnamed field 0          | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_101
  *****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | Name                                                        | Size                 | Contents                                               |
  +=============================================================+======================+========================================================+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_5                                       |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | operation_result                                            | Determined from data | $operation.alpha.operation_result.delegation           |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | internal_operation_results                                  | Variable             | sequence of $operation.alpha.internal_operation_result |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  block_header.alpha.full_header
  ******************************

  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | level                                 | 4 bytes  | signed 32-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | proto                                 | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | predecessor                           | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | timestamp                             | 8 bytes  | signed 64-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | validation_pass                       | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | operations_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | # bytes in field "fitness"            | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | fitness                               | Variable | sequence of $fitness.elem           |
  +---------------------------------------+----------+-------------------------------------+
  | context                               | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  inlined.endorsement.contents (5 bytes, 8-bit tag)
  *************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  inlined.endorsement
  *******************

  +------------+----------+-------------------------------+
  | Name       | Size     | Contents                      |
  +============+==========+===============================+
  | branch     | 32 bytes | bytes                         |
  +------------+----------+-------------------------------+
  | operations | 5 bytes  | $inlined.endorsement.contents |
  +------------+----------+-------------------------------+
  | signature  | Variable | bytes                         |
  +------------+----------+-------------------------------+


  operation_metadata.alpha.balance_updates
  ****************************************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_5        |
  +-----------------------+----------+-------------------------+


  contract_id (22 bytes, 8-bit tag)
  *********************************

  Implicit (tag 0)
  ================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash       |
  +---------------------------+----------+------------------------+


  Originated (tag 1)
  ==================

  +---------------+----------+------------------------+
  | Name          | Size     | Contents               |
  +===============+==========+========================+
  | Tag           | 1 byte   | unsigned 8-bit integer |
  +---------------+----------+------------------------+
  | Contract_hash | 20 bytes | bytes                  |
  +---------------+----------+------------------------+
  | padding       | 1 byte   | padding                |
  +---------------+----------+------------------------+


  X_136 (Determined from data, 8-bit tag)
  ***************************************

  Contract (tag 0)
  ================

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | contract | 22 bytes | $contract_id           |
  +----------+----------+------------------------+


  Rewards (tag 1)
  ===============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | delegate | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | level    | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+


  Fees (tag 2)
  ============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | delegate | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | level    | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+


  Deposits (tag 3)
  ================

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | delegate | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | level    | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  X_134
  *****

  +-------------------------------------------------------------+----------+------------------------------------+
  | Name                                                        | Size     | Contents                           |
  +=============================================================+==========+====================================+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes  | unsigned 30-bit integer            |
  +-------------------------------------------------------------+----------+------------------------------------+
  | balance_updates                                             | Variable | sequence of $X_5                   |
  +-------------------------------------------------------------+----------+------------------------------------+
  | delegate                                                    | 21 bytes | $public_key_hash                   |
  +-------------------------------------------------------------+----------+------------------------------------+
  | # bytes in next field                                       | 4 bytes  | unsigned 30-bit integer            |
  +-------------------------------------------------------------+----------+------------------------------------+
  | slots                                                       | Variable | sequence of unsigned 8-bit integer |
  +-------------------------------------------------------------+----------+------------------------------------+


  operation.alpha.operation_contents_and_result (Determined from data, 8-bit tag)
  *******************************************************************************

  Endorsement (tag 0)
  ===================

  +----------+----------------------+------------------------+
  | Name     | Size                 | Contents               |
  +==========+======================+========================+
  | Tag      | 1 byte               | unsigned 8-bit integer |
  +----------+----------------------+------------------------+
  | level    | 4 bytes              | signed 32-bit integer  |
  +----------+----------------------+------------------------+
  | metadata | Determined from data | $X_134                 |
  +----------+----------------------+------------------------+


  Seed_nonce_revelation (tag 1)
  =============================

  +----------+----------------------+-------------------------------------------+
  | Name     | Size                 | Contents                                  |
  +==========+======================+===========================================+
  | Tag      | 1 byte               | unsigned 8-bit integer                    |
  +----------+----------------------+-------------------------------------------+
  | level    | 4 bytes              | signed 32-bit integer                     |
  +----------+----------------------+-------------------------------------------+
  | nonce    | 32 bytes             | bytes                                     |
  +----------+----------------------+-------------------------------------------+
  | metadata | Determined from data | $operation_metadata.alpha.balance_updates |
  +----------+----------------------+-------------------------------------------+


  Double_endorsement_evidence (tag 2)
  ===================================

  +-----------------------+----------------------+-------------------------------------------+
  | Name                  | Size                 | Contents                                  |
  +=======================+======================+===========================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                    |
  +-----------------------+----------------------+-------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                   |
  +-----------------------+----------------------+-------------------------------------------+
  | op1                   | Variable             | $inlined.endorsement                      |
  +-----------------------+----------------------+-------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                   |
  +-----------------------+----------------------+-------------------------------------------+
  | op2                   | Variable             | $inlined.endorsement                      |
  +-----------------------+----------------------+-------------------------------------------+
  | metadata              | Determined from data | $operation_metadata.alpha.balance_updates |
  +-----------------------+----------------------+-------------------------------------------+


  Double_baking_evidence (tag 3)
  ==============================

  +-----------------------+----------------------+-------------------------------------------+
  | Name                  | Size                 | Contents                                  |
  +=======================+======================+===========================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                    |
  +-----------------------+----------------------+-------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                   |
  +-----------------------+----------------------+-------------------------------------------+
  | bh1                   | Determined from data | $block_header.alpha.full_header           |
  +-----------------------+----------------------+-------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                   |
  +-----------------------+----------------------+-------------------------------------------+
  | bh2                   | Determined from data | $block_header.alpha.full_header           |
  +-----------------------+----------------------+-------------------------------------------+
  | metadata              | Determined from data | $operation_metadata.alpha.balance_updates |
  +-----------------------+----------------------+-------------------------------------------+


  Activate_account (tag 4)
  ========================

  +----------+----------------------+-------------------------------------------+
  | Name     | Size                 | Contents                                  |
  +==========+======================+===========================================+
  | Tag      | 1 byte               | unsigned 8-bit integer                    |
  +----------+----------------------+-------------------------------------------+
  | pkh      | 20 bytes             | bytes                                     |
  +----------+----------------------+-------------------------------------------+
  | secret   | 20 bytes             | bytes                                     |
  +----------+----------------------+-------------------------------------------+
  | metadata | Determined from data | $operation_metadata.alpha.balance_updates |
  +----------+----------------------+-------------------------------------------+


  Proposals (tag 5)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | source                | 21 bytes | $public_key_hash        |
  +-----------------------+----------+-------------------------+
  | period                | 4 bytes  | signed 32-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | proposals             | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  Ballot (tag 6)
  ==============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | source   | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | period   | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+
  | proposal | 32 bytes | bytes                  |
  +----------+----------+------------------------+
  | ballot   | 1 byte   | signed 8-bit integer   |
  +----------+----------+------------------------+


  Reveal (tag 7)
  ==============

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 22 bytes             | $contract_id           |
  +---------------+----------------------+------------------------+
  | fee           | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | counter       | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | gas_limit     | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | storage_limit | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | public_key    | Determined from data | $public_key            |
  +---------------+----------------------+------------------------+
  | metadata      | Determined from data | $X_101                 |
  +---------------+----------------------+------------------------+


  Transaction (tag 8)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | fee                              | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | counter                          | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | gas_limit                        | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | storage_limit                    | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                       |
  +----------------------------------+----------------------+-------------------------------------+
  | metadata                         | Determined from data | $X_64                               |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 9)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+
  | metadata                       | Determined from data | $X_34                               |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 10)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | metadata                       | Determined from data | $X_101                              |
  +--------------------------------+----------------------+-------------------------------------+


  X_137 (Determined from data, 8-bit tag)
  ***************************************

  Operation_with_metadata (tag 0)
  ===============================

  +---------------------------------+----------+------------------------------------------------------------+
  | Name                            | Size     | Contents                                                   |
  +=================================+==========+============================================================+
  | Tag                             | 1 byte   | unsigned 8-bit integer                                     |
  +---------------------------------+----------+------------------------------------------------------------+
  | # bytes in next field           | 4 bytes  | unsigned 30-bit integer                                    |
  +---------------------------------+----------+------------------------------------------------------------+
  | contents                        | Variable | sequence of $operation.alpha.operation_contents_and_result |
  +---------------------------------+----------+------------------------------------------------------------+
  | ? presence of field "signature" | 1 byte   | boolean (0 for false, 255 for true)                        |
  +---------------------------------+----------+------------------------------------------------------------+
  | signature                       | 64 bytes | bytes                                                      |
  +---------------------------------+----------+------------------------------------------------------------+


  Operation_without_metadata (tag 1)
  ==================================

  +---------------------------------+----------+---------------------------------------+
  | Name                            | Size     | Contents                              |
  +=================================+==========+=======================================+
  | Tag                             | 1 byte   | unsigned 8-bit integer                |
  +---------------------------------+----------+---------------------------------------+
  | # bytes in next field           | 4 bytes  | unsigned 30-bit integer               |
  +---------------------------------+----------+---------------------------------------+
  | contents                        | Variable | sequence of $operation.alpha.contents |
  +---------------------------------+----------+---------------------------------------+
  | ? presence of field "signature" | 1 byte   | boolean (0 for false, 255 for true)   |
  +---------------------------------+----------+---------------------------------------+
  | signature                       | 64 bytes | bytes                                 |
  +---------------------------------+----------+---------------------------------------+


  operation
  *********

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | chain_id              | 4 bytes              | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | hash                  | 32 bytes             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | branch                | 32 bytes             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_137                  |
  +-----------------------+----------------------+-------------------------+


  X_7
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | # bytes in next field    | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | Unnamed field 0          | Variable | sequence of $operation  |
  +--------------------------+----------+-------------------------+

  

GET ../<block_id>/context/constants

All constants

  { "proof_of_work_nonce_size": integer ∈ [0, 255],
    "nonce_length": integer ∈ [0, 255],
    "max_revelations_per_block": integer ∈ [0, 255],
    "max_operation_data_length": integer ∈ [-2^30-2, 2^30+2],
    "preserved_cycles": integer ∈ [0, 255],
    "blocks_per_cycle": integer ∈ [-2^31-2, 2^31+2],
    "blocks_per_commitment": integer ∈ [-2^31-2, 2^31+2],
    "blocks_per_roll_snapshot": integer ∈ [-2^31-2, 2^31+2],
    "blocks_per_voting_period": integer ∈ [-2^31-2, 2^31+2],
    "time_between_blocks": [ $int64 ... ],
    "endorsers_per_block": integer ∈ [0, 2^16-1],
    "hard_gas_limit_per_operation": $bignum,
    "hard_gas_limit_per_block": $bignum,
    "proof_of_work_threshold": $int64,
    "tokens_per_roll": $mutez,
    "michelson_maximum_type_size": integer ∈ [0, 2^16-1],
    "seed_nonce_revelation_tip": $mutez,
    "origination_burn": $mutez,
    "block_security_deposit": $mutez,
    "endorsement_security_deposit": $mutez,
    "block_reward": $mutez,
    "endorsement_reward": $mutez,
    "cost_per_byte": $mutez,
    "hard_storage_limit_per_operation": $bignum }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | Name                             | Size                 | Contents                                                     |
  +==================================+======================+==============================================================+
  | proof_of_work_nonce_size         | 1 byte               | unsigned 8-bit integer                                       |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | nonce_length                     | 1 byte               | unsigned 8-bit integer                                       |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | max_revelations_per_block        | 1 byte               | unsigned 8-bit integer                                       |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | max_operation_data_length        | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | preserved_cycles                 | 1 byte               | unsigned 8-bit integer                                       |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | blocks_per_cycle                 | 4 bytes              | signed 32-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | blocks_per_commitment            | 4 bytes              | signed 32-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | blocks_per_roll_snapshot         | 4 bytes              | signed 32-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | blocks_per_voting_period         | 4 bytes              | signed 32-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | # bytes in next field            | 4 bytes              | unsigned 30-bit integer                                      |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | time_between_blocks              | Variable             | sequence of signed 64-bit integer                            |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | endorsers_per_block              | 2 bytes              | unsigned 16-bit integer                                      |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | hard_gas_limit_per_operation     | Determined from data | $Z.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | hard_gas_limit_per_block         | Determined from data | $Z.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | proof_of_work_threshold          | 8 bytes              | signed 64-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | tokens_per_roll                  | Determined from data | $N.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | michelson_maximum_type_size      | 2 bytes              | unsigned 16-bit integer                                      |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | seed_nonce_revelation_tip        | Determined from data | $N.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | origination_burn                 | Determined from data | $N.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | block_security_deposit           | Determined from data | $N.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | endorsement_security_deposit     | Determined from data | $N.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | block_reward                     | Determined from data | $N.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | endorsement_reward               | Determined from data | $N.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | cost_per_byte                    | Determined from data | $N.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | hard_storage_limit_per_operation | Determined from data | $Z.t                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

GET ../<block_id>/context/constants/errors

Schema for all the RPC errors from this protocol version

  any
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

GET ../<block_id>/context/contracts

All existing contracts (including non-empty default contracts).

  [ $contract_id ... ]
  $contract_id:
    /* A contract handle
       A contract notation as given to an RPC or inside scripts. Can be a
       base58 implicit contract hash or a base58 originated contract hash. */
    string
  +-----------------------+----------+--------------------------+
  | Name                  | Size     | Contents                 |
  +=======================+==========+==========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer  |
  +-----------------------+----------+--------------------------+
  | Unnamed field 0       | Variable | sequence of $contract_id |
  +-----------------------+----------+--------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  contract_id (22 bytes, 8-bit tag)
  *********************************

  Implicit (tag 0)
  ================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash       |
  +---------------------------+----------+------------------------+


  Originated (tag 1)
  ==================

  +---------------+----------+------------------------+
  | Name          | Size     | Contents               |
  +===============+==========+========================+
  | Tag           | 1 byte   | unsigned 8-bit integer |
  +---------------+----------+------------------------+
  | Contract_hash | 20 bytes | bytes                  |
  +---------------+----------+------------------------+
  | padding       | 1 byte   | padding                |
  +---------------+----------+------------------------+

  

GET ../<block_id>/context/contracts/<contract_id>

Access the complete status of a contract.

  { "manager": $Signature.Public_key_hash,
    "balance": $mutez,
    "spendable": boolean,
    "delegate": { "setable": boolean,
                  "value"?: $Signature.Public_key_hash },
    "script"?: $scripted.contracts,
    "counter": $positive_bignum }
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  +------------------------------+----------------------+-------------------------------------+
  | Name                         | Size                 | Contents                            |
  +==============================+======================+=====================================+
  | manager                      | 21 bytes             | $public_key_hash                    |
  +------------------------------+----------------------+-------------------------------------+
  | balance                      | Determined from data | $N.t                                |
  +------------------------------+----------------------+-------------------------------------+
  | spendable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +------------------------------+----------------------+-------------------------------------+
  | delegate                     | Determined from data | $X_0                                |
  +------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script" | 1 byte               | boolean (0 for false, 255 for true) |
  +------------------------------+----------------------+-------------------------------------+
  | script                       | Determined from data | $scripted.contracts                 |
  +------------------------------+----------------------+-------------------------------------+
  | counter                      | Determined from data | $N.t                                |
  +------------------------------+----------------------+-------------------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  X_0
  ***

  +-----------------------------+----------+-------------------------------------+
  | Name                        | Size     | Contents                            |
  +=============================+==========+=====================================+
  | setable                     | 1 byte   | boolean (0 for false, 255 for true) |
  +-----------------------------+----------+-------------------------------------+
  | ? presence of field "value" | 1 byte   | boolean (0 for false, 255 for true) |
  +-----------------------------+----------+-------------------------------------+
  | value                       | 21 bytes | $public_key_hash                    |
  +-----------------------------+----------+-------------------------------------+


  scripted.contracts
  ******************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

GET ../<block_id>/context/contracts/<contract_id>/balance

Access the balance of a contract.

  $mutez
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $N.t     |
  +-----------------+----------------------+----------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

POST ../<block_id>/context/contracts/<contract_id>/big_map_get

Access the value associated with a key in the big map storage of the contract.

  { "key": $micheline.michelson_v1.expression,
    "type": $micheline.michelson_v1.expression }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  +------+----------------------+------------------------------------+
  | Name | Size                 | Contents                           |
  +======+======================+====================================+
  | key  | Determined from data | $micheline.michelson_v1.expression |
  +------+----------------------+------------------------------------+
  | type | Determined from data | $micheline.michelson_v1.expression |
  +------+----------------------+------------------------------------+


  michelson.v1.primitives (Enumeration: unsigned 8-bit integer):
  **************************************************************

  +-------------+------------------+
  | Case number | Encoded string   |
  +=============+==================+
  | 0           | parameter        |
  +-------------+------------------+
  | 1           | storage          |
  +-------------+------------------+
  | 2           | code             |
  +-------------+------------------+
  | 3           | False            |
  +-------------+------------------+
  | 4           | Elt              |
  +-------------+------------------+
  | 5           | Left             |
  +-------------+------------------+
  | 6           | None             |
  +-------------+------------------+
  | 7           | Pair             |
  +-------------+------------------+
  | 8           | Right            |
  +-------------+------------------+
  | 9           | Some             |
  +-------------+------------------+
  | 10          | True             |
  +-------------+------------------+
  | 11          | Unit             |
  +-------------+------------------+
  | 12          | PACK             |
  +-------------+------------------+
  | 13          | UNPACK           |
  +-------------+------------------+
  | 14          | BLAKE2B          |
  +-------------+------------------+
  | 15          | SHA256           |
  +-------------+------------------+
  | 16          | SHA512           |
  +-------------+------------------+
  | 17          | ABS              |
  +-------------+------------------+
  | 18          | ADD              |
  +-------------+------------------+
  | 19          | AMOUNT           |
  +-------------+------------------+
  | 20          | AND              |
  +-------------+------------------+
  | 21          | BALANCE          |
  +-------------+------------------+
  | 22          | CAR              |
  +-------------+------------------+
  | 23          | CDR              |
  +-------------+------------------+
  | 24          | CHECK_SIGNATURE  |
  +-------------+------------------+
  | 25          | COMPARE          |
  +-------------+------------------+
  | 26          | CONCAT           |
  +-------------+------------------+
  | 27          | CONS             |
  +-------------+------------------+
  | 28          | CREATE_ACCOUNT   |
  +-------------+------------------+
  | 29          | CREATE_CONTRACT  |
  +-------------+------------------+
  | 30          | IMPLICIT_ACCOUNT |
  +-------------+------------------+
  | 31          | DIP              |
  +-------------+------------------+
  | 32          | DROP             |
  +-------------+------------------+
  | 33          | DUP              |
  +-------------+------------------+
  | 34          | EDIV             |
  +-------------+------------------+
  | 35          | EMPTY_MAP        |
  +-------------+------------------+
  | 36          | EMPTY_SET        |
  +-------------+------------------+
  | 37          | EQ               |
  +-------------+------------------+
  | 38          | EXEC             |
  +-------------+------------------+
  | 39          | FAILWITH         |
  +-------------+------------------+
  | 40          | GE               |
  +-------------+------------------+
  | 41          | GET              |
  +-------------+------------------+
  | 42          | GT               |
  +-------------+------------------+
  | 43          | HASH_KEY         |
  +-------------+------------------+
  | 44          | IF               |
  +-------------+------------------+
  | 45          | IF_CONS          |
  +-------------+------------------+
  | 46          | IF_LEFT          |
  +-------------+------------------+
  | 47          | IF_NONE          |
  +-------------+------------------+
  | 48          | INT              |
  +-------------+------------------+
  | 49          | LAMBDA           |
  +-------------+------------------+
  | 50          | LE               |
  +-------------+------------------+
  | 51          | LEFT             |
  +-------------+------------------+
  | 52          | LOOP             |
  +-------------+------------------+
  | 53          | LSL              |
  +-------------+------------------+
  | 54          | LSR              |
  +-------------+------------------+
  | 55          | LT               |
  +-------------+------------------+
  | 56          | MAP              |
  +-------------+------------------+
  | 57          | MEM              |
  +-------------+------------------+
  | 58          | MUL              |
  +-------------+------------------+
  | 59          | NEG              |
  +-------------+------------------+
  | 60          | NEQ              |
  +-------------+------------------+
  | 61          | NIL              |
  +-------------+------------------+
  | 62          | NONE             |
  +-------------+------------------+
  | 63          | NOT              |
  +-------------+------------------+
  | 64          | NOW              |
  +-------------+------------------+
  | 65          | OR               |
  +-------------+------------------+
  | 66          | PAIR             |
  +-------------+------------------+
  | 67          | PUSH             |
  +-------------+------------------+
  | 68          | RIGHT            |
  +-------------+------------------+
  | 69          | SIZE             |
  +-------------+------------------+
  | 70          | SOME             |
  +-------------+------------------+
  | 71          | SOURCE           |
  +-------------+------------------+
  | 72          | SENDER           |
  +-------------+------------------+
  | 73          | SELF             |
  +-------------+------------------+
  | 74          | STEPS_TO_QUOTA   |
  +-------------+------------------+
  | 75          | SUB              |
  +-------------+------------------+
  | 76          | SWAP             |
  +-------------+------------------+
  | 77          | TRANSFER_TOKENS  |
  +-------------+------------------+
  | 78          | SET_DELEGATE     |
  +-------------+------------------+
  | 79          | UNIT             |
  +-------------+------------------+
  | 80          | UPDATE           |
  +-------------+------------------+
  | 81          | XOR              |
  +-------------+------------------+
  | 82          | ITER             |
  +-------------+------------------+
  | 83          | LOOP_LEFT        |
  +-------------+------------------+
  | 84          | ADDRESS          |
  +-------------+------------------+
  | 85          | CONTRACT         |
  +-------------+------------------+
  | 86          | ISNAT            |
  +-------------+------------------+
  | 87          | CAST             |
  +-------------+------------------+
  | 88          | RENAME           |
  +-------------+------------------+
  | 89          | bool             |
  +-------------+------------------+
  | 90          | contract         |
  +-------------+------------------+
  | 91          | int              |
  +-------------+------------------+
  | 92          | key              |
  +-------------+------------------+
  | 93          | key_hash         |
  +-------------+------------------+
  | 94          | lambda           |
  +-------------+------------------+
  | 95          | list             |
  +-------------+------------------+
  | 96          | map              |
  +-------------+------------------+
  | 97          | big_map          |
  +-------------+------------------+
  | 98          | nat              |
  +-------------+------------------+
  | 99          | option           |
  +-------------+------------------+
  | 100         | or               |
  +-------------+------------------+
  | 101         | pair             |
  +-------------+------------------+
  | 102         | set              |
  +-------------+------------------+
  | 103         | signature        |
  +-------------+------------------+
  | 104         | string           |
  +-------------+------------------+
  | 105         | bytes            |
  +-------------+------------------+
  | 106         | mutez            |
  +-------------+------------------+
  | 107         | timestamp        |
  +-------------+------------------+
  | 108         | unit             |
  +-------------+------------------+
  | 109         | operation        |
  +-------------+------------------+
  | 110         | address          |
  +-------------+------------------+
  | 111         | SLICE            |
  +-------------+------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  micheline.michelson_v1.expression (Determined from data, 8-bit tag)
  *******************************************************************

  Int (tag 0)
  ===========

  +------+----------------------+------------------------+
  | Name | Size                 | Contents               |
  +======+======================+========================+
  | Tag  | 1 byte               | unsigned 8-bit integer |
  +------+----------------------+------------------------+
  | int  | Determined from data | $Z.t                   |
  +------+----------------------+------------------------+


  String (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | string                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Sequence (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------+
  | Name                  | Size     | Contents                                       |
  +=======================+==========+================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                         |
  +-----------------------+----------+------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                        |
  +-----------------------+----------+------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of $micheline.michelson_v1.expression |
  +-----------------------+----------+------------------------------------------------+


  Prim (no args, annot) (tag 3)
  =============================

  +------+--------+------------------------------------------------------------------------------+
  | Name | Size   | Contents                                                                     |
  +======+========+==============================================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                                       |
  +------+--------+------------------------------------------------------------------------------+
  | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+--------+------------------------------------------------------------------------------+


  Prim (no args + annot) (tag 4)
  ==============================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Prim (1 arg, no annot) (tag 5)
  ==============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg  | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (1 arg + annot) (tag 6)
  ============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg                   | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args, no annot) (tag 7)
  ===============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg1 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg2 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args + annot) (tag 8)
  =============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg1                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg2                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Generic prim (any number of args with or without annot) (tag 9)
  ===============================================================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | args                  | Variable | sequence of $micheline.michelson_v1.expression                               |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Bytes (tag 10)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | bytes                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  
  $micheline.michelson_v1.expression || null
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_1     |
  +-----------------+----------------------+----------+


  michelson.v1.primitives (Enumeration: unsigned 8-bit integer):
  **************************************************************

  +-------------+------------------+
  | Case number | Encoded string   |
  +=============+==================+
  | 0           | parameter        |
  +-------------+------------------+
  | 1           | storage          |
  +-------------+------------------+
  | 2           | code             |
  +-------------+------------------+
  | 3           | False            |
  +-------------+------------------+
  | 4           | Elt              |
  +-------------+------------------+
  | 5           | Left             |
  +-------------+------------------+
  | 6           | None             |
  +-------------+------------------+
  | 7           | Pair             |
  +-------------+------------------+
  | 8           | Right            |
  +-------------+------------------+
  | 9           | Some             |
  +-------------+------------------+
  | 10          | True             |
  +-------------+------------------+
  | 11          | Unit             |
  +-------------+------------------+
  | 12          | PACK             |
  +-------------+------------------+
  | 13          | UNPACK           |
  +-------------+------------------+
  | 14          | BLAKE2B          |
  +-------------+------------------+
  | 15          | SHA256           |
  +-------------+------------------+
  | 16          | SHA512           |
  +-------------+------------------+
  | 17          | ABS              |
  +-------------+------------------+
  | 18          | ADD              |
  +-------------+------------------+
  | 19          | AMOUNT           |
  +-------------+------------------+
  | 20          | AND              |
  +-------------+------------------+
  | 21          | BALANCE          |
  +-------------+------------------+
  | 22          | CAR              |
  +-------------+------------------+
  | 23          | CDR              |
  +-------------+------------------+
  | 24          | CHECK_SIGNATURE  |
  +-------------+------------------+
  | 25          | COMPARE          |
  +-------------+------------------+
  | 26          | CONCAT           |
  +-------------+------------------+
  | 27          | CONS             |
  +-------------+------------------+
  | 28          | CREATE_ACCOUNT   |
  +-------------+------------------+
  | 29          | CREATE_CONTRACT  |
  +-------------+------------------+
  | 30          | IMPLICIT_ACCOUNT |
  +-------------+------------------+
  | 31          | DIP              |
  +-------------+------------------+
  | 32          | DROP             |
  +-------------+------------------+
  | 33          | DUP              |
  +-------------+------------------+
  | 34          | EDIV             |
  +-------------+------------------+
  | 35          | EMPTY_MAP        |
  +-------------+------------------+
  | 36          | EMPTY_SET        |
  +-------------+------------------+
  | 37          | EQ               |
  +-------------+------------------+
  | 38          | EXEC             |
  +-------------+------------------+
  | 39          | FAILWITH         |
  +-------------+------------------+
  | 40          | GE               |
  +-------------+------------------+
  | 41          | GET              |
  +-------------+------------------+
  | 42          | GT               |
  +-------------+------------------+
  | 43          | HASH_KEY         |
  +-------------+------------------+
  | 44          | IF               |
  +-------------+------------------+
  | 45          | IF_CONS          |
  +-------------+------------------+
  | 46          | IF_LEFT          |
  +-------------+------------------+
  | 47          | IF_NONE          |
  +-------------+------------------+
  | 48          | INT              |
  +-------------+------------------+
  | 49          | LAMBDA           |
  +-------------+------------------+
  | 50          | LE               |
  +-------------+------------------+
  | 51          | LEFT             |
  +-------------+------------------+
  | 52          | LOOP             |
  +-------------+------------------+
  | 53          | LSL              |
  +-------------+------------------+
  | 54          | LSR              |
  +-------------+------------------+
  | 55          | LT               |
  +-------------+------------------+
  | 56          | MAP              |
  +-------------+------------------+
  | 57          | MEM              |
  +-------------+------------------+
  | 58          | MUL              |
  +-------------+------------------+
  | 59          | NEG              |
  +-------------+------------------+
  | 60          | NEQ              |
  +-------------+------------------+
  | 61          | NIL              |
  +-------------+------------------+
  | 62          | NONE             |
  +-------------+------------------+
  | 63          | NOT              |
  +-------------+------------------+
  | 64          | NOW              |
  +-------------+------------------+
  | 65          | OR               |
  +-------------+------------------+
  | 66          | PAIR             |
  +-------------+------------------+
  | 67          | PUSH             |
  +-------------+------------------+
  | 68          | RIGHT            |
  +-------------+------------------+
  | 69          | SIZE             |
  +-------------+------------------+
  | 70          | SOME             |
  +-------------+------------------+
  | 71          | SOURCE           |
  +-------------+------------------+
  | 72          | SENDER           |
  +-------------+------------------+
  | 73          | SELF             |
  +-------------+------------------+
  | 74          | STEPS_TO_QUOTA   |
  +-------------+------------------+
  | 75          | SUB              |
  +-------------+------------------+
  | 76          | SWAP             |
  +-------------+------------------+
  | 77          | TRANSFER_TOKENS  |
  +-------------+------------------+
  | 78          | SET_DELEGATE     |
  +-------------+------------------+
  | 79          | UNIT             |
  +-------------+------------------+
  | 80          | UPDATE           |
  +-------------+------------------+
  | 81          | XOR              |
  +-------------+------------------+
  | 82          | ITER             |
  +-------------+------------------+
  | 83          | LOOP_LEFT        |
  +-------------+------------------+
  | 84          | ADDRESS          |
  +-------------+------------------+
  | 85          | CONTRACT         |
  +-------------+------------------+
  | 86          | ISNAT            |
  +-------------+------------------+
  | 87          | CAST             |
  +-------------+------------------+
  | 88          | RENAME           |
  +-------------+------------------+
  | 89          | bool             |
  +-------------+------------------+
  | 90          | contract         |
  +-------------+------------------+
  | 91          | int              |
  +-------------+------------------+
  | 92          | key              |
  +-------------+------------------+
  | 93          | key_hash         |
  +-------------+------------------+
  | 94          | lambda           |
  +-------------+------------------+
  | 95          | list             |
  +-------------+------------------+
  | 96          | map              |
  +-------------+------------------+
  | 97          | big_map          |
  +-------------+------------------+
  | 98          | nat              |
  +-------------+------------------+
  | 99          | option           |
  +-------------+------------------+
  | 100         | or               |
  +-------------+------------------+
  | 101         | pair             |
  +-------------+------------------+
  | 102         | set              |
  +-------------+------------------+
  | 103         | signature        |
  +-------------+------------------+
  | 104         | string           |
  +-------------+------------------+
  | 105         | bytes            |
  +-------------+------------------+
  | 106         | mutez            |
  +-------------+------------------+
  | 107         | timestamp        |
  +-------------+------------------+
  | 108         | unit             |
  +-------------+------------------+
  | 109         | operation        |
  +-------------+------------------+
  | 110         | address          |
  +-------------+------------------+
  | 111         | SLICE            |
  +-------------+------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  micheline.michelson_v1.expression (Determined from data, 8-bit tag)
  *******************************************************************

  Int (tag 0)
  ===========

  +------+----------------------+------------------------+
  | Name | Size                 | Contents               |
  +======+======================+========================+
  | Tag  | 1 byte               | unsigned 8-bit integer |
  +------+----------------------+------------------------+
  | int  | Determined from data | $Z.t                   |
  +------+----------------------+------------------------+


  String (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | string                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Sequence (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------+
  | Name                  | Size     | Contents                                       |
  +=======================+==========+================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                         |
  +-----------------------+----------+------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                        |
  +-----------------------+----------+------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of $micheline.michelson_v1.expression |
  +-----------------------+----------+------------------------------------------------+


  Prim (no args, annot) (tag 3)
  =============================

  +------+--------+------------------------------------------------------------------------------+
  | Name | Size   | Contents                                                                     |
  +======+========+==============================================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                                       |
  +------+--------+------------------------------------------------------------------------------+
  | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+--------+------------------------------------------------------------------------------+


  Prim (no args + annot) (tag 4)
  ==============================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Prim (1 arg, no annot) (tag 5)
  ==============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg  | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (1 arg + annot) (tag 6)
  ============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg                   | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args, no annot) (tag 7)
  ===============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg1 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg2 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args + annot) (tag 8)
  =============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg1                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg2                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Generic prim (any number of args with or without annot) (tag 9)
  ===============================================================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | args                  | Variable | sequence of $micheline.michelson_v1.expression                               |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Bytes (tag 10)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | bytes                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_1 (Determined from data, 8-bit tag)
  *************************************

  None (tag 0)
  ============

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Some (tag 1)
  ============

  +-----------------+----------------------+------------------------------------+
  | Name            | Size                 | Contents                           |
  +=================+======================+====================================+
  | Tag             | 1 byte               | unsigned 8-bit integer             |
  +-----------------+----------------------+------------------------------------+
  | Unnamed field 0 | Determined from data | $micheline.michelson_v1.expression |
  +-----------------+----------------------+------------------------------------+

  

GET ../<block_id>/context/contracts/<contract_id>/counter

Access the counter of a contract, if any.

  $bignum
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $Z.t     |
  +-----------------+----------------------+----------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

GET ../<block_id>/context/contracts/<contract_id>/delegatable

Tells if the contract delegate can be changed.

  boolean
  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  

GET ../<block_id>/context/contracts/<contract_id>/delegate

Access the delegate of a contract, if any.

  $Signature.Public_key_hash
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  +---------------------------+----------+------------------+
  | Name                      | Size     | Contents         |
  +===========================+==========+==================+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash |
  +---------------------------+----------+------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+

  

GET ../<block_id>/context/contracts/<contract_id>/manager

Access the manager of a contract.

  $Signature.Public_key_hash
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  +---------------------------+----------+------------------+
  | Name                      | Size     | Contents         |
  +===========================+==========+==================+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash |
  +---------------------------+----------+------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+

  

GET ../<block_id>/context/contracts/<contract_id>/manager_key

Access the manager of a contract.

  { "manager": $Signature.Public_key_hash,
    "key"?: $Signature.Public_key }
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    string
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  +---------------------------+----------------------+-------------------------------------+
  | Name                      | Size                 | Contents                            |
  +===========================+======================+=====================================+
  | manager                   | 21 bytes             | $public_key_hash                    |
  +---------------------------+----------------------+-------------------------------------+
  | ? presence of field "key" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------+----------------------+-------------------------------------+
  | key                       | Determined from data | $public_key                         |
  +---------------------------+----------------------+-------------------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  public_key (Determined from data, 8-bit tag)
  ********************************************

  Ed25519 (tag 0)
  ===============

  +--------------------+----------+------------------------+
  | Name               | Size     | Contents               |
  +====================+==========+========================+
  | Tag                | 1 byte   | unsigned 8-bit integer |
  +--------------------+----------+------------------------+
  | Ed25519.Public_key | 32 bytes | bytes                  |
  +--------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | Secp256k1.Public_key | 33 bytes | bytes                  |
  +----------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | P256.Public_key | 33 bytes | bytes                  |
  +-----------------+----------+------------------------+

  

GET ../<block_id>/context/contracts/<contract_id>/script

Access the code and data of the contract.

  $scripted.contracts
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

GET ../<block_id>/context/contracts/<contract_id>/spendable

Tells if the contract tokens can be spent by the manager.

  boolean
  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  

GET ../<block_id>/context/contracts/<contract_id>/storage

Access the data of the contract.

  $micheline.michelson_v1.expression
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  +-----------------+----------------------+------------------------------------+
  | Name            | Size                 | Contents                           |
  +=================+======================+====================================+
  | Unnamed field 0 | Determined from data | $micheline.michelson_v1.expression |
  +-----------------+----------------------+------------------------------------+


  michelson.v1.primitives (Enumeration: unsigned 8-bit integer):
  **************************************************************

  +-------------+------------------+
  | Case number | Encoded string   |
  +=============+==================+
  | 0           | parameter        |
  +-------------+------------------+
  | 1           | storage          |
  +-------------+------------------+
  | 2           | code             |
  +-------------+------------------+
  | 3           | False            |
  +-------------+------------------+
  | 4           | Elt              |
  +-------------+------------------+
  | 5           | Left             |
  +-------------+------------------+
  | 6           | None             |
  +-------------+------------------+
  | 7           | Pair             |
  +-------------+------------------+
  | 8           | Right            |
  +-------------+------------------+
  | 9           | Some             |
  +-------------+------------------+
  | 10          | True             |
  +-------------+------------------+
  | 11          | Unit             |
  +-------------+------------------+
  | 12          | PACK             |
  +-------------+------------------+
  | 13          | UNPACK           |
  +-------------+------------------+
  | 14          | BLAKE2B          |
  +-------------+------------------+
  | 15          | SHA256           |
  +-------------+------------------+
  | 16          | SHA512           |
  +-------------+------------------+
  | 17          | ABS              |
  +-------------+------------------+
  | 18          | ADD              |
  +-------------+------------------+
  | 19          | AMOUNT           |
  +-------------+------------------+
  | 20          | AND              |
  +-------------+------------------+
  | 21          | BALANCE          |
  +-------------+------------------+
  | 22          | CAR              |
  +-------------+------------------+
  | 23          | CDR              |
  +-------------+------------------+
  | 24          | CHECK_SIGNATURE  |
  +-------------+------------------+
  | 25          | COMPARE          |
  +-------------+------------------+
  | 26          | CONCAT           |
  +-------------+------------------+
  | 27          | CONS             |
  +-------------+------------------+
  | 28          | CREATE_ACCOUNT   |
  +-------------+------------------+
  | 29          | CREATE_CONTRACT  |
  +-------------+------------------+
  | 30          | IMPLICIT_ACCOUNT |
  +-------------+------------------+
  | 31          | DIP              |
  +-------------+------------------+
  | 32          | DROP             |
  +-------------+------------------+
  | 33          | DUP              |
  +-------------+------------------+
  | 34          | EDIV             |
  +-------------+------------------+
  | 35          | EMPTY_MAP        |
  +-------------+------------------+
  | 36          | EMPTY_SET        |
  +-------------+------------------+
  | 37          | EQ               |
  +-------------+------------------+
  | 38          | EXEC             |
  +-------------+------------------+
  | 39          | FAILWITH         |
  +-------------+------------------+
  | 40          | GE               |
  +-------------+------------------+
  | 41          | GET              |
  +-------------+------------------+
  | 42          | GT               |
  +-------------+------------------+
  | 43          | HASH_KEY         |
  +-------------+------------------+
  | 44          | IF               |
  +-------------+------------------+
  | 45          | IF_CONS          |
  +-------------+------------------+
  | 46          | IF_LEFT          |
  +-------------+------------------+
  | 47          | IF_NONE          |
  +-------------+------------------+
  | 48          | INT              |
  +-------------+------------------+
  | 49          | LAMBDA           |
  +-------------+------------------+
  | 50          | LE               |
  +-------------+------------------+
  | 51          | LEFT             |
  +-------------+------------------+
  | 52          | LOOP             |
  +-------------+------------------+
  | 53          | LSL              |
  +-------------+------------------+
  | 54          | LSR              |
  +-------------+------------------+
  | 55          | LT               |
  +-------------+------------------+
  | 56          | MAP              |
  +-------------+------------------+
  | 57          | MEM              |
  +-------------+------------------+
  | 58          | MUL              |
  +-------------+------------------+
  | 59          | NEG              |
  +-------------+------------------+
  | 60          | NEQ              |
  +-------------+------------------+
  | 61          | NIL              |
  +-------------+------------------+
  | 62          | NONE             |
  +-------------+------------------+
  | 63          | NOT              |
  +-------------+------------------+
  | 64          | NOW              |
  +-------------+------------------+
  | 65          | OR               |
  +-------------+------------------+
  | 66          | PAIR             |
  +-------------+------------------+
  | 67          | PUSH             |
  +-------------+------------------+
  | 68          | RIGHT            |
  +-------------+------------------+
  | 69          | SIZE             |
  +-------------+------------------+
  | 70          | SOME             |
  +-------------+------------------+
  | 71          | SOURCE           |
  +-------------+------------------+
  | 72          | SENDER           |
  +-------------+------------------+
  | 73          | SELF             |
  +-------------+------------------+
  | 74          | STEPS_TO_QUOTA   |
  +-------------+------------------+
  | 75          | SUB              |
  +-------------+------------------+
  | 76          | SWAP             |
  +-------------+------------------+
  | 77          | TRANSFER_TOKENS  |
  +-------------+------------------+
  | 78          | SET_DELEGATE     |
  +-------------+------------------+
  | 79          | UNIT             |
  +-------------+------------------+
  | 80          | UPDATE           |
  +-------------+------------------+
  | 81          | XOR              |
  +-------------+------------------+
  | 82          | ITER             |
  +-------------+------------------+
  | 83          | LOOP_LEFT        |
  +-------------+------------------+
  | 84          | ADDRESS          |
  +-------------+------------------+
  | 85          | CONTRACT         |
  +-------------+------------------+
  | 86          | ISNAT            |
  +-------------+------------------+
  | 87          | CAST             |
  +-------------+------------------+
  | 88          | RENAME           |
  +-------------+------------------+
  | 89          | bool             |
  +-------------+------------------+
  | 90          | contract         |
  +-------------+------------------+
  | 91          | int              |
  +-------------+------------------+
  | 92          | key              |
  +-------------+------------------+
  | 93          | key_hash         |
  +-------------+------------------+
  | 94          | lambda           |
  +-------------+------------------+
  | 95          | list             |
  +-------------+------------------+
  | 96          | map              |
  +-------------+------------------+
  | 97          | big_map          |
  +-------------+------------------+
  | 98          | nat              |
  +-------------+------------------+
  | 99          | option           |
  +-------------+------------------+
  | 100         | or               |
  +-------------+------------------+
  | 101         | pair             |
  +-------------+------------------+
  | 102         | set              |
  +-------------+------------------+
  | 103         | signature        |
  +-------------+------------------+
  | 104         | string           |
  +-------------+------------------+
  | 105         | bytes            |
  +-------------+------------------+
  | 106         | mutez            |
  +-------------+------------------+
  | 107         | timestamp        |
  +-------------+------------------+
  | 108         | unit             |
  +-------------+------------------+
  | 109         | operation        |
  +-------------+------------------+
  | 110         | address          |
  +-------------+------------------+
  | 111         | SLICE            |
  +-------------+------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  micheline.michelson_v1.expression (Determined from data, 8-bit tag)
  *******************************************************************

  Int (tag 0)
  ===========

  +------+----------------------+------------------------+
  | Name | Size                 | Contents               |
  +======+======================+========================+
  | Tag  | 1 byte               | unsigned 8-bit integer |
  +------+----------------------+------------------------+
  | int  | Determined from data | $Z.t                   |
  +------+----------------------+------------------------+


  String (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | string                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Sequence (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------+
  | Name                  | Size     | Contents                                       |
  +=======================+==========+================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                         |
  +-----------------------+----------+------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                        |
  +-----------------------+----------+------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of $micheline.michelson_v1.expression |
  +-----------------------+----------+------------------------------------------------+


  Prim (no args, annot) (tag 3)
  =============================

  +------+--------+------------------------------------------------------------------------------+
  | Name | Size   | Contents                                                                     |
  +======+========+==============================================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                                       |
  +------+--------+------------------------------------------------------------------------------+
  | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+--------+------------------------------------------------------------------------------+


  Prim (no args + annot) (tag 4)
  ==============================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Prim (1 arg, no annot) (tag 5)
  ==============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg  | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (1 arg + annot) (tag 6)
  ============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg                   | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args, no annot) (tag 7)
  ===============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg1 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg2 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args + annot) (tag 8)
  =============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg1                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg2                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Generic prim (any number of args with or without annot) (tag 9)
  ===============================================================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | args                  | Variable | sequence of $micheline.michelson_v1.expression                               |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Bytes (tag 10)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | bytes                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET ../<block_id>/context/delegates?[active]&[inactive]

Lists all registered delegates.

Optional query arguments :

  • active
  • inactive

  [ $Signature.Public_key_hash ... ]
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  +-----------------------+----------+------------------------------+
  | Name                  | Size     | Contents                     |
  +=======================+==========+==============================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer      |
  +-----------------------+----------+------------------------------+
  | Unnamed field 0       | Variable | sequence of $public_key_hash |
  +-----------------------+----------+------------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+

  

GET ../<block_id>/context/delegates/<pkh>

Everything about a delegate.

  { "balance": $mutez,
    "frozen_balance": $mutez,
    "frozen_balance_by_cycle":
      [ { "cycle": integer ∈ [-2^31-2, 2^31+2],
          "deposit": $mutez,
          "fees": $mutez,
          "rewards": $mutez } ... ],
    "staking_balance": $mutez,
    "delegated_contracts": [ $Contract_hash ... ],
    "delegated_balance": $mutez,
    "deactivated": boolean,
    "grace_period": integer ∈ [-2^31-2, 2^31+2] }
  $Contract_hash:
    /* A contract ID (Base58Check-encoded) */
    string
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +-------------------------+----------------------+-------------------------------------+
  | Name                    | Size                 | Contents                            |
  +=========================+======================+=====================================+
  | balance                 | Determined from data | $N.t                                |
  +-------------------------+----------------------+-------------------------------------+
  | frozen_balance          | Determined from data | $N.t                                |
  +-------------------------+----------------------+-------------------------------------+
  | # bytes in next field   | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------+----------------------+-------------------------------------+
  | frozen_balance_by_cycle | Variable             | sequence of $X_0                    |
  +-------------------------+----------------------+-------------------------------------+
  | staking_balance         | Determined from data | $N.t                                |
  +-------------------------+----------------------+-------------------------------------+
  | # bytes in next field   | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------+----------------------+-------------------------------------+
  | delegated_contracts     | Variable             | sequence of bytes                   |
  +-------------------------+----------------------+-------------------------------------+
  | delegated_balance       | Determined from data | $N.t                                |
  +-------------------------+----------------------+-------------------------------------+
  | deactivated             | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------+----------------------+-------------------------------------+
  | grace_period            | 4 bytes              | signed 32-bit integer               |
  +-------------------------+----------------------+-------------------------------------+


  X_0
  ***

  +---------+----------------------+-----------------------+
  | Name    | Size                 | Contents              |
  +=========+======================+=======================+
  | cycle   | 4 bytes              | signed 32-bit integer |
  +---------+----------------------+-----------------------+
  | deposit | Determined from data | $N.t                  |
  +---------+----------------------+-----------------------+
  | fees    | Determined from data | $N.t                  |
  +---------+----------------------+-----------------------+
  | rewards | Determined from data | $N.t                  |
  +---------+----------------------+-----------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

GET ../<block_id>/context/delegates/<pkh>/balance

Returns the full balance of a given delegate, including the frozen balances.

  $mutez
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $N.t     |
  +-----------------+----------------------+----------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

GET ../<block_id>/context/delegates/<pkh>/deactivated

Tells whether the delegate is currently tagged as deactivated or not.

  boolean
  +-----------------+--------+-------------------------------------+
  | Name            | Size   | Contents                            |
  +=================+========+=====================================+
  | Unnamed field 0 | 1 byte | boolean (0 for false, 255 for true) |
  +-----------------+--------+-------------------------------------+


  

GET ../<block_id>/context/delegates/<pkh>/delegated_balance

Returns the balances of all the contracts that delegate to a given delegate. This excludes the delegate's own balance and its frozen balances.

  $mutez
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $N.t     |
  +-----------------+----------------------+----------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

GET ../<block_id>/context/delegates/<pkh>/delegated_contracts

Returns the list of contracts that delegate to a given delegate.

  [ $Contract_hash ... ]
  $Contract_hash:
    /* A contract ID (Base58Check-encoded) */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  

GET ../<block_id>/context/delegates/<pkh>/frozen_balance

Returns the total frozen balances of a given delegate, this includes the frozen deposits, rewards and fees.

  $mutez
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $N.t     |
  +-----------------+----------------------+----------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

GET ../<block_id>/context/delegates/<pkh>/frozen_balance_by_cycle

Returns the frozen balances of a given delegate, indexed by the cycle by which it will be unfrozen

  [ { "cycle": integer ∈ [-2^31-2, 2^31+2],
      "deposit": $mutez,
      "fees": $mutez,
      "rewards": $mutez } ... ]
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  X_0
  ***

  +---------+----------------------+-----------------------+
  | Name    | Size                 | Contents              |
  +=========+======================+=======================+
  | cycle   | 4 bytes              | signed 32-bit integer |
  +---------+----------------------+-----------------------+
  | deposit | Determined from data | $N.t                  |
  +---------+----------------------+-----------------------+
  | fees    | Determined from data | $N.t                  |
  +---------+----------------------+-----------------------+
  | rewards | Determined from data | $N.t                  |
  +---------+----------------------+-----------------------+

  

GET ../<block_id>/context/delegates/<pkh>/grace_period

Returns the cycle by the end of which the delegate might be deactivated if she fails to execute any delegate action. A deactivated delegate might be reactivated (without loosing any rolls) by simply re-registering as a delegate. For deactivated delegates, this value contains the cycle by which they were deactivated.

  integer ∈ [-2^31-2, 2^31+2]
  +-----------------+---------+-----------------------+
  | Name            | Size    | Contents              |
  +=================+=========+=======================+
  | Unnamed field 0 | 4 bytes | signed 32-bit integer |
  +-----------------+---------+-----------------------+


  

GET ../<block_id>/context/delegates/<pkh>/staking_balance

Returns the total amount of tokens delegated to a given delegate. This includes the balances of all the contracts that delegate to it, but also the balance of the delegate itself and its frozen fees and deposits. The rewards do not count in the delegated balance until they are unfrozen.

  $mutez
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $N.t     |
  +-----------------+----------------------+----------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  

GET ../<block_id>/context/nonces/<block_level>

Info about the nonce of a previous block.

  { "nonce": /^[a-zA-Z0-9]+$/ } || { "hash": $cycle_nonce } || {  }
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_0     |
  +-----------------+----------------------+----------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Revealed (tag 0)
  ================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | nonce | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Missing (tag 1)
  ===============

  +------+----------+------------------------+
  | Name | Size     | Contents               |
  +======+==========+========================+
  | Tag  | 1 byte   | unsigned 8-bit integer |
  +------+----------+------------------------+
  | hash | 32 bytes | bytes                  |
  +------+----------+------------------------+


  Forgotten (tag 2)
  =================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+

  

GET ../<block_id>/context/raw/bytes?[depth=<int>]

Returns the raw context.

Optional query arguments :

  • depth = <int>

  $raw_context
  $raw_context: /^[a-zA-Z0-9]+$/ || { *: $raw_context } || null
  +-----------------+----------------------+--------------+
  | Name            | Size                 | Contents     |
  +=================+======================+==============+
  | Unnamed field 0 | Determined from data | $raw_context |
  +-----------------+----------------------+--------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +-----------------+----------------------+--------------+
  | Name            | Size                 | Contents     |
  +=================+======================+==============+
  | Unnamed field 0 | Determined from data | $X_1         |
  +-----------------+----------------------+--------------+
  | Unnamed field 1 | Determined from data | $raw_context |
  +-----------------+----------------------+--------------+


  raw_context (Determined from data, 8-bit tag)
  *********************************************

  Key (tag 0)
  ===========

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Dir (tag 1)
  ===========

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  Cut (tag 2)
  ===========

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+

  

POST ../<block_id>/context/seed

Seed of the cycle to which the block belongs.

  {  }
  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  
  /^[a-zA-Z0-9]+$/
  +-----------------+----------+----------+
  | Name            | Size     | Contents |
  +=================+==========+==========+
  | Unnamed field 0 | 32 bytes | bytes    |
  +-----------------+----------+----------+


  

GET ../<block_id>/hash

The block's hash, its unique identifier.

  $block_hash
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  +------------+----------+----------+
  | Name       | Size     | Contents |
  +============+==========+==========+
  | block_hash | 32 bytes | bytes    |
  +------------+----------+----------+


  

GET ../<block_id>/header

The whole block header.

  $block_header
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    string
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header:
    { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
      "chain_id": $Chain_id,
      "hash": $block_hash,
      "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | chain_id                              | 4 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | hash                                  | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | level                                 | 4 bytes  | signed 32-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | proto                                 | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | predecessor                           | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | timestamp                             | 8 bytes  | signed 64-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | validation_pass                       | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | operations_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | # bytes in field "fitness"            | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | fitness                               | Variable | sequence of $fitness.elem           |
  +---------------------------------------+----------+-------------------------------------+
  | context                               | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET ../<block_id>/header/protocol_data

The version-specific fragment of the block header.

  { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
    "priority": integer ∈ [0, 2^16-1],
    "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
    "seed_nonce_hash"?: $cycle_nonce,
    "signature": $Signature }
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  

GET ../<block_id>/header/protocol_data/raw

The version-specific fragment of the block header (unparsed).

  /^[a-zA-Z0-9]+$/
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

GET ../<block_id>/header/raw

The whole block header (unparsed).

  /^[a-zA-Z0-9]+$/
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

GET ../<block_id>/header/shell

The shell-specific fragment of the block header.

  $block_header.shell
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header.shell:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash }
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET ../<block_id>/helpers/baking_rights?(level=<block_level>)*&(cycle=<block_cycle>)*&(delegate=<pkh>)*&[max_priority=<int>]&[all]

Retrieves the list of delegates allowed to bake a block. By default, it gives the best baking priorities for bakers that have at least one opportunity below the 64th priority for the next block. Parameters `level` and `cycle` can be used to specify the (valid) level(s) in the past or future at which the baking rights have to be returned. Parameter `delegate` can be used to restrict the results to the given delegates. If parameter `all` is set, all the baking opportunities for each baker at each level are returned, instead of just the first one. Returns the list of baking slots. Also returns the minimal timestamps that correspond to these slots. The timestamps are omitted for levels in the past, and are only estimates for levels later that the next block, based on the hypothesis that all predecessor blocks were baked at the first priority.

Optional query arguments :

  • level = <block_level>
  • cycle = <block_cycle>
  • delegate = <pkh>
  • max_priority = <int>
  • all

  [ { "level": integer ∈ [-2^31-2, 2^31+2],
      "delegate": $Signature.Public_key_hash,
      "priority": integer ∈ [0, 2^16-1],
      "estimated_time"?: $timestamp } ... ]
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  X_0
  ***

  +--------------------------------------+----------+-------------------------------------+
  | Name                                 | Size     | Contents                            |
  +======================================+==========+=====================================+
  | level                                | 4 bytes  | signed 32-bit integer               |
  +--------------------------------------+----------+-------------------------------------+
  | delegate                             | 21 bytes | $public_key_hash                    |
  +--------------------------------------+----------+-------------------------------------+
  | priority                             | 2 bytes  | unsigned 16-bit integer             |
  +--------------------------------------+----------+-------------------------------------+
  | ? presence of field "estimated_time" | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------------+----------+-------------------------------------+
  | estimated_time                       | 8 bytes  | signed 64-bit integer               |
  +--------------------------------------+----------+-------------------------------------+

  

GET ../<block_id>/helpers/complete/<prefix>

Try to complete a prefix of a Base58Check-encoded data. This RPC is actually able to complete hashes of block, operations, public_keys and contracts.

  [ string ... ]
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  

GET ../<block_id>/helpers/current_level?[offset=<int32>]

Returns the level of the interrogated block, or the one of a block located `offset` blocks after in the chain (or before when negative). For instance, the next block if `offset` is 1.

Optional query arguments :

  • offset = <int32>

  { "level": integer ∈ [-2^31-2, 2^31+2],
    "level_position": integer ∈ [-2^31-2, 2^31+2],
    "cycle": integer ∈ [-2^31-2, 2^31+2],
    "cycle_position": integer ∈ [-2^31-2, 2^31+2],
    "voting_period": integer ∈ [-2^31-2, 2^31+2],
    "voting_period_position": integer ∈ [-2^31-2, 2^31+2],
    "expected_commitment": boolean }
  +------------------------+---------+-------------------------------------+
  | Name                   | Size    | Contents                            |
  +========================+=========+=====================================+
  | level                  | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | level_position         | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | cycle                  | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | cycle_position         | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | voting_period          | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | voting_period_position | 4 bytes | signed 32-bit integer               |
  +------------------------+---------+-------------------------------------+
  | expected_commitment    | 1 byte  | boolean (0 for false, 255 for true) |
  +------------------------+---------+-------------------------------------+


  

GET ../<block_id>/helpers/endorsing_rights?(level=<block_level>)*&(cycle=<block_cycle>)*&(delegate=<pkh>)*

Retrieves the delegates allowed to endorse a block. By default, it gives the endorsement slots for delegates that have at least one in the next block. Parameters `level` and `cycle` can be used to specify the (valid) level(s) in the past or future at which the endorsement rights have to be returned. Parameter `delegate` can be used to restrict the results to the given delegates. Returns the list of endorsement slots. Also returns the minimal timestamps that correspond to these slots. The timestamps are omitted for levels in the past, and are only estimates for levels later that the next block, based on the hypothesis that all predecessor blocks were baked at the first priority.

Optional query arguments :

  • level = <block_level>
  • cycle = <block_cycle>
  • delegate = <pkh>

  [ { "level": integer ∈ [-2^31-2, 2^31+2],
      "delegate": $Signature.Public_key_hash,
      "slots": [ integer ∈ [0, 2^16-1] ... ],
      "estimated_time"?: $timestamp } ... ]
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  X_0
  ***

  +--------------------------------------+----------+-------------------------------------+
  | Name                                 | Size     | Contents                            |
  +======================================+==========+=====================================+
  | level                                | 4 bytes  | signed 32-bit integer               |
  +--------------------------------------+----------+-------------------------------------+
  | delegate                             | 21 bytes | $public_key_hash                    |
  +--------------------------------------+----------+-------------------------------------+
  | # bytes in next field                | 4 bytes  | unsigned 30-bit integer             |
  +--------------------------------------+----------+-------------------------------------+
  | slots                                | Variable | sequence of unsigned 16-bit integer |
  +--------------------------------------+----------+-------------------------------------+
  | ? presence of field "estimated_time" | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------------+----------+-------------------------------------+
  | estimated_time                       | 8 bytes  | signed 64-bit integer               |
  +--------------------------------------+----------+-------------------------------------+

  

POST ../<block_id>/helpers/forge/operations

Forge an operation

  $operation.alpha.unsigned_operation
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    string
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $contract_id:
    /* A contract handle
       A contract notation as given to an RPC or inside scripts. Can be a
       base58 implicit contract hash or a base58 originated contract hash. */
    string
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $inlined.endorsement:
    { "branch": $block_hash,
      "operations": $inlined.endorsement.contents,
      "signature"?: $Signature }
  $inlined.endorsement.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $operation.alpha.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
    || { "kind": "seed_nonce_revelation",
         "level": integer ∈ [-2^31-2, 2^31+2],
         "nonce": /^[a-zA-Z0-9]+$/ }
    || { "kind": "double_endorsement_evidence",
         "op1": $inlined.endorsement,
         "op2": $inlined.endorsement }
    || { "kind": "double_baking_evidence",
         "bh1": $block_header.alpha.full_header,
         "bh2": $block_header.alpha.full_header }
    || { "kind": "activate_account",
         "pkh": $Ed25519.Public_key_hash,
         "secret": /^[a-zA-Z0-9]+$/ }
    || { "kind": "proposals",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposals": [ $Protocol_hash ... ] }
    || { "kind": "ballot",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposal": $Protocol_hash,
         "ballot": "nay" | "yay" | "pass" }
    || { "kind": "reveal",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression }
    || { "kind": "origination",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts }
    || { "kind": "delegation",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "delegate"?: $Signature.Public_key_hash }
  $operation.alpha.unsigned_operation:
    { "branch": $block_hash,
      "contents": [ $operation.alpha.contents ... ] }
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +----------+----------+---------------------------------------+
  | Name     | Size     | Contents                              |
  +==========+==========+=======================================+
  | branch   | 32 bytes | bytes                                 |
  +----------+----------+---------------------------------------+
  | contents | Variable | sequence of $operation.alpha.contents |
  +----------+----------+---------------------------------------+


  scripted.contracts
  ******************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  contract_id (22 bytes, 8-bit tag)
  *********************************

  Implicit (tag 0)
  ================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash       |
  +---------------------------+----------+------------------------+


  Originated (tag 1)
  ==================

  +---------------+----------+------------------------+
  | Name          | Size     | Contents               |
  +===============+==========+========================+
  | Tag           | 1 byte   | unsigned 8-bit integer |
  +---------------+----------+------------------------+
  | Contract_hash | 20 bytes | bytes                  |
  +---------------+----------+------------------------+
  | padding       | 1 byte   | padding                |
  +---------------+----------+------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  public_key (Determined from data, 8-bit tag)
  ********************************************

  Ed25519 (tag 0)
  ===============

  +--------------------+----------+------------------------+
  | Name               | Size     | Contents               |
  +====================+==========+========================+
  | Tag                | 1 byte   | unsigned 8-bit integer |
  +--------------------+----------+------------------------+
  | Ed25519.Public_key | 32 bytes | bytes                  |
  +--------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | Secp256k1.Public_key | 33 bytes | bytes                  |
  +----------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | P256.Public_key | 33 bytes | bytes                  |
  +-----------------+----------+------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  block_header.alpha.full_header
  ******************************

  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | level                                 | 4 bytes  | signed 32-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | proto                                 | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | predecessor                           | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | timestamp                             | 8 bytes  | signed 64-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | validation_pass                       | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | operations_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | # bytes in field "fitness"            | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | fitness                               | Variable | sequence of $fitness.elem           |
  +---------------------------------------+----------+-------------------------------------+
  | context                               | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  inlined.endorsement.contents (5 bytes, 8-bit tag)
  *************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  inlined.endorsement
  *******************

  +------------+----------+-------------------------------+
  | Name       | Size     | Contents                      |
  +============+==========+===============================+
  | branch     | 32 bytes | bytes                         |
  +------------+----------+-------------------------------+
  | operations | 5 bytes  | $inlined.endorsement.contents |
  +------------+----------+-------------------------------+
  | signature  | Variable | bytes                         |
  +------------+----------+-------------------------------+


  operation.alpha.contents (Determined from data, 8-bit tag)
  **********************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  Seed_nonce_revelation (tag 1)
  =============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | level | 4 bytes  | signed 32-bit integer  |
  +-------+----------+------------------------+
  | nonce | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Double_endorsement_evidence (tag 2)
  ===================================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op1                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op2                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+


  Double_baking_evidence (tag 3)
  ==============================

  +-----------------------+----------------------+---------------------------------+
  | Name                  | Size                 | Contents                        |
  +=======================+======================+=================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer          |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh1                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh2                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+


  Activate_account (tag 4)
  ========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | pkh    | 20 bytes | bytes                  |
  +--------+----------+------------------------+
  | secret | 20 bytes | bytes                  |
  +--------+----------+------------------------+


  Proposals (tag 5)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | source                | 21 bytes | $public_key_hash        |
  +-----------------------+----------+-------------------------+
  | period                | 4 bytes  | signed 32-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | proposals             | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  Ballot (tag 6)
  ==============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | source   | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | period   | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+
  | proposal | 32 bytes | bytes                  |
  +----------+----------+------------------------+
  | ballot   | 1 byte   | signed 8-bit integer   |
  +----------+----------+------------------------+


  Reveal (tag 7)
  ==============

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 22 bytes             | $contract_id           |
  +---------------+----------------------+------------------------+
  | fee           | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | counter       | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | gas_limit     | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | storage_limit | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | public_key    | Determined from data | $public_key            |
  +---------------+----------------------+------------------------+


  Transaction (tag 8)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | fee                              | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | counter                          | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | gas_limit                        | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | storage_limit                    | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                       |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 9)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 10)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+

  
  /^[a-zA-Z0-9]+$/
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

POST ../<block_id>/helpers/forge/protocol_data

Forge the protocol-specific part of a block header

  { "priority": integer ∈ [0, 2^16-1],
    "nonce_hash"?: $cycle_nonce,
    "proof_of_work_nonce"?: /^[a-zA-Z0-9]+$/ }
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  +----------------------------------+----------+-------------------------------------+
  | Name                             | Size     | Contents                            |
  +==================================+==========+=====================================+
  | priority                         | 2 bytes  | unsigned 16-bit integer             |
  +----------------------------------+----------+-------------------------------------+
  | ? presence of field "nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +----------------------------------+----------+-------------------------------------+
  | nonce_hash                       | 32 bytes | bytes                               |
  +----------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce              | 8 bytes  | bytes                               |
  +----------------------------------+----------+-------------------------------------+


  
  { "protocol_data": /^[a-zA-Z0-9]+$/ }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | protocol_data         | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

POST ../<block_id>/helpers/forge_block_header

Forge a block header

  { "level": integer ∈ [-2^31-2, 2^31+2],
    "proto": integer ∈ [0, 255],
    "predecessor": $block_hash,
    "timestamp": $timestamp,
    "validation_pass": integer ∈ [0, 255],
    "operations_hash": $Operation_list_list_hash,
    "fitness": $fitness,
    "context": $Context_hash,
    "protocol_data": /^[a-zA-Z0-9]+$/ }
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | protocol_data              | Variable | bytes                     |
  +----------------------------+----------+---------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  
  { "block": /^[a-zA-Z0-9]+$/ }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | block                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

GET ../<block_id>/helpers/levels_in_current_cycle?[offset=<int32>]

Levels of a cycle

Optional query arguments :

  • offset = <int32>

  { "first": integer ∈ [-2^31-2, 2^31+2],
    "last": integer ∈ [-2^31-2, 2^31+2] }
  +-------+---------+-----------------------+
  | Name  | Size    | Contents              |
  +=======+=========+=======================+
  | first | 4 bytes | signed 32-bit integer |
  +-------+---------+-----------------------+
  | last  | 4 bytes | signed 32-bit integer |
  +-------+---------+-----------------------+


  

POST ../<block_id>/helpers/parse/block

Parse a block

  { "level": integer ∈ [-2^31-2, 2^31+2],
    "proto": integer ∈ [0, 255],
    "predecessor": $block_hash,
    "timestamp": $timestamp,
    "validation_pass": integer ∈ [0, 255],
    "operations_hash": $Operation_list_list_hash,
    "fitness": $fitness,
    "context": $Context_hash,
    "protocol_data": /^[a-zA-Z0-9]+$/ }
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | protocol_data              | Variable | bytes                     |
  +----------------------------+----------+---------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+

  
  $block_header.alpha.signed_contents
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $block_header.alpha.signed_contents:
    { "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  

POST ../<block_id>/helpers/parse/operations

Parse operations

  { "operations": [ { "branch": $block_hash,
                      "data": /^[a-zA-Z0-9]+$/ } ... ],
    "check_signature"?: boolean }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | # bytes in next field                 | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | operations                            | Variable | sequence of $X_0                    |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "check_signature" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | check_signature                       | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+


  X_0
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | branch                   | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | data                     | Variable | bytes                   |
  +--------------------------+----------+-------------------------+

  
  [ { "branch": $block_hash,
      "contents": [ $operation.alpha.contents ... ],
      "signature": $Signature } ... ]
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    string
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $contract_id:
    /* A contract handle
       A contract notation as given to an RPC or inside scripts. Can be a
       base58 implicit contract hash or a base58 originated contract hash. */
    string
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $inlined.endorsement:
    { "branch": $block_hash,
      "operations": $inlined.endorsement.contents,
      "signature"?: $Signature }
  $inlined.endorsement.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $operation.alpha.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
    || { "kind": "seed_nonce_revelation",
         "level": integer ∈ [-2^31-2, 2^31+2],
         "nonce": /^[a-zA-Z0-9]+$/ }
    || { "kind": "double_endorsement_evidence",
         "op1": $inlined.endorsement,
         "op2": $inlined.endorsement }
    || { "kind": "double_baking_evidence",
         "bh1": $block_header.alpha.full_header,
         "bh2": $block_header.alpha.full_header }
    || { "kind": "activate_account",
         "pkh": $Ed25519.Public_key_hash,
         "secret": /^[a-zA-Z0-9]+$/ }
    || { "kind": "proposals",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposals": [ $Protocol_hash ... ] }
    || { "kind": "ballot",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposal": $Protocol_hash,
         "ballot": "nay" | "yay" | "pass" }
    || { "kind": "reveal",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression }
    || { "kind": "origination",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts }
    || { "kind": "delegation",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "delegate"?: $Signature.Public_key_hash }
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  scripted.contracts
  ******************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  contract_id (22 bytes, 8-bit tag)
  *********************************

  Implicit (tag 0)
  ================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash       |
  +---------------------------+----------+------------------------+


  Originated (tag 1)
  ==================

  +---------------+----------+------------------------+
  | Name          | Size     | Contents               |
  +===============+==========+========================+
  | Tag           | 1 byte   | unsigned 8-bit integer |
  +---------------+----------+------------------------+
  | Contract_hash | 20 bytes | bytes                  |
  +---------------+----------+------------------------+
  | padding       | 1 byte   | padding                |
  +---------------+----------+------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  public_key (Determined from data, 8-bit tag)
  ********************************************

  Ed25519 (tag 0)
  ===============

  +--------------------+----------+------------------------+
  | Name               | Size     | Contents               |
  +====================+==========+========================+
  | Tag                | 1 byte   | unsigned 8-bit integer |
  +--------------------+----------+------------------------+
  | Ed25519.Public_key | 32 bytes | bytes                  |
  +--------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | Secp256k1.Public_key | 33 bytes | bytes                  |
  +----------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | P256.Public_key | 33 bytes | bytes                  |
  +-----------------+----------+------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  block_header.alpha.full_header
  ******************************

  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | level                                 | 4 bytes  | signed 32-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | proto                                 | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | predecessor                           | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | timestamp                             | 8 bytes  | signed 64-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | validation_pass                       | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | operations_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | # bytes in field "fitness"            | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | fitness                               | Variable | sequence of $fitness.elem           |
  +---------------------------------------+----------+-------------------------------------+
  | context                               | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  inlined.endorsement.contents (5 bytes, 8-bit tag)
  *************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  inlined.endorsement
  *******************

  +------------+----------+-------------------------------+
  | Name       | Size     | Contents                      |
  +============+==========+===============================+
  | branch     | 32 bytes | bytes                         |
  +------------+----------+-------------------------------+
  | operations | 5 bytes  | $inlined.endorsement.contents |
  +------------+----------+-------------------------------+
  | signature  | Variable | bytes                         |
  +------------+----------+-------------------------------+


  operation.alpha.contents (Determined from data, 8-bit tag)
  **********************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  Seed_nonce_revelation (tag 1)
  =============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | level | 4 bytes  | signed 32-bit integer  |
  +-------+----------+------------------------+
  | nonce | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Double_endorsement_evidence (tag 2)
  ===================================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op1                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op2                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+


  Double_baking_evidence (tag 3)
  ==============================

  +-----------------------+----------------------+---------------------------------+
  | Name                  | Size                 | Contents                        |
  +=======================+======================+=================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer          |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh1                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh2                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+


  Activate_account (tag 4)
  ========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | pkh    | 20 bytes | bytes                  |
  +--------+----------+------------------------+
  | secret | 20 bytes | bytes                  |
  +--------+----------+------------------------+


  Proposals (tag 5)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | source                | 21 bytes | $public_key_hash        |
  +-----------------------+----------+-------------------------+
  | period                | 4 bytes  | signed 32-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | proposals             | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  Ballot (tag 6)
  ==============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | source   | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | period   | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+
  | proposal | 32 bytes | bytes                  |
  +----------+----------+------------------------+
  | ballot   | 1 byte   | signed 8-bit integer   |
  +----------+----------+------------------------+


  Reveal (tag 7)
  ==============

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 22 bytes             | $contract_id           |
  +---------------+----------------------+------------------------+
  | fee           | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | counter       | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | gas_limit     | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | storage_limit | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | public_key    | Determined from data | $public_key            |
  +---------------+----------------------+------------------------+


  Transaction (tag 8)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | fee                              | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | counter                          | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | gas_limit                        | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | storage_limit                    | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                       |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 9)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 10)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+


  X_0
  ***

  +--------------------------+----------+---------------------------------------+
  | Name                     | Size     | Contents                              |
  +==========================+==========+=======================================+
  | # bytes in next 3 fields | 4 bytes  | unsigned 30-bit integer               |
  +--------------------------+----------+---------------------------------------+
  | branch                   | 32 bytes | bytes                                 |
  +--------------------------+----------+---------------------------------------+
  | contents                 | Variable | sequence of $operation.alpha.contents |
  +--------------------------+----------+---------------------------------------+
  | signature                | 64 bytes | bytes                                 |
  +--------------------------+----------+---------------------------------------+

  

POST ../<block_id>/helpers/preapply/block?[sort]&[timestamp=<date>]

Simulate the validation of a block that would contain the given operations and return the resulting fitness and context hash.

Optional query arguments :

  • sort
  • timestamp = <date>

  { "protocol_data":
      { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
        "priority": integer ∈ [0, 2^16-1],
        "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
        "seed_nonce_hash"?: $cycle_nonce,
        "signature": $Signature },
    "operations": [ [ $next_operation ... ] ... ] }
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    string
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $contract_id:
    /* A contract handle
       A contract notation as given to an RPC or inside scripts. Can be a
       base58 implicit contract hash or a base58 originated contract hash. */
    string
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $inlined.endorsement:
    { "branch": $block_hash,
      "operations": $inlined.endorsement.contents,
      "signature"?: $Signature }
  $inlined.endorsement.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $next_operation:
    { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
      "branch": $block_hash,
      "contents": [ $operation.alpha.contents ... ],
      "signature": $Signature }
  $operation.alpha.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
    || { "kind": "seed_nonce_revelation",
         "level": integer ∈ [-2^31-2, 2^31+2],
         "nonce": /^[a-zA-Z0-9]+$/ }
    || { "kind": "double_endorsement_evidence",
         "op1": $inlined.endorsement,
         "op2": $inlined.endorsement }
    || { "kind": "double_baking_evidence",
         "bh1": $block_header.alpha.full_header,
         "bh2": $block_header.alpha.full_header }
    || { "kind": "activate_account",
         "pkh": $Ed25519.Public_key_hash,
         "secret": /^[a-zA-Z0-9]+$/ }
    || { "kind": "proposals",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposals": [ $Protocol_hash ... ] }
    || { "kind": "ballot",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposal": $Protocol_hash,
         "ballot": "nay" | "yay" | "pass" }
    || { "kind": "reveal",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression }
    || { "kind": "origination",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts }
    || { "kind": "delegation",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "delegate"?: $Signature.Public_key_hash }
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | protocol_data         | Determined from data | $X_0                    |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | operations            | Variable             | sequence of $X_1        |
  +-----------------------+----------------------+-------------------------+


  X_0
  ***

  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | # bytes in next 5 fields              | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  scripted.contracts
  ******************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  contract_id (22 bytes, 8-bit tag)
  *********************************

  Implicit (tag 0)
  ================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash       |
  +---------------------------+----------+------------------------+


  Originated (tag 1)
  ==================

  +---------------+----------+------------------------+
  | Name          | Size     | Contents               |
  +===============+==========+========================+
  | Tag           | 1 byte   | unsigned 8-bit integer |
  +---------------+----------+------------------------+
  | Contract_hash | 20 bytes | bytes                  |
  +---------------+----------+------------------------+
  | padding       | 1 byte   | padding                |
  +---------------+----------+------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  public_key (Determined from data, 8-bit tag)
  ********************************************

  Ed25519 (tag 0)
  ===============

  +--------------------+----------+------------------------+
  | Name               | Size     | Contents               |
  +====================+==========+========================+
  | Tag                | 1 byte   | unsigned 8-bit integer |
  +--------------------+----------+------------------------+
  | Ed25519.Public_key | 32 bytes | bytes                  |
  +--------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | Secp256k1.Public_key | 33 bytes | bytes                  |
  +----------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | P256.Public_key | 33 bytes | bytes                  |
  +-----------------+----------+------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  block_header.alpha.full_header
  ******************************

  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | level                                 | 4 bytes  | signed 32-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | proto                                 | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | predecessor                           | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | timestamp                             | 8 bytes  | signed 64-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | validation_pass                       | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | operations_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | # bytes in field "fitness"            | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | fitness                               | Variable | sequence of $fitness.elem           |
  +---------------------------------------+----------+-------------------------------------+
  | context                               | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  inlined.endorsement.contents (5 bytes, 8-bit tag)
  *************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  inlined.endorsement
  *******************

  +------------+----------+-------------------------------+
  | Name       | Size     | Contents                      |
  +============+==========+===============================+
  | branch     | 32 bytes | bytes                         |
  +------------+----------+-------------------------------+
  | operations | 5 bytes  | $inlined.endorsement.contents |
  +------------+----------+-------------------------------+
  | signature  | Variable | bytes                         |
  +------------+----------+-------------------------------+


  operation.alpha.contents (Determined from data, 8-bit tag)
  **********************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  Seed_nonce_revelation (tag 1)
  =============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | level | 4 bytes  | signed 32-bit integer  |
  +-------+----------+------------------------+
  | nonce | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Double_endorsement_evidence (tag 2)
  ===================================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op1                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op2                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+


  Double_baking_evidence (tag 3)
  ==============================

  +-----------------------+----------------------+---------------------------------+
  | Name                  | Size                 | Contents                        |
  +=======================+======================+=================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer          |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh1                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh2                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+


  Activate_account (tag 4)
  ========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | pkh    | 20 bytes | bytes                  |
  +--------+----------+------------------------+
  | secret | 20 bytes | bytes                  |
  +--------+----------+------------------------+


  Proposals (tag 5)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | source                | 21 bytes | $public_key_hash        |
  +-----------------------+----------+-------------------------+
  | period                | 4 bytes  | signed 32-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | proposals             | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  Ballot (tag 6)
  ==============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | source   | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | period   | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+
  | proposal | 32 bytes | bytes                  |
  +----------+----------+------------------------+
  | ballot   | 1 byte   | signed 8-bit integer   |
  +----------+----------+------------------------+


  Reveal (tag 7)
  ==============

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 22 bytes             | $contract_id           |
  +---------------+----------------------+------------------------+
  | fee           | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | counter       | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | gas_limit     | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | storage_limit | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | public_key    | Determined from data | $public_key            |
  +---------------+----------------------+------------------------+


  Transaction (tag 8)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | fee                              | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | counter                          | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | gas_limit                        | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | storage_limit                    | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                       |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 9)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 10)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+


  next_operation
  **************

  +--------------------------+----------+---------------------------------------+
  | Name                     | Size     | Contents                              |
  +==========================+==========+=======================================+
  | # bytes in next field    | 4 bytes  | unsigned 30-bit integer               |
  +--------------------------+----------+---------------------------------------+
  | branch                   | 32 bytes | bytes                                 |
  +--------------------------+----------+---------------------------------------+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer               |
  +--------------------------+----------+---------------------------------------+
  | contents                 | Variable | sequence of $operation.alpha.contents |
  +--------------------------+----------+---------------------------------------+
  | signature                | 64 bytes | bytes                                 |
  +--------------------------+----------+---------------------------------------+


  X_1
  ***

  +--------------------------+----------+-----------------------------+
  | Name                     | Size     | Contents                    |
  +==========================+==========+=============================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer     |
  +--------------------------+----------+-----------------------------+
  | # bytes in next field    | 4 bytes  | unsigned 30-bit integer     |
  +--------------------------+----------+-----------------------------+
  | Unnamed field 0          | Variable | sequence of $next_operation |
  +--------------------------+----------+-----------------------------+

  
  { "shell_header": $block_header.shell,
    "operations":
      [ { "applied":
            [ { "hash": $Operation_hash,
                "branch": $block_hash,
                "data": /^[a-zA-Z0-9]+$/ } ... ],
          "refused":
            [ { "hash": $Operation_hash,
                "branch": $block_hash,
                "data": /^[a-zA-Z0-9]+$/,
                "error": $error } ... ],
          "branch_refused":
            [ { "hash": $Operation_hash,
                "branch": $block_hash,
                "data": /^[a-zA-Z0-9]+$/,
                "error": $error } ... ],
          "branch_delayed":
            [ { "hash": $Operation_hash,
                "branch": $block_hash,
                "data": /^[a-zA-Z0-9]+$/,
                "error": $error } ... ] } ... ] }
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header.shell:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash }
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | shell_header          | Determined from data | $block_header.shell     |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | operations            | Variable             | sequence of $X_0        |
  +-----------------------+----------------------+-------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  block_header.shell
  ******************

  +----------------------------+----------+---------------------------+
  | Name                       | Size     | Contents                  |
  +============================+==========+===========================+
  | level                      | 4 bytes  | signed 32-bit integer     |
  +----------------------------+----------+---------------------------+
  | proto                      | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | predecessor                | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | timestamp                  | 8 bytes  | signed 64-bit integer     |
  +----------------------------+----------+---------------------------+
  | validation_pass            | 1 byte   | unsigned 8-bit integer    |
  +----------------------------+----------+---------------------------+
  | operations_hash            | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+
  | # bytes in field "fitness" | 4 bytes  | unsigned 30-bit integer   |
  +----------------------------+----------+---------------------------+
  | fitness                    | Variable | sequence of $fitness.elem |
  +----------------------------+----------+---------------------------+
  | context                    | 32 bytes | bytes                     |
  +----------------------------+----------+---------------------------+


  X_1
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | hash                     | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | branch                   | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | data                     | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_4
  ***

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | hash                     | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | branch                   | 32 bytes | bytes                   |
  +--------------------------+----------+-------------------------+
  | data                     | Variable | bytes                   |
  +--------------------------+----------+-------------------------+
  | # bytes in field "error" | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | error                    | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_0
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | applied               | Variable | sequence of $X_1        |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | refused               | Variable | sequence of $X_4        |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | branch_refused        | Variable | sequence of $X_4        |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | branch_delayed        | Variable | sequence of $X_4        |
  +-----------------------+----------+-------------------------+

  

POST ../<block_id>/helpers/preapply/operations

Simulate the validation of an operation.

  [ $next_operation ... ]
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    string
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $contract_id:
    /* A contract handle
       A contract notation as given to an RPC or inside scripts. Can be a
       base58 implicit contract hash or a base58 originated contract hash. */
    string
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $inlined.endorsement:
    { "branch": $block_hash,
      "operations": $inlined.endorsement.contents,
      "signature"?: $Signature }
  $inlined.endorsement.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $next_operation:
    { "protocol": "PsYLVpVvgbLhAhoqAkMFUo6gudkJ9weNXhUYCiLDzcUpFpkk8Wt",
      "branch": $block_hash,
      "contents": [ $operation.alpha.contents ... ],
      "signature": $Signature }
  $operation.alpha.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
    || { "kind": "seed_nonce_revelation",
         "level": integer ∈ [-2^31-2, 2^31+2],
         "nonce": /^[a-zA-Z0-9]+$/ }
    || { "kind": "double_endorsement_evidence",
         "op1": $inlined.endorsement,
         "op2": $inlined.endorsement }
    || { "kind": "double_baking_evidence",
         "bh1": $block_header.alpha.full_header,
         "bh2": $block_header.alpha.full_header }
    || { "kind": "activate_account",
         "pkh": $Ed25519.Public_key_hash,
         "secret": /^[a-zA-Z0-9]+$/ }
    || { "kind": "proposals",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposals": [ $Protocol_hash ... ] }
    || { "kind": "ballot",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposal": $Protocol_hash,
         "ballot": "nay" | "yay" | "pass" }
    || { "kind": "reveal",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression }
    || { "kind": "origination",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts }
    || { "kind": "delegation",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "delegate"?: $Signature.Public_key_hash }
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-----------------------------+
  | Name                  | Size     | Contents                    |
  +=======================+==========+=============================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer     |
  +-----------------------+----------+-----------------------------+
  | Unnamed field 0       | Variable | sequence of $next_operation |
  +-----------------------+----------+-----------------------------+


  scripted.contracts
  ******************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  contract_id (22 bytes, 8-bit tag)
  *********************************

  Implicit (tag 0)
  ================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash       |
  +---------------------------+----------+------------------------+


  Originated (tag 1)
  ==================

  +---------------+----------+------------------------+
  | Name          | Size     | Contents               |
  +===============+==========+========================+
  | Tag           | 1 byte   | unsigned 8-bit integer |
  +---------------+----------+------------------------+
  | Contract_hash | 20 bytes | bytes                  |
  +---------------+----------+------------------------+
  | padding       | 1 byte   | padding                |
  +---------------+----------+------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  public_key (Determined from data, 8-bit tag)
  ********************************************

  Ed25519 (tag 0)
  ===============

  +--------------------+----------+------------------------+
  | Name               | Size     | Contents               |
  +====================+==========+========================+
  | Tag                | 1 byte   | unsigned 8-bit integer |
  +--------------------+----------+------------------------+
  | Ed25519.Public_key | 32 bytes | bytes                  |
  +--------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | Secp256k1.Public_key | 33 bytes | bytes                  |
  +----------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | P256.Public_key | 33 bytes | bytes                  |
  +-----------------+----------+------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  block_header.alpha.full_header
  ******************************

  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | level                                 | 4 bytes  | signed 32-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | proto                                 | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | predecessor                           | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | timestamp                             | 8 bytes  | signed 64-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | validation_pass                       | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | operations_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | # bytes in field "fitness"            | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | fitness                               | Variable | sequence of $fitness.elem           |
  +---------------------------------------+----------+-------------------------------------+
  | context                               | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  inlined.endorsement.contents (5 bytes, 8-bit tag)
  *************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  inlined.endorsement
  *******************

  +------------+----------+-------------------------------+
  | Name       | Size     | Contents                      |
  +============+==========+===============================+
  | branch     | 32 bytes | bytes                         |
  +------------+----------+-------------------------------+
  | operations | 5 bytes  | $inlined.endorsement.contents |
  +------------+----------+-------------------------------+
  | signature  | Variable | bytes                         |
  +------------+----------+-------------------------------+


  operation.alpha.contents (Determined from data, 8-bit tag)
  **********************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  Seed_nonce_revelation (tag 1)
  =============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | level | 4 bytes  | signed 32-bit integer  |
  +-------+----------+------------------------+
  | nonce | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Double_endorsement_evidence (tag 2)
  ===================================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op1                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op2                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+


  Double_baking_evidence (tag 3)
  ==============================

  +-----------------------+----------------------+---------------------------------+
  | Name                  | Size                 | Contents                        |
  +=======================+======================+=================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer          |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh1                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh2                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+


  Activate_account (tag 4)
  ========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | pkh    | 20 bytes | bytes                  |
  +--------+----------+------------------------+
  | secret | 20 bytes | bytes                  |
  +--------+----------+------------------------+


  Proposals (tag 5)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | source                | 21 bytes | $public_key_hash        |
  +-----------------------+----------+-------------------------+
  | period                | 4 bytes  | signed 32-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | proposals             | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  Ballot (tag 6)
  ==============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | source   | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | period   | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+
  | proposal | 32 bytes | bytes                  |
  +----------+----------+------------------------+
  | ballot   | 1 byte   | signed 8-bit integer   |
  +----------+----------+------------------------+


  Reveal (tag 7)
  ==============

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 22 bytes             | $contract_id           |
  +---------------+----------------------+------------------------+
  | fee           | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | counter       | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | gas_limit     | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | storage_limit | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | public_key    | Determined from data | $public_key            |
  +---------------+----------------------+------------------------+


  Transaction (tag 8)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | fee                              | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | counter                          | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | gas_limit                        | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | storage_limit                    | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                       |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 9)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 10)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+


  next_operation
  **************

  +--------------------------+----------+---------------------------------------+
  | Name                     | Size     | Contents                              |
  +==========================+==========+=======================================+
  | # bytes in next field    | 4 bytes  | unsigned 30-bit integer               |
  +--------------------------+----------+---------------------------------------+
  | branch                   | 32 bytes | bytes                                 |
  +--------------------------+----------+---------------------------------------+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer               |
  +--------------------------+----------+---------------------------------------+
  | contents                 | Variable | sequence of $operation.alpha.contents |
  +--------------------------+----------+---------------------------------------+
  | signature                | 64 bytes | bytes                                 |
  +--------------------------+----------+---------------------------------------+

  
  [ $operation.alpha.operation_with_metadata ... ]
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    string
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    string
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    string
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    string
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    string
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    string
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    string
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "priority": integer ∈ [0, 2^16-1],
      "proof_of_work_nonce": /^[a-zA-Z0-9]+$/,
      "seed_nonce_hash"?: $cycle_nonce,
      "signature": $Signature }
  $contract.big_map_diff:
    [ { "key_hash": $script_expr,
        "key": $micheline.michelson_v1.expression,
        "value"?: $micheline.michelson_v1.expression } ... ]
  $contract_id:
    /* A contract handle
       A contract notation as given to an RPC or inside scripts. Can be a
       base58 implicit contract hash or a base58 originated contract hash. */
    string
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    string
  $error:
    /* The full list of RPC errors would be too long to include.
       It is available at RPC `/errors` (GET).
       Errors specific to protocol Alpha have an id that starts with
       `proto.alpha`. */
    any
  $fitness:
    /* Block fitness
       The fitness, or score, of a block, that allow the Tezos to decide
       which chain is the best. A fitness value is a list of byte sequences.
       They are compared as follows: shortest lists are smaller; lists of the
       same length are compared according to the lexicographical order. */
    [ /^[a-zA-Z0-9]+$/ ... ]
  $inlined.endorsement:
    { "branch": $block_hash,
      "operations": $inlined.endorsement.contents,
      "signature"?: $Signature }
  $inlined.endorsement.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $operation.alpha.contents:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2] }
    || { "kind": "seed_nonce_revelation",
         "level": integer ∈ [-2^31-2, 2^31+2],
         "nonce": /^[a-zA-Z0-9]+$/ }
    || { "kind": "double_endorsement_evidence",
         "op1": $inlined.endorsement,
         "op2": $inlined.endorsement }
    || { "kind": "double_baking_evidence",
         "bh1": $block_header.alpha.full_header,
         "bh2": $block_header.alpha.full_header }
    || { "kind": "activate_account",
         "pkh": $Ed25519.Public_key_hash,
         "secret": /^[a-zA-Z0-9]+$/ }
    || { "kind": "proposals",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposals": [ $Protocol_hash ... ] }
    || { "kind": "ballot",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposal": $Protocol_hash,
         "ballot": "nay" | "yay" | "pass" }
    || { "kind": "reveal",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression }
    || { "kind": "origination",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts }
    || { "kind": "delegation",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "delegate"?: $Signature.Public_key_hash }
  $operation.alpha.internal_operation_result:
    { "kind": "reveal",
      "source": $contract_id,
      "nonce": integer ∈ [0, 2^16-1],
      "public_key": $Signature.Public_key,
      "result": $operation.alpha.operation_result.reveal }
    || { "kind": "transaction",
         "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression,
         "result": $operation.alpha.operation_result.transaction }
    || { "kind": "origination",
         "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts,
         "result": $operation.alpha.operation_result.origination }
    || { "kind": "delegation",
         "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "delegate"?: $Signature.Public_key_hash,
         "result": $operation.alpha.operation_result.delegation }
  $operation.alpha.operation_contents_and_result:
    { "kind": "endorsement",
      "level": integer ∈ [-2^31-2, 2^31+2],
      "metadata":
        { "balance_updates": $operation_metadata.alpha.balance_updates,
          "delegate": $Signature.Public_key_hash,
          "slots": [ integer ∈ [0, 255] ... ] } }
    || { "kind": "seed_nonce_revelation",
         "level": integer ∈ [-2^31-2, 2^31+2],
         "nonce": /^[a-zA-Z0-9]+$/,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates } }
    || { "kind": "double_endorsement_evidence",
         "op1": $inlined.endorsement,
         "op2": $inlined.endorsement,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates } }
    || { "kind": "double_baking_evidence",
         "bh1": $block_header.alpha.full_header,
         "bh2": $block_header.alpha.full_header,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates } }
    || { "kind": "activate_account",
         "pkh": $Ed25519.Public_key_hash,
         "secret": /^[a-zA-Z0-9]+$/,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates } }
    || { "kind": "proposals",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposals": [ $Protocol_hash ... ],
         "metadata": {  } }
    || { "kind": "ballot",
         "source": $Signature.Public_key_hash,
         "period": integer ∈ [-2^31-2, 2^31+2],
         "proposal": $Protocol_hash,
         "ballot": "nay" | "yay" | "pass",
         "metadata": {  } }
    || { "kind": "reveal",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates,
             "operation_result": $operation.alpha.operation_result.reveal,
             "internal_operation_results"?:
               [ $operation.alpha.internal_operation_result ... ] } }
    || { "kind": "transaction",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates,
             "operation_result":
               $operation.alpha.operation_result.transaction,
             "internal_operation_results"?:
               [ $operation.alpha.internal_operation_result ... ] } }
    || { "kind": "origination",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates,
             "operation_result":
               $operation.alpha.operation_result.origination,
             "internal_operation_results"?:
               [ $operation.alpha.internal_operation_result ... ] } }
    || { "kind": "delegation",
         "source": $contract_id,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "delegate"?: $Signature.Public_key_hash,
         "metadata":
           { "balance_updates": $operation_metadata.alpha.balance_updates,
             "operation_result": $operation.alpha.operation_result.delegation,
             "internal_operation_results"?:
               [ $operation.alpha.internal_operation_result ... ] } }
  $operation.alpha.operation_result.delegation:
    { "status": "applied" }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ] }
  $operation.alpha.operation_result.origination:
    { "status": "applied",
      "balance_updates"?: $operation_metadata.alpha.balance_updates,
      "originated_contracts"?: [ $contract_id ... ],
      "consumed_gas"?: $bignum,
      "storage_size"?: $bignum,
      "paid_storage_size_diff"?: $bignum }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ],
         "balance_updates"?: $operation_metadata.alpha.balance_updates,
         "originated_contracts"?: [ $contract_id ... ],
         "consumed_gas"?: $bignum,
         "storage_size"?: $bignum,
         "paid_storage_size_diff"?: $bignum }
  $operation.alpha.operation_result.reveal:
    { "status": "applied" }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ] }
  $operation.alpha.operation_result.transaction:
    { "status": "applied",
      "storage"?: $micheline.michelson_v1.expression,
      "big_map_diff"?: $contract.big_map_diff,
      "balance_updates"?: $operation_metadata.alpha.balance_updates,
      "originated_contracts"?: [ $contract_id ... ],
      "consumed_gas"?: $bignum,
      "storage_size"?: $bignum,
      "paid_storage_size_diff"?: $bignum }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ],
         "storage"?: $micheline.michelson_v1.expression,
         "big_map_diff"?: $contract.big_map_diff,
         "balance_updates"?: $operation_metadata.alpha.balance_updates,
         "originated_contracts"?: [ $contract_id ... ],
         "consumed_gas"?: $bignum,
         "storage_size"?: $bignum,
         "paid_storage_size_diff"?: $bignum }
  $operation.alpha.operation_with_metadata:
    { "contents": [ $operation.alpha.operation_contents_and_result ... ],
      "signature"?: $Signature }
    || { "contents": [ $operation.alpha.contents ... ],
         "signature"?: $Signature }
  $operation_metadata.alpha.balance_updates:
    [ { "kind": "contract",
        "contract": $contract_id,
        "change": $int64 }
      || { "kind": "freezer",
           "category": "rewards",
           "delegate": $Signature.Public_key_hash,
           "level": integer ∈ [-2^31-2, 2^31+2],
           "change": $int64 }
      || { "kind": "freezer",
           "category": "fees",
           "delegate": $Signature.Public_key_hash,
           "level": integer ∈ [-2^31-2, 2^31+2],
           "change": $int64 }
      || { "kind": "freezer",
           "category": "deposits",
           "delegate": $Signature.Public_key_hash,
           "level": integer ∈ [-2^31-2, 2^31+2],
           "change": $int64 } ... ]
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $script_expr:
    /* A script expression ID (Base58Check-encoded) */
    string
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  $timestamp: $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in human readble form as specified in RFC 3339. */
    string
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  operation.alpha.contents (Determined from data, 8-bit tag)
  **********************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  Seed_nonce_revelation (tag 1)
  =============================

  +-------+----------+------------------------+
  | Name  | Size     | Contents               |
  +=======+==========+========================+
  | Tag   | 1 byte   | unsigned 8-bit integer |
  +-------+----------+------------------------+
  | level | 4 bytes  | signed 32-bit integer  |
  +-------+----------+------------------------+
  | nonce | 32 bytes | bytes                  |
  +-------+----------+------------------------+


  Double_endorsement_evidence (tag 2)
  ===================================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op1                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | op2                   | Variable | $inlined.endorsement    |
  +-----------------------+----------+-------------------------+


  Double_baking_evidence (tag 3)
  ==============================

  +-----------------------+----------------------+---------------------------------+
  | Name                  | Size                 | Contents                        |
  +=======================+======================+=================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer          |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh1                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer         |
  +-----------------------+----------------------+---------------------------------+
  | bh2                   | Determined from data | $block_header.alpha.full_header |
  +-----------------------+----------------------+---------------------------------+


  Activate_account (tag 4)
  ========================

  +--------+----------+------------------------+
  | Name   | Size     | Contents               |
  +========+==========+========================+
  | Tag    | 1 byte   | unsigned 8-bit integer |
  +--------+----------+------------------------+
  | pkh    | 20 bytes | bytes                  |
  +--------+----------+------------------------+
  | secret | 20 bytes | bytes                  |
  +--------+----------+------------------------+


  Proposals (tag 5)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | source                | 21 bytes | $public_key_hash        |
  +-----------------------+----------+-------------------------+
  | period                | 4 bytes  | signed 32-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | proposals             | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  Ballot (tag 6)
  ==============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | source   | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | period   | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+
  | proposal | 32 bytes | bytes                  |
  +----------+----------+------------------------+
  | ballot   | 1 byte   | signed 8-bit integer   |
  +----------+----------+------------------------+


  Reveal (tag 7)
  ==============

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 22 bytes             | $contract_id           |
  +---------------+----------------------+------------------------+
  | fee           | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | counter       | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | gas_limit     | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | storage_limit | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | public_key    | Determined from data | $public_key            |
  +---------------+----------------------+------------------------+


  Transaction (tag 8)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | fee                              | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | counter                          | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | gas_limit                        | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | storage_limit                    | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                       |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 9)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 10)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+


  X_3
  ***

  +-----------------+----------------------+-----------------------+
  | Name            | Size                 | Contents              |
  +=================+======================+=======================+
  | Unnamed field 0 | Determined from data | $X_129                |
  +-----------------+----------------------+-----------------------+
  | change          | 8 bytes              | signed 64-bit integer |
  +-----------------+----------------------+-----------------------+


  operation.alpha.operation_result.delegation (Determined from data, 8-bit tag)
  *****************************************************************************

  Applied (tag 0)
  ===============

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+


  Failed (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | errors                | Variable | sequence of $error      |
  +-----------------------+----------+-------------------------+


  Skipped (tag 2)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Backtracked (tag 3)
  ===================

  +------------------------------+----------------------+----------------------------------------------------+
  | Name                         | Size                 | Contents                                           |
  +==============================+======================+====================================================+
  | Tag                          | 1 byte               | unsigned 8-bit integer                             |
  +------------------------------+----------------------+----------------------------------------------------+
  | ? presence of field "errors" | 1 byte               | boolean (0 for false, 255 for true)                |
  +------------------------------+----------------------+----------------------------------------------------+
  | errors                       | Determined from data | $X_118                                             |
  +------------------------------+----------------------+----------------------------------------------------+
  | Unnamed field 0              | 0 bytes              | placeholder (not actually present in the encoding) |
  +------------------------------+----------------------+----------------------------------------------------+


  X_15
  ****

  +-----------------------------+----------------------+-------------------------------------+
  | Name                        | Size                 | Contents                            |
  +=============================+======================+=====================================+
  | key_hash                    | 32 bytes             | bytes                               |
  +-----------------------------+----------------------+-------------------------------------+
  | key                         | Determined from data | $micheline.michelson_v1.expression  |
  +-----------------------------+----------------------+-------------------------------------+
  | ? presence of field "value" | 1 byte               | boolean (0 for false, 255 for true) |
  +-----------------------------+----------------------+-------------------------------------+
  | value                       | Determined from data | $micheline.michelson_v1.expression  |
  +-----------------------------+----------------------+-------------------------------------+


  operation.alpha.internal_operation_result (Determined from data, 8-bit tag)
  ***************************************************************************

  reveal (tag 0)
  ==============

  +------------+----------------------+----------------------------------------------+
  | Name       | Size                 | Contents                                     |
  +============+======================+==============================================+
  | Tag        | 1 byte               | unsigned 8-bit integer                       |
  +------------+----------------------+----------------------------------------------+
  | source     | 22 bytes             | $contract_id                                 |
  +------------+----------------------+----------------------------------------------+
  | nonce      | 2 bytes              | unsigned 16-bit integer                      |
  +------------+----------------------+----------------------------------------------+
  | public_key | Determined from data | $public_key                                  |
  +------------+----------------------+----------------------------------------------+
  | result     | Determined from data | $operation.alpha.operation_result.delegation |
  +------------+----------------------+----------------------------------------------+


  transaction (tag 1)
  ===================

  +----------------------------------+----------------------+-----------------------------------------------+
  | Name                             | Size                 | Contents                                      |
  +==================================+======================+===============================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer                        |
  +----------------------------------+----------------------+-----------------------------------------------+
  | source                           | 22 bytes             | $contract_id                                  |
  +----------------------------------+----------------------+-----------------------------------------------+
  | nonce                            | 2 bytes              | unsigned 16-bit integer                       |
  +----------------------------------+----------------------+-----------------------------------------------+
  | amount                           | Determined from data | $N.t                                          |
  +----------------------------------+----------------------+-----------------------------------------------+
  | destination                      | 22 bytes             | $contract_id                                  |
  +----------------------------------+----------------------+-----------------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true)           |
  +----------------------------------+----------------------+-----------------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                                 |
  +----------------------------------+----------------------+-----------------------------------------------+
  | result                           | Determined from data | $operation.alpha.operation_result.transaction |
  +----------------------------------+----------------------+-----------------------------------------------+


  origination (tag 2)
  ===================

  +--------------------------------+----------------------+-----------------------------------------------+
  | Name                           | Size                 | Contents                                      |
  +================================+======================+===============================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer                        |
  +--------------------------------+----------------------+-----------------------------------------------+
  | source                         | 22 bytes             | $contract_id                                  |
  +--------------------------------+----------------------+-----------------------------------------------+
  | nonce                          | 2 bytes              | unsigned 16-bit integer                       |
  +--------------------------------+----------------------+-----------------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                              |
  +--------------------------------+----------------------+-----------------------------------------------+
  | balance                        | Determined from data | $N.t                                          |
  +--------------------------------+----------------------+-----------------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                              |
  +--------------------------------+----------------------+-----------------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | script                         | Determined from data | $scripted.contracts                           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | result                         | Determined from data | $operation.alpha.operation_result.origination |
  +--------------------------------+----------------------+-----------------------------------------------+


  delegation (tag 3)
  ==================

  +--------------------------------+----------------------+----------------------------------------------+
  | Name                           | Size                 | Contents                                     |
  +================================+======================+==============================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer                       |
  +--------------------------------+----------------------+----------------------------------------------+
  | source                         | 22 bytes             | $contract_id                                 |
  +--------------------------------+----------------------+----------------------------------------------+
  | nonce                          | 2 bytes              | unsigned 16-bit integer                      |
  +--------------------------------+----------------------+----------------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true)          |
  +--------------------------------+----------------------+----------------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                             |
  +--------------------------------+----------------------+----------------------------------------------+
  | result                         | Determined from data | $operation.alpha.operation_result.delegation |
  +--------------------------------+----------------------+----------------------------------------------+


  X_27
  ****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | Name                                                        | Size                 | Contents                                               |
  +=============================================================+======================+========================================================+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_3                                       |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | operation_result                                            | Determined from data | $operation.alpha.operation_result.origination          |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | internal_operation_results                                  | Variable             | sequence of $operation.alpha.internal_operation_result |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+


  X_57
  ****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | Name                                                        | Size                 | Contents                                               |
  +=============================================================+======================+========================================================+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_3                                       |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | operation_result                                            | Determined from data | $operation.alpha.operation_result.transaction          |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | internal_operation_results                                  | Variable             | sequence of $operation.alpha.internal_operation_result |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+


  scripted.contracts
  ******************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  operation.alpha.operation_result.origination (Determined from data, 8-bit tag)
  ******************************************************************************

  Applied (tag 0)
  ===============

  +-------------------------------------------------------------+----------------------+--------------------------+
  | Name                                                        | Size                 | Contents                 |
  +=============================================================+======================+==========================+
  | Tag                                                         | 1 byte               | unsigned 8-bit integer   |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer  |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | balance_updates                                             | Variable             | sequence of $X_3         |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer  |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | originated_contracts                                        | Variable             | sequence of $contract_id |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | consumed_gas                                                | Determined from data | $Z.t                     |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | storage_size                                                | Determined from data | $Z.t                     |
  +-------------------------------------------------------------+----------------------+--------------------------+
  | paid_storage_size_diff                                      | Determined from data | $Z.t                     |
  +-------------------------------------------------------------+----------------------+--------------------------+


  Failed (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | errors                | Variable | sequence of $error      |
  +-----------------------+----------+-------------------------+


  Skipped (tag 2)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Backtracked (tag 3)
  ===================

  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | Name                                                        | Size                 | Contents                            |
  +=============================================================+======================+=====================================+
  | Tag                                                         | 1 byte               | unsigned 8-bit integer              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "errors"                                | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | errors                                                      | Determined from data | $X_118                              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_3                    |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | originated_contracts                                        | Variable             | sequence of $contract_id            |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | consumed_gas                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage_size                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | paid_storage_size_diff                                      | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  michelson.v1.primitives (Enumeration: unsigned 8-bit integer):
  **************************************************************

  +-------------+------------------+
  | Case number | Encoded string   |
  +=============+==================+
  | 0           | parameter        |
  +-------------+------------------+
  | 1           | storage          |
  +-------------+------------------+
  | 2           | code             |
  +-------------+------------------+
  | 3           | False            |
  +-------------+------------------+
  | 4           | Elt              |
  +-------------+------------------+
  | 5           | Left             |
  +-------------+------------------+
  | 6           | None             |
  +-------------+------------------+
  | 7           | Pair             |
  +-------------+------------------+
  | 8           | Right            |
  +-------------+------------------+
  | 9           | Some             |
  +-------------+------------------+
  | 10          | True             |
  +-------------+------------------+
  | 11          | Unit             |
  +-------------+------------------+
  | 12          | PACK             |
  +-------------+------------------+
  | 13          | UNPACK           |
  +-------------+------------------+
  | 14          | BLAKE2B          |
  +-------------+------------------+
  | 15          | SHA256           |
  +-------------+------------------+
  | 16          | SHA512           |
  +-------------+------------------+
  | 17          | ABS              |
  +-------------+------------------+
  | 18          | ADD              |
  +-------------+------------------+
  | 19          | AMOUNT           |
  +-------------+------------------+
  | 20          | AND              |
  +-------------+------------------+
  | 21          | BALANCE          |
  +-------------+------------------+
  | 22          | CAR              |
  +-------------+------------------+
  | 23          | CDR              |
  +-------------+------------------+
  | 24          | CHECK_SIGNATURE  |
  +-------------+------------------+
  | 25          | COMPARE          |
  +-------------+------------------+
  | 26          | CONCAT           |
  +-------------+------------------+
  | 27          | CONS             |
  +-------------+------------------+
  | 28          | CREATE_ACCOUNT   |
  +-------------+------------------+
  | 29          | CREATE_CONTRACT  |
  +-------------+------------------+
  | 30          | IMPLICIT_ACCOUNT |
  +-------------+------------------+
  | 31          | DIP              |
  +-------------+------------------+
  | 32          | DROP             |
  +-------------+------------------+
  | 33          | DUP              |
  +-------------+------------------+
  | 34          | EDIV             |
  +-------------+------------------+
  | 35          | EMPTY_MAP        |
  +-------------+------------------+
  | 36          | EMPTY_SET        |
  +-------------+------------------+
  | 37          | EQ               |
  +-------------+------------------+
  | 38          | EXEC             |
  +-------------+------------------+
  | 39          | FAILWITH         |
  +-------------+------------------+
  | 40          | GE               |
  +-------------+------------------+
  | 41          | GET              |
  +-------------+------------------+
  | 42          | GT               |
  +-------------+------------------+
  | 43          | HASH_KEY         |
  +-------------+------------------+
  | 44          | IF               |
  +-------------+------------------+
  | 45          | IF_CONS          |
  +-------------+------------------+
  | 46          | IF_LEFT          |
  +-------------+------------------+
  | 47          | IF_NONE          |
  +-------------+------------------+
  | 48          | INT              |
  +-------------+------------------+
  | 49          | LAMBDA           |
  +-------------+------------------+
  | 50          | LE               |
  +-------------+------------------+
  | 51          | LEFT             |
  +-------------+------------------+
  | 52          | LOOP             |
  +-------------+------------------+
  | 53          | LSL              |
  +-------------+------------------+
  | 54          | LSR              |
  +-------------+------------------+
  | 55          | LT               |
  +-------------+------------------+
  | 56          | MAP              |
  +-------------+------------------+
  | 57          | MEM              |
  +-------------+------------------+
  | 58          | MUL              |
  +-------------+------------------+
  | 59          | NEG              |
  +-------------+------------------+
  | 60          | NEQ              |
  +-------------+------------------+
  | 61          | NIL              |
  +-------------+------------------+
  | 62          | NONE             |
  +-------------+------------------+
  | 63          | NOT              |
  +-------------+------------------+
  | 64          | NOW              |
  +-------------+------------------+
  | 65          | OR               |
  +-------------+------------------+
  | 66          | PAIR             |
  +-------------+------------------+
  | 67          | PUSH             |
  +-------------+------------------+
  | 68          | RIGHT            |
  +-------------+------------------+
  | 69          | SIZE             |
  +-------------+------------------+
  | 70          | SOME             |
  +-------------+------------------+
  | 71          | SOURCE           |
  +-------------+------------------+
  | 72          | SENDER           |
  +-------------+------------------+
  | 73          | SELF             |
  +-------------+------------------+
  | 74          | STEPS_TO_QUOTA   |
  +-------------+------------------+
  | 75          | SUB              |
  +-------------+------------------+
  | 76          | SWAP             |
  +-------------+------------------+
  | 77          | TRANSFER_TOKENS  |
  +-------------+------------------+
  | 78          | SET_DELEGATE     |
  +-------------+------------------+
  | 79          | UNIT             |
  +-------------+------------------+
  | 80          | UPDATE           |
  +-------------+------------------+
  | 81          | XOR              |
  +-------------+------------------+
  | 82          | ITER             |
  +-------------+------------------+
  | 83          | LOOP_LEFT        |
  +-------------+------------------+
  | 84          | ADDRESS          |
  +-------------+------------------+
  | 85          | CONTRACT         |
  +-------------+------------------+
  | 86          | ISNAT            |
  +-------------+------------------+
  | 87          | CAST             |
  +-------------+------------------+
  | 88          | RENAME           |
  +-------------+------------------+
  | 89          | bool             |
  +-------------+------------------+
  | 90          | contract         |
  +-------------+------------------+
  | 91          | int              |
  +-------------+------------------+
  | 92          | key              |
  +-------------+------------------+
  | 93          | key_hash         |
  +-------------+------------------+
  | 94          | lambda           |
  +-------------+------------------+
  | 95          | list             |
  +-------------+------------------+
  | 96          | map              |
  +-------------+------------------+
  | 97          | big_map          |
  +-------------+------------------+
  | 98          | nat              |
  +-------------+------------------+
  | 99          | option           |
  +-------------+------------------+
  | 100         | or               |
  +-------------+------------------+
  | 101         | pair             |
  +-------------+------------------+
  | 102         | set              |
  +-------------+------------------+
  | 103         | signature        |
  +-------------+------------------+
  | 104         | string           |
  +-------------+------------------+
  | 105         | bytes            |
  +-------------+------------------+
  | 106         | mutez            |
  +-------------+------------------+
  | 107         | timestamp        |
  +-------------+------------------+
  | 108         | unit             |
  +-------------+------------------+
  | 109         | operation        |
  +-------------+------------------+
  | 110         | address          |
  +-------------+------------------+
  | 111         | SLICE            |
  +-------------+------------------+


  micheline.michelson_v1.expression (Determined from data, 8-bit tag)
  *******************************************************************

  Int (tag 0)
  ===========

  +------+----------------------+------------------------+
  | Name | Size                 | Contents               |
  +======+======================+========================+
  | Tag  | 1 byte               | unsigned 8-bit integer |
  +------+----------------------+------------------------+
  | int  | Determined from data | $Z.t                   |
  +------+----------------------+------------------------+


  String (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | string                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Sequence (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------+
  | Name                  | Size     | Contents                                       |
  +=======================+==========+================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                         |
  +-----------------------+----------+------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                        |
  +-----------------------+----------+------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of $micheline.michelson_v1.expression |
  +-----------------------+----------+------------------------------------------------+


  Prim (no args, annot) (tag 3)
  =============================

  +------+--------+------------------------------------------------------------------------------+
  | Name | Size   | Contents                                                                     |
  +======+========+==============================================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                                       |
  +------+--------+------------------------------------------------------------------------------+
  | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+--------+------------------------------------------------------------------------------+


  Prim (no args + annot) (tag 4)
  ==============================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Prim (1 arg, no annot) (tag 5)
  ==============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg  | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (1 arg + annot) (tag 6)
  ============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg                   | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args, no annot) (tag 7)
  ===============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg1 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg2 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args + annot) (tag 8)
  =============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg1                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg2                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Generic prim (any number of args with or without annot) (tag 9)
  ===============================================================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | args                  | Variable | sequence of $micheline.michelson_v1.expression                               |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Bytes (tag 10)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | bytes                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  contract.big_map_diff
  *********************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_15       |
  +-----------------------+----------+-------------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  operation.alpha.operation_result.transaction (Determined from data, 8-bit tag)
  ******************************************************************************

  Applied (tag 0)
  ===============

  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | Name                                                        | Size                 | Contents                            |
  +=============================================================+======================+=====================================+
  | Tag                                                         | 1 byte               | unsigned 8-bit integer              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "storage"                               | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage                                                     | Determined from data | $micheline.michelson_v1.expression  |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "big_map_diff"                          | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | big_map_diff                                                | Determined from data | $contract.big_map_diff              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_3                    |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | originated_contracts                                        | Variable             | sequence of $contract_id            |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | consumed_gas                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage_size                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | paid_storage_size_diff                                      | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  Failed (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | errors                | Variable | sequence of $error      |
  +-----------------------+----------+-------------------------+


  Skipped (tag 2)
  ===============

  +------+--------+------------------------+
  | Name | Size   | Contents               |
  +======+========+========================+
  | Tag  | 1 byte | unsigned 8-bit integer |
  +------+--------+------------------------+


  Backtracked (tag 3)
  ===================

  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | Name                                                        | Size                 | Contents                            |
  +=============================================================+======================+=====================================+
  | Tag                                                         | 1 byte               | unsigned 8-bit integer              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "errors"                                | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | errors                                                      | Determined from data | $X_118                              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "storage"                               | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage                                                     | Determined from data | $micheline.michelson_v1.expression  |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "big_map_diff"                          | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | big_map_diff                                                | Determined from data | $contract.big_map_diff              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_3                    |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer             |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | originated_contracts                                        | Variable             | sequence of $contract_id            |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | consumed_gas                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | storage_size                                                | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | paid_storage_size_diff                                      | Determined from data | $Z.t                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  public_key (Determined from data, 8-bit tag)
  ********************************************

  Ed25519 (tag 0)
  ===============

  +--------------------+----------+------------------------+
  | Name               | Size     | Contents               |
  +====================+==========+========================+
  | Tag                | 1 byte   | unsigned 8-bit integer |
  +--------------------+----------+------------------------+
  | Ed25519.Public_key | 32 bytes | bytes                  |
  +--------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | Secp256k1.Public_key | 33 bytes | bytes                  |
  +----------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | P256.Public_key | 33 bytes | bytes                  |
  +-----------------+----------+------------------------+


  X_118
  *****

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $error      |
  +-----------------------+----------+-------------------------+


  error
  *****

  +--------------------------+----------+-------------------------+
  | Name                     | Size     | Contents                |
  +==========================+==========+=========================+
  | # bytes in next 2 fields | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | # bytes in next field    | 4 bytes  | unsigned 30-bit integer |
  +--------------------------+----------+-------------------------+
  | Unnamed field 0          | Variable | bytes                   |
  +--------------------------+----------+-------------------------+


  X_94
  ****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | Name                                                        | Size                 | Contents                                               |
  +=============================================================+======================+========================================================+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | balance_updates                                             | Variable             | sequence of $X_3                                       |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | operation_result                                            | Determined from data | $operation.alpha.operation_result.delegation           |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | # bytes in next field                                       | 4 bytes              | unsigned 30-bit integer                                |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | internal_operation_results                                  | Variable             | sequence of $operation.alpha.internal_operation_result |
  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+


  fitness.elem
  ************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  block_header.alpha.full_header
  ******************************

  +---------------------------------------+----------+-------------------------------------+
  | Name                                  | Size     | Contents                            |
  +=======================================+==========+=====================================+
  | level                                 | 4 bytes  | signed 32-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | proto                                 | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | predecessor                           | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | timestamp                             | 8 bytes  | signed 64-bit integer               |
  +---------------------------------------+----------+-------------------------------------+
  | validation_pass                       | 1 byte   | unsigned 8-bit integer              |
  +---------------------------------------+----------+-------------------------------------+
  | operations_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | # bytes in field "fitness"            | 4 bytes  | unsigned 30-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | fitness                               | Variable | sequence of $fitness.elem           |
  +---------------------------------------+----------+-------------------------------------+
  | context                               | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | priority                              | 2 bytes  | unsigned 16-bit integer             |
  +---------------------------------------+----------+-------------------------------------+
  | proof_of_work_nonce                   | 8 bytes  | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | ? presence of field "seed_nonce_hash" | 1 byte   | boolean (0 for false, 255 for true) |
  +---------------------------------------+----------+-------------------------------------+
  | seed_nonce_hash                       | 32 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+
  | signature                             | 64 bytes | bytes                               |
  +---------------------------------------+----------+-------------------------------------+


  inlined.endorsement.contents (5 bytes, 8-bit tag)
  *************************************************

  Endorsement (tag 0)
  ===================

  +-------+---------+------------------------+
  | Name  | Size    | Contents               |
  +=======+=========+========================+
  | Tag   | 1 byte  | unsigned 8-bit integer |
  +-------+---------+------------------------+
  | level | 4 bytes | signed 32-bit integer  |
  +-------+---------+------------------------+


  inlined.endorsement
  *******************

  +------------+----------+-------------------------------+
  | Name       | Size     | Contents                      |
  +============+==========+===============================+
  | branch     | 32 bytes | bytes                         |
  +------------+----------+-------------------------------+
  | operations | 5 bytes  | $inlined.endorsement.contents |
  +------------+----------+-------------------------------+
  | signature  | Variable | bytes                         |
  +------------+----------+-------------------------------+


  operation_metadata.alpha.balance_updates
  ****************************************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_3        |
  +-----------------------+----------+-------------------------+


  contract_id (22 bytes, 8-bit tag)
  *********************************

  Implicit (tag 0)
  ================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash       |
  +---------------------------+----------+------------------------+


  Originated (tag 1)
  ==================

  +---------------+----------+------------------------+
  | Name          | Size     | Contents               |
  +===============+==========+========================+
  | Tag           | 1 byte   | unsigned 8-bit integer |
  +---------------+----------+------------------------+
  | Contract_hash | 20 bytes | bytes                  |
  +---------------+----------+------------------------+
  | padding       | 1 byte   | padding                |
  +---------------+----------+------------------------+


  X_129 (Determined from data, 8-bit tag)
  ***************************************

  Contract (tag 0)
  ================

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | contract | 22 bytes | $contract_id           |
  +----------+----------+------------------------+


  Rewards (tag 1)
  ===============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | delegate | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | level    | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+


  Fees (tag 2)
  ============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | delegate | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | level    | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+


  Deposits (tag 3)
  ================

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | delegate | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | level    | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  X_127
  *****

  +-------------------------------------------------------------+----------+------------------------------------+
  | Name                                                        | Size     | Contents                           |
  +=============================================================+==========+====================================+
  | # bytes in field "operation_metadata.alpha.balance_updates" | 4 bytes  | unsigned 30-bit integer            |
  +-------------------------------------------------------------+----------+------------------------------------+
  | balance_updates                                             | Variable | sequence of $X_3                   |
  +-------------------------------------------------------------+----------+------------------------------------+
  | delegate                                                    | 21 bytes | $public_key_hash                   |
  +-------------------------------------------------------------+----------+------------------------------------+
  | # bytes in next field                                       | 4 bytes  | unsigned 30-bit integer            |
  +-------------------------------------------------------------+----------+------------------------------------+
  | slots                                                       | Variable | sequence of unsigned 8-bit integer |
  +-------------------------------------------------------------+----------+------------------------------------+


  operation.alpha.operation_contents_and_result (Determined from data, 8-bit tag)
  *******************************************************************************

  Endorsement (tag 0)
  ===================

  +----------+----------------------+------------------------+
  | Name     | Size                 | Contents               |
  +==========+======================+========================+
  | Tag      | 1 byte               | unsigned 8-bit integer |
  +----------+----------------------+------------------------+
  | level    | 4 bytes              | signed 32-bit integer  |
  +----------+----------------------+------------------------+
  | metadata | Determined from data | $X_127                 |
  +----------+----------------------+------------------------+


  Seed_nonce_revelation (tag 1)
  =============================

  +----------+----------------------+-------------------------------------------+
  | Name     | Size                 | Contents                                  |
  +==========+======================+===========================================+
  | Tag      | 1 byte               | unsigned 8-bit integer                    |
  +----------+----------------------+-------------------------------------------+
  | level    | 4 bytes              | signed 32-bit integer                     |
  +----------+----------------------+-------------------------------------------+
  | nonce    | 32 bytes             | bytes                                     |
  +----------+----------------------+-------------------------------------------+
  | metadata | Determined from data | $operation_metadata.alpha.balance_updates |
  +----------+----------------------+-------------------------------------------+


  Double_endorsement_evidence (tag 2)
  ===================================

  +-----------------------+----------------------+-------------------------------------------+
  | Name                  | Size                 | Contents                                  |
  +=======================+======================+===========================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                    |
  +-----------------------+----------------------+-------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                   |
  +-----------------------+----------------------+-------------------------------------------+
  | op1                   | Variable             | $inlined.endorsement                      |
  +-----------------------+----------------------+-------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                   |
  +-----------------------+----------------------+-------------------------------------------+
  | op2                   | Variable             | $inlined.endorsement                      |
  +-----------------------+----------------------+-------------------------------------------+
  | metadata              | Determined from data | $operation_metadata.alpha.balance_updates |
  +-----------------------+----------------------+-------------------------------------------+


  Double_baking_evidence (tag 3)
  ==============================

  +-----------------------+----------------------+-------------------------------------------+
  | Name                  | Size                 | Contents                                  |
  +=======================+======================+===========================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                    |
  +-----------------------+----------------------+-------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                   |
  +-----------------------+----------------------+-------------------------------------------+
  | bh1                   | Determined from data | $block_header.alpha.full_header           |
  +-----------------------+----------------------+-------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                   |
  +-----------------------+----------------------+-------------------------------------------+
  | bh2                   | Determined from data | $block_header.alpha.full_header           |
  +-----------------------+----------------------+-------------------------------------------+
  | metadata              | Determined from data | $operation_metadata.alpha.balance_updates |
  +-----------------------+----------------------+-------------------------------------------+


  Activate_account (tag 4)
  ========================

  +----------+----------------------+-------------------------------------------+
  | Name     | Size                 | Contents                                  |
  +==========+======================+===========================================+
  | Tag      | 1 byte               | unsigned 8-bit integer                    |
  +----------+----------------------+-------------------------------------------+
  | pkh      | 20 bytes             | bytes                                     |
  +----------+----------------------+-------------------------------------------+
  | secret   | 20 bytes             | bytes                                     |
  +----------+----------------------+-------------------------------------------+
  | metadata | Determined from data | $operation_metadata.alpha.balance_updates |
  +----------+----------------------+-------------------------------------------+


  Proposals (tag 5)
  =================

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | source                | 21 bytes | $public_key_hash        |
  +-----------------------+----------+-------------------------+
  | period                | 4 bytes  | signed 32-bit integer   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | proposals             | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  Ballot (tag 6)
  ==============

  +----------+----------+------------------------+
  | Name     | Size     | Contents               |
  +==========+==========+========================+
  | Tag      | 1 byte   | unsigned 8-bit integer |
  +----------+----------+------------------------+
  | source   | 21 bytes | $public_key_hash       |
  +----------+----------+------------------------+
  | period   | 4 bytes  | signed 32-bit integer  |
  +----------+----------+------------------------+
  | proposal | 32 bytes | bytes                  |
  +----------+----------+------------------------+
  | ballot   | 1 byte   | signed 8-bit integer   |
  +----------+----------+------------------------+


  Reveal (tag 7)
  ==============

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 22 bytes             | $contract_id           |
  +---------------+----------------------+------------------------+
  | fee           | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | counter       | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | gas_limit     | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | storage_limit | Determined from data | $N.t                   |
  +---------------+----------------------+------------------------+
  | public_key    | Determined from data | $public_key            |
  +---------------+----------------------+------------------------+
  | metadata      | Determined from data | $X_94                  |
  +---------------+----------------------+------------------------+


  Transaction (tag 8)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | fee                              | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | counter                          | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | gas_limit                        | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | storage_limit                    | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $fitness.elem                       |
  +----------------------------------+----------------------+-------------------------------------+
  | metadata                         | Determined from data | $X_57                               |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 9)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+
  | metadata                       | Determined from data | $X_27                               |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 10)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 22 bytes             | $contract_id                        |
  +--------------------------------+----------------------+-------------------------------------+
  | fee                            | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | counter                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | gas_limit                      | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | storage_limit                  | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | metadata                       | Determined from data | $X_94                               |
  +--------------------------------+----------------------+-------------------------------------+


  X_130 (Determined from data, 8-bit tag)
  ***************************************

  Operation_with_metadata (tag 0)
  ===============================

  +---------------------------------+----------+------------------------------------------------------------+
  | Name                            | Size     | Contents                                                   |
  +=================================+==========+============================================================+
  | Tag                             | 1 byte   | unsigned 8-bit integer                                     |
  +---------------------------------+----------+------------------------------------------------------------+
  | # bytes in next field           | 4 bytes  | unsigned 30-bit integer                                    |
  +---------------------------------+----------+------------------------------------------------------------+
  | contents                        | Variable | sequence of $operation.alpha.operation_contents_and_result |
  +---------------------------------+----------+------------------------------------------------------------+
  | ? presence of field "signature" | 1 byte   | boolean (0 for false, 255 for true)                        |
  +---------------------------------+----------+------------------------------------------------------------+
  | signature                       | 64 bytes | bytes                                                      |
  +---------------------------------+----------+------------------------------------------------------------+


  Operation_without_metadata (tag 1)
  ==================================

  +---------------------------------+----------+---------------------------------------+
  | Name                            | Size     | Contents                              |
  +=================================+==========+=======================================+
  | Tag                             | 1 byte   | unsigned 8-bit integer                |
  +---------------------------------+----------+---------------------------------------+
  | # bytes in next field           | 4 bytes  | unsigned 30-bit integer               |
  +---------------------------------+----------+---------------------------------------+
  | contents                        | Variable | sequence of $operation.alpha.contents |
  +---------------------------------+----------+---------------------------------------+
  | ? presence of field "signature" | 1 byte   | boolean (0 for false, 255 for true)   |
  +---------------------------------+----------+---------------------------------------+
  | signature                       | 64 bytes | bytes                                 |
  +---------------------------------+----------+---------------------------------------+


  X_0
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | Unnamed field 0       | Determined from data | $X_130                  |
  +-----------------------+----------------------+-------------------------+

  

POST ../<block_id>/helpers/scripts/pack_data

Computes the serialized version of some data expression using the same algorithm as script instruction PACK

  { "data": $micheline.michelson_v1.expression,
    "type": $micheline.michelson_v1.expression,
    "gas"?: $bignum }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  +---------------------------+----------------------+-------------------------------------+
  | Name                      | Size                 | Contents                            |
  +===========================+======================+=====================================+
  | data                      | Determined from data | $micheline.michelson_v1.expression  |
  +---------------------------+----------------------+-------------------------------------+
  | type                      | Determined from data | $micheline.michelson_v1.expression  |
  +---------------------------+----------------------+-------------------------------------+
  | ? presence of field "gas" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------+----------------------+-------------------------------------+
  | gas                       | Determined from data | $Z.t                                |
  +---------------------------+----------------------+-------------------------------------+


  michelson.v1.primitives (Enumeration: unsigned 8-bit integer):
  **************************************************************

  +-------------+------------------+
  | Case number | Encoded string   |
  +=============+==================+
  | 0           | parameter        |
  +-------------+------------------+
  | 1           | storage          |
  +-------------+------------------+
  | 2           | code             |
  +-------------+------------------+
  | 3           | False            |
  +-------------+------------------+
  | 4           | Elt              |
  +-------------+------------------+
  | 5           | Left             |
  +-------------+------------------+
  | 6           | None             |
  +-------------+------------------+
  | 7           | Pair             |
  +-------------+------------------+
  | 8           | Right            |
  +-------------+------------------+
  | 9           | Some             |
  +-------------+------------------+
  | 10          | True             |
  +-------------+------------------+
  | 11          | Unit             |
  +-------------+------------------+
  | 12          | PACK             |
  +-------------+------------------+
  | 13          | UNPACK           |
  +-------------+------------------+
  | 14          | BLAKE2B          |
  +-------------+------------------+
  | 15          | SHA256           |
  +-------------+------------------+
  | 16          | SHA512           |
  +-------------+------------------+
  | 17          | ABS              |
  +-------------+------------------+
  | 18          | ADD              |
  +-------------+------------------+
  | 19          | AMOUNT           |
  +-------------+------------------+
  | 20          | AND              |
  +-------------+------------------+
  | 21          | BALANCE          |
  +-------------+------------------+
  | 22          | CAR              |
  +-------------+------------------+
  | 23          | CDR              |
  +-------------+------------------+
  | 24          | CHECK_SIGNATURE  |
  +-------------+------------------+
  | 25          | COMPARE          |
  +-------------+------------------+
  | 26          | CONCAT           |
  +-------------+------------------+
  | 27          | CONS             |
  +-------------+------------------+
  | 28          | CREATE_ACCOUNT   |
  +-------------+------------------+
  | 29          | CREATE_CONTRACT  |
  +-------------+------------------+
  | 30          | IMPLICIT_ACCOUNT |
  +-------------+------------------+
  | 31          | DIP              |
  +-------------+------------------+
  | 32          | DROP             |
  +-------------+------------------+
  | 33          | DUP              |
  +-------------+------------------+
  | 34          | EDIV             |
  +-------------+------------------+
  | 35          | EMPTY_MAP        |
  +-------------+------------------+
  | 36          | EMPTY_SET        |
  +-------------+------------------+
  | 37          | EQ               |
  +-------------+------------------+
  | 38          | EXEC             |
  +-------------+------------------+
  | 39          | FAILWITH         |
  +-------------+------------------+
  | 40          | GE               |
  +-------------+------------------+
  | 41          | GET              |
  +-------------+------------------+
  | 42          | GT               |
  +-------------+------------------+
  | 43          | HASH_KEY         |
  +-------------+------------------+
  | 44          | IF               |
  +-------------+------------------+
  | 45          | IF_CONS          |
  +-------------+------------------+
  | 46          | IF_LEFT          |
  +-------------+------------------+
  | 47          | IF_NONE          |
  +-------------+------------------+
  | 48          | INT              |
  +-------------+------------------+
  | 49          | LAMBDA           |
  +-------------+------------------+
  | 50          | LE               |
  +-------------+------------------+
  | 51          | LEFT             |
  +-------------+------------------+
  | 52          | LOOP             |
  +-------------+------------------+
  | 53          | LSL              |
  +-------------+------------------+
  | 54          | LSR              |
  +-------------+------------------+
  | 55          | LT               |
  +-------------+------------------+
  | 56          | MAP              |
  +-------------+------------------+
  | 57          | MEM              |
  +-------------+------------------+
  | 58          | MUL              |
  +-------------+------------------+
  | 59          | NEG              |
  +-------------+------------------+
  | 60          | NEQ              |
  +-------------+------------------+
  | 61          | NIL              |
  +-------------+------------------+
  | 62          | NONE             |
  +-------------+------------------+
  | 63          | NOT              |
  +-------------+------------------+
  | 64          | NOW              |
  +-------------+------------------+
  | 65          | OR               |
  +-------------+------------------+
  | 66          | PAIR             |
  +-------------+------------------+
  | 67          | PUSH             |
  +-------------+------------------+
  | 68          | RIGHT            |
  +-------------+------------------+
  | 69          | SIZE             |
  +-------------+------------------+
  | 70          | SOME             |
  +-------------+------------------+
  | 71          | SOURCE           |
  +-------------+------------------+
  | 72          | SENDER           |
  +-------------+------------------+
  | 73          | SELF             |
  +-------------+------------------+
  | 74          | STEPS_TO_QUOTA   |
  +-------------+------------------+
  | 75          | SUB              |
  +-------------+------------------+
  | 76          | SWAP             |
  +-------------+------------------+
  | 77          | TRANSFER_TOKENS  |
  +-------------+------------------+
  | 78          | SET_DELEGATE     |
  +-------------+------------------+
  | 79          | UNIT             |
  +-------------+------------------+
  | 80          | UPDATE           |
  +-------------+------------------+
  | 81          | XOR              |
  +-------------+------------------+
  | 82          | ITER             |
  +-------------+------------------+
  | 83          | LOOP_LEFT        |
  +-------------+------------------+
  | 84          | ADDRESS          |
  +-------------+------------------+
  | 85          | CONTRACT         |
  +-------------+------------------+
  | 86          | ISNAT            |
  +-------------+------------------+
  | 87          | CAST             |
  +-------------+------------------+
  | 88          | RENAME           |
  +-------------+------------------+
  | 89          | bool             |
  +-------------+------------------+
  | 90          | contract         |
  +-------------+------------------+
  | 91          | int              |
  +-------------+------------------+
  | 92          | key              |
  +-------------+------------------+
  | 93          | key_hash         |
  +-------------+------------------+
  | 94          | lambda           |
  +-------------+------------------+
  | 95          | list             |
  +-------------+------------------+
  | 96          | map              |
  +-------------+------------------+
  | 97          | big_map          |
  +-------------+------------------+
  | 98          | nat              |
  +-------------+------------------+
  | 99          | option           |
  +-------------+------------------+
  | 100         | or               |
  +-------------+------------------+
  | 101         | pair             |
  +-------------+------------------+
  | 102         | set              |
  +-------------+------------------+
  | 103         | signature        |
  +-------------+------------------+
  | 104         | string           |
  +-------------+------------------+
  | 105         | bytes            |
  +-------------+------------------+
  | 106         | mutez            |
  +-------------+------------------+
  | 107         | timestamp        |
  +-------------+------------------+
  | 108         | unit             |
  +-------------+------------------+
  | 109         | operation        |
  +-------------+------------------+
  | 110         | address          |
  +-------------+------------------+
  | 111         | SLICE            |
  +-------------+------------------+


  micheline.michelson_v1.expression (Determined from data, 8-bit tag)
  *******************************************************************

  Int (tag 0)
  ===========

  +------+----------------------+------------------------+
  | Name | Size                 | Contents               |
  +======+======================+========================+
  | Tag  | 1 byte               | unsigned 8-bit integer |
  +------+----------------------+------------------------+
  | int  | Determined from data | $Z.t                   |
  +------+----------------------+------------------------+


  String (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | string                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Sequence (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------+
  | Name                  | Size     | Contents                                       |
  +=======================+==========+================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                         |
  +-----------------------+----------+------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                        |
  +-----------------------+----------+------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of $micheline.michelson_v1.expression |
  +-----------------------+----------+------------------------------------------------+


  Prim (no args, annot) (tag 3)
  =============================

  +------+--------+------------------------------------------------------------------------------+
  | Name | Size   | Contents                                                                     |
  +======+========+==============================================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                                       |
  +------+--------+------------------------------------------------------------------------------+
  | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+--------+------------------------------------------------------------------------------+


  Prim (no args + annot) (tag 4)
  ==============================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Prim (1 arg, no annot) (tag 5)
  ==============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg  | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (1 arg + annot) (tag 6)
  ============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg                   | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args, no annot) (tag 7)
  ===============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg1 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg2 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args + annot) (tag 8)
  =============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg1                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg2                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Generic prim (any number of args with or without annot) (tag 9)
  ===============================================================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | args                  | Variable | sequence of $micheline.michelson_v1.expression                               |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Bytes (tag 10)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | bytes                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  
  { "packed": /^[a-zA-Z0-9]+$/,
    "gas": $bignum || "unaccounted" }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | packed                | Variable             | bytes                   |
  +-----------------------+----------------------+-------------------------+
  | gas                   | Determined from data | $X_0                    |
  +-----------------------+----------------------+-------------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  X_0 (Determined from data, 8-bit tag)
  *************************************

  Limited (tag 0)
  ===============

  +-----------------+----------------------+------------------------+
  | Name            | Size                 | Contents               |
  +=================+======================+========================+
  | Tag             | 1 byte               | unsigned 8-bit integer |
  +-----------------+----------------------+------------------------+
  | Unnamed field 0 | Determined from data | $Z.t                   |
  +-----------------+----------------------+------------------------+


  Unaccounted (tag 1)
  ===================

  +-----------------+---------+----------------------------------------------------+
  | Name            | Size    | Contents                                           |
  +=================+=========+====================================================+
  | Tag             | 1 byte  | unsigned 8-bit integer                             |
  +-----------------+---------+----------------------------------------------------+
  | Unnamed field 0 | 0 bytes | placeholder (not actually present in the encoding) |
  +-----------------+---------+----------------------------------------------------+

  

POST ../<block_id>/helpers/scripts/run_code

Run a piece of code in the current context

  { "script": $micheline.michelson_v1.expression,
    "storage": $micheline.michelson_v1.expression,
    "input": $micheline.michelson_v1.expression,
    "amount": $mutez }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  +---------+----------------------+------------------------------------+
  | Name    | Size                 | Contents                           |
  +=========+======================+====================================+
  | script  | Determined from data | $micheline.michelson_v1.expression |
  +---------+----------------------+------------------------------------+
  | storage | Determined from data | $micheline.michelson_v1.expression |
  +---------+----------------------+------------------------------------+
  | input   | Determined from data | $micheline.michelson_v1.expression |
  +---------+----------------------+------------------------------------+
  | amount  | Determined from data | $N.t                               |
  +---------+----------------------+------------------------------------+


  michelson.v1.primitives (Enumeration: unsigned 8-bit integer):
  **************************************************************

  +-------------+------------------+
  | Case number | Encoded string   |
  +=============+==================+
  | 0           | parameter        |
  +-------------+------------------+
  | 1           | storage          |
  +-------------+------------------+
  | 2           | code             |
  +-------------+------------------+
  | 3           | False            |
  +-------------+------------------+
  | 4           | Elt              |
  +-------------+------------------+
  | 5           | Left             |
  +-------------+------------------+
  | 6           | None             |
  +-------------+------------------+
  | 7           | Pair             |
  +-------------+------------------+
  | 8           | Right            |
  +-------------+------------------+
  | 9           | Some             |
  +-------------+------------------+
  | 10          | True             |
  +-------------+------------------+
  | 11          | Unit             |
  +-------------+------------------+
  | 12          | PACK             |
  +-------------+------------------+
  | 13          | UNPACK           |
  +-------------+------------------+
  | 14          | BLAKE2B          |
  +-------------+------------------+
  | 15          | SHA256           |
  +-------------+------------------+
  | 16          | SHA512           |
  +-------------+------------------+
  | 17          | ABS              |
  +-------------+------------------+
  | 18          | ADD              |
  +-------------+------------------+
  | 19          | AMOUNT           |
  +-------------+------------------+
  | 20          | AND              |
  +-------------+------------------+
  | 21          | BALANCE          |
  +-------------+------------------+
  | 22          | CAR              |
  +-------------+------------------+
  | 23          | CDR              |
  +-------------+------------------+
  | 24          | CHECK_SIGNATURE  |
  +-------------+------------------+
  | 25          | COMPARE          |
  +-------------+------------------+
  | 26          | CONCAT           |
  +-------------+------------------+
  | 27          | CONS             |
  +-------------+------------------+
  | 28          | CREATE_ACCOUNT   |
  +-------------+------------------+
  | 29          | CREATE_CONTRACT  |
  +-------------+------------------+
  | 30          | IMPLICIT_ACCOUNT |
  +-------------+------------------+
  | 31          | DIP              |
  +-------------+------------------+
  | 32          | DROP             |
  +-------------+------------------+
  | 33          | DUP              |
  +-------------+------------------+
  | 34          | EDIV             |
  +-------------+------------------+
  | 35          | EMPTY_MAP        |
  +-------------+------------------+
  | 36          | EMPTY_SET        |
  +-------------+------------------+
  | 37          | EQ               |
  +-------------+------------------+
  | 38          | EXEC             |
  +-------------+------------------+
  | 39          | FAILWITH         |
  +-------------+------------------+
  | 40          | GE               |
  +-------------+------------------+
  | 41          | GET              |
  +-------------+------------------+
  | 42          | GT               |
  +-------------+------------------+
  | 43          | HASH_KEY         |
  +-------------+------------------+
  | 44          | IF               |
  +-------------+------------------+
  | 45          | IF_CONS          |
  +-------------+------------------+
  | 46          | IF_LEFT          |
  +-------------+------------------+
  | 47          | IF_NONE          |
  +-------------+------------------+
  | 48          | INT              |
  +-------------+------------------+
  | 49          | LAMBDA           |
  +-------------+------------------+
  | 50          | LE               |
  +-------------+------------------+
  | 51          | LEFT             |
  +-------------+------------------+
  | 52          | LOOP             |
  +-------------+------------------+
  | 53          | LSL              |
  +-------------+------------------+
  | 54          | LSR              |
  +-------------+------------------+
  | 55          | LT               |
  +-------------+------------------+
  | 56          | MAP              |
  +-------------+------------------+
  | 57          | MEM              |
  +-------------+------------------+
  | 58          | MUL              |
  +-------------+------------------+
  | 59          | NEG              |
  +-------------+------------------+
  | 60          | NEQ              |
  +-------------+------------------+
  | 61          | NIL              |
  +-------------+------------------+
  | 62          | NONE             |
  +-------------+------------------+
  | 63          | NOT              |
  +-------------+------------------+
  | 64          | NOW              |
  +-------------+------------------+
  | 65          | OR               |
  +-------------+------------------+
  | 66          | PAIR             |
  +-------------+------------------+
  | 67          | PUSH             |
  +-------------+------------------+
  | 68          | RIGHT            |
  +-------------+------------------+
  | 69          | SIZE             |
  +-------------+------------------+
  | 70          | SOME             |
  +-------------+------------------+
  | 71          | SOURCE           |
  +-------------+------------------+
  | 72          | SENDER           |
  +-------------+------------------+
  | 73          | SELF             |
  +-------------+------------------+
  | 74          | STEPS_TO_QUOTA   |
  +-------------+------------------+
  | 75          | SUB              |
  +-------------+------------------+
  | 76          | SWAP             |
  +-------------+------------------+
  | 77          | TRANSFER_TOKENS  |
  +-------------+------------------+
  | 78          | SET_DELEGATE     |
  +-------------+------------------+
  | 79          | UNIT             |
  +-------------+------------------+
  | 80          | UPDATE           |
  +-------------+------------------+
  | 81          | XOR              |
  +-------------+------------------+
  | 82          | ITER             |
  +-------------+------------------+
  | 83          | LOOP_LEFT        |
  +-------------+------------------+
  | 84          | ADDRESS          |
  +-------------+------------------+
  | 85          | CONTRACT         |
  +-------------+------------------+
  | 86          | ISNAT            |
  +-------------+------------------+
  | 87          | CAST             |
  +-------------+------------------+
  | 88          | RENAME           |
  +-------------+------------------+
  | 89          | bool             |
  +-------------+------------------+
  | 90          | contract         |
  +-------------+------------------+
  | 91          | int              |
  +-------------+------------------+
  | 92          | key              |
  +-------------+------------------+
  | 93          | key_hash         |
  +-------------+------------------+
  | 94          | lambda           |
  +-------------+------------------+
  | 95          | list             |
  +-------------+------------------+
  | 96          | map              |
  +-------------+------------------+
  | 97          | big_map          |
  +-------------+------------------+
  | 98          | nat              |
  +-------------+------------------+
  | 99          | option           |
  +-------------+------------------+
  | 100         | or               |
  +-------------+------------------+
  | 101         | pair             |
  +-------------+------------------+
  | 102         | set              |
  +-------------+------------------+
  | 103         | signature        |
  +-------------+------------------+
  | 104         | string           |
  +-------------+------------------+
  | 105         | bytes            |
  +-------------+------------------+
  | 106         | mutez            |
  +-------------+------------------+
  | 107         | timestamp        |
  +-------------+------------------+
  | 108         | unit             |
  +-------------+------------------+
  | 109         | operation        |
  +-------------+------------------+
  | 110         | address          |
  +-------------+------------------+
  | 111         | SLICE            |
  +-------------+------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  micheline.michelson_v1.expression (Determined from data, 8-bit tag)
  *******************************************************************

  Int (tag 0)
  ===========

  +------+----------------------+------------------------+
  | Name | Size                 | Contents               |
  +======+======================+========================+
  | Tag  | 1 byte               | unsigned 8-bit integer |
  +------+----------------------+------------------------+
  | int  | Determined from data | $Z.t                   |
  +------+----------------------+------------------------+


  String (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | string                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Sequence (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------+
  | Name                  | Size     | Contents                                       |
  +=======================+==========+================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                         |
  +-----------------------+----------+------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                        |
  +-----------------------+----------+------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of $micheline.michelson_v1.expression |
  +-----------------------+----------+------------------------------------------------+


  Prim (no args, annot) (tag 3)
  =============================

  +------+--------+------------------------------------------------------------------------------+
  | Name | Size   | Contents                                                                     |
  +======+========+==============================================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                                       |
  +------+--------+------------------------------------------------------------------------------+
  | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+--------+------------------------------------------------------------------------------+


  Prim (no args + annot) (tag 4)
  ==============================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Prim (1 arg, no annot) (tag 5)
  ==============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg  | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (1 arg + annot) (tag 6)
  ============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg                   | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args, no annot) (tag 7)
  ===============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg1 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg2 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args + annot) (tag 8)
  =============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg1                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg2                  | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Generic prim (any number of args with or without annot) (tag 9)
  ===============================================================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | args                  | Variable | sequence of $micheline.michelson_v1.expression                               |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Bytes (tag 10)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | bytes                 | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+

  
  { "storage": $micheline.michelson_v1.expression,
    "operations": [ $operation.alpha.internal_operation ... ],
    "big_map_diff"?: $contract.big_map_diff }
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    string
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    string
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $contract.big_map_diff:
    [ { "key_hash": $script_expr,
        "key": $micheline.michelson_v1.expression,
        "value"?: $micheline.michelson_v1.expression } ... ]
  $contract_id:
    /* A contract handle
       A contract notation as given to an RPC or inside scripts. Can be a
       base58 implicit contract hash or a base58 originated contract hash. */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": string }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "LE"
    | "UNIT"
    | "timestamp"
    | "signature"
    | "COMPARE"
    | "LAMBDA"
    | "LOOP"
    | "Elt"
    | "IMPLICIT_ACCOUNT"
    | "NONE"
    | "set"
    | "pair"
    | "bytes"
    | "BLAKE2B"
    | "address"
    | "SHA256"
    | "XOR"
    | "RENAME"
    | "MAP"
    | "SET_DELEGATE"
    | "DIP"
    | "PACK"
    | "or"
    | "SIZE"
    | "Right"
    | "list"
    | "IF_CONS"
    | "LSR"
    | "TRANSFER_TOKENS"
    | "storage"
    | "UPDATE"
    | "CDR"
    | "SWAP"
    | "SOME"
    | "False"
    | "SHA512"
    | "CHECK_SIGNATURE"
    | "BALANCE"
    | "key_hash"
    | "unit"
    | "EMPTY_SET"
    | "SUB"
    | "MEM"
    | "RIGHT"
    | "ADDRESS"
    | "option"
    | "CONCAT"
    | "big_map"
    | "string"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NOT"
    | "LEFT"
    | "mutez"
    | "AMOUNT"
    | "DROP"
    | "ABS"
    | "bool"
    | "GE"
    | "PUSH"
    | "LT"
    | "operation"
    | "NEQ"
    | "NEG"
    | "None"
    | "CONS"
    | "EXEC"
    | "NIL"
    | "ISNAT"
    | "MUL"
    | "LOOP_LEFT"
    | "EDIV"
    | "SLICE"
    | "STEPS_TO_QUOTA"
    | "INT"
    | "SOURCE"
    | "CAR"
    | "CREATE_ACCOUNT"
    | "LSL"
    | "OR"
    | "IF_NONE"
    | "SELF"
    | "IF"
    | "Left"
    | "contract"
    | "map"
    | "SENDER"
    | "nat"
    | "DUP"
    | "EQ"
    | "NOW"
    | "key"
    | "GET"
    | "lambda"
    | "int"
    | "True"
    | "GT"
    | "parameter"
    | "IF_LEFT"
    | "FAILWITH"
    | "PAIR"
    | "ITER"
    | "Pair"
    | "CAST"
    | "EMPTY_MAP"
    | "CREATE_CONTRACT"
    | "HASH_KEY"
    | "CONTRACT"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $operation.alpha.internal_operation:
    { "source": $contract_id,
      "nonce": integer ∈ [0, 2^16-1],
      "kind": "reveal",
      "public_key": $Signature.Public_key }
    || { "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "kind": "transaction",
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?: $micheline.michelson_v1.expression }
    || { "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "kind": "origination",
         "managerPubkey": $Signature.Public_key_hash,
         "balance": $mutez,
         "spendable"?: boolean,
         "delegatable"?: boolean,
         "delegate"?: $Signature.Public_key_hash,
         "script"?: $scripted.contracts }
    || { "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "kind": "delegation",
         "delegate"?: $Signature.Public_key_hash }
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $script_expr:
    /* A script expression ID (Base58Check-encoded) */
    string
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  +------------------------------------+----------------------+-------------------------------------------------+
  | Name                               | Size                 | Contents                                        |
  +====================================+======================+=================================================+
  | storage                            | Determined from data | $micheline.michelson_v1.expression              |
  +------------------------------------+----------------------+-------------------------------------------------+
  | # bytes in next field              | 4 bytes              | unsigned 30-bit integer                         |
  +------------------------------------+----------------------+-------------------------------------------------+
  | operations                         | Variable             | sequence of $operation.alpha.internal_operation |
  +------------------------------------+----------------------+-------------------------------------------------+
  | ? presence of field "big_map_diff" | 1 byte               | boolean (0 for false, 255 for true)             |
  +------------------------------------+----------------------+-------------------------------------------------+
  | big_map_diff                       | Determined from data | $contract.big_map_diff                          |
  +------------------------------------+----------------------+-------------------------------------------------+


  scripted.contracts
  ******************

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | code                  | Variable | bytes                   |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | storage               | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  N.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). Size bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | N.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  public_key_hash (21 bytes, 8-bit tag)
  *************************************

  Ed25519 (tag 0)
  ===============

  +-------------------------+----------+------------------------+
  | Name                    | Size     | Contents               |
  +=========================+==========+========================+
  | Tag                     | 1 byte   | unsigned 8-bit integer |
  +-------------------------+----------+------------------------+
  | Ed25519.Public_key_hash | 20 bytes | bytes                  |
  +-------------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Secp256k1.Public_key_hash | 20 bytes | bytes                  |
  +---------------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | P256.Public_key_hash | 20 bytes | bytes                  |
  +----------------------+----------+------------------------+


  contract_id (22 bytes, 8-bit tag)
  *********************************

  Implicit (tag 0)
  ================

  +---------------------------+----------+------------------------+
  | Name                      | Size     | Contents               |
  +===========================+==========+========================+
  | Tag                       | 1 byte   | unsigned 8-bit integer |
  +---------------------------+----------+------------------------+
  | Signature.Public_key_hash | 21 bytes | $public_key_hash       |
  +---------------------------+----------+------------------------+


  Originated (tag 1)
  ==================

  +---------------+----------+------------------------+
  | Name          | Size     | Contents               |
  +===============+==========+========================+
  | Tag           | 1 byte   | unsigned 8-bit integer |
  +---------------+----------+------------------------+
  | Contract_hash | 20 bytes | bytes                  |
  +---------------+----------+------------------------+
  | padding       | 1 byte   | padding                |
  +---------------+----------+------------------------+


  X_1
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  public_key (Determined from data, 8-bit tag)
  ********************************************

  Ed25519 (tag 0)
  ===============

  +--------------------+----------+------------------------+
  | Name               | Size     | Contents               |
  +====================+==========+========================+
  | Tag                | 1 byte   | unsigned 8-bit integer |
  +--------------------+----------+------------------------+
  | Ed25519.Public_key | 32 bytes | bytes                  |
  +--------------------+----------+------------------------+


  Secp256k1 (tag 1)
  =================

  +----------------------+----------+------------------------+
  | Name                 | Size     | Contents               |
  +======================+==========+========================+
  | Tag                  | 1 byte   | unsigned 8-bit integer |
  +----------------------+----------+------------------------+
  | Secp256k1.Public_key | 33 bytes | bytes                  |
  +----------------------+----------+------------------------+


  P256 (tag 2)
  ============

  +-----------------+----------+------------------------+
  | Name            | Size     | Contents               |
  +=================+==========+========================+
  | Tag             | 1 byte   | unsigned 8-bit integer |
  +-----------------+----------+------------------------+
  | P256.Public_key | 33 bytes | bytes                  |
  +-----------------+----------+------------------------+


  X_2 (Determined from data, 8-bit tag)
  *************************************

  Reveal (tag 0)
  ==============

  +------------+----------------------+------------------------+
  | Name       | Size                 | Contents               |
  +============+======================+========================+
  | Tag        | 1 byte               | unsigned 8-bit integer |
  +------------+----------------------+------------------------+
  | public_key | Determined from data | $public_key            |
  +------------+----------------------+------------------------+


  Transaction (tag 1)
  ===================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | amount                           | Determined from data | $N.t                                |
  +----------------------------------+----------------------+-------------------------------------+
  | destination                      | 22 bytes             | $contract_id                        |
  +----------------------------------+----------------------+-------------------------------------+
  | ? presence of field "parameters" | 1 byte               | boolean (0 for false, 255 for true) |
  +----------------------------------+----------------------+-------------------------------------+
  | parameters                       | Determined from data | $X_1                                |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 2)
  ===================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | managerPubkey                  | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | spendable                      | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegatable                    | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "script"   | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 3)
  ==================

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | Tag                            | 1 byte   | unsigned 8-bit integer              |
  +--------------------------------+----------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte   | boolean (0 for false, 255 for true) |
  +--------------------------------+----------+-------------------------------------+
  | delegate                       | 21 bytes | $public_key_hash                    |
  +--------------------------------+----------+-------------------------------------+


  operation.alpha.internal_operation
  **********************************

  +-----------------+----------------------+-------------------------+
  | Name            | Size                 | Contents                |
  +=================+======================+=========================+
  | source          | 22 bytes             | $contract_id            |
  +-----------------+----------------------+-------------------------+
  | nonce           | 2 bytes              | unsigned 16-bit integer |
  +-----------------+----------------------+-------------------------+
  | Unnamed field 0 | Determined from data | $X_2                    |
  +-----------------+----------------------+-------------------------+


  michelson.v1.primitives (Enumeration: unsigned 8-bit integer):
  **************************************************************

  +-------------+------------------+
  | Case number | Encoded string   |
  +=============+==================+
  | 0           | parameter        |
  +-------------+------------------+
  | 1           | storage          |
  +-------------+------------------+
  | 2           | code             |
  +-------------+------------------+
  | 3           | False            |
  +-------------+------------------+
  | 4           | Elt              |
  +-------------+------------------+
  | 5           | Left             |
  +-------------+------------------+
  | 6           | None             |
  +-------------+------------------+
  | 7           | Pair             |
  +-------------+------------------+
  | 8           | Right            |
  +-------------+------------------+
  | 9           | Some             |
  +-------------+------------------+
  | 10          | True             |
  +-------------+------------------+
  | 11          | Unit             |
  +-------------+------------------+
  | 12          | PACK             |
  +-------------+------------------+
  | 13          | UNPACK           |
  +-------------+------------------+
  | 14          | BLAKE2B          |
  +-------------+------------------+
  | 15          | SHA256           |
  +-------------+------------------+
  | 16          | SHA512           |
  +-------------+------------------+
  | 17          | ABS              |
  +-------------+------------------+
  | 18          | ADD              |
  +-------------+------------------+
  | 19          | AMOUNT           |
  +-------------+------------------+
  | 20          | AND              |
  +-------------+------------------+
  | 21          | BALANCE          |
  +-------------+------------------+
  | 22          | CAR              |
  +-------------+------------------+
  | 23          | CDR              |
  +-------------+------------------+
  | 24          | CHECK_SIGNATURE  |
  +-------------+------------------+
  | 25          | COMPARE          |
  +-------------+------------------+
  | 26          | CONCAT           |
  +-------------+------------------+
  | 27          | CONS             |
  +-------------+------------------+
  | 28          | CREATE_ACCOUNT   |
  +-------------+------------------+
  | 29          | CREATE_CONTRACT  |
  +-------------+------------------+
  | 30          | IMPLICIT_ACCOUNT |
  +-------------+------------------+
  | 31          | DIP              |
  +-------------+------------------+
  | 32          | DROP             |
  +-------------+------------------+
  | 33          | DUP              |
  +-------------+------------------+
  | 34          | EDIV             |
  +-------------+------------------+
  | 35          | EMPTY_MAP        |
  +-------------+------------------+
  | 36          | EMPTY_SET        |
  +-------------+------------------+
  | 37          | EQ               |
  +-------------+------------------+
  | 38          | EXEC             |
  +-------------+------------------+
  | 39          | FAILWITH         |
  +-------------+------------------+
  | 40          | GE               |
  +-------------+------------------+
  | 41          | GET              |
  +-------------+------------------+
  | 42          | GT               |
  +-------------+------------------+
  | 43          | HASH_KEY         |
  +-------------+------------------+
  | 44          | IF               |
  +-------------+------------------+
  | 45          | IF_CONS          |
  +-------------+------------------+
  | 46          | IF_LEFT          |
  +-------------+------------------+
  | 47          | IF_NONE          |
  +-------------+------------------+
  | 48          | INT              |
  +-------------+------------------+
  | 49          | LAMBDA           |
  +-------------+------------------+
  | 50          | LE               |
  +-------------+------------------+
  | 51          | LEFT             |
  +-------------+------------------+
  | 52          | LOOP             |
  +-------------+------------------+
  | 53          | LSL              |
  +-------------+------------------+
  | 54          | LSR              |
  +-------------+------------------+
  | 55          | LT               |
  +-------------+------------------+
  | 56          | MAP              |
  +-------------+------------------+
  | 57          | MEM              |
  +-------------+------------------+
  | 58          | MUL              |
  +-------------+------------------+
  | 59          | NEG              |
  +-------------+------------------+
  | 60          | NEQ              |
  +-------------+------------------+
  | 61          | NIL              |
  +-------------+------------------+
  | 62          | NONE             |
  +-------------+------------------+
  | 63          | NOT              |
  +-------------+------------------+
  | 64          | NOW              |
  +-------------+------------------+
  | 65          | OR               |
  +-------------+------------------+
  | 66          | PAIR             |
  +-------------+------------------+
  | 67          | PUSH             |
  +-------------+------------------+
  | 68          | RIGHT            |
  +-------------+------------------+
  | 69          | SIZE             |
  +-------------+------------------+
  | 70          | SOME             |
  +-------------+------------------+
  | 71          | SOURCE           |
  +-------------+------------------+
  | 72          | SENDER           |
  +-------------+------------------+
  | 73          | SELF             |
  +-------------+------------------+
  | 74          | STEPS_TO_QUOTA   |
  +-------------+------------------+
  | 75          | SUB              |
  +-------------+------------------+
  | 76          | SWAP             |
  +-------------+------------------+
  | 77          | TRANSFER_TOKENS  |
  +-------------+------------------+
  | 78          | SET_DELEGATE     |
  +-------------+------------------+
  | 79          | UNIT             |
  +-------------+------------------+
  | 80          | UPDATE           |
  +-------------+------------------+
  | 81          | XOR              |
  +-------------+------------------+
  | 82          | ITER             |
  +-------------+------------------+
  | 83          | LOOP_LEFT        |
  +-------------+------------------+
  | 84          | ADDRESS          |
  +-------------+------------------+
  | 85          | CONTRACT         |
  +-------------+------------------+
  | 86          | ISNAT            |
  +-------------+------------------+
  | 87          | CAST             |
  +-------------+------------------+
  | 88          | RENAME           |
  +-------------+------------------+
  | 89          | bool             |
  +-------------+------------------+
  | 90          | contract         |
  +-------------+------------------+
  | 91          | int              |
  +-------------+------------------+
  | 92          | key              |
  +-------------+------------------+
  | 93          | key_hash         |
  +-------------+------------------+
  | 94          | lambda           |
  +-------------+------------------+
  | 95          | list             |
  +-------------+------------------+
  | 96          | map              |
  +-------------+------------------+
  | 97          | big_map          |
  +-------------+------------------+
  | 98          | nat              |
  +-------------+------------------+
  | 99          | option           |
  +-------------+------------------+
  | 100         | or               |
  +-------------+------------------+
  | 101         | pair             |
  +-------------+------------------+
  | 102         | set              |
  +-------------+------------------+
  | 103         | signature        |
  +-------------+------------------+
  | 104         | string           |
  +-------------+------------------+
  | 105         | bytes            |
  +-------------+------------------+
  | 106         | mutez            |
  +-------------+------------------+
  | 107         | timestamp        |
  +-------------+------------------+
  | 108         | unit             |
  +-------------+------------------+
  | 109         | operation        |
  +-------------+------------------+
  | 110         | address          |
  +-------------+------------------+
  | 111         | SLICE            |
  +-------------+------------------+


  Z.t
  ***

  A variable length sequence of bytes, encoding a Zarith number. Each byte has a running unary size bit: the most significant bit of each byte tells is this is the last byte in the sequence (0) or if there is more to read (1). The second most significant bit of the first byte is reserved for the sign (positive if zero). Size and sign bits ignored, data is then the binary representation of the absolute value of the number in little endian order.

  +------+----------------------+----------+
  | Name | Size                 | Contents |
  +======+======================+==========+
  | Z.t  | Determined from data | bytes    |
  +------+----------------------+----------+


  micheline.michelson_v1.expression (Determined from data, 8-bit tag)
  *******************************************************************

  Int (tag 0)
  ===========

  +------+----------------------+------------------------+
  | Name | Size                 | Contents               |
  +======+======================+========================+
  | Tag  | 1 byte               | unsigned 8-bit integer |
  +------+----------------------+------------------------+
  | int  | Determined from data | $Z.t                   |
  +------+----------------------+------------------------+


  String (tag 1)
  ==============

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | Tag                   | 1 byte   | unsigned 8-bit integer  |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | string                | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  Sequence (tag 2)
  ================

  +-----------------------+----------+------------------------------------------------+
  | Name                  | Size     | Contents                                       |
  +=======================+==========+================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                         |
  +-----------------------+----------+------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                        |
  +-----------------------+----------+------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of $micheline.michelson_v1.expression |
  +-----------------------+----------+------------------------------------------------+


  Prim (no args, annot) (tag 3)
  =============================

  +------+--------+------------------------------------------------------------------------------+
  | Name | Size   | Contents                                                                     |
  +======+========+==============================================================================+
  | Tag  | 1 byte | unsigned 8-bit integer                                                       |
  +------+--------+------------------------------------------------------------------------------+
  | prim | 1 byte | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+--------+------------------------------------------------------------------------------+


  Prim (no args + annot) (tag 4)
  ==============================

  +-----------------------+----------+------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                     |
  +=======================+==========+==============================================================================+
  | Tag                   | 1 byte   | unsigned 8-bit integer                                                       |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | prim                  | 1 byte   | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                      |
  +-----------------------+----------+------------------------------------------------------------------------------+
  | annots                | Variable | bytes                                                                        |
  +-----------------------+----------+------------------------------------------------------------------------------+


  Prim (1 arg, no annot) (tag 5)
  ==============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg  | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (1 arg + annot) (tag 6)
  ============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg                   | Determined from data | $micheline.michelson_v1.expression                                           |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                                      |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | annots                | Variable             | bytes                                                                        |
  +-----------------------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args, no annot) (tag 7)
  ===============================

  +------+----------------------+------------------------------------------------------------------------------+
  | Name | Size                 | Contents                                                                     |
  +======+======================+==============================================================================+
  | Tag  | 1 byte               | unsigned 8-bit integer                                                       |
  +------+----------------------+------------------------------------------------------------------------------+
  | prim | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg1 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+
  | arg2 | Determined from data | $micheline.michelson_v1.expression                                           |
  +------+----------------------+------------------------------------------------------------------------------+


  Prim (2 args + annot) (tag 8)
  =============================

  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | Name                  | Size                 | Contents                                                                     |
  +=======================+======================+==============================================================================+
  | Tag                   | 1 byte               | unsigned 8-bit integer                                                       |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | prim                  | 1 byte               | unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------------------+------------------------------------------------------------------------------+
  | arg1                  |