๐Ÿ” XDC ZK Lab Guide

Interactive cryptography education for the quantum age

Open ZK Lab โ†’
XDC ZK Lab Dashboard

๐Ÿ“‘ Table of Contents

1. Introduction 2. The Quantum Threat 3. Zero-Knowledge Commitments 4. Hash-Based Signatures 5. Merkle Tree Proofs 6. Algorithm Comparison 7. Ethereum Foundation Research 8. XDC & The Future

1. Introduction

XDC ZK Lab is an educational platform for learning about two critical areas of modern cryptography:

๐Ÿ”’ Zero-Knowledge Proofs

Prove something is true without revealing WHY it's true. Used for privacy, voting, and scalability.

๐Ÿ›ก๏ธ Post-Quantum Cryptography

Cryptographic algorithms that remain secure against attacks from quantum computers.

2. The Quantum Threat

Current blockchain cryptography (ECDSA, BLS) relies on mathematical problems that quantum computers can solve efficiently using Shor's Algorithm.

โš ๏ธ What's at Risk

When large-scale quantum computers arrive, they could:

โœ… What's Safe

Hash functions (Keccak-256, SHA-3) remain relatively secure. Quantum computers only reduce their effective security by half (Grover's algorithm).

Timeline

Experts estimate "Q-Day" (when quantum computers break ECDSA) could arrive between 2030-2040. However, blockchain data is permanentโ€”an attacker could store encrypted data now and decrypt it later.

3. Zero-Knowledge Commitments

A commitment scheme lets you "lock in" a value without revealing it. Later, you can prove you committed to that exact value.

How It Works

commitment = hash(secret + salt)

// Later, to reveal:
verify: hash(revealed_secret + salt) == commitment

Using the Demo

1
Enter Your Secret

Type any value (e.g., your vote, a number, a password)

2
Note the Salt

A random salt is auto-generated. Save itโ€”you'll need it to reveal later.

3
Create Commitment

Click to generate. Share the commitment hash (it reveals nothing about your secret).

4
Verify Later

To prove what you committed, provide the secret + salt. Anyone can verify.

๐Ÿ’ก Real-World Use Cases

4. Hash-Based Signatures

Unlike ECDSA, hash-based signatures rely only on the security of hash functionsโ€”which remain quantum-safe.

How It Works (Simplified)

// Key Generation
private_key = random_bytes()
public_key = hash(private_key)

// Signing
signature = hash(private_key + message)

// Verification
verify: hash(derived_key + message) == signature
๐Ÿ’ก Real Algorithms

Using the Demo

1
Generate Keypair

Creates a quantum-safe public/private key pair

2
Sign a Message

Enter any message and generate a signature

3
Verify Signature

Anyone with the public key can verify the signature is valid

5. Merkle Tree Proofs

Merkle trees let you prove an item belongs to a set without revealing the entire set. Foundation of ZK-rollups, airdrops, and state proofs.

Structure

         [Root Hash]
           /      \
      [Hash AB]  [Hash CD]
       /    \     /    \
   [A]    [B]  [C]    [D]

Proof Example

To prove "B" is in the tree, you only need:

  1. Hash of A (sibling)
  2. Hash of CD (uncle)
  3. The root hash

This is O(log n) data instead of O(n)โ€”very efficient for large sets!

Using the Demo

1
Build Tree

Enter items (one per line) and build the Merkle tree

2
Generate Proof

Enter an item to get its inclusion proof

3
Verify Proof

Given root + item + proof, verify inclusion

๐Ÿ’ก Blockchain Use Cases

6. Algorithm Comparison

Algorithm Type Classical Quantum Used In
ECDSA Signature โœ“ Safe โœ— Broken BTC, ETH, XDC
BLS Signature โœ“ Safe โœ— Broken ETH Validators
Keccak-256 Hash โœ“ Safe โœ“ 128-bit* ETH Addresses
SPHINCS+ Signature โœ“ Safe โœ“ Safe NIST Standard
Dilithium Signature โœ“ Safe โœ“ Safe NIST Standard
STARKs ZK Proof โœ“ Safe โœ“ Safe StarkNet
SNARKs ZK Proof โœ“ Safe โœ— Pairing-based Zcash, zkSync

* Grover's algorithm halves effective hash security

7. Ethereum Foundation Research

The Ethereum Foundation is actively researching post-quantum solutions:

๐Ÿ”ฎ Roadmap Items

Learn More

8. XDC & The Future

As an EVM-compatible chain, XDC will benefit from Ethereum's post-quantum research. Key considerations:

๐Ÿ”ท Preparation Steps

๐Ÿ’ก Why Act Now?

Blockchain data is permanent. "Harvest now, decrypt later" attacks mean sensitive transactions today could be exposed decades from now. Early preparation is essential.