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>/checkpoint (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)
    • /fetch_protocol
      • /fetch_protocol/<Protocol_hash> (GET)
    • /injection
      • /injection/block (POST)
      • /injection/operation (POST)
      • /injection/protocol (POST)
    • /monitor
      • /monitor/active_chains (GET)
      • /monitor/bootstrapped (GET)
      • /monitor/commit_hash (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/peers/<peer_id>/unban (GET)
          • /network/peers/<peer_id>/untrust (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/points/<point>/unban (GET)
          • /network/points/<point>/untrust (GET)
      • /network/self (GET)
      • /network/stat (GET)
      • /network/version (GET)
      • /network/versions (GET)
    • /protocols (GET)
      • /protocols/<Protocol_hash> (GET)
    • /stats
      • /stats/gc (GET)
      • /stats/memory (GET)
    • /workers
      • /workers/block_validator (GET)
      • /workers/chain_validators (GET)
        • /workers/chain_validators/<chain_id> (GET)
          • /workers/chain_validators/<chain_id>/ddb (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/big_maps
        • ../<block_id>/context/big_maps/<big_map_id>
          • ../<block_id>/context/big_maps/<big_map_id>/<script_expr> (GET)
      • ../<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>/delegate (GET)
          • ../<block_id>/context/contracts/<contract_id>/entrypoints (GET)
            • ../<block_id>/context/contracts/<contract_id>/entrypoints/<string> (GET)
          • ../<block_id>/context/contracts/<contract_id>/manager_key (GET)
          • ../<block_id>/context/contracts/<contract_id>/script (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>/endorsing_power (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/entrypoint (POST)
        • ../<block_id>/helpers/scripts/entrypoints (POST)
        • ../<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>/minimal_valid_time (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)
    • ../<block_id>/protocols (GET)
    • ../<block_id>/required_endorsements (GET)
    • ../<block_id>/votes
      • ../<block_id>/votes/ballot_list (GET)
      • ../<block_id>/votes/ballots (GET)
      • ../<block_id>/votes/current_period_kind (GET)
      • ../<block_id>/votes/current_proposal (GET)
      • ../<block_id>/votes/current_quorum (GET)
      • ../<block_id>/votes/listings (GET)
      • ../<block_id>/votes/proposals (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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------+---------+----------+
  | Name     | Size    | Contents |
  +==========+=========+==========+
  | Chain_id | 4 bytes | bytes    |
  +----------+---------+----------+


  

GET /chains/<chain_id>/checkpoint

The current checkpoint for this chain.

  { "block": $block_header,
    "save_point": integer ∈ [-2^31-2, 2^31+2],
    "caboose": integer ∈ [-2^31-2, 2^31+2],
    "history_mode": "full" | "archive" | "rolling" }
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header:
    /* Block header
       Block header. It contains both shell and protocol specific data. */
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "protocol_data": /^[a-zA-Z0-9]+$/ }
  $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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +--------------+----------+----------------------------------------------------------+
  | Name         | Size     | Contents                                                 |
  +==============+==========+==========================================================+
  | block        | Variable | $block_header                                            |
  +--------------+----------+----------------------------------------------------------+
  | save_point   | 4 bytes  | signed 32-bit integer                                    |
  +--------------+----------+----------------------------------------------------------+
  | caboose      | 4 bytes  | signed 32-bit integer                                    |
  +--------------+----------+----------------------------------------------------------+
  | history_mode | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_0) |
  +--------------+----------+----------------------------------------------------------+


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

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


  block_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                     |
  +----------------------------+----------+---------------------------+
  | protocol_data              | Variable | bytes                     |
  +----------------------------+----------+---------------------------+


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

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | archive        |
  +-------------+----------------+
  | 1           | full           |
  +-------------+----------------+
  | 2           | rolling        |
  +-------------+----------------+

  

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) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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) */
    $unistring
  $error:
    /* The full list of error is available with the global RPC `GET errors` */
    any
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +--------------------------+----------+-------------------------+
  | 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": $unistring,
         "kind": "Enum" }
    || { "layout": $layout,
         "kind": "Seq",
         "max_length"?: integer ∈ [-2^30-2, 2^30+2] }
    || { "name": $unistring,
         "kind": "Ref" }
    || { "kind": "Padding" }
  $schema.field:
    { "name": $unistring,
      "layout": $layout,
      "data_kind": $schema.kind,
      "kind": "named" }
    || { "layout": $layout,
         "kind": "anon",
         "data_kind": $schema.kind }
    || { "kind": "dyn",
         "name"?: $unistring,
         "num_fields": integer ∈ [-2^30-2, 2^30+2],
         "size": "Uint30" | "Uint16" | "Uint8" }
    || { "kind": "option_indicator",
         "name": $unistring }
  $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":
                [ $unistring
                  || { "id": "single",
                       "name": $unistring,
                       "descr"?: $unistring }
                  || { "id": "multiple",
                       "name": $unistring,
                       "descr"?: $unistring } ... ],
              "description"?: $unistring,
              "query":
                [ { "name": $unistring,
                    "description"?: $unistring,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": $unistring,
                            "descr"?: $unistring } }
                      || { "optional":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } } } ... ],
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } } },
          "post_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ $unistring
                  || { "id": "single",
                       "name": $unistring,
                       "descr"?: $unistring }
                  || { "id": "multiple",
                       "name": $unistring,
                       "descr"?: $unistring } ... ],
              "description"?: $unistring,
              "query":
                [ { "name": $unistring,
                    "description"?: $unistring,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": $unistring,
                            "descr"?: $unistring } }
                      || { "optional":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } } } ... ],
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } } },
          "delete_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ $unistring
                  || { "id": "single",
                       "name": $unistring,
                       "descr"?: $unistring }
                  || { "id": "multiple",
                       "name": $unistring,
                       "descr"?: $unistring } ... ],
              "description"?: $unistring,
              "query":
                [ { "name": $unistring,
                    "description"?: $unistring,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": $unistring,
                            "descr"?: $unistring } }
                      || { "optional":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } } } ... ],
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } } },
          "put_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ $unistring
                  || { "id": "single",
                       "name": $unistring,
                       "descr"?: $unistring }
                  || { "id": "multiple",
                       "name": $unistring,
                       "descr"?: $unistring } ... ],
              "description"?: $unistring,
              "query":
                [ { "name": $unistring,
                    "description"?: $unistring,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": $unistring,
                            "descr"?: $unistring } }
                      || { "optional":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } } } ... ],
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } } },
          "patch_service"?:
            { "meth": "PATCH" | "GET" | "POST" | "PUT" | "DELETE",
              "path":
                [ $unistring
                  || { "id": "single",
                       "name": $unistring,
                       "descr"?: $unistring }
                  || { "id": "multiple",
                       "name": $unistring,
                       "descr"?: $unistring } ... ],
              "description"?: $unistring,
              "query":
                [ { "name": $unistring,
                    "description"?: $unistring,
                    "kind":
                      { "single":
                          { "id": "single",
                            "name": $unistring,
                            "descr"?: $unistring } }
                      || { "optional":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } }
                      || { "flag": {  } }
                      || { "multi":
                             { "id": "single",
                               "name": $unistring,
                               "descr"?: $unistring } } } ... ],
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } },
              "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],
                                   $unistring ] ... ] },
                      "fields":
                        [ { "description":
                              { "title": $unistring,
                                "description"?: $unistring },
                            "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],
                                         $unistring ] ... ] } } ... ] } } },
          "subdirs"?:
            { "suffixes":
                [ { "name": $unistring,
                    "tree": $service_tree } ... ] }
            || { "dynamic_dispatch":
                   { "arg":
                       { "id": "single",
                         "name": $unistring,
                         "descr"?: $unistring },
                     "tree": $service_tree } } } }
    || { "dynamic": $unistring || null }
  $union case:
    { "tag": integer ∈ [-2^30-2, 2^30+2],
      "fields": [ $schema.field ... ],
      "name"?: $unistring }
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+---------------+
  | 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                   |
  +-----------------------+----------+-------------------------+


  

GET /fetch_protocol/<Protocol_hash>

Fetch a protocol from the network.

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


  

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. If ?async is true, the function returns immediately. Otherwise, the block will be validated before the result is returned. If ?force is true, it will be injected even on non strictly increasing fitness. An optional ?chain parameter can be used to specify whether to inject on the test chain or the main chain.

Optional query arguments :

  • async
  • force
  • chain = <chain_id>

  { "data": /^[a-zA-Z0-9]+$/,
    "operations": [ [ $operation ... ] ... ] }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $operation:
    /* An operation. The shell_header part indicates a block an operation is
       meant to apply on top of. The proto part is protocol-specific and
       appears as a binary blob. */
    { "branch": $block_hash,
      "data": /^[a-zA-Z0-9]+$/ }
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +------------+----------+----------+
  | 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. If ?async is true, the function returns immediately. Otherwise, the operation will be validated before the result is returned. An optional ?chain parameter can be used to specify whether to inject on the test chain or the main chain.

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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------+----------+----------+
  | Name           | Size     | Contents |
  +================+==========+==========+
  | Operation_hash | 32 bytes | bytes    |
  +----------------+----------+----------+


  

POST /injection/protocol?[async]

Inject a protocol in node. Returns the ID of the protocol. If ?async is true, the function returns immediately. Otherwise, the protocol will be validated before the result is returned.

Optional query arguments :

  • async

  $protocol
  $protocol:
    /* The environment a protocol relies on and the components a protocol is
       made of. */
    { "expected_env_version": integer ∈ [-2^15, 2^15-1],
      "components":
        [ { "name": $unistring,
            "interface"?: $unistring,
            "implementation": $unistring } ... ] }
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------+----------+----------+
  | Name          | Size     | Contents |
  +===============+==========+==========+
  | Protocol_hash | 32 bytes | bytes    |
  +---------------+----------+----------+


  

GET /monitor/active_chains

Monitor every chain creation and destruction. Currently active chains will be given as first elements

  [ { "chain_id": $Chain_id }
    || { "chain_id": $Chain_id,
         "test_protocol": $Protocol_hash,
         "expiration_date": $timestamp.protocol }
    || { "stopping": $Chain_id } ... ]
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


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

  Main (tag 0)
  ============

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


  Test (tag 1)
  ============

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


  Stopping (tag 2)
  ================

  +----------+---------+------------------------+
  | Name     | Size    | Contents               |
  +==========+=========+========================+
  | Tag      | 1 byte  | unsigned 8-bit integer |
  +----------+---------+------------------------+
  | stopping | 4 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.protocol }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------+----------+-----------------------+
  | Name      | Size     | Contents              |
  +===========+==========+=======================+
  | block     | 32 bytes | bytes                 |
  +-----------+----------+-----------------------+
  | timestamp | 8 bytes  | signed 64-bit integer |
  +-----------+----------+-----------------------+


  

GET /monitor/commit_hash

Get information on the build of the node.

  $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | bytes                   |
  +-----------------------+----------+-------------------------+


  

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

