Value Commitments and the Value Pool
1. Why This Chapter Exists
Orchard hides note values inside Sinsemilla note commitments and
reconciles them across a bundle with a Pedersen value commitment.
The balance equation is enforced by a RedPallas binding signature
on the difference of the sum of commitments and the declared
value_balance. After this chapter the reader can derive the
binding signature key on paper and locate the bases
and in the code.
2. Definitions
Definition 2.1 (Value Commitment Bases)
Two fixed generators , derived by hashing-to-curve under distinct domain strings.
Definition 2.2 (Per-Action Net Commitment)
For Action with input value , output value , and trapdoor :
Definition 2.3 (Binding Signature Key)
If the prover's value sum matches , , which the prover can sign for. Any mismatch breaks knowledge of the discrete log relative to .
Invariant 2.4 (NoteValue Range)
NoteValue is an unsigned 64-bit integer; ValueSum is a signed
64-bit value (in the Rust sense, so range
). The valueBalanceOrchard type parameter on
Bundle is user-defined; the Zcash instantiation restricts it to
51 bits.
3. The Code
3.1 Value Types
loading...
NoteValue, ValueSum, ValueCommitTrapdoor, and
ValueCommitment are the four value-domain types. The module
header documents the i64-vs-63-bit caveat in detail.
3.2 Constants
The bases and are declared as fixed
bases in
src/constants/fixed_bases.rs.
Recent refactors collapsed OrchardFixedBases to a unit struct
(PR #496);
contributors should expect the API surface to change here.
3.3 Binding Signature Wiring
src/bundle/commitments.rs
implements the digests that the binding signature signs.
src/primitives/redpallas.rs
exposes the
Binding marker that selects as the base; see
Chapter 14.
4. Failure Modes
- Wrong base for the binding signature. Confusing
and produces a verifier that accepts an arbitrary
value imbalance; the type marker
Bindingexists exactly to prevent this confusion. - Identity
cv^net_i. If , the prover has no discrete-log knowledge of . Sampling fresh per Action keeps the probability negligible. - Pseudo-random base reuse. A future contributor must not reuse for another commitment scheme; doing so would compute a commitment that opens to the wrong subset.
- NoteValue vs i64 confusion. The
value.rsheader reiterates thati64represents only 63 bits in this context. PRs that cast aNoteValue(u64) toi64without checking the upper bit are broken.
5. Spec Pointers
- Zcash Protocol Specification, Section 4.13: Balance.
- Zcash Protocol Specification, Section 5.4.8.3: Homomorphic Pedersen commitments.
- ZIP 224: Orchard-specific value commitment parameters.
6. Exercises
- Take a bundle with two Actions where
and
. With
value_balance = 0, compute symbolically and confirm the dependence on the 's only. - Locate the unit test for
ValueSum::overflow_*. What edge case does it pin down? - Code task. Patch
tests/builder.rsso the bundle's declaredvalue_balanceis off by one from the true sum. Confirm thatBundle::verifyreturnsErrand identify theredpallas::Bindingsignature failure as the proximate cause.
7. Further Reading
- Maller et al., Sonic on the Pedersen-commitment style of value reconciliation used here.
- The
src/constants/fixed_bases.rscommit history documents the generator derivation.