package tezos-protocol-alpha
Install
Dune 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.V1
Source
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
*)Withdraw
removesqty
of the tickets represented byticket_hash
from the operation's signer in layer-2, and permitsdestination
to retrieve those tickets in layer-1 through aTx_rollup_withdraw
operation.| 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
*)Transfer
movesqty
of the tickets represented byticket_hash
from the operation's signer in layer-2 todestination
in 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.t
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.
val compact_transaction :
(Indexable.unknown, Indexable.unknown) transaction
Tezos_protocol_environment_alpha.Data_encoding.Compact.t
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.
val compact_transaction_signer_index :
(Indexable.index_only, Indexable.unknown) transaction
Tezos_protocol_environment_alpha.Data_encoding.Compact.t
A specialized compact_transaction
where the signers are indexes only.
val transaction_encoding :
(Indexable.unknown, Indexable.unknown) transaction
Tezos_protocol_environment_alpha.Data_encoding.t
The 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.t
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 typeBls.Public_key.t
.
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
to1110
, the tag encodes the size of the list ofoperation_content
, e.g.,0010
means that there is two elements incontents
. 1111
means thatcontents
is prefixed by its number of elements.
val compact_operation_content :
Indexable.unknown operation_content
Tezos_protocol_environment_alpha.Data_encoding.Compact.t
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 typeTx_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 typeTicket_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.