Khalil Tahraoui-

Engineering Robust Systems

Using Zero-Knowledge Proofs in Our Blockchain System and Why

During the Huawei ICT Competition Innovation Track, we worked on a blockchain-based system where privacy and verifiability had to coexist. The core challenge was to validate sensitive conditions such as age eligibility and data correctness without exposing any underlying private information on-chain.

To solve this, I integrated Zero-Knowledge Proof mechanisms inspired by zk-SNARKs and zk-STARKs.


Why Zero-Knowledge Proofs were needed

In a blockchain environment, all submitted data is typically transparent. This creates a conflict when sensitive attributes must be verified.

The system required:

  • Verifying conditions like user age ≥ 18
  • Ensuring data correctness on-chain
  • Preventing exposure of private inputs

This introduces the constraint:

x > 18

without revealing the actual value of x.


1. Age Verification Using zk-SNARK-style Constraints

A clean and effective way to prove x ≥ 18 is to reframe the condition as:

x = 18 + k, where k ≥ 0

The prover must demonstrate that there exists a witness k satisfying this relationship. This is encoded as an arithmetic circuit that is satisfiable only when the condition holds.

In the circuit:

  • Private input: user’s age x
  • Auxiliary witness: k
  • The circuit enforces x = 18 + k and proves k ≥ 0 (typically via bit decomposition or range-proof techniques)

The prover locally computes the witness assignment and generates a zero-knowledge proof:

π=Prove(x,k)

The smart contract only performs:

Verify(π)→

without accessing x or k.


Performance characteristics (SNARK-based setup)

  • Proof size: ~200–800 bytes
  • Verification time: ~2–10 ms on-chain
  • Proving time: depends on circuit complexity (typically 100ms–seconds range)

2. Privacy-preserving computation using zk-STARK-style traces

For more complex validation logic, a trace-based execution model was used.

Instead of proving a single constraint, the system proves correctness of a full execution trace:

T = {s_0, s_1, ..., s_n}

where each state si represents a deterministic computation step.

The proof guarantees:

∃T such that F(T) = valid execution

without revealing T.

This is particularly useful for:

  • validating sensitive on-chain attributes
  • ensuring computation integrity across untrusted nodes
  • enforcing correctness without exposing raw data

Performance characteristics (STARK-style setup)

  • Proof size: ~tens to hundreds of KB
  • Verification time: logarithmic in trace size
  • Proving time: higher than SNARKs but fully transparent setup

Tools and cryptographic stack

The system was designed using:

  • zk-SNARK-inspired circuit modeling (R1CS abstraction)
  • zk-STARK-style execution traces
  • Solidity smart contracts for on-chain verification
  • Off-chain witness generation layer (custom implementation in backend logic)
  • Cryptographic hashing primitives for commitment schemes

How ZKP integrates with the blockchain system

The architecture follows a simple trust flow:

  • User submits private input off-chain
  • Witness is generated locally
  • ZK proof is created (SNARK/STARK depending on use case)
  • Proof is submitted to smart contract
  • Smart contract verifies proof only

No sensitive information is ever stored on-chain.


Impact in the Huawei Innovation Track

This design enabled the blockchain system to:

  • Enforce verification rules without exposing private data
  • Maintain trustless validation on-chain
  • Separate computation from data disclosure
  • Strengthen privacy guarantees in a transparent ledger environment

Conclusion

Zero-Knowledge Proofs were used as a cryptographic verification layer inside a blockchain system, enabling correctness validation without data disclosure.

This shifted the system model from:

  • blockchain exposes everything but verifies correctness
  • to blockchain verifies correctness without ever seeing the data

We are actively looking for funding as this is a B2G (Business-to-Government) project.