Skip to main content

denomination_split

Function denomination_split 

Source
pub fn denomination_split(
    num_ballots: u64,
    sk: &SpendingKey,
    round_id: Base,
    proposal_id: u64,
    van_commitment: Base,
) -> [u64; 16]
Expand description

Decompose num_ballots into [NUM_SHARES] shares using a greedy denomination strategy with randomized remainder distribution.

  1. Greedy fill: place the largest standard denominations that fit, consuming up to [MAX_DENOM_SHARES] slots.
  2. Remainder split: if a non-zero remainder exists, distribute it across all free slots using deterministic PRF-derived weights.
  3. The caller then shuffles the result via [deterministic_shuffle].

The randomized remainder prevents a single non-standard value from fingerprinting the voter’s exact balance.