lea-improvement-proposals

Abstract

This LIP defines the official, standardized binary layout interpreted by the Genesis LEA Transaction Decoder.
As the first canonical decoder in the LEA model, it is based on the Simple Compact Transaction Protocol (SCTP) primitives introduced in LIP-6. The format follows a flexible, invocation-based structure, including a unified address vector, gas configuration, a sequence of invocation instructions, and a dual-signature scheme (Ed25519 and SPHINCS-256s).

Motivation

While LIP-6 defines the low-level data primitives for encoding data, it does not define the high-level structure of a transaction (the "grammar"). A standard transaction format is essential for all network participants to interpret, validate, and process transactions in a uniform way. This proposal provides that standard, detailing the exact order, type, and meaning of each component within a transaction. It also specifies the precise method for hashing and signing transactions to ensure cryptographic integrity.

Specification

All LEA transactions MUST be serialized according to the following structure, using the SCTP encoding types defined in LIP-6. The transaction's total decoded size MUST NOT exceed 1MB.

Core Type System

The transaction format utilizes a specific subset of the SCTP types:

SCTP Type ID Name Description
8 ULEB128 Unsigned variable-length integer
13 VECTOR Raw byte array with a length prefix
15 EOF End-of-transaction marker (literal byte: 0x0F)

LEA Transaction Format (as interpreted by Genesis Decoder)

A transaction is a sequence of core fields followed by a variable number of Invocation blocks and SignaturePair blocks.

Field Type Description
version ULEB128 Transaction format version. The value MUST be 1.
sequence ULEB128 Sender's nonce or sequence number
addresses VECTOR 32-byte addresses; signers first, fee payer first
gasLimit ULEB128 Max gas units allowed
gasPrice ULEB128 Price per gas unit
invocations Invocation[] One or more invocation instructions
signatures SignaturePair[] One signature pair per signer
EOF Byte (0x0F) End-of-transaction marker (literal byte)

Invocation Block

Field Type Description
targetIndex ULEB128 Index into the addresses vector (0-based)
instructions VECTOR Instruction bytecode intended for the target address

SignaturePair Block

Field Type Description
ed25519Signature VECTOR (64 bytes) Ed25519 signature over the hash
sphincs256sSignature VECTOR (29792 bytes) SPHINCS-256s signature for PQC security

Notation Key


Field Constraints and Rules

  1. Addresses (addresses):

    • This field is a single SCTP VECTOR containing all 32-byte addresses involved in the transaction.
    • The addresses vector MUST be assembled using a deterministic, three-tiered sorting algorithm to ensure a single, canonical representation: a. Group 1 (Fee Payer): The address of the fee payer MUST be the first address in the vector (index 0). b. Group 2 (Other Signers): The addresses of all other signers (i.e., the signers from index 1 to N-1) MUST be sorted amongst themselves based on their 32-byte binary lexicographical value. These are appended to the vector immediately after the fee payer. c. Group 3 (Non-Signer Addresses): All remaining unique, non-signer addresses MUST also be sorted amongst themselves based on their 32-byte binary lexicographical value. These are appended last.
    • The addresses vector MUST NOT contain duplicate entries.
    • The total byte length of the vector MUST be a multiple of 32.
  2. Invocations:

    • The transaction contains one or more Invocation blocks.
    • Each Invocation consists of a targetIndex (ULEB128) followed by an instructions field (VECTOR).
    • The targetIndex MUST be a valid, 0-based index into the addresses vector.
    • The instructions field contains the application-specific instruction bytecode to be executed in the context of the targeted address.
  3. Signature Set:

    • The number of SignaturePair blocks implicitly defines the number of signed addresses. If there are N signature pairs, then the first N addresses in the addresses vector are considered signers.
    • Each SignaturePair corresponds one-to-one with the signers in the addresses vector by index.
    • Each SignaturePair contains two VECTORs:
      • ed25519Signature: A 64-byte Ed25519 signature.
      • sphincs256sSignature: A 29,792-byte SPHINCS-256s signature.
  4. Termination:

    • Every valid transaction MUST end with a single EOF byte (0x0F).
    • No other data is permitted after the EOF marker.

Hashing and Signing Protocol


Rationale


Backwards Compatibility

This LIP defines a new, foundational application-layer standard. It does not replace a previously defined transaction format LIP. As such, it does not introduce a backwards compatibility break in the LIP process, but its adoption is a mandatory and breaking change for any client or node software wishing to interact with the LEA network, in conjunction with the adoption of LIP-6.


Security Considerations


This LIP is licensed under the MIT License, in alignment with the main LEA Project License.