package tezos-protocol-alpha
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Tx_rollup_l2_batch/V1/index.html
Module Tx_rollup_l2_batch.V1Source
type 'status operation_content = | Withdraw of {destination : Tezos_protocol_environment_alpha.Signature.Public_key_hash.t;ticket_hash : Alpha_context.Ticket_hash.t;qty : Tx_rollup_l2_qty.t;
}(*A
*)Withdrawremovesqtyof the tickets represented byticket_hashfrom the operation's signer in layer-2, and permitsdestinationto retrieve those tickets in layer-1 through aTx_rollup_withdrawoperation.| Transfer of {destination : 'status Tx_rollup_l2_address.Indexable.t;ticket_hash : 'status Tx_rollup_l2_context_sig.Ticket_indexable.t;qty : Tx_rollup_l2_qty.t;
}(*A
*)Transfermovesqtyof the tickets represented byticket_hashfrom the operation's signer in layer-2 todestinationin layer-2.
type ('signer, 'content) operation = {signer : 'signer Signer_indexable.t;counter : int64;contents : 'content operation_content list;
}type ('signer, 'content) t = {contents : ('signer, 'content) transaction list;aggregated_signature : signature;
}val compact :
bits:int ->
(Indexable.unknown, Indexable.unknown) t
Tezos_protocol_environment_alpha.Data_encoding.Compact.tcompact ~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.
val compact_transaction :
(Indexable.unknown, Indexable.unknown) transaction
Tezos_protocol_environment_alpha.Data_encoding.Compact.tA 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.
val compact_transaction_signer_index :
(Indexable.index_only, Indexable.unknown) transaction
Tezos_protocol_environment_alpha.Data_encoding.Compact.tA specialized compact_transaction where the signers are indexes only.
val transaction_encoding :
(Indexable.unknown, Indexable.unknown) transaction
Tezos_protocol_environment_alpha.Data_encoding.tThe encoding of reference used to sign a transaction. It is derived from compact_transaction.
val compact_operation :
(Indexable.unknown, Indexable.unknown) operation
Tezos_protocol_environment_alpha.Data_encoding.Compact.tA 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,
00means an index fitting on 1 byte.01means an index fitting on 2 bytes.10means an index fitting on 4 bytes.11means a value of typeBls.Public_key.t.
The counter field follows a similar logic,
00means an index fitting on 1 byte.01means an index fitting on 2 bytes.10means an index fitting on 4 bytes.11means an integer fitting on 8 bytes.
Finally, the contents field follows this pattern
- From
0000to1110, the tag encodes the size of the list ofoperation_content, e.g.,0010means that there is two elements incontents. 1111means thatcontentsis prefixed by its number of elements.
val compact_operation_content :
Indexable.unknown operation_content
Tezos_protocol_environment_alpha.Data_encoding.Compact.tA 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,
000means a layer-1 address.100means an index for a layer-2 address, fitting on 1 byte.101means an index for a layer-2 address, fitting on 2 bytes.110means an index for a layer-2 address, fitting on 4 bytes.111means a value (of typeTx_rollup_l2_address.t, that is a layer-2 address.
The ticket_hash is encoded using this logic:
00means an index for a ticket hash, fitting on 1 byte.01means an index for a ticket hash, fitting on 2 bytes.10means an index for a ticket hash, fitting on 4 bytes.11means a value (of typeTicket_hash.t.
The qty field follows a similar logic,
00means an integer fitting on 1 byte.01means an integer fitting on 2 bytes.10means an integer fitting on 4 bytes.11means 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.