Owner: @David Rusu
Reviewers: 🟢@Thomas Lavaur 🟢@Giacomo Pasini 🟢@Gusto Bacvinka 🔺@Daniel Sanchez Quiros 🟢@Álvaro Castro-Castilla
This document specifies the canonical encoding of Mantle transactions and it’s sub-components. Transactions sent through the mempool and included in blocks use this encoding.
The transaction encoding is specified in ABNF form to remove any ambiguity and guarantee a canonical encoding. The high level encoding choices which were not immediately derivable from the Mantle specification are listed here:
SignedMantleTx = MantleTx OpsProofs LedgerTxProof
MantleTx = Ops LedgerTx ExecutionGasPrice StorageGasPrice
ExecutionGasPrice = UINT64
StorageGasPrice = UINT64
Ops = OpCount *Op
OpCount = Byte
Op = Opcode OpPayload
Opcode = Byte
OpPayload = ChannelInscribe /
ChannelBlob /
ChannelSetKeys /
SDPDeclare /
SDPWithdraw /
SDPActive /
LeaderClaim
ChannelInscribe = ChannelId Inscription Parent Signer
Inscription = UINT32 *BYTE
ChannelBlob = ChannelId BlobId BlobSize DaStorageGasPrice Parent Signer
BlobId = Hash32
BlobSize = UINT64
DaStorageGasPrice = UINT64
ChannelSetKeys = ChannelId KeyCount *Signer
KeyCount = Byte
ChannelId = Hash32
Parent = Hash32
Signer = Ed25519PublicKey
SDPDeclare = ServiceType LocatorCount *Locator ProviderId ZkId LockedNoteId
ServiceType = Byte ; 0 = BN, 1 = DA
LocatorCount = Byte ; Max 8
Locator = 2Byte *BYTE ; Max 329 bytes, multiaddr format
ProviderId = Ed25519PublicKey
ZkId = ZkPublicKey
LockedNoteId = NoteId
SDPWithdraw = DeclarationId Nonce LockedNoteId
DeclarationId = Hash32
Nonce = UINT64
SDPActive = DeclarationId Nonce Metadata
Metadata = UINT32 *BYTE ; Service-specific node activeness metadata