Skip to main content

L2PS Quick Start Guide

This guide walks you through setting up L2PS from scratch on your Demos node.

Prerequisites

  • Running Demos node
  • Node.js 18+
  • Docker (for PostgreSQL)

1. Create L2PS Network

Create Configuration Directory

Generate Encryption Keys

Create Config File

Create data/l2ps/testnet_l2ps_001/config.json:

2. ZK Proof Setup (Optional)

ZK proofs provide cryptographic verification of L2PS batch validity.
Without ZK keys, the system still works but batches are submitted without proofs (graceful degradation).

Install Circom

Generate ZK Keys

This generates:
  • keys/batch_5/ - For 1-5 tx batches (~37K constraints)
  • keys/batch_10/ - For 6-10 tx batches (~74K constraints)

3. Start Node

Look for these logs:

4. Test with POC App

The POC app provides a visual interface to test L2PS transactions.
The L2PS POC app is available as a separate repository. Clone it to test your L2PS setup.

Install and Run

Configure Keys

Create .env file in the POC app directory:
Critical: Client keys MUST exactly match node keys. Copy the key values from your node’s L2PS configuration:
Paste these values into your POC app’s .env file.

5. Send Test Transactions

Via POC App

  1. Generate or enter a mnemonic
  2. Connect wallet
  3. Toggle to L2PS (Private) mode
  4. Enter recipient and amount
  5. Click Send L2PS Transaction

Via CLI

6. Verify Results

Wait for batch aggregation, then check:

Check Proofs

Check Mempool Status

Expected Results

For 50 transactions:

Environment Configuration

Troubleshooting

Check data/l2ps/<uid>/config.json exists and JSON is valid.
Ensure private_key.txt and iv.txt exist with valid hex values (64 and 24 chars respectively).
POC .env keys must exactly match node key files. Use the auto-copy command above.
Remember: L2PS requires amount + 1 DEM fee. Fund wallet first.
Run npm run l2ps:zk:setup. System works without ZK (graceful degradation).

Complete Setup Checklist

Next Steps

L2PS Architecture

Understand the complete L2PS architecture

L2PS SDK

Integrate L2PS into your application