Skip to main content

L2PS (Layer 2 Privacy Subnet) Framework

L2PS is a privacy-preserving transaction layer that enables encrypted transactions on the Demos Network. Unlike public L1 transactions, L2PS transactions are encrypted client-side and only decrypted by authorized network participants.

Key Features

Client-Side Encryption

Transactions are encrypted with AES-256 in your browser before leaving your device.

Batch Rollups

Multiple L2PS transactions are bundled into a single L1 transaction per block.

ZK Proofs

PLONK zero-knowledge proofs verify batch validity without revealing content.

Authenticated History

Only address owners can access their private transaction history via cryptographic signatures.

How It Works

Transaction Flow

1

Client Encrypts

Transaction is encrypted with shared AES-256 key in the browser before transmission.
2

L2PS Node Decrypts

Node receives encrypted blob, decrypts, validates signature and balance.
3

Batch Aggregator

Bundles up to 10 transactions per L1 block with ZK proof.
4

L1 Submission

Single L1 batch transaction submitted to blockchain.

Privacy Model

ComponentL1 (Public)L2PS (Private)
AmountVisible to allEncrypted
RecipientVisible to allEncrypted
SenderVisible to allVisible (outer tx)
History AccessAnyoneOwner only (signature required)

Transaction Lifecycle

Every L2PS transaction progresses through three stages:

Executed

Instant - Local node decrypts, validates against L1 state, reserves balance.

Batched

Per L1 block - Transaction included in batch with ZK proof generated.

Confirmed

Final - L1 block confirmed, transaction is immutable on blockchain.

Transaction Fee

Each L2PS transaction costs 1 DEM. This creates a deflationary mechanism while ensuring fair access to privacy features.

Architecture Components

ComponentDescription
L2PS MempoolSeparate storage for encrypted transactions
Batch AggregatorBundles transactions per L1 block (max 10 tx)
ZK ProverGenerates PLONK proofs for batch validity
L2PS ConsensusApplies GCR edits to L1 state
Hash ServiceRelays consolidated hashes to validators

Network Participation

To participate in an L2PS network, nodes must:
  1. Have the shared AES-256 key and IV
  2. Be configured with the correct L2PS UID
  3. Store and sync the L2PS mempool with other participants
// L2PS Network Configuration
{
  "uid": "testnet_l2ps_001",
  "enabled": true,
  "keys": {
    "private_key_path": "data/l2ps/testnet_l2ps_001/private_key.txt",
    "iv_path": "data/l2ps/testnet_l2ps_001/iv.txt"
  }
}

Next Steps