<aside> 💡

Quick Facts

The Logos Execution Zone (LEZ) is the primary execution layer designed for applications using the Logos stack. It is implemented as a Sovereign Zone built on the Logos Blockchain, and uses zero knowledge proofs to ensure the correctness of its operations. Building on LEZ is the simplest way to deploy general-purpose applications on Logos, with built-in support for private execution.

The LEZ runs a Risc0-based virtual machine known as the Logos Execution Environment (LEE). It separates state into public and private components, both of which can be used and modified seamlessly by LEE programs. This selective privacy is unique to the LEE, allowing developers to write generic programs while the LEE guarantees privacy and correctness.

Accounts Model

To achieve separation between public and private state while allowing for full programmability, the LEE uses a stateless program model. Under this model, all persistent data is stored in accounts, which can be either public or private. Public accounts are stored on-chain as a map between the account ID and its associated state (such as a token balance). A public account owner’s private key signs transactions and authorises executions, while the derived account ID is publicly visible on-chain.

Private accounts, by contrast, are stored locally on the account-holder’s node, which publishes commitments to the account state onto the chain whenever the state is updated. The latest commitment binds the current account state to the chain without revealing its data, while nullifiers for previous commitments ensure that old commitments are not used for program execution. Private accounts are created with two associated key pairs.

  1. Nullifier keys: The private nullifier key is used by the account owner to sign transactions and authorise executions. The public nullifier key is used as the account ID for verifying ownership.
  2. Viewing keys: The private nullifier key is used by the account owner to create ZK proofs. The public viewing key is used to verify proofs without revealing the account owner.

<aside> 💡

A program must obtain a private account’s nullifier public key, as well as its viewing public key, in order to modify a private account state. Therefore, you cannot transfer tokens to a private account without being provided this information by the owner.

</aside>

When an LEE program executes, it modifies the accounts provided to it. These accounts could be either public or private, as an LEE program can be executed over both types of accounts. In either case, the program is executed using the same bytecode, the main difference being whether the user who runs a program will generate a zero knowledge proof. Executions modifying public accounts are executed transparently by LEZ validators like any standard RISC-V VM call. On the other hand, private executions involve the generation of zero knowledge proofs via Risc0, which are then verified by LEZ validators.

LEZ Node Architecture

The LEZ operates as a Sovereign Zone, with updates to its state (both public and private) inscribed on the Logos Blockchain. The LEZ is sequenced in a decentralized manner by a permissioned set of sequencer nodes, who take turns posting the latest updates to the LEZ channel on Mantle. In addition to the sequencers, the LEZ maintains an open network of validators, which update the Zone state by transparently executing programs (for public executions) or by verifying zero knowledge proofs of correct state transitions (for private executions). Anybody can join the validator network and contribute to the correctness of the LEZ state, submitting the latest state to an LEZ sequencer to post on the blockchain. The LEZ also supports read-only indexer nodes that follow the LEZ channel for purposes such as block exploration and development.

Use Cases

The LEZ is a ready-made platform for privacy-preserving applications built using the Logos stack. Since the same LEE program can be executed over both public and private accounts, computationally costly private executions can be used only when necessary to speed up execution. Together with Solana-style parallel execution, this feature makes the LEZ uniquely suited to applications requiring high throughput as well as private application state.

As an example, the LEZ could be used to host private DeFi applications. With support for privacy built-in, the LEZ could be used to build protocols where transaction details, user balances, or trading strategies are kept confidential by default, only revealing necessary information to authorised parties. This is especially so when high volumes of transactions are expected by these applications. Examples may include:

<aside> 💡

The Logos docs include a tutorial on how to create your own Automated Market Maker (AMM) trading pool program on the LEZ.

</aside>

See Also