package tezos-protocol-013-PtJakart

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'status operation_content =
  1. | Withdraw of {
    1. destination : Tezos_protocol_environment_013_PtJakart.Signature.Public_key_hash.t;
    2. ticket_hash : Alpha_context.Ticket_hash.t;
    3. qty : Tx_rollup_l2_qty.t;
    }
    (*

    A Withdraw removes qty of the tickets represented by ticket_hash from the operation's signer in layer-2, and permits destination to retrieve those tickets in layer-1 through a Tx_rollup_withdraw operation.

    *)
  2. | Transfer of {
    1. destination : 'status Tx_rollup_l2_address.Indexable.t;
    2. ticket_hash : 'status Tx_rollup_l2_context_sig.Ticket_indexable.t;
    3. qty : Tx_rollup_l2_qty.t;
    }
    (*

    A Transfer moves qty of the tickets represented by ticket_hash from the operation's signer in layer-2 to destination in layer-2.

    *)
type ('signer, 'content) operation = {
  1. signer : 'signer Signer_indexable.t;
  2. counter : int64;
  3. contents : 'content operation_content list;
}
type ('signer, 'content) transaction = ('signer, 'content) operation list
type ('signer, 'content) t = {
  1. contents : ('signer, 'content) transaction list;
  2. aggregated_signature : signature;
}

compact ~bits is a specialized, space-efficient encoding for a batch of layer-2 operations, such as the bits first bits of the first byte of the resulting binary array are used to encode small lists of transactions.

A specialized, space-efficient encoding for transaction.

The first byte of the resulting binary array is used to encode the size of lists of less than 254 elements. For larger lists, the tag is 11111111 and the list is prefixed by its size, which consumes eight bytes.

A specialized compact_transaction where the signers are indexes only.

The encoding of reference used to sign a transaction. It is derived from compact_transaction.

A specialized, space-efficient encoding for operation.

The first byte of the binary output describes precisely the layout of the encoded value.

Considering the tag ooooccss, ss describes the format of signer, cc of counter and oooo of contents.

More precisely, for signer,

  • 00 means an index fitting on 1 byte.
  • 01 means an index fitting on 2 bytes.
  • 10 means an index fitting on 4 bytes.
  • 11 means a value of type Bls_signature.pk.

The counter field follows a similar logic,

  • 00 means an index fitting on 1 byte.
  • 01 means an index fitting on 2 bytes.
  • 10 means an index fitting on 4 bytes.
  • 11 means an integer fitting on 8 bytes.

Finally, the contents field follows this pattern

  • From 0000 to 1110, the tag encodes the size of the list of operation_content, e.g., 0010 means that there is two elements in contents.
  • 1111 means that contents is prefixed by its number of elements.

A specialized, space-efficient encoding for operation_content.

The first byte of the binary output describes precisely the layout of the encoded value.

Considering the tag 0qqttddd, ddd describes the format of destination, tt of ticket_hash and qq of qty. More precisely, for destination,

  • 000 means a layer-1 address.
  • 100 means an index for a layer-2 address, fitting on 1 byte.
  • 101 means an index for a layer-2 address, fitting on 2 bytes.
  • 110 means an index for a layer-2 address, fitting on 4 bytes.
  • 111 means a value (of type Tx_rollup_l2_address.t, that is a layer-2 address.

The ticket_hash is encoded using this logic:

  • 00 means an index for a ticket hash, fitting on 1 byte.
  • 01 means an index for a ticket hash, fitting on 2 bytes.
  • 10 means an index for a ticket hash, fitting on 4 bytes.
  • 11 means a value (of type Ticket_hash.t.

The qty field follows a similar logic,

  • 00 means an integer fitting on 1 byte.
  • 01 means an integer fitting on 2 bytes.
  • 10 means an integer fitting on 4 bytes.
  • 11 means an integer fitting on 8 bytes.

If used to read, respectively write, a value where the the destination is a layer-1 address and the ticket_hash is an index, which is not allowed by the layer-2 protocol, then a

  • Data_encoding.Binary.Read_error (Exception_raised_in_user_function ...),

respectively

  • Data_encoding.Binary.Write_error (Exception_raised_in_user_function ...)

exception is raised.

OCaml

Innovation. Community. Security.