package tezos-protocol-014-PtKathma
This module provides a typed API for the Rollup Management Protocol that defines the communication protocol for exchanging messages between Layer 1 and Layer 2 for smart-contract rollups.
The API exposes functions for constructing inbox messages. These are messages produced by the Layer 1 protocol and added to a smart-contract rollups inbox.
The Layer 2 node is responsible for decoding and interpreting the messages.
A type outbox_message
representing messages from Layer 2 to Layer 1 is also provided. An outbox_message
consists of a set of transactions to L1 accounts.
type transaction = private
| Transaction : {
destination : Contract_hash.t;
entrypoint : Alpha_context.Entrypoint.t;
parameters_ty : ('a, _) Script_typed_ir.ty;
parameters : 'a;
unparsed_parameters : Alpha_context.Script.expr;
} -> transaction
A type representing a Layer 2 to Layer 1 transaction.
A type representing a batch of Layer 2 to Layer 1 transactions.
A type representing messages from Layer 2 to Layer 1.
val make_internal_inbox_message :
Alpha_context.context ->
('a, _) Script_typed_ir.ty ->
payload:'a ->
sender:Contract_hash.t ->
source:Alpha_context.public_key_hash ->
(Alpha_context.Sc_rollup.Inbox.Message.t * Alpha_context.context)
Tezos_protocol_environment_014_PtKathma.Error_monad.tzresult
Tezos_protocol_environment_014_PtKathma.Lwt.t
make_internal_inbox_message ctxt ty ~payload ~sender ~source
constructs a smart-contract rollup's inbox message
(an L1 to L2 message) with the given payload
, sender
, and source
.
val outbox_message_of_bytes :
Alpha_context.context ->
string ->
(outbox_message * Alpha_context.context)
Tezos_protocol_environment_014_PtKathma.Error_monad.tzresult
Tezos_protocol_environment_014_PtKathma.Lwt.t
outbox_message_of_bytes ctxt bs
decodes an outbox message value from the given bytes bs
. The function involves parsing Micheline expressions to typed values.
module Internal_for_tests : sig ... end
Function for constructing and encoding inbox_message
and outbox_message
values. Since Layer 1 only ever consumes outbox_message
values and produces inbox_message
values, these functions are used for testing only.