2026-02-12 10:52:38 -05:00
2026-02-12 10:52:38 -05:00
2026-02-12 16:31:34 +03:00
2026-02-12 10:52:38 -05:00
2026-02-12 16:31:34 +03:00
2026-02-12 16:31:34 +03:00
2025-07-16 10:38:59 -03:00
2025-11-26 00:33:09 +03:00

Logos Execution Zone (LEZ)

Logos Execution Zone (LEZ) is a programmable blockchain that cleanly separates public and private state while keeping them fully interoperable. Developers can build apps that operate across transparent and privacy-preserving accounts without changing their logic. Privacy is enforced by the protocol itself through zero-knowledge proofs (ZKPs), so it is always available and automatic.

Background

These features are provided by the Logos Execution Environment (LEE). Traditional public blockchains expose a fully transparent state: the mapping from account IDs to account values is entirely visible. LEE introduces a parallel private state that coexists with the public one. Together, public and private accounts form a partition of the account ID space: public IDs are visible on-chain, while private accounts are accessible only to holders of the corresponding viewing keys. Consistency across both states is enforced by ZKPs.

Public accounts are stored on-chain as a visible map from IDs to account states, and their values are updated in place. Private accounts are never stored on-chain in raw form. Each update produces a new commitment that binds the current value while keeping it hidden. Previous commitments remain on-chain, but a nullifier set marks old versions as spent, ensuring that only the most recent private state can be used in execution.

Programmability and selective privacy

LEZ aims to deliver full programmability in a hybrid public/private model, with the same flexibility and composability as public blockchains. Developers write and deploy programs in LEZ just as they would elsewhere. The protocol automatically supports executions that involve any combination of public and private accounts. From the programs perspective, all accounts look the same, and privacy is enforced transparently. This lets developers focus on business logic while the system guarantees privacy and correctness.

To our knowledge, this design is unique to LEZ. Other privacy-focused programmable blockchains often require developers to explicitly handle private inputs inside their app logic. In LEZ, privacy is protocol-level: programs do not change, accounts are treated uniformly, and private execution works out of the box.


Example: Creating and transferring tokens across states

  1. Token creation (public execution)

    • Alice submits a transaction that executes the token program New function on-chain.
    • A new public token definition account is created.
    • The minted tokens are recorded on-chain in Alices public account.
  2. Transfer from public to private (local / privacy-preserving execution)

    • Alice runs the token program Transfer function locally, sending to Bobs private account.
    • A ZKP of correct execution is generated.
    • The proof is submitted to the blockchain and verified by validators.
    • Alices public balance is updated on-chain.
    • Bobs private balance remains hidden, while the transfer is provably correct.
  3. Transferring private to public (local / privacy-preserving execution)

    • Bob executes the token program Transfer function locally, sending to Charlies public account.
    • A ZKP of correct execution is generated.
    • Bobs private balance stays hidden.
    • Charlies public account is updated on-chain.
  4. Transfer from public to public (public execution)

    • Alice submits an on-chain transaction to run Transfer, sending to Charlies public account.
    • Execution is handled fully on-chain without ZKPs.
    • Alices and Charlies public balances are updated.

Key points:

  • The same token program is used in every execution.
  • The only difference is execution mode: public execution updates visible state on-chain, while private execution relies on ZKPs.
  • Validators verify proofs only for privacy-preserving transactions, keeping processing efficient.

The accounts model

To achieve both state separation and full programmability, LEZ uses a stateless program model. Programs hold no internal state. All persistent data is stored in accounts passed explicitly into each execution. This enables precise access control and visibility while preserving composability across public and private states.

Execution types

LEZ supports two execution types:

  • Public execution runs transparently on-chain.
  • Private execution runs off-chain and is verified on-chain with ZKPs.

Both public and private executions use the same Risc0 VM bytecode. Public transactions are executed directly on-chain like any standard RISC-V VM call, without proof generation. Private transactions are executed locally by users, who generate Risc0 proofs that validators verify instead of re-executing the program.

This design keeps public transactions as fast as any RISC-Vbased VM and makes private transactions efficient for validators. It also supports parallel execution similar to Solana, improving throughput. The main computational cost for privacy-preserving transactions is on the user side, where ZK proofs are generated.



Install dependencies

Install build dependencies

  • On Linux Ubuntu / Debian
apt install build-essential clang libclang-dev libssl-dev pkg-config
  • On Fedora
sudo dnf install clang clang-devel openssl-devel pkgconf
  • On Mac
xcode-select --install
brew install pkg-config openssl

Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install Risc0

curl -L https://risczero.com/install | bash

Then restart your shell and run

rzup install

Run tests

The LEZ repository includes both unit and integration test suites.

Unit tests

# RISC0_DEV_MODE=1 is used to skip proof generation and reduce test runtime overhead
RISC0_DEV_MODE=1 cargo test --release

Integration tests

export NSSA_WALLET_HOME_DIR=$(pwd)/integration_tests/configs/debug/wallet/
cd integration_tests
# RISC0_DEV_MODE=1 skips proof generation; RUST_LOG=info enables runtime logs
RUST_LOG=info RISC0_DEV_MODE=1 cargo run $(pwd)/configs/debug all

Run the sequencer and node

Running Manually

The sequencer and node can be run locally:

  1. On one terminal go to the logos-blockchain/logos-blockchain repo and run a local logos blockchain node:

    • git checkout master; git pull
    • cargo clean
    • rm ~/.logos-blockchain-circuits
    • ./scripts/setup-logos-blockchain-circuits.sh
    • cargo build --all-features
    • ./target/debug/logos-blockchain-node nodes/node/config-one-node.yaml
  2. On another terminal go to the logos-blockchain/lssa repo and run indexer service:

    • RUST_LOG=info cargo run --release -p indexer_service indexer/service/configs/indexer_config.json
  3. On another terminal go to the logos-blockchain/lssa repo and run the sequencer:

    • RUST_LOG=info RISC0_DEV_MODE=1 cargo run --release -p sequencer_runner sequencer_runner/configs/debug

Running with Docker

You can run the whole setup with Docker:

docker compose up

With that you can send transactions from local wallet to the Sequencer running inside Docker using wallet/configs/debug as well as exploring blocks by opening http://localhost:8080.

Caution for local image builds

If you're going to build sequencer image locally you should better adjust default docker settings and set defaultKeepStorage at least 25GB so that it can keep layers properly cached.

Description
This repo serves for Nescience Node testnet
Readme
Languages
Rust 96.8%
C 1.4%
CSS 0.6%
Dockerfile 0.5%
RenderScript 0.4%
Other 0.2%