Privacy Suite
Bulletproofs

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 information

The 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: ❌ Zero

For 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:

ScenarioBinary RepresentationResult
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 rejected

Technical 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 structure

From 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:

ProofWhat It ValidatesSecurity Level
A_ySender has private keyπŸ”’ Cryptographically secure
A_DEncrypted balance update correctπŸ”’ Homomorphic validation
A_bBalance commitment validπŸ”’ Binding & hiding
A_XAdditional protocol constraintsπŸ”’ Protocol-specific
A_tCombined 128-bit value valid (transfer + balance)πŸ”’ Range proof (bulletproof)
A_uNo 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 rejected

Source: 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:

InformationLearned?Reason
Combined 128-bit value is validβœ… YesThis is what's proven
Transfer and balance each in [0, 2^64)βœ… YesImplicit from 128-bit structure
Exact transfer amount❌ NoZero-knowledge property
Exact remaining balance❌ NoZero-knowledge property
Any bits of either value❌ NoBits are hidden
Any private information❌ NoPerfect 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:

ApplicationWhat It ValidatesProtection
Transaction AmountsCombined 128-bit value (transfer + remaining balance)Prevents negative transfers
Balance SufficiencyBoth transfer and remaining balance in [0, 2^64)Prevents overdrafts
Smart Contract StateState transitions valid, no negative balancesEnsures 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

FeatureBenefitImpact
πŸ”’ Zero-KnowledgeAmount hidden from networkPerfect privacy
πŸ“¦ Logarithmic Proofs7 rounds for 128-bit rangeEfficient transactions
πŸ” No Trusted SetupPure cryptographyDecentralized security
πŸ›‘οΈ Triple-Layer DefenseMultiple fail-safesNegative transfers impossible
βœ… Proven Securitybn256 elliptic curve discrete logStandard 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:

Technical Details:

Learn More: