← Playground

Range Proof (Bit Decomposition)

Prove v ≥ T by showing delta = v - T is non-negative. A non-negative value can be written as a sum of bits, each 0 or 1. The full ZK version commits to each bit; here we visualize the decomposition.

Inputs

For the full check (random blinding per bit, Pedersen commitments, Schnorr-OR per bit, homomorphic product), set g, h, p below and run Full ZK check — same path as Bit-OR demo + Ex3.

Decomposition

delta = v − T
bits (LSB first)
Σ bi · 2i

Why this proves v ≥ T

BigUint arithmetic refuses to compute v - T when v < T (would underflow). So just being able to produce delta and its bit decomposition is the proof. In a true ZK protocol, the prover commits to each bit, and the verifier checks the homomorphic recombination without ever seeing the bits.