Monitor all blocks that are successfully 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.protocol,
    "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) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+---------------------------+
  | 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 successfully loaded and compiled by the node.

  $Protocol_hash
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------+----------+----------+
  | 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 successfully 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.protocol,
    "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) */
    $unistring
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+---------------------------+
  | 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": $p2p_connection.id,
      "remote_socket_port": integer ∈ [0, 2^16-1],
      "announced_version": $network_version,
      "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) */
    $unistring
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 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             |
  +--------------------------------+----------+-------------------------------------+


  network_version
  ***************

  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+


  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) |
  +-----------------+--------+-------------------------------------+


  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 | $p2p_connection.id                  |
  +--------------------+----------------------+-------------------------------------+
  | remote_socket_port | 2 bytes              | unsigned 16-bit integer             |
  +--------------------+----------------------+-------------------------------------+
  | announced_version  | Determined from data | $network_version                    |
  +--------------------+----------------------+-------------------------------------+
  | private            | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------+----------------------+-------------------------------------+
  | local_metadata     | 2 bytes              | $X_2                                |
  +--------------------+----------------------+-------------------------------------+
  | remote_metadata    | 2 bytes              | $X_2                                |
  +--------------------+----------------------+-------------------------------------+

  

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": $p2p_connection.id,
    "remote_socket_port": integer ∈ [0, 2^16-1],
    "announced_version": $network_version,
    "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) */
    $unistring
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +--------------------+----------------------+-------------------------------------+
  | Name               | Size                 | Contents                            |
  +====================+======================+=====================================+
  | incoming           | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------+----------------------+-------------------------------------+
  | peer_id            | 16 bytes             | bytes                               |
  +--------------------+----------------------+-------------------------------------+
  | id_point           | Determined from data | $p2p_connection.id                  |
  +--------------------+----------------------+-------------------------------------+
  | remote_socket_port | 2 bytes              | unsigned 16-bit integer             |
  +--------------------+----------------------+-------------------------------------+
  | announced_version  | Determined from data | $network_version                    |
  +--------------------+----------------------+-------------------------------------+
  | private            | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------+----------------------+-------------------------------------+
  | local_metadata     | 2 bytes              | $X_0                                |
  +--------------------+----------------------+-------------------------------------+
  | remote_metadata    | 2 bytes              | $X_1                                |
  +--------------------+----------------------+-------------------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 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             |
  +--------------------------------+----------+-------------------------------------+


  network_version
  ***************

  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+


  X_1
  ***

  +-----------------+--------+-------------------------------------+
  | 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

  $p2p_connection.pool_event
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_connection.pool_event:
    /* An event that may happen during maintenance of and other operations on
       the p2p connection pool. Typically, it includes connection errors,
       peer swaps, etc. */
    { "event": "too_few_connections" }
    || { "event": "too_many_connections" }
    || { "event": "new_point",
         "point": $p2p_point.id }
    || { "event": "new_peer",
         "peer_id": $Crypto_box.Public_key_hash }
    || { "event": "incoming_connection",
         "point": $p2p_point.id }
    || { "event": "outgoing_connection",
         "point": $p2p_point.id }
    || { "event": "authentication_failed",
         "point": $p2p_point.id }
    || { "event": "accepting_request",
         "point": $p2p_point.id,
         "id_point": $p2p_connection.id,
         "peer_id": $Crypto_box.Public_key_hash }
    || { "event": "rejecting_request",
         "point": $p2p_point.id,
         "id_point": $p2p_connection.id,
         "peer_id": $Crypto_box.Public_key_hash }
    || { "event": "request_rejected",
         "point": $p2p_point.id,
         "identity"?: [ $p2p_connection.id, $Crypto_box.Public_key_hash ] }
    || { "event": "connection_established",
         "id_point": $p2p_connection.id,
         "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 }
  $p2p_point.id:
    /* Identifier for a peer point */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_1     |
  +-----------------+----------------------+----------+


  X_0
  ***

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


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 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 (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 field "p2p_point.id" | 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 field "p2p_point.id" | 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 field "p2p_point.id" | 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 field "p2p_point.id" | 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 field "p2p_point.id" | 4 bytes              | unsigned 30-bit integer |
  +---------------------------------+----------------------+-------------------------+
  | point                           | Variable             | bytes                   |
  +---------------------------------+----------------------+-------------------------+
  | id_point                        | Determined from data | $p2p_connection.id      |
  +---------------------------------+----------------------+-------------------------+
  | peer_id                         | 16 bytes             | bytes                   |
  +---------------------------------+----------------------+-------------------------+


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

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


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

  +---------------------------------+----------------------+-------------------------------------+
  | Name                            | Size                 | Contents                            |
  +=================================+======================+=====================================+
  | Tag                             | 1 byte               | unsigned 8-bit integer              |
  +---------------------------------+----------------------+-------------------------------------+
  | # bytes in field "p2p_point.id" | 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_0                                |
  +---------------------------------+----------------------+-------------------------------------+


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

  +----------+----------------------+------------------------+
  | Name     | Size                 | Contents               |
  +==========+======================+========================+
  | Tag      | 1 byte               | unsigned 8-bit integer |
  +----------+----------------------+------------------------+
  | id_point | Determined from data | $p2p_connection.id     |
  +----------+----------------------+------------------------+
  | 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 },
        "peer_metadata":
          { "responses":
              { "sent":
                  { "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "other": $bignum },
                "failed":
                  { "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "other": $bignum },
                "received":
                  { "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "other": $bignum },
                "unexpected": $bignum,
                "outdated": $bignum },
            "requests":
              { "sent":
                  { "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "other": $bignum },
                "received":
                  { "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "other": $bignum },
                "failed":
                  { "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "other": $bignum },
                "scheduled":
                  { "branch": $bignum,
                    "head": $bignum,
                    "block_header": $bignum,
                    "operations": $bignum,
                    "protocols": $bignum,
                    "operation_hashes_for_block": $bignum,
                    "operations_for_block": $bignum,
                    "other": $bignum } },
            "valid_blocks": $bignum,
            "old_heads": $bignum,
            "prevalidator_results":
              { "cannot_download": $bignum,
                "cannot_parse": $bignum,
                "refused_by_prefilter": $bignum,
                "refused_by_postfilter": $bignum,
                "applied": $bignum,
                "branch_delayed": $bignum,
                "branch_refused": $bignum,
                "refused": $bignum,
                "duplicate": $bignum,
                "outdated": $bignum },
            "unactivated_chains": $bignum,
            "inactive_chains": $bignum,
            "future_blocks_advertised": $bignum,
            "unadvertised":
              { "block": $bignum,
                "operations": $bignum,
                "protocol": $bignum },
            "advertisements":
              { "sent": { "head": $bignum,
                          "branch": $bignum },
                "received": { "head": $bignum,
                              "branch": $bignum } } },
        "state": $p2p_peer.state,
        "reachable_at"?: $p2p_connection.id,
        "stat": $p2p_stat,
        "last_failed_connection"?: [ $p2p_connection.id, $timestamp.system ],
        "last_rejected_connection"?:
          [ $p2p_connection.id, $timestamp.system ],
        "last_established_connection"?:
          [ $p2p_connection.id, $timestamp.system ],
        "last_disconnection"?: [ $p2p_connection.id, $timestamp.system ],
        "last_seen"?: [ $p2p_connection.id, $timestamp.system ],
        "last_miss"?: [ $p2p_connection.id, $timestamp.system ] } ] ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_peer.state:
    /* The state a peer connection can be in: accepted (when the connection
       is being established), running (when the connection is already
       established), disconnected (otherwise). */
    "running" | "accepted" | "disconnected"
  $p2p_stat:
    /* Statistics about the p2p network. */
    { "total_sent": $int64,
      "total_recv": $int64,
      "current_inflow": integer ∈ [-2^30-2, 2^30+2],
      "current_outflow": integer ∈ [-2^30-2, 2^30+2] }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  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) |
  +-----------------+--------+-------------------------------------+


  X_4
  ***

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | sent       | Determined from data | $X_12    |
  +------------+----------------------+----------+
  | failed     | Determined from data | $X_12    |
  +------------+----------------------+----------+
  | received   | Determined from data | $X_12    |
  +------------+----------------------+----------+
  | unexpected | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | outdated   | Determined from data | $Z.t     |
  +------------+----------------------+----------+


  X_12
  ****

  +----------------------------+----------------------+----------+
  | Name                       | Size                 | Contents |
  +============================+======================+==========+
  | branch                     | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | head                       | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | block_header               | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | operations                 | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | protocols                  | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | operation_hashes_for_block | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | operations_for_block       | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | other                      | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+


  X_8
  ***

  +-----------+----------------------+----------+
  | Name      | Size                 | Contents |
  +===========+======================+==========+
  | sent      | Determined from data | $X_12    |
  +-----------+----------------------+----------+
  | received  | Determined from data | $X_12    |
  +-----------+----------------------+----------+
  | failed    | Determined from data | $X_12    |
  +-----------+----------------------+----------+
  | scheduled | Determined from data | $X_12    |
  +-----------+----------------------+----------+


  X_13
  ****

  +-----------------------+----------------------+----------+
  | Name                  | Size                 | Contents |
  +=======================+======================+==========+
  | cannot_download       | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | cannot_parse          | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_prefilter  | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_postfilter | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | applied               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_delayed        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_refused        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | duplicate             | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | outdated              | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+


  X_14
  ****

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | block      | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | operations | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | protocol   | 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    |
  +------+----------------------+----------+


  X_17
  ****

  +--------+----------------------+----------+
  | Name   | Size                 | Contents |
  +========+======================+==========+
  | head   | Determined from data | $Z.t     |
  +--------+----------------------+----------+
  | branch | Determined from data | $Z.t     |
  +--------+----------------------+----------+


  X_15
  ****

  +----------+----------------------+----------+
  | Name     | Size                 | Contents |
  +==========+======================+==========+
  | sent     | Determined from data | $X_17    |
  +----------+----------------------+----------+
  | received | Determined from data | $X_17    |
  +----------+----------------------+----------+


  X_3
  ***

  +--------------------------+----------------------+----------+
  | Name                     | Size                 | Contents |
  +==========================+======================+==========+
  | responses                | Determined from data | $X_4     |
  +--------------------------+----------------------+----------+
  | requests                 | Determined from data | $X_8     |
  +--------------------------+----------------------+----------+
  | valid_blocks             | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | old_heads                | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | prevalidator_results     | Determined from data | $X_13    |
  +--------------------------+----------------------+----------+
  | unactivated_chains       | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | inactive_chains          | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | future_blocks_advertised | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | unadvertised             | Determined from data | $X_14    |
  +--------------------------+----------------------+----------+
  | advertisements           | Determined from data | $X_15    |
  +--------------------------+----------------------+----------+


  p2p_peer.state (Enumeration: unsigned 8-bit integer):
  *****************************************************

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


  p2p_stat
  ********

  +-----------------+---------+--------------------------------------------------------------+
  | 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 |
  +-----------------+---------+--------------------------------------------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 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_23
  ****

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


  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                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | peer_metadata                                     | Determined from data | $X_3                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | state                                             | 1 byte               | unsigned 8-bit integer encoding an enumeration (see p2p_peer.state) |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "reachable_at"                | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | reachable_at                                      | Determined from data | $p2p_connection.id                                                  |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | stat                                              | 24 bytes             | $p2p_stat                                                           |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_failed_connection                            | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_rejected_connection                          | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_established_connection                       | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_disconnection                                | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_seen                                         | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_miss                                         | Determined from data | $X_23                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+


  X_0
  ***

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

  

GET /network/peers/<peer_id>

Details about a given peer.

  { "score": number,
    "trusted": boolean,
    "conn_metadata"?: { "disable_mempool": boolean,
                        "private_node": boolean },
    "peer_metadata":
      { "responses":
          { "sent":
              { "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "other": $bignum },
            "failed":
              { "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "other": $bignum },
            "received":
              { "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "other": $bignum },
            "unexpected": $bignum,
            "outdated": $bignum },
        "requests":
          { "sent":
              { "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "other": $bignum },
            "received":
              { "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "other": $bignum },
            "failed":
              { "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "other": $bignum },
            "scheduled":
              { "branch": $bignum,
                "head": $bignum,
                "block_header": $bignum,
                "operations": $bignum,
                "protocols": $bignum,
                "operation_hashes_for_block": $bignum,
                "operations_for_block": $bignum,
                "other": $bignum } },
        "valid_blocks": $bignum,
        "old_heads": $bignum,
        "prevalidator_results":
          { "cannot_download": $bignum,
            "cannot_parse": $bignum,
            "refused_by_prefilter": $bignum,
            "refused_by_postfilter": $bignum,
            "applied": $bignum,
            "branch_delayed": $bignum,
            "branch_refused": $bignum,
            "refused": $bignum,
            "duplicate": $bignum,
            "outdated": $bignum },
        "unactivated_chains": $bignum,
        "inactive_chains": $bignum,
        "future_blocks_advertised": $bignum,
        "unadvertised":
          { "block": $bignum,
            "operations": $bignum,
            "protocol": $bignum },
        "advertisements":
          { "sent": { "head": $bignum,
                      "branch": $bignum },
            "received": { "head": $bignum,
                          "branch": $bignum } } },
    "state": $p2p_peer.state,
    "reachable_at"?: $p2p_connection.id,
    "stat": $p2p_stat,
    "last_failed_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_rejected_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_established_connection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_disconnection"?: [ $p2p_connection.id, $timestamp.system ],
    "last_seen"?: [ $p2p_connection.id, $timestamp.system ],
    "last_miss"?: [ $p2p_connection.id, $timestamp.system ] }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_connection.id:
    /* The identifier for a p2p connection. It includes an address and a port
       number. */
    { "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $p2p_peer.state:
    /* The state a peer connection can be in: accepted (when the connection
       is being established), running (when the connection is already
       established), disconnected (otherwise). */
    "running" | "accepted" | "disconnected"
  $p2p_stat:
    /* Statistics about the p2p network. */
    { "total_sent": $int64,
      "total_recv": $int64,
      "current_inflow": integer ∈ [-2^30-2, 2^30+2],
      "current_outflow": integer ∈ [-2^30-2, 2^30+2] }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | 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                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | peer_metadata                                     | Determined from data | $X_1                                                                |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | state                                             | 1 byte               | unsigned 8-bit integer encoding an enumeration (see p2p_peer.state) |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "reachable_at"                | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | reachable_at                                      | Determined from data | $p2p_connection.id                                                  |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | stat                                              | 24 bytes             | $p2p_stat                                                           |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_failed_connection"      | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_failed_connection                            | Determined from data | $X_16                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_rejected_connection"    | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_rejected_connection                          | Determined from data | $X_17                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_established_connection                       | Determined from data | $X_18                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_disconnection                                | Determined from data | $X_19                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_seen                                         | Determined from data | $X_20                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true)                                 |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+
  | last_miss                                         | Determined from data | $X_21                                                               |
  +---------------------------------------------------+----------------------+---------------------------------------------------------------------+


  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) |
  +-----------------+--------+-------------------------------------+


  X_2
  ***

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | sent       | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | failed     | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | received   | Determined from data | $X_10    |
  +------------+----------------------+----------+
  | unexpected | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | outdated   | Determined from data | $Z.t     |
  +------------+----------------------+----------+


  X_10
  ****

  +----------------------------+----------------------+----------+
  | Name                       | Size                 | Contents |
  +============================+======================+==========+
  | branch                     | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | head                       | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | block_header               | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | operations                 | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | protocols                  | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | operation_hashes_for_block | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | operations_for_block       | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+
  | other                      | Determined from data | $Z.t     |
  +----------------------------+----------------------+----------+


  X_6
  ***

  +-----------+----------------------+----------+
  | Name      | Size                 | Contents |
  +===========+======================+==========+
  | sent      | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | received  | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | failed    | Determined from data | $X_10    |
  +-----------+----------------------+----------+
  | scheduled | Determined from data | $X_10    |
  +-----------+----------------------+----------+


  X_11
  ****

  +-----------------------+----------------------+----------+
  | Name                  | Size                 | Contents |
  +=======================+======================+==========+
  | cannot_download       | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | cannot_parse          | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_prefilter  | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused_by_postfilter | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | applied               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_delayed        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | branch_refused        | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | refused               | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | duplicate             | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+
  | outdated              | Determined from data | $Z.t     |
  +-----------------------+----------------------+----------+


  X_12
  ****

  +------------+----------------------+----------+
  | Name       | Size                 | Contents |
  +============+======================+==========+
  | block      | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | operations | Determined from data | $Z.t     |
  +------------+----------------------+----------+
  | protocol   | 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    |
  +------+----------------------+----------+


  X_15
  ****

  +--------+----------------------+----------+
  | Name   | Size                 | Contents |
  +========+======================+==========+
  | head   | Determined from data | $Z.t     |
  +--------+----------------------+----------+
  | branch | Determined from data | $Z.t     |
  +--------+----------------------+----------+


  X_13
  ****

  +----------+----------------------+----------+
  | Name     | Size                 | Contents |
  +==========+======================+==========+
  | sent     | Determined from data | $X_15    |
  +----------+----------------------+----------+
  | received | Determined from data | $X_15    |
  +----------+----------------------+----------+


  X_1
  ***

  +--------------------------+----------------------+----------+
  | Name                     | Size                 | Contents |
  +==========================+======================+==========+
  | responses                | Determined from data | $X_2     |
  +--------------------------+----------------------+----------+
  | requests                 | Determined from data | $X_6     |
  +--------------------------+----------------------+----------+
  | valid_blocks             | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | old_heads                | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | prevalidator_results     | Determined from data | $X_11    |
  +--------------------------+----------------------+----------+
  | unactivated_chains       | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | inactive_chains          | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | future_blocks_advertised | Determined from data | $Z.t     |
  +--------------------------+----------------------+----------+
  | unadvertised             | Determined from data | $X_12    |
  +--------------------------+----------------------+----------+
  | advertisements           | Determined from data | $X_13    |
  +--------------------------+----------------------+----------+


  p2p_peer.state (Enumeration: unsigned 8-bit integer):
  *****************************************************

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


  p2p_stat
  ********

  +-----------------+---------+--------------------------------------------------------------+
  | 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 |
  +-----------------+---------+--------------------------------------------------------------+


  p2p_connection.id
  *****************

  +--------------------------------+----------+-------------------------------------+
  | Name                           | Size     | Contents                            |
  +================================+==========+=====================================+
  | # bytes in field "p2p_address" | 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_21
  ****

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

  

GET /network/peers/<peer_id>/ban

Blacklist the given peer and remove it from the whitelist if present.

  {  }
  +-----------------+---------+----------------------------------------------------+
  | 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

  [ $p2p_peer.pool_event ... ]
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_address:
    /* An address for locating peers. */
    $unistring
  $p2p_peer.pool_event:
    /* An event that may happen during maintenance of and other operations on
       the connection to a specific peer. */
    { "kind":
        "rejecting_request"
        | "incoming_request"
        | "disconnection"
        | "external_disconnection"
        | "connection_established"
        | "request_rejected",
      "timestamp": $timestamp.system,
      "addr": $p2p_address,
      "port"?: integer ∈ [0, 2^16-1] }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+----------------------------------+
  | Name                  | Size     | Contents                         |
  +=======================+==========+==================================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer          |
  +-----------------------+----------+----------------------------------+
  | Unnamed field 0       | Variable | sequence of $p2p_peer.pool_event |
  +-----------------------+----------+----------------------------------+


  X_0 (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 |
  +-------------+------------------------+


  p2p_peer.pool_event
  *******************

  +--------------------------------+----------+----------------------------------------------------------+
  | Name                           | Size     | Contents                                                 |
  +================================+==========+==========================================================+
  | kind                           | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_0) |
  +--------------------------------+----------+----------------------------------------------------------+
  | timestamp                      | 8 bytes  | signed 64-bit integer                                    |
  +--------------------------------+----------+----------------------------------------------------------+
  | # bytes in field "p2p_address" | 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                                  |
  +--------------------------------+----------+----------------------------------------------------------+

  

GET /network/peers/<peer_id>/trust

Whitelist a given peer permanently and remove it from the blacklist if present. 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/peers/<peer_id>/unban

Remove the given peer from the blacklist.

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


  

GET /network/peers/<peer_id>/untrust

Remove a given peer from the whitelist.

  {  }
  +-----------------+---------+----------------------------------------------------+
  | 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>

  [ [ $p2p_point.id, $p2p_point.info ] ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_point.id:
    /* Identifier for a peer point */
    $unistring
  $p2p_point.info:
    /* Information about a peer point. Includes flags, state, and records
       about past events. */
    { "trusted": boolean,
      "greylisted_until"?: $timestamp.system,
      "state": $p2p_point.state,
      "p2p_peer_id"?: $Crypto_box.Public_key_hash,
      "last_failed_connection"?: $timestamp.system,
      "last_rejected_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_established_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_disconnection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_seen"?: [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_miss"?: $timestamp.system }
  $p2p_point.state:
    /* The state a connection to a peer point can be in: requested
       (connection open from here), accepted (handshake), running (connection
       already established), disconnected (no connection). */
    { "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" }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  p2p_point.id
  ************

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


  p2p_point.state (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 |
  +-----------------+----------+-----------------------+


  p2p_point.info
  **************

  +---------------------------------------------------+----------------------+-------------------------------------+
  | 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 | $p2p_point.state                    |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? 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_4                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_established_connection                       | 24 bytes             | $X_4                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_disconnection                                | 24 bytes             | $X_4                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? 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
  ***

  +-----------------+----------------------+-----------------+
  | Name            | Size                 | Contents        |
  +=================+======================+=================+
  | Unnamed field 0 | Determined from data | $p2p_point.id   |
  +-----------------+----------------------+-----------------+
  | Unnamed field 1 | Determined from data | $p2p_point.info |
  +-----------------+----------------------+-----------------+

  

GET /network/points/<point>

Details about a given `IP:addr`.

  $p2p_point.info
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_point.info:
    /* Information about a peer point. Includes flags, state, and records
       about past events. */
    { "trusted": boolean,
      "greylisted_until"?: $timestamp.system,
      "state": $p2p_point.state,
      "p2p_peer_id"?: $Crypto_box.Public_key_hash,
      "last_failed_connection"?: $timestamp.system,
      "last_rejected_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_established_connection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_disconnection"?:
        [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_seen"?: [ $Crypto_box.Public_key_hash, $timestamp.system ],
      "last_miss"?: $timestamp.system }
  $p2p_point.state:
    /* The state a connection to a peer point can be in: requested
       (connection open from here), accepted (handshake), running (connection
       already established), disconnected (no connection). */
    { "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" }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------------------+----------------------+-------------------------------------+
  | 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 | $p2p_point.state                    |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? 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_0                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_established_connection" | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_established_connection                       | 24 bytes             | $X_1                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_disconnection"          | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_disconnection                                | 24 bytes             | $X_2                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_seen"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_seen                                         | 24 bytes             | $X_3                                |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | ? presence of field "last_miss"                   | 1 byte               | boolean (0 for false, 255 for true) |
  +---------------------------------------------------+----------------------+-------------------------------------+
  | last_miss                                         | 8 bytes              | signed 64-bit integer               |
  +---------------------------------------------------+----------------------+-------------------------------------+


  p2p_point.state (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_3
  ***

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

  

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

Connect to a peer

Optional query arguments :

  • timeout = <timespan>

  {  }
  +-----------------+---------+----------------------------------------------------+
  | 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 and remove it from the whitelist if present.

  {  }
  +-----------------+---------+----------------------------------------------------+
  | 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

  [ $p2p_point.pool_event ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_point.pool_event:
    /* Events happening during maintenance of and operations on a peer point
       pool (such as connections, disconnections, connection requests). */
    [ $timestamp.system,
      { "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.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-----------------------------------+
  | Name                  | Size     | Contents                          |
  +=======================+==========+===================================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer           |
  +-----------------------+----------+-----------------------------------+
  | Unnamed field 0       | Variable | sequence of $p2p_point.pool_event |
  +-----------------------+----------+-----------------------------------+


  X_0 (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                  |
  +-------------+----------+------------------------+


  p2p_point.pool_event
  ********************

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

  

GET /network/points/<point>/trust

Trust a given address permanently and remove it from the blacklist if present. Connections from this address can still be closed on authentication if the peer is greylisted.

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


  

GET /network/points/<point>/unban

Remove an address from the blacklist.

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


  

GET /network/points/<point>/untrust

Remove an address from the whitelist.

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


  

GET /network/self

Return the node's peer id

  $Crypto_box.Public_key_hash
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+----------+
  | Name                       | Size     | Contents |
  +============================+==========+==========+
  | Crypto_box.Public_key_hash | 16 bytes | bytes    |
  +----------------------------+----------+----------+


  

GET /network/stat

Global network bandwidth statistics in B/s.

  $p2p_stat
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $p2p_stat:
    /* Statistics about the p2p network. */
    { "total_sent": $int64,
      "total_recv": $int64,
      "current_inflow": integer ∈ [-2^30-2, 2^30+2],
      "current_outflow": integer ∈ [-2^30-2, 2^30+2] }
  +-----------------+---------+--------------------------------------------------------------+
  | 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/version

Supported network layer version.

  $network_version
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+


  

GET /network/versions

DEPRECATED: use `version` instead.

  [ $network_version ... ]
  $distributed_db_version:
    /* A version number for the distributed DB protocol */
    integer ∈ [0, 2^16-1]
  $distributed_db_version.name:
    /* A name for the distributed DB protocol */
    $unistring
  $network_version:
    /* A version number for the network protocol (includes distributed DB
       version and p2p version) */
    { "chain_name": $distributed_db_version.name,
      "distributed_db_version": $distributed_db_version,
      "p2p_version": $p2p_version }
  $p2p_version:
    /* A version number for the p2p layer. */
    integer ∈ [0, 2^16-1]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+------------------------------+
  | Name                  | Size     | Contents                     |
  +=======================+==========+==============================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer      |
  +-----------------------+----------+------------------------------+
  | Unnamed field 0       | Variable | sequence of $network_version |
  +-----------------------+----------+------------------------------+


  network_version
  ***************

  +------------------------------------------------+----------+-------------------------+
  | Name                                           | Size     | Contents                |
  +================================================+==========+=========================+
  | # bytes in field "distributed_db_version.name" | 4 bytes  | unsigned 30-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | chain_name                                     | Variable | bytes                   |
  +------------------------------------------------+----------+-------------------------+
  | distributed_db_version                         | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+
  | p2p_version                                    | 2 bytes  | unsigned 16-bit integer |
  +------------------------------------------------+----------+-------------------------+

  

GET /protocols

  [ $Protocol_hash ... ]
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of bytes       |
  +-----------------------+----------+-------------------------+


  

GET /protocols/<Protocol_hash>

  $protocol
  $protocol:
    /* The environment a protocol relies on and the components a protocol is
       made of. */
    { "expected_env_version": integer ∈ [-2^15, 2^15-1],
      "components":
        [ { "name": $unistring,
            "interface"?: $unistring,
            "implementation": $unistring } ... ] }
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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 /stats/gc

Gets stats from the OCaml Garbage Collector

  { "minor_words": number,
    "promoted_words": number,
    "major_words": number,
    "minor_collections": integer ∈ [-2^30-2, 2^30+2],
    "major_collections": integer ∈ [-2^30-2, 2^30+2],
    "heap_words": integer ∈ [-2^30-2, 2^30+2],
    "heap_chunks": integer ∈ [-2^30-2, 2^30+2],
    "live_words": integer ∈ [-2^30-2, 2^30+2],
    "live_blocks": integer ∈ [-2^30-2, 2^30+2],
    "free_words": integer ∈ [-2^30-2, 2^30+2],
    "free_blocks": integer ∈ [-2^30-2, 2^30+2],
    "largest_free": integer ∈ [-2^30-2, 2^30+2],
    "fragments": integer ∈ [-2^30-2, 2^30+2],
    "compactions": integer ∈ [-2^30-2, 2^30+2],
    "top_heap_words": integer ∈ [-2^30-2, 2^30+2],
    "stack_size": integer ∈ [-2^30-2, 2^30+2] }
  +-------------------+---------+--------------------------------------------------------------+
  | Name              | Size    | Contents                                                     |
  +===================+=========+==============================================================+
  | minor_words       | 8 bytes | double-precision floating-point number                       |
  +-------------------+---------+--------------------------------------------------------------+
  | promoted_words    | 8 bytes | double-precision floating-point number                       |
  +-------------------+---------+--------------------------------------------------------------+
  | major_words       | 8 bytes | double-precision floating-point number                       |
  +-------------------+---------+--------------------------------------------------------------+
  | minor_collections | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | major_collections | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | heap_words        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | heap_chunks       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | live_words        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | live_blocks       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | free_words        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | free_blocks       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | largest_free      | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | fragments         | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | compactions       | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | top_heap_words    | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+
  | stack_size        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-------------------+---------+--------------------------------------------------------------+


  

GET /stats/memory

Gets memory usage stats

  { "page_size": integer ∈ [-2^30-2, 2^30+2],
    "size": $int64,
    "resident": $int64,
    "shared": $int64,
    "text": $int64,
    "lib": $int64,
    "data": $int64,
    "dt": $int64 }
  || { "page_size": integer ∈ [-2^30-2, 2^30+2],
       "mem": number,
       "resident": $int64 }
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_0     |
  +-----------------+----------------------+----------+


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

  Linux_proc_statm (tag 0)
  ========================

  +-----------+---------+--------------------------------------------------------------+
  | Name      | Size    | Contents                                                     |
  +===========+=========+==============================================================+
  | Tag       | 1 byte  | unsigned 8-bit integer                                       |
  +-----------+---------+--------------------------------------------------------------+
  | page_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------+---------+--------------------------------------------------------------+
  | size      | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | resident  | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | shared    | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | text      | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | lib       | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | data      | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+
  | dt        | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+


  Darwin_ps (tag 1)
  =================

  +-----------+---------+--------------------------------------------------------------+
  | Name      | Size    | Contents                                                     |
  +===========+=========+==============================================================+
  | Tag       | 1 byte  | unsigned 8-bit integer                                       |
  +-----------+---------+--------------------------------------------------------------+
  | page_size | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------+---------+--------------------------------------------------------------+
  | mem       | 8 bytes | double-precision floating-point number                       |
  +-----------+---------+--------------------------------------------------------------+
  | resident  | 8 bytes | signed 64-bit integer                                        |
  +-----------+---------+--------------------------------------------------------------+

  

GET /workers/block_validator

Introspect the state of the block_validator worker.

  { "status":
      { "phase": "launching",
        "since": $timestamp.system }
      || { "phase": "running",
           "since": $timestamp.system }
      || { "phase": "closing",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { "phase": "closed",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { "phase": "crashed",
           "birth": $timestamp.system,
           "since": $timestamp.system,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp.system,
          "request":
            { "block": $block_hash,
              "chain_id": $Chain_id,
              "peer"?: $Crypto_box.Public_key_hash } } ... ],
    "backlog":
      [ { "level":
            "info" | "debug" | "error" | "fatal" | "warning" | "notice",
          "events":
            [ { "message": $unistring }
              || { "successful_validation":
                     { "block": $block_hash,
                       "chain_id": $Chain_id,
                       "peer"?: $Crypto_box.Public_key_hash },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timestamp.system,
                       "completed": $timestamp.system } }
              || { "failed_validation":
                     { "block": $block_hash,
                       "chain_id": $Chain_id,
                       "peer"?: $Crypto_box.Public_key_hash },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timestamp.system,
                       "completed": $timestamp.system },
                   "errors"?: $error } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp.system,
        "treated": $timestamp.system,
        "request":
          { "block": $block_hash,
            "chain_id": $Chain_id,
            "peer"?: $Crypto_box.Public_key_hash } } }
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $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.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------------------+-------------------------------------+
  | 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_12                               |
  +---------------------------------------+----------------------+-------------------------------------+


  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_13                   |
  +-----------------------+----------------------+-------------------------+


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

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | debug          |
  +-------------+----------------+
  | 1           | info           |
  +-------------+----------------+
  | 2           | notice         |
  +-------------+----------------+
  | 3           | warning        |
  +-------------+----------------+
  | 4           | error          |
  +-------------+----------------+
  | 5           | fatal          |
  +-------------+----------------+


  X_10
  ****

  +-----------+---------+-----------------------+
  | 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_11 (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_13                  |
  +-----------------------+----------------------+------------------------+
  | status                | 24 bytes             | $X_10                  |
  +-----------------------+----------------------+------------------------+


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

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


  X_6
  ***

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


  X_5
  ***

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


  X_3
  ***

  +-----------------------+----------------------+----------------------------------------------------------+
  | Name                  | Size                 | Contents                                                 |
  +=======================+======================+==========================================================+
  | level                 | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_4) |
  +-----------------------+----------------------+----------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                  |
  +-----------------------+----------------------+----------------------------------------------------------+
  | events                | Determined from data | $X_5                                                     |
  +-----------------------+----------------------+----------------------------------------------------------+


  X_13
  ****

  +----------------------------+----------+-------------------------------------+
  | 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_12
  ****

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

  

GET /workers/chain_validators

Lists the chain validator workers and their status.

  [ { "chain_id": $Chain_id,
      "status":
        { "phase": "launching",
          "since": $timestamp.system }
        || { "phase": "running",
             "since": $timestamp.system }
        || { "phase": "closing",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { "phase": "closed",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { "phase": "crashed",
             "birth": $timestamp.system,
             "since": $timestamp.system,
             "errors": $error },
      "information":
        { "instances": integer ∈ [-2^30-2, 2^30+2],
          "status":
            { "phase": "launching",
              "since": $timestamp.system }
            || { "phase": "running",
                 "since": $timestamp.system }
            || { "phase": "closing",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { "phase": "closed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { "phase": "crashed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system,
                 "errors": $error },
          "queue_length": integer ∈ [-2^30-2, 2^30+2] },
      "pipelines": integer ∈ [-128, 127] } ... ]
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $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.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_3 (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_2
  ***

  +--------------+----------------------+--------------------------------------------------------------+
  | Name         | Size                 | Contents                                                     |
  +==============+======================+==============================================================+
  | instances    | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+
  | status       | Determined from data | $X_3                                                         |
  +--------------+----------------------+--------------------------------------------------------------+
  | queue_length | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+


  X_0
  ***

  +-------------+----------------------+----------------------+
  | Name        | Size                 | Contents             |
  +=============+======================+======================+
  | chain_id    | 4 bytes              | bytes                |
  +-------------+----------------------+----------------------+
  | status      | Determined from data | $X_3                 |
  +-------------+----------------------+----------------------+
  | information | Determined from data | $X_2                 |
  +-------------+----------------------+----------------------+
  | pipelines   | 1 byte               | signed 8-bit integer |
  +-------------+----------------------+----------------------+

  

GET /workers/chain_validators/<chain_id>

Introspect the state of a chain validator worker.

  { "status":
      { "phase": "launching",
        "since": $timestamp.system }
      || { "phase": "running",
           "since": $timestamp.system }
      || { "phase": "closing",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { "phase": "closed",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { "phase": "crashed",
           "birth": $timestamp.system,
           "since": $timestamp.system,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp.system,
          "request": $block_hash } ... ],
    "backlog":
      [ { "level":
            "info" | "debug" | "error" | "fatal" | "warning" | "notice",
          "events":
            [ { "request": $block_hash,
                "status":
                  { "pushed": $timestamp.system,
                    "treated": $timestamp.system,
                    "completed": $timestamp.system },
                "outcome": "branch" | "ignored" | "increment",
                "fitness": $fitness }
              || $error ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp.system,
        "treated": $timestamp.system,
        "request": $block_hash } }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $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.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------------------+-------------------------------------+
  | 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_9                                |
  +---------------------------------------+----------------------+-------------------------------------+


  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_3 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | debug          |
  +-------------+----------------+
  | 1           | info           |
  +-------------+----------------+
  | 2           | notice         |
  +-------------+----------------+
  | 3           | warning        |
  +-------------+----------------+
  | 4           | error          |
  +-------------+----------------+
  | 5           | fatal          |
  +-------------+----------------+


  X_6
  ***

  +-----------+---------+-----------------------+
  | 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_7 (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_8 (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_6                                                     |
  +----------------------------+----------+----------------------------------------------------------+
  | outcome                    | 1 byte   | unsigned 8-bit integer encoding an enumeration (see X_7) |
  +----------------------------+----------+----------------------------------------------------------+
  | # 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_5
  ***

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


  X_4
  ***

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


  X_2
  ***

  +-----------------------+----------------------+----------------------------------------------------------+
  | Name                  | Size                 | Contents                                                 |
  +=======================+======================+==========================================================+
  | level                 | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_3) |
  +-----------------------+----------------------+----------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                  |
  +-----------------------+----------------------+----------------------------------------------------------+
  | events                | Determined from data | $X_4                                                     |
  +-----------------------+----------------------+----------------------------------------------------------+


  X_9
  ***

  +---------+----------+-----------------------+
  | 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>/ddb

Introspect the state of the DDB attached to a chain validator worker.

  { "p2p_readers": integer ∈ [-2^30-2, 2^30+2],
    "active_chains": integer ∈ [-2^30-2, 2^30+2],
    "operation_db":
      { "table_length": integer ∈ [-2^30-2, 2^30+2],
        "scheduler_length": integer ∈ [-2^30-2, 2^30+2] },
    "operations_db":
      { "table_length": integer ∈ [-2^30-2, 2^30+2],
        "scheduler_length": integer ∈ [-2^30-2, 2^30+2] },
    "block_header_db":
      { "table_length": integer ∈ [-2^30-2, 2^30+2],
        "scheduler_length": integer ∈ [-2^30-2, 2^30+2] },
    "operations_hashed_db":
      { "table_length": integer ∈ [-2^30-2, 2^30+2],
        "scheduler_length": integer ∈ [-2^30-2, 2^30+2] },
    "active_connections": integer ∈ [-2^30-2, 2^30+2],
    "active_peers": integer ∈ [-2^30-2, 2^30+2] }
  +----------------------+---------+--------------------------------------------------------------+
  | Name                 | Size    | Contents                                                     |
  +======================+=========+==============================================================+
  | p2p_readers          | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------+---------+--------------------------------------------------------------+
  | active_chains        | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------+---------+--------------------------------------------------------------+
  | operation_db         | 8 bytes | $X_0                                                         |
  +----------------------+---------+--------------------------------------------------------------+
  | operations_db        | 8 bytes | $X_1                                                         |
  +----------------------+---------+--------------------------------------------------------------+
  | block_header_db      | 8 bytes | $X_2                                                         |
  +----------------------+---------+--------------------------------------------------------------+
  | operations_hashed_db | 8 bytes | $X_3                                                         |
  +----------------------+---------+--------------------------------------------------------------+
  | active_connections   | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------+---------+--------------------------------------------------------------+
  | active_peers         | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------+---------+--------------------------------------------------------------+


  X_3
  ***

  +------------------+---------+--------------------------------------------------------------+
  | Name             | Size    | Contents                                                     |
  +==================+=========+==============================================================+
  | table_length     | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------------------+---------+--------------------------------------------------------------+
  | scheduler_length | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +------------------+---------+--------------------------------------------------------------+

  

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.system }
        || { "phase": "running",
             "since": $timestamp.system }
        || { "phase": "closing",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { "phase": "closed",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { "phase": "crashed",
             "birth": $timestamp.system,
             "since": $timestamp.system,
             "errors": $error },
      "information":
        { "instances": integer ∈ [-2^30-2, 2^30+2],
          "status":
            { "phase": "launching",
              "since": $timestamp.system }
            || { "phase": "running",
                 "since": $timestamp.system }
            || { "phase": "closing",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { "phase": "closed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { "phase": "crashed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system,
                 "errors": $error },
          "queue_length": integer ∈ [-2^30-2, 2^30+2] },
      "pipelines":
        { "fetched_headers": integer ∈ [-2^30-2, 2^30+2],
          "fetched_blocks": integer ∈ [-2^30-2, 2^30+2] } } ... ]
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $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.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_3 (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_2
  ***

  +--------------+----------------------+--------------------------------------------------------------+
  | Name         | Size                 | Contents                                                     |
  +==============+======================+==============================================================+
  | instances    | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+
  | status       | Determined from data | $X_3                                                         |
  +--------------+----------------------+--------------------------------------------------------------+
  | queue_length | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+


  X_4
  ***

  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | fetched_headers | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+
  | fetched_blocks  | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  X_0
  ***

  +-------------+----------------------+----------+
  | Name        | Size                 | Contents |
  +=============+======================+==========+
  | peer_id     | 16 bytes             | bytes    |
  +-------------+----------------------+----------+
  | status      | Determined from data | $X_3     |
  +-------------+----------------------+----------+
  | information | Determined from data | $X_2     |
  +-------------+----------------------+----------+
  | pipelines   | 8 bytes              | $X_4     |
  +-------------+----------------------+----------+

  

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

Introspect the state of a peer validator worker.

  { "status":
      { "phase": "launching",
        "since": $timestamp.system }
      || { "phase": "running",
           "since": $timestamp.system }
      || { "phase": "closing",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { "phase": "closed",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { "phase": "crashed",
           "birth": $timestamp.system,
           "since": $timestamp.system,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp.system,
          "request":
            { "request": "new_head",
              "block": $block_hash }
            || { "request": "new_branch",
                 "block": $block_hash,
                 "locators": integer ∈ [-2^30-2, 2^30+2] } } ... ],
    "backlog":
      [ { "level":
            "info" | "debug" | "error" | "fatal" | "warning" | "notice",
          "events":
            [ { "message": $unistring }
              || { "request":
                     { "request": "new_head",
                       "block": $block_hash }
                     || { "request": "new_branch",
                          "block": $block_hash,
                          "locators": integer ∈ [-2^30-2, 2^30+2] },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timestamp.system,
                       "completed": $timestamp.system } }
              || { "error": $error,
                   "failed_request":
                     { "request": "new_head",
                       "block": $block_hash }
                     || { "request": "new_branch",
                          "block": $block_hash,
                          "locators": integer ∈ [-2^30-2, 2^30+2] },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timestamp.system,
                       "completed": $timestamp.system } } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp.system,
        "treated": $timestamp.system,
        "request":
          { "request": "new_head",
            "block": $block_hash }
          || { "request": "new_branch",
               "block": $block_hash,
               "locators": integer ∈ [-2^30-2, 2^30+2] } } }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $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.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------------------+-------------------------------------+
  | 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_12                               |
  +---------------------------------------+----------------------+-------------------------------------+


  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_13                   |
  +-----------------------+----------------------+-------------------------+


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

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | debug          |
  +-------------+----------------+
  | 1           | info           |
  +-------------+----------------+
  | 2           | notice         |
  +-------------+----------------+
  | 3           | warning        |
  +-------------+----------------+
  | 4           | error          |
  +-------------+----------------+
  | 5           | fatal          |
  +-------------+----------------+


  X_10
  ****

  +-----------+---------+-----------------------+
  | 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_11 (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_13                  |
  +---------+----------------------+------------------------+
  | status  | 24 bytes             | $X_10                  |
  +---------+----------------------+------------------------+


  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_13                   |
  +--------------------------+----------------------+-------------------------+
  | status                   | 24 bytes             | $X_10                   |
  +--------------------------+----------------------+-------------------------+


  X_6
  ***

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


  X_5
  ***

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


  X_3
  ***

  +-----------------------+----------------------+----------------------------------------------------------+
  | Name                  | Size                 | Contents                                                 |
  +=======================+======================+==========================================================+
  | level                 | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_4) |
  +-----------------------+----------------------+----------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                  |
  +-----------------------+----------------------+----------------------------------------------------------+
  | events                | Determined from data | $X_5                                                     |
  +-----------------------+----------------------+----------------------------------------------------------+


  X_13 (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                                                        |
  +----------+----------+--------------------------------------------------------------+
  | locators | 4 bytes  | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------+----------+--------------------------------------------------------------+


  X_12
  ****

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

  

GET /workers/prevalidators

Lists the Prevalidator workers and their status.

  [ { "chain_id": $Chain_id,
      "status":
        { "phase": "launching",
          "since": $timestamp.system }
        || { "phase": "running",
             "since": $timestamp.system }
        || { "phase": "closing",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { "phase": "closed",
             "birth": $timestamp.system,
             "since": $timestamp.system }
        || { "phase": "crashed",
             "birth": $timestamp.system,
             "since": $timestamp.system,
             "errors": $error },
      "information":
        { "instances": integer ∈ [-2^30-2, 2^30+2],
          "status":
            { "phase": "launching",
              "since": $timestamp.system }
            || { "phase": "running",
                 "since": $timestamp.system }
            || { "phase": "closing",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { "phase": "closed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system }
            || { "phase": "crashed",
                 "birth": $timestamp.system,
                 "since": $timestamp.system,
                 "errors": $error },
          "queue_length": integer ∈ [-2^30-2, 2^30+2] },
      "pipelines": integer ∈ [-128, 127] } ... ]
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $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.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+


  X_3 (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_2
  ***

  +--------------+----------------------+--------------------------------------------------------------+
  | Name         | Size                 | Contents                                                     |
  +==============+======================+==============================================================+
  | instances    | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+
  | status       | Determined from data | $X_3                                                         |
  +--------------+----------------------+--------------------------------------------------------------+
  | queue_length | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +--------------+----------------------+--------------------------------------------------------------+


  X_0
  ***

  +-------------+----------------------+----------------------+
  | Name        | Size                 | Contents             |
  +=============+======================+======================+
  | chain_id    | 4 bytes              | bytes                |
  +-------------+----------------------+----------------------+
  | status      | Determined from data | $X_3                 |
  +-------------+----------------------+----------------------+
  | information | Determined from data | $X_2                 |
  +-------------+----------------------+----------------------+
  | pipelines   | 1 byte               | signed 8-bit integer |
  +-------------+----------------------+----------------------+

  

GET /workers/prevalidators/<chain_id>

Introspect the state of prevalidator workers.

  { "status":
      { "phase": "launching",
        "since": $timestamp.system }
      || { "phase": "running",
           "since": $timestamp.system }
      || { "phase": "closing",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { "phase": "closed",
           "birth": $timestamp.system,
           "since": $timestamp.system }
      || { "phase": "crashed",
           "birth": $timestamp.system,
           "since": $timestamp.system,
           "errors": $error },
    "pending_requests":
      [ { "pushed": $timestamp.system,
          "request":
            { "request": "flush",
              "block": $block_hash }
            || { "request": "notify",
                 "peer": $Crypto_box.Public_key_hash,
                 "mempool": $mempool }
            || { "request": "inject",
                 "operation": $operation }
            || { "request": "arrived",
                 "operation_hash": $Operation_hash,
                 "operation": $operation }
            || { "request": "advertise" } } ... ],
    "backlog":
      [ { "level":
            "info" | "debug" | "error" | "fatal" | "warning" | "notice",
          "events":
            [ { "message": $unistring }
              || { "request":
                     { "request": "flush",
                       "block": $block_hash }
                     || { "request": "notify",
                          "peer": $Crypto_box.Public_key_hash,
                          "mempool": $mempool }
                     || { "request": "inject",
                          "operation": $operation }
                     || { "request": "arrived",
                          "operation_hash": $Operation_hash,
                          "operation": $operation }
                     || { "request": "advertise" },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timestamp.system,
                       "completed": $timestamp.system } }
              || { "error": $error,
                   "failed_request":
                     { "request": "flush",
                       "block": $block_hash }
                     || { "request": "notify",
                          "peer": $Crypto_box.Public_key_hash,
                          "mempool": $mempool }
                     || { "request": "inject",
                          "operation": $operation }
                     || { "request": "arrived",
                          "operation_hash": $Operation_hash,
                          "operation": $operation }
                     || { "request": "advertise" },
                   "status":
                     { "pushed": $timestamp.system,
                       "treated": $timestamp.system,
                       "completed": $timestamp.system } } ... ] } ... ],
    "current_request"?:
      { "pushed": $timestamp.system,
        "treated": $timestamp.system,
        "request":
          { "request": "flush",
            "block": $block_hash }
          || { "request": "notify",
               "peer": $Crypto_box.Public_key_hash,
               "mempool": $mempool }
          || { "request": "inject",
               "operation": $operation }
          || { "request": "arrived",
               "operation_hash": $Operation_hash,
               "operation": $operation }
          || { "request": "advertise" } } }
  $Crypto_box.Public_key_hash:
    /* A Cryptobox public key ID (Base58Check-encoded) */
    $unistring
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $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
  $mempool:
    /* A batch of operation. This format is used to gossip operations between
       peers. */
    { "known_valid": [ $Operation_hash ... ],
      "pending": [ $Operation_hash ... ] }
  $operation:
    /* An operation. The shell_header part indicates a block an operation is
       meant to apply on top of. The proto part is protocol-specific and
       appears as a binary blob. */
    { "branch": $block_hash,
      "data": /^[a-zA-Z0-9]+$/ }
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $timestamp.system:
    /* A timestamp as seen by the underlying, local computer: subsecond-level
       precision, epoch or rfc3339 based. */
    $timestamp.rfc || $int64
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------------------+-------------------------+
  | 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_4        |
  +-----------------------+----------------------+-------------------------+
  | current_request       | Variable             | $X_15                   |
  +-----------------------+----------------------+-------------------------+


  X_15
  ****

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


  X_17 (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 | $mempool               |
  +---------+----------------------+------------------------+


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

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


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

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


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

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


  X_16
  ****

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


  operation
  *********

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


  X_4
  ***

  +-----------------------+----------------------+----------------------------------------------------------+
  | Name                  | Size                 | Contents                                                 |
  +=======================+======================+==========================================================+
  | level                 | 1 byte               | unsigned 8-bit integer encoding an enumeration (see X_5) |
  +-----------------------+----------------------+----------------------------------------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer                                  |
  +-----------------------+----------------------+----------------------------------------------------------+
  | events                | Determined from data | $X_6                                                     |
  +-----------------------+----------------------+----------------------------------------------------------+


  X_6
  ***

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


  X_7
  ***

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


  X_14 (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_17                  |
  +---------+----------+------------------------+
  | status  | 24 bytes | $X_13                  |
  +---------+----------+------------------------+


  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_17                   |
  +--------------------------+----------+-------------------------+
  | status                   | 24 bytes | $X_13                   |
  +--------------------------+----------+-------------------------+


  X_13
  ****

  +-----------+---------+-----------------------+
  | 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_5 (Enumeration: unsigned 8-bit integer):
  ******************************************

  +-------------+----------------+
  | Case number | Encoded string |
  +=============+================+
  | 0           | debug          |
  +-------------+----------------+
  | 1           | info           |
  +-------------+----------------+
  | 2           | notice         |
  +-------------+----------------+
  | 3           | warning        |
  +-------------+----------------+
  | 4           | error          |
  +-------------+----------------+
  | 5           | fatal          |
  +-------------+----------------+


  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_17                   |
  +-----------------------+----------+-------------------------+


  mempool
  *******

  +-----------------------+----------------------+-------------------------+
  | 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_16                   |
  +-----------------------+----------------------+-------------------------+


  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                   |
  +--------------------------+----------+-------------------------+

  

Protocol Alpha

GET ../<block_id>

All the information about a block.

  { "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
    "chain_id": $Chain_id,
    "hash": $block_hash,
    "header": $raw_block_header,
    "metadata": $block_header_metadata,
    "operations": [ [ $operation ... ] ... ] }
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    $unistring
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    $unistring
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    $unistring
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    $unistring
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "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": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
      "next_protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
      "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:
    [ { "action": "update",
        "big_map": $bignum,
        "key_hash": $script_expr,
        "key": $micheline.michelson_v1.expression,
        "value"?: $micheline.michelson_v1.expression }
      || { "action": "remove",
           "big_map": $bignum }
      || { "action": "copy",
           "source_big_map": $bignum,
           "destination_big_map": $bignum }
      || { "action": "alloc",
           "big_map": $bignum,
           "key_type": $micheline.michelson_v1.expression,
           "value_type": $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. */
    $unistring
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    $unistring
  $entrypoint:
    /* entrypoint
       Named entrypoint to a Michelson smart contract */
    "default"
    || "root"
    || "do"
    || "set_delegate"
    || "remove_delegate"
    || 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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $operation:
    { "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
      "chain_id": $Chain_id,
      "hash": $Operation_hash,
      "branch": $block_hash,
      "contents": [ $operation.alpha.operation_contents_and_result ... ],
      "signature"?: $Signature }
    || { "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
         "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": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?:
           { "entrypoint": $entrypoint,
             "value": $micheline.michelson_v1.expression } }
    || { "kind": "origination",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "balance": $mutez,
         "delegate"?: $Signature.Public_key_hash,
         "script": $scripted.contracts }
    || { "kind": "delegation",
         "source": $Signature.Public_key_hash,
         "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"?:
           { "entrypoint": $entrypoint,
             "value": $micheline.michelson_v1.expression },
         "result": $operation.alpha.operation_result.transaction }
    || { "kind": "origination",
         "source": $contract_id,
         "nonce": integer ∈ [0, 2^16-1],
         "balance": $mutez,
         "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": $Signature.Public_key_hash,
         "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": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?:
           { "entrypoint": $entrypoint,
             "value": $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": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "balance": $mutez,
         "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": $Signature.Public_key_hash,
         "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",
      "consumed_gas"?: $bignum }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ],
         "consumed_gas"?: $bignum }
  $operation.alpha.operation_result.origination:
    { "status": "applied",
      "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 ... ],
         "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_result.reveal:
    { "status": "applied",
      "consumed_gas"?: $bignum }
    || { "status": "failed",
         "errors": [ $error ... ] }
    || { "status": "skipped" }
    || { "status": "backtracked",
         "errors"?: [ $error ... ],
         "consumed_gas"?: $bignum }
  $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,
      "allocated_destination_contract"?: boolean }
    || { "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,
         "allocated_destination_contract"?: boolean }
  $operation_metadata.alpha.balance_updates:
    [ { "kind": "contract",
        "contract": $contract_id,
        "change": $int64 }
      || { "kind": "freezer",
           "category": "rewards",
           "delegate": $Signature.Public_key_hash,
           "cycle": integer ∈ [-2^31-2, 2^31+2],
           "change": $int64 }
      || { "kind": "freezer",
           "category": "fees",
           "delegate": $Signature.Public_key_hash,
           "cycle": integer ∈ [-2^31-2, 2^31+2],
           "change": $int64 }
      || { "kind": "freezer",
           "category": "deposits",
           "delegate": $Signature.Public_key_hash,
           "cycle": 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.protocol,
      "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) */
    $unistring
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  $test_chain_status:
    /* The status of the test chain: not_running (there is no test chain at
       the moment), forking (the test chain is being setup), running (the
       test chain is running). */
    { "status": "not_running" }
    || { "status": "forking",
         "protocol": $Protocol_hash,
         "expiration": $timestamp.protocol }
    || { "status": "running",
         "chain_id": $Chain_id,
         "genesis": $block_hash,
         "protocol": $Protocol_hash,
         "expiration": $timestamp.protocol }
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------------------+-------------------------+
  | 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_206                |
  +-----------------+----------------------+-----------------------+
  | 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 107)
  ================

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 21 bytes             | $public_key_hash       |
  +---------------+----------------------+------------------------+
  | 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 108)
  =====================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 21 bytes             | $public_key_hash                    |
  +----------------------------------+----------------------+-------------------------------------+
  | 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 | $X_177                              |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 109)
  =====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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                                |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 110)
  ====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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 |
  +--------------+----------------------+------------------------+
  | consumed_gas | 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_195                              |
  +------------------------------+----------------------+-------------------------------------+
  | consumed_gas                 | Determined from data | $Z.t                                |
  +------------------------------+----------------------+-------------------------------------+


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

  update (tag 0)
  ==============

  +-----------------------------+----------------------+-------------------------------------+
  | Name                        | Size                 | Contents                            |
  +=============================+======================+=====================================+
  | Tag                         | 1 byte               | unsigned 8-bit integer              |
  +-----------------------------+----------------------+-------------------------------------+
  | big_map                     | Determined from data | $Z.t                                |
  +-----------------------------+----------------------+-------------------------------------+
  | 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  |
  +-----------------------------+----------------------+-------------------------------------+


  remove (tag 1)
  ==============

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


  copy (tag 2)
  ============

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


  alloc (tag 3)
  =============

  +------------+----------------------+------------------------------------+
  | Name       | Size                 | Contents                           |
  +============+======================+====================================+
  | Tag        | 1 byte               | unsigned 8-bit integer             |
  +------------+----------------------+------------------------------------+
  | big_map    | Determined from data | $Z.t                               |
  +------------+----------------------+------------------------------------+
  | key_type   | Determined from data | $micheline.michelson_v1.expression |
  +------------+----------------------+------------------------------------+
  | value_type | 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 | $X_177                                        |
  +----------------------------------+----------------------+-----------------------------------------------+
  | 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                       |
  +--------------------------------+----------------------+-----------------------------------------------+
  | balance                        | Determined from data | $N.t                                          |
  +--------------------------------+----------------------+-----------------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true)           |
  +--------------------------------+----------------------+-----------------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                              |
  +--------------------------------+----------------------+-----------------------------------------------+
  | 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_48
  ****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | 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_102
  *****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | 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              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? 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_195                              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? 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                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  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    |
  +------+----------------------+----------+


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

  default (tag 0)
  ===============

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


  root (tag 1)
  ============

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


  do (tag 2)
  ==========

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


  set_delegate (tag 3)
  ====================

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


  remove_delegate (tag 4)
  =======================

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


  named (tag 255)
  ===============

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


  X_177
  *****

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | entrypoint            | Determined from data | $entrypoint             |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | value                 | Variable             | 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            |
  +-------------+------------------+
  | 112         | DIG              |
  +-------------+------------------+
  | 113         | DUG              |
  +-------------+------------------+
  | 114         | EMPTY_BIG_MAP    |
  +-------------+------------------+
  | 115         | APPLY            |
  +-------------+------------------+
  | 116         | chain_id         |
  +-------------+------------------+
  | 117         | CHAIN_ID         |
  +-------------+------------------+


  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_19       |
  +-----------------------+----------+-------------------------+


  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                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | allocated_destination_contract                              | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  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_195                              |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | ? 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                                |
  +-------------------------------------------------------------+----------------------+-------------------------------------+
  | allocated_destination_contract                              | 1 byte               | boolean (0 for false, 255 for true) |
  +-------------------------------------------------------------+----------------------+-------------------------------------+


  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_195
  *****

  +-----------------------+----------+-------------------------+
  | 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                   |
  +--------------------------+----------+-------------------------+


  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_157
  *****

  +-------------------------------------------------------------+----------------------+--------------------------------------------------------+
  | 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_206 (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       |
  +----------+----------+------------------------+
  | cycle    | 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       |
  +----------+----------+------------------------+
  | cycle    | 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       |
  +----------+----------+------------------------+
  | cycle    | 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_204
  *****

  +-------------------------------------------------------------+----------+------------------------------------+
  | 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_204                 |
  +----------+----------------------+------------------------+


  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 107)
  ================

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 21 bytes             | $public_key_hash       |
  +---------------+----------------------+------------------------+
  | 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_157                 |
  +---------------+----------------------+------------------------+


  Transaction (tag 108)
  =====================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 21 bytes             | $public_key_hash                    |
  +----------------------------------+----------------------+-------------------------------------+
  | 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 | $X_177                              |
  +----------------------------------+----------------------+-------------------------------------+
  | metadata                         | Determined from data | $X_102                              |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 109)
  =====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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                                |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+
  | metadata                       | Determined from data | $X_48                               |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 110)
  ====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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_157                              |
  +--------------------------------+----------------------+-------------------------------------+


  X_207 (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_207                  |
  +-----------------------+----------------------+-------------------------+


  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/big_maps/<big_map_id>/<script_expr>

Access the value associated with a key in a big map.

  $micheline.michelson_v1.expression
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+------------------------------------+
  | 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            |
  +-------------+------------------+
  | 112         | DIG              |
  +-------------+------------------+
  | 113         | DUG              |
  +-------------+------------------+
  | 114         | EMPTY_BIG_MAP    |
  +-------------+------------------+
  | 115         | APPLY            |
  +-------------+------------------+
  | 116         | chain_id         |
  +-------------+------------------+
  | 117         | CHAIN_ID         |
  +-------------+------------------+


  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/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],
    "max_proposals_per_delegate": integer ∈ [0, 255],
    "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_size": integer ∈ [-2^30-2, 2^30+2],
    "block_security_deposit": $mutez,
    "endorsement_security_deposit": $mutez,
    "block_reward": $mutez,
    "endorsement_reward": $mutez,
    "cost_per_byte": $mutez,
    "hard_storage_limit_per_operation": $bignum,
    "test_chain_duration": $int64,
    "quorum_min": integer ∈ [-2^31-2, 2^31+2],
    "quorum_max": integer ∈ [-2^31-2, 2^31+2],
    "min_proposal_quorum": integer ∈ [-2^31-2, 2^31+2],
    "initial_endorsers": integer ∈ [0, 2^16-1],
    "delay_per_missing_endorsement": $int64 }
  $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 |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | max_proposals_per_delegate       | 1 byte               | unsigned 8-bit integer                                       |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | 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_size                 | 4 bytes              | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | 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                                                         |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | test_chain_duration              | 8 bytes              | signed 64-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | quorum_min                       | 4 bytes              | signed 32-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | quorum_max                       | 4 bytes              | signed 32-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | min_proposal_quorum              | 4 bytes              | signed 32-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | initial_endorsers                | 2 bytes              | unsigned 16-bit integer                                      |
  +----------------------------------+----------------------+--------------------------------------------------------------+
  | delay_per_missing_endorsement    | 8 bytes              | signed 64-bit integer                                        |
  +----------------------------------+----------------------+--------------------------------------------------------------+


  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. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+--------------------------+
  | 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.

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


  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 a big map of the contract (deprecated).

  { "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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +------+----------------------+------------------------------------+
  | 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            |
  +-------------+------------------+
  | 112         | DIG              |
  +-------------+------------------+
  | 113         | DUG              |
  +-------------+------------------+
  | 114         | EMPTY_BIG_MAP    |
  +-------------+------------------+
  | 115         | APPLY            |
  +-------------+------------------+
  | 116         | chain_id         |
  +-------------+------------------+
  | 117         | CHAIN_ID         |
  +-------------+------------------+


  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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+----------+
  | 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            |
  +-------------+------------------+
  | 112         | DIG              |
  +-------------+------------------+
  | 113         | DUG              |
  +-------------+------------------+
  | 114         | EMPTY_BIG_MAP    |
  +-------------+------------------+
  | 115         | APPLY            |
  +-------------+------------------+
  | 116         | chain_id         |
  +-------------+------------------+
  | 117         | CHAIN_ID         |
  +-------------+------------------+


  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>/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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------+----------+------------------+
  | 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>/entrypoints

Return the list of entrypoints of the contract

  { "unreachable"?: [ { "path": [ $michelson.v1.primitives ... ] } ... ],
    "entrypoints": { *: $micheline.michelson_v1.expression } }
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | unreachable           | Variable | sequence of $X_0        |
  +-----------------------+----------+-------------------------+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | entrypoints           | Variable | sequence of $X_1        |
  +-----------------------+----------+-------------------------+


  X_0
  ***

  +-----------------------+----------+------------------------------------------------------------------------------------------+
  | Name                  | Size     | Contents                                                                                 |
  +=======================+==========+==========================================================================================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer                                                                  |
  +-----------------------+----------+------------------------------------------------------------------------------------------+
  | Unnamed field 0       | Variable | sequence of unsigned 8-bit integer encoding an enumeration (see michelson.v1.primitives) |
  +-----------------------+----------+------------------------------------------------------------------------------------------+


  X_2
  ***

  +-----------------------+----------+-------------------------+
  | Name                  | Size     | Contents                |
  +=======================+==========+=========================+
  | # bytes in next field | 4 bytes  | unsigned 30-bit integer |
  +-----------------------+----------+-------------------------+
  | Unnamed field 0       | Variable | 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            |
  +-------------+------------------+
  | 112         | DIG              |
  +-------------+------------------+
  | 113         | DUG              |
  +-------------+------------------+
  | 114         | EMPTY_BIG_MAP    |
  +-------------+------------------+
  | 115         | APPLY            |
  +-------------+------------------+
  | 116         | chain_id         |
  +-------------+------------------+
  | 117         | CHAIN_ID         |
  +-------------+------------------+


  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
  ***

  +-----------------+----------------------+------------------------------------+
  | Name            | Size                 | Contents                           |
  +=================+======================+====================================+
  | Unnamed field 0 | Determined from data | $X_2                               |
  +-----------------+----------------------+------------------------------------+
  | Unnamed field 1 | Determined from data | $micheline.michelson_v1.expression |
  +-----------------+----------------------+------------------------------------+

  

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

Return the type of the given entrypoint of the contract

  $micheline.michelson_v1.expression
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $micheline.michelson_v1.expression:
    { "int": $bignum }
    || { "string": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+------------------------------------+
  | 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            |
  +-------------+------------------+
  | 112         | DIG              |
  +-------------+------------------+
  | 113         | DUG              |
  +-------------+------------------+
  | 114         | EMPTY_BIG_MAP    |
  +-------------+------------------+
  | 115         | APPLY            |
  +-------------+------------------+
  | 116         | chain_id         |
  +-------------+------------------+
  | 117         | CHAIN_ID         |
  +-------------+------------------+


  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/contracts/<contract_id>/manager_key

Access the manager of a contract.

  $Signature.Public_key || null
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+----------+
  | Name            | Size                 | Contents |
  +=================+======================+==========+
  | Unnamed field 0 | Determined from data | $X_0     |
  +-----------------+----------------------+----------+


  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_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 |
  +----------------------+----------------------+------------------------+
  | Signature.Public_key | Determined from data | $public_key            |
  +----------------------+----------------------+------------------------+

  

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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $scripted.contracts:
    { "code": $micheline.michelson_v1.expression,
      "storage": $micheline.michelson_v1.expression }
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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>/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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+------------------------------------+
  | 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            |
  +-------------+------------------+
  | 112         | DIG              |
  +-------------+------------------+
  | 113         | DUG              |
  +-------------+------------------+
  | 114         | EMPTY_BIG_MAP    |
  +-------------+------------------+
  | 115         | APPLY            |
  +-------------+------------------+
  | 116         | chain_id         |
  +-------------+------------------+
  | 117         | CHAIN_ID         |
  +-------------+------------------+


  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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+------------------------------+
  | 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_id ... ],
    "delegated_balance": $mutez,
    "deactivated": boolean,
    "grace_period": integer ∈ [-2^31-2, 2^31+2] }
  $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. */
    $unistring
  $mutez: $positive_bignum
  $positive_bignum:
    /* Positive big number
       Decimal representation of a positive big number */
    string
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-------------------------+----------------------+-------------------------------------+
  | 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 $contract_id            |
  +-------------------------+----------------------+-------------------------------------+
  | 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                  |
  +---------+----------------------+-----------------------+


  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                |
  +---------------+----------+------------------------+


  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_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. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+--------------------------+
  | 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/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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------+----------------------+----------+
  | 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    |
  +-----------------+----------+----------+


  

POST ../<block_id>/endorsing_power

Get the endorsing power of an endorsement, that is, the number of slots that the endorser has

  { "endorsement_operation":
      { "branch": $block_hash,
        "contents": [ $operation.alpha.contents ... ],
        "signature": $Signature },
    "chain_id": $Chain_id }
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    $unistring
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    $unistring
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    $unistring
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "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. */
    $unistring
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    $unistring
  $entrypoint:
    /* entrypoint
       Named entrypoint to a Michelson smart contract */
    "default"
    || "root"
    || "do"
    || "set_delegate"
    || "remove_delegate"
    || 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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "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": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?:
           { "entrypoint": $entrypoint,
             "value": $micheline.michelson_v1.expression } }
    || { "kind": "origination",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "balance": $mutez,
         "delegate"?: $Signature.Public_key_hash,
         "script": $scripted.contracts }
    || { "kind": "delegation",
         "source": $Signature.Public_key_hash,
         "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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+----------+
  | Name                  | Size     | Contents |
  +=======================+==========+==========+
  | endorsement_operation | Variable | $X_0     |
  +-----------------------+----------+----------+
  | chain_id              | 4 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                |
  +---------------+----------+------------------------+


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

  default (tag 0)
  ===============

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


  root (tag 1)
  ============

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


  do (tag 2)
  ==========

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


  set_delegate (tag 3)
  ====================

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


  remove_delegate (tag 4)
  =======================

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


  named (tag 255)
  ===============

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


  X_1
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | entrypoint            | Determined from data | $entrypoint             |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | value                 | 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 (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 107)
  ================

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 21 bytes             | $public_key_hash       |
  +---------------+----------------------+------------------------+
  | 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 108)
  =====================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 21 bytes             | $public_key_hash                    |
  +----------------------------------+----------------------+-------------------------------------+
  | 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 | $X_1                                |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 109)
  =====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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                                |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 110)
  ====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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                              |
  +===========+==========+=======================================+
  | branch    | 32 bytes | bytes                                 |
  +-----------+----------+---------------------------------------+
  | contents  | Variable | sequence of $operation.alpha.contents |
  +-----------+----------+---------------------------------------+
  | signature | 64 bytes | bytes                                 |
  +-----------+----------+---------------------------------------+

  
  integer ∈ [-2^30-2, 2^30+2]
  +-----------------+---------+--------------------------------------------------------------+
  | Name            | Size    | Contents                                                     |
  +=================+=========+==============================================================+
  | Unnamed field 0 | 4 bytes | signed 31-bit integer in the range -1073741824 to 1073741823 |
  +-----------------+---------+--------------------------------------------------------------+


  

GET ../<block_id>/hash

The block's hash, its unique identifier.

  $block_hash
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +------------+----------+----------+
  | Name       | Size     | Contents |
  +============+==========+==========+
  | block_hash | 32 bytes | bytes    |
  +------------+----------+----------+


  

GET ../<block_id>/header

The whole block header.

  $block_header
  $Chain_id:
    /* Network identifier (Base58Check-encoded) */
    $unistring
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header:
    { "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
      "chain_id": $Chain_id,
      "hash": $block_hash,
      "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "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) */
    $unistring
  $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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------+-------------------------------------+
  | 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": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
    "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) */
    $unistring
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------+-------------------------------------+
  | 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) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header.shell:
    /* Shell header
       Block header's shell-related content. It contains information such as
       the block level, its predecessor and timestamp. */
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+---------------------------+
  | 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.protocol } ... ]
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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.

  [ $unistring ... ]
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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.protocol } ... ]
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    $unistring
  $int64:
    /* 64 bit integers
       Decimal representation of 64 bit integers */
    string
  $timestamp.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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) */
    $unistring
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    $unistring
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    $unistring
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    $unistring
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "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. */
    $unistring
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    $unistring
  $entrypoint:
    /* entrypoint
       Named entrypoint to a Michelson smart contract */
    "default"
    || "root"
    || "do"
    || "set_delegate"
    || "remove_delegate"
    || 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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "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": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?:
           { "entrypoint": $entrypoint,
             "value": $micheline.michelson_v1.expression } }
    || { "kind": "origination",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "balance": $mutez,
         "delegate"?: $Signature.Public_key_hash,
         "script": $scripted.contracts }
    || { "kind": "delegation",
         "source": $Signature.Public_key_hash,
         "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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------+----------+---------------------------------------+
  | 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                |
  +---------------+----------+------------------------+


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

  default (tag 0)
  ===============

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


  root (tag 1)
  ============

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


  do (tag 2)
  ==========

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


  set_delegate (tag 3)
  ====================

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


  remove_delegate (tag 4)
  =======================

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


  named (tag 255)
  ===============

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


  X_0
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | entrypoint            | Determined from data | $entrypoint             |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | value                 | 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 (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 107)
  ================

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 21 bytes             | $public_key_hash       |
  +---------------+----------------------+------------------------+
  | 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 108)
  =====================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 21 bytes             | $public_key_hash                    |
  +----------------------------------+----------------------+-------------------------------------+
  | 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 | $X_0                                |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 109)
  =====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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                                |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 110)
  ====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------------+----------+-------------------------------------+
  | 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

  $block_header
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header:
    /* Block header
       Block header. It contains both shell and protocol specific data. */
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "protocol_data": /^[a-zA-Z0-9]+$/ }
  $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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+---------------------------+
  | 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

  $block_header
  $Context_hash:
    /* A hash of context (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header:
    /* Block header
       Block header. It contains both shell and protocol specific data. */
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "validation_pass": integer ∈ [0, 255],
      "operations_hash": $Operation_list_list_hash,
      "fitness": $fitness,
      "context": $Context_hash,
      "protocol_data": /^[a-zA-Z0-9]+$/ }
  $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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +----------------------------+----------+---------------------------+
  | 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) */
    $unistring
  $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) */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------+-------------------------------------+
  | 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": [ $operation ... ],
    "check_signature"?: boolean }
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $operation:
    /* An operation. The shell_header part indicates a block an operation is
       meant to apply on top of. The proto part is protocol-specific and
       appears as a binary blob. */
    { "branch": $block_hash,
      "data": /^[a-zA-Z0-9]+$/ }
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +---------------------------------------+----------+-------------------------------------+
  | 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) */
    $unistring
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    $unistring
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    $unistring
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    $unistring
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "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. */
    $unistring
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    $unistring
  $entrypoint:
    /* entrypoint
       Named entrypoint to a Michelson smart contract */
    "default"
    || "root"
    || "do"
    || "set_delegate"
    || "remove_delegate"
    || 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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "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": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?:
           { "entrypoint": $entrypoint,
             "value": $micheline.michelson_v1.expression } }
    || { "kind": "origination",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "balance": $mutez,
         "delegate"?: $Signature.Public_key_hash,
         "script": $scripted.contracts }
    || { "kind": "delegation",
         "source": $Signature.Public_key_hash,
         "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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------+-------------------------+
  | 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                |
  +---------------+----------+------------------------+


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

  default (tag 0)
  ===============

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


  root (tag 1)
  ============

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


  do (tag 2)
  ==========

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


  set_delegate (tag 3)
  ====================

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


  remove_delegate (tag 4)
  =======================

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


  named (tag 255)
  ===============

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


  X_1
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | entrypoint            | Determined from data | $entrypoint             |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | value                 | 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 (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 107)
  ================

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 21 bytes             | $public_key_hash       |
  +---------------+----------------------+------------------------+
  | 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 108)
  =====================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 21 bytes             | $public_key_hash                    |
  +----------------------------------+----------------------+-------------------------------------+
  | 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 | $X_1                                |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 109)
  =====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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                                |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 110)
  ====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
        "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) */
    $unistring
  $Ed25519.Public_key_hash:
    /* An Ed25519 public key hash (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $Protocol_hash:
    /* A Tezos protocol ID (Base58Check-encoded) */
    $unistring
  $Signature:
    /* A Ed25519, Secp256k1 or P256 signature (Base58Check-encoded) */
    $unistring
  $Signature.Public_key:
    /* A Ed25519, Secp256k1, or P256 public key (Base58Check-encoded) */
    $unistring
  $Signature.Public_key_hash:
    /* A Ed25519, Secp256k1, or P256 public key hash (Base58Check-encoded) */
    $unistring
  $bignum:
    /* Big number
       Decimal representation of a big number */
    string
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header.alpha.full_header:
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "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. */
    $unistring
  $cycle_nonce:
    /* A nonce hash (Base58Check-encoded) */
    $unistring
  $entrypoint:
    /* entrypoint
       Named entrypoint to a Michelson smart contract */
    "default"
    || "root"
    || "do"
    || "set_delegate"
    || "remove_delegate"
    || 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": $unistring }
    || { "bytes": /^[a-zA-Z0-9]+$/ }
    || [ $micheline.michelson_v1.expression ... ]
    || { "prim": $michelson.v1.primitives,
         "args"?: [ $micheline.michelson_v1.expression ... ],
         "annots"?: [ string ... ] }
  $michelson.v1.primitives:
    "ADD"
    | "IF_NONE"
    | "SWAP"
    | "set"
    | "nat"
    | "CHECK_SIGNATURE"
    | "IF_LEFT"
    | "LAMBDA"
    | "Elt"
    | "CREATE_CONTRACT"
    | "NEG"
    | "big_map"
    | "map"
    | "or"
    | "BLAKE2B"
    | "bytes"
    | "SHA256"
    | "SET_DELEGATE"
    | "CONTRACT"
    | "LSL"
    | "SUB"
    | "IMPLICIT_ACCOUNT"
    | "PACK"
    | "list"
    | "PAIR"
    | "Right"
    | "contract"
    | "GT"
    | "LEFT"
    | "STEPS_TO_QUOTA"
    | "storage"
    | "TRANSFER_TOKENS"
    | "CDR"
    | "SLICE"
    | "PUSH"
    | "False"
    | "SHA512"
    | "CHAIN_ID"
    | "BALANCE"
    | "signature"
    | "DUG"
    | "SELF"
    | "EMPTY_BIG_MAP"
    | "LSR"
    | "OR"
    | "XOR"
    | "lambda"
    | "COMPARE"
    | "key"
    | "option"
    | "Unit"
    | "Some"
    | "UNPACK"
    | "NEQ"
    | "INT"
    | "pair"
    | "AMOUNT"
    | "DIP"
    | "ABS"
    | "ISNAT"
    | "EXEC"
    | "NOW"
    | "LOOP"
    | "chain_id"
    | "string"
    | "MEM"
    | "MAP"
    | "None"
    | "address"
    | "CONCAT"
    | "EMPTY_SET"
    | "MUL"
    | "LOOP_LEFT"
    | "timestamp"
    | "LT"
    | "UPDATE"
    | "DUP"
    | "SOURCE"
    | "mutez"
    | "SENDER"
    | "IF_CONS"
    | "RIGHT"
    | "CAR"
    | "CONS"
    | "LE"
    | "NONE"
    | "IF"
    | "SOME"
    | "GET"
    | "Left"
    | "CAST"
    | "int"
    | "SIZE"
    | "key_hash"
    | "unit"
    | "DROP"
    | "EMPTY_MAP"
    | "NIL"
    | "DIG"
    | "APPLY"
    | "bool"
    | "RENAME"
    | "operation"
    | "True"
    | "FAILWITH"
    | "parameter"
    | "HASH_KEY"
    | "EQ"
    | "NOT"
    | "UNIT"
    | "Pair"
    | "ADDRESS"
    | "EDIV"
    | "CREATE_ACCOUNT"
    | "GE"
    | "ITER"
    | "code"
    | "AND"
  $mutez: $positive_bignum
  $next_operation:
    { "protocol": "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK",
      "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": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "public_key": $Signature.Public_key }
    || { "kind": "transaction",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "amount": $mutez,
         "destination": $contract_id,
         "parameters"?:
           { "entrypoint": $entrypoint,
             "value": $micheline.michelson_v1.expression } }
    || { "kind": "origination",
         "source": $Signature.Public_key_hash,
         "fee": $mutez,
         "counter": $positive_bignum,
         "gas_limit": $positive_bignum,
         "storage_limit": $positive_bignum,
         "balance": $mutez,
         "delegate"?: $Signature.Public_key_hash,
         "script": $scripted.contracts }
    || { "kind": "delegation",
         "source": $Signature.Public_key_hash,
         "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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------------------+-------------------------+
  | 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                |
  +---------------+----------+------------------------+


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

  default (tag 0)
  ===============

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


  root (tag 1)
  ============

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


  do (tag 2)
  ==========

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


  set_delegate (tag 3)
  ====================

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


  remove_delegate (tag 4)
  =======================

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


  named (tag 255)
  ===============

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


  X_2
  ***

  +-----------------------+----------------------+-------------------------+
  | Name                  | Size                 | Contents                |
  +=======================+======================+=========================+
  | entrypoint            | Determined from data | $entrypoint             |
  +-----------------------+----------------------+-------------------------+
  | # bytes in next field | 4 bytes              | unsigned 30-bit integer |
  +-----------------------+----------------------+-------------------------+
  | value                 | 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 (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 107)
  ================

  +---------------+----------------------+------------------------+
  | Name          | Size                 | Contents               |
  +===============+======================+========================+
  | Tag           | 1 byte               | unsigned 8-bit integer |
  +---------------+----------------------+------------------------+
  | source        | 21 bytes             | $public_key_hash       |
  +---------------+----------------------+------------------------+
  | 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 108)
  =====================

  +----------------------------------+----------------------+-------------------------------------+
  | Name                             | Size                 | Contents                            |
  +==================================+======================+=====================================+
  | Tag                              | 1 byte               | unsigned 8-bit integer              |
  +----------------------------------+----------------------+-------------------------------------+
  | source                           | 21 bytes             | $public_key_hash                    |
  +----------------------------------+----------------------+-------------------------------------+
  | 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 | $X_2                                |
  +----------------------------------+----------------------+-------------------------------------+


  Origination (tag 109)
  =====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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                                |
  +--------------------------------+----------------------+-------------------------------------+
  | balance                        | Determined from data | $N.t                                |
  +--------------------------------+----------------------+-------------------------------------+
  | ? presence of field "delegate" | 1 byte               | boolean (0 for false, 255 for true) |
  +--------------------------------+----------------------+-------------------------------------+
  | delegate                       | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | script                         | Determined from data | $scripted.contracts                 |
  +--------------------------------+----------------------+-------------------------------------+


  Delegation (tag 110)
  ====================

  +--------------------------------+----------------------+-------------------------------------+
  | Name                           | Size                 | Contents                            |
  +================================+======================+=====================================+
  | Tag                            | 1 byte               | unsigned 8-bit integer              |
  +--------------------------------+----------------------+-------------------------------------+
  | source                         | 21 bytes             | $public_key_hash                    |
  +--------------------------------+----------------------+-------------------------------------+
  | 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) */
    $unistring
  $Operation_hash:
    /* A Tezos operation ID (Base58Check-encoded) */
    $unistring
  $Operation_list_list_hash:
    /* A list of list of operations (Base58Check-encoded) */
    $unistring
  $block_hash:
    /* A block identifier (Base58Check-encoded) */
    $unistring
  $block_header.shell:
    /* Shell header
       Block header's shell-related content. It contains information such as
       the block level, its predecessor and timestamp. */
    { "level": integer ∈ [-2^31-2, 2^31+2],
      "proto": integer ∈ [0, 255],
      "predecessor": $block_hash,
      "timestamp": $timestamp.protocol,
      "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.protocol:
    /* A timestamp as seen by the protocol: second-level precision, epoch
       based. */
    $timestamp.rfc || $int64
  $timestamp.rfc:
    /* RFC 3339 formatted timestamp
       A date in RFC 3339 notation. */
    $unistring
  $unistring:
    /* Universal string representation
       Either a plain UTF8 string, or a sequence of bytes for strings that
       contain invalid byte sequences. */
    string || { "invalid_utf8_string": [ integer ∈ [0, 255] ... ] }
  +-----------------------+----------------------+-------------------------+
  | 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