Bulletproofs: Zero-Knowledge Range Proofs
Zero-Knowledge Magic: Bulletproofs prove your transaction amounts are valid without revealing what they are. DERO uses a 128-bit combined range proof to validate both the transfer amount and remaining balance in a single proof. Privacy + Security = Perfect.
What Problem Do Bulletproofs Solve?
The Challenge:
DERO needs to verify:
β Amount is positive (not negative)
β Amount is reasonable (not 999 trillion)
β Sender has enough balance
But WITHOUT revealing:
β The actual amount
β The sender's balance
β Any private informationThe Solution: Bulletproofs
- β Prove combined 128-bit value is valid (transfer + remaining balance, each 64-bit)
- β Never reveal the amount value
- β Logarithmic-size proof (7 rounds for 128-bit range)
- β No trusted setup needed
How It Works (Simple Analogy)
The Bouncer Problem:
Show ID (Reveals Everything)
You: "I'm 25 years old"
Bouncer: "Show me your ID"
Bouncer learns:
β You're over 21
β Your exact age (25)
β Your address
β Your full name
β Your photo
β Everything else on ID
Privacy: β ZeroFor DERO:
- Bulletproof proves: "Combined 128-bit value is valid (transfer amount in lower 64 bits, remaining balance in upper 64 bits)"
- Network learns: β Both values are valid (in [0, 2^64))
- Network learns: β What either value actually is
The Proof Flow
What Network Sees:
- β Commitment (encrypted amount)
- β Bulletproof (logarithmic-size proof)
- β Proof is valid
- β Actual amount (hidden)
Protection Against Negative Transfers
Three-Layer Defense
DERO uses three cryptographic layers to prevent negative transfers:
Layer 1: Bit Decomposition Protection
What Happens with Negative Values:
| Scenario | Binary Representation | Result |
|---|---|---|
| Valid (100 DERO) | 1100100 | β Valid bit string |
| Invalid (-100) | -1100100 | β Contains - character |
From Source Code (cryptography/crypto/proof_generate.go:473-487):
// Bit decomposition process
number_string := reverse("0000...000" + number.Text(2))
// For negative values:
// Go's BigInt.Text(2) returns "-1100100" (with minus sign)
// Bit loop expects only '0' or '1' characters
// Minus sign ('-', ASCII 45) is invalid
// Proof generation fails β Transaction rejectedTechnical Guarantee:
- Go's
BigInt.Text(2)always returns"-[binary]"for negatives - This is standard library behavior (cannot be bypassed)
- Bit processing loop expects only
'0'(48) or'1'(49) - Minus sign
'-'(45) breaks the proof generation
Layer 2: Range Proof (A_t)
What A_t Validates:
DERO constructs a combined 128-bit value where the lower 64 bits represent the transfer amount and the upper 64 bits represent the remaining balance. This is created by: value = transfer_amount + (remaining_balance << 64).
A_t Range Proof checks:
β Combined 128-bit value is valid
β Transfer amount (lower 64 bits) is in range [0, 2^64)
β Remaining balance (upper 64 bits) is in range [0, 2^64)
β All 128 bit commitments are valid (0 or 1)If Layer 1 fails (has - character):
- Bit commitments cannot be created
- A_t proof generation fails
- Transaction rejected
Source: cryptography/crypto/proof_generate.go:471 - Combined value construction: btransfer.Add(btransfer, bdiff.Lsh(bdiff, 64))
Why 128 bits? By combining transfer amount and remaining balance into a single 128-bit value, DERO proves both are valid in one proof while keeping both values hidden.
Layer 3: Inner Product Proof - The Cryptographic Fail-Safe
Layer 3 is the cryptographic fail-safe that ensures complete integrity across all proof components. Using a recursive halving algorithm, it creates cryptographic commitments at each step, making it mathematically impossible to have invalid bit vectors or any form of manipulation.
What It Validates:
Inner Product Proof cryptographically verifies:
β Bit commitments match amount commitment
β Mathematical consistency across all components
β No manipulation possible at any level
β Integrity of entire proof structureFrom Source Code (cryptography/crypto/proof_innerproduct.go):
// Inner product proof verifies:
// - Bit vectors (aL, aR) match commitments
// - Final inner product equals committed value
// - All recursive steps are cryptographically consistent
// If ANY layer fails:
if P_calculated.String() != P.String() {
// Verification fails
// Transaction rejected
}The Fail-Safe Guarantee:
Even if Layers 1 and 2 were somehow bypassed (mathematically impossible), Layer 3 would still reject the transaction because invalid bit vectors create inconsistent inner products, and the recursive structure cryptographically binds all components. The final verification checks mathematical consistency - any corruption is detected and rejected.
Triple Protection: Layer 1 catches negatives at bit decomposition. Layer 2 validates range. Layer 3 is the cryptographic fail-safe that ensures complete integrity across all proof components. All three layers must pass - this is mathematically guaranteed.
The Six Sigma Proofs
DERO uses six interconnected proofs that all must pass:
| Proof | What It Validates | Security Level |
|---|---|---|
| A_y | Sender has private key | π Cryptographically secure |
| A_D | Encrypted balance update correct | π Homomorphic validation |
| A_b | Balance commitment valid | π Binding & hiding |
| A_X | Additional protocol constraints | π Protocol-specific |
| A_t | Combined 128-bit value valid (transfer + balance) | π Range proof (bulletproof) |
| A_u | No double-spending | π Unspent validation |
All Bound Together:
Challenge hash (c) = hash(A_y || A_D || A_b || A_X || A_t || A_u || ...)
If ANY proof fails:
β Challenge hash is different
β Verification fails
β Transaction rejectedSource: cryptography/crypto/proof_verify.go - Verifies all six sigma proofs + inner product
Inner Product Proof (The Core Algorithm)
Recursive Halving - How Logarithmic Scaling Works
The Algorithm:
Iterations:
- Start: 128 elements
- Iteration 1: 64 elements
- Iteration 2: 32 elements
- Iteration 3: 16 elements
- Iteration 4: 8 elements
- Iteration 5: 4 elements
- Iteration 6: 2 elements
- Iteration 7: 1 element
Total: logβ(128) = 7 iterations
Source: cryptography/crypto/proof_innerproduct.go - Recursive halving algorithm
Zero-Knowledge Property Explained
What "Zero-Knowledge" Means
After seeing a valid bulletproof, verifier learns:
| Information | Learned? | Reason |
|---|---|---|
| Combined 128-bit value is valid | β Yes | This is what's proven |
| Transfer and balance each in [0, 2^64) | β Yes | Implicit from 128-bit structure |
| Exact transfer amount | β No | Zero-knowledge property |
| Exact remaining balance | β No | Zero-knowledge property |
| Any bits of either value | β No | Bits are hidden |
| Any private information | β No | Perfect privacy |
Formal Properties:
- β Completeness: Valid proofs always verify
- β Soundness: Invalid proofs never verify
- β Zero-knowledge: No information leaked
Where Bulletproofs Are Used
Three Core Applications:
| Application | What It Validates | Protection |
|---|---|---|
| Transaction Amounts | Combined 128-bit value (transfer + remaining balance) | Prevents negative transfers |
| Balance Sufficiency | Both transfer and remaining balance in [0, 2^64) | Prevents overdrafts |
| Smart Contract State | State transitions valid, no negative balances | Ensures contract integrity |
All three use the same bulletproof mechanism:
- β Prove value is in valid range
- β Never reveal the actual value
- β Cryptographic guarantee
Key Takeaways
What You Get
| Feature | Benefit | Impact |
|---|---|---|
| π Zero-Knowledge | Amount hidden from network | Perfect privacy |
| π¦ Logarithmic Proofs | 7 rounds for 128-bit range | Efficient transactions |
| π No Trusted Setup | Pure cryptography | Decentralized security |
| π‘οΈ Triple-Layer Defense | Multiple fail-safes | Negative transfers impossible |
| β Proven Security | bn256 elliptic curve discrete log | Standard discrete log security assumption |
What You're Protected From
The Bottom Line:
Triple-Layer Security: Layer 1 catches negatives at bit decomposition. Layer 2 validates range. Layer 3 provides cryptographic fail-safe integrity. All three must pass - mathematically guaranteed.
Performance + Privacy: DERO's bulletproof implementation keeps proofs logarithmic in size while preserving strong cryptographic guarantees.
Related Pages
Privacy Suite:
- Ring Signatures - Sender anonymity
- Homomorphic Encryption - Amount encryption
- Transaction Privacy - Complete privacy model
Technical Details:
- DERO Tokens - How bulletproofs secure token balances
- Transaction Structure - Bulletproof integration
Learn More:
- Privacy Features Overview - Full privacy suite
- Private Smart Contracts - Contract privacy