Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.
This repository was archived by the owner on May 20, 2026. It is now read-only.

Add radix path: combinatorial lower bound for the privacy cost function #28

Description

@bc1cindy

a sub-transaction mapping is a partition of the transaction into groups where each group has matching input and output sums; the more such valid partitions exist, the higher the ambiguity, and the higher the privacy. Counting them reduces to subset-sum: enumerating output subsets whose sums match input subset sums. General subset-sum is NP-hard, so the cost function needs bounds that are cheap to compute

the Radix path applies when outputs decompose into standard denominations: values with Hamming weight 1 in base 2 (powers of 2), base 3 (1-2 series: 1, 2, 3, 6, 9, 18, …), or base 10 (1-2-5 series: 1, 2, 5, 10, 20, 50, …, the same shape as fiat banknotes). The three bases are complementary and form a geometric progression with non-trivial multiplicities, so the resulting subset-sum instances are dense by construction.

the count per output is k × m!, where:

  • k : number of distinct standard denominations whose sum equals the output value
  • m: minimum multiplicity, across the transaction outputs, of the denominations used in that decomposition

this counts mappings produced by an exchange between a k-sized subset and a single-output subset of equal value: k is the linear orientation choice, m! permutes the m identical copies of each denomination across sub-transactions. Outputs that cannot decompose into ≤ max_size denominations (default 6) contribute 0. The total is a lower bound on consistent mappings; returned as u128 with saturation

3 PRs implement proposal:

  • 1 (radix-primitives): mapping count primitives, factorial, radix_mapping_count, STANDARD_DENOMS + range helpers (standard_denoms_in_range, powers_in_range...), radix_decompose (DFS with backtracking), and radix_mappings(outputs, max_size) -> u128
  • 2 (radix-sumsets): param consts, sumset, gap, density, and approximate_from_below analytical tooling
  • 3 (radix-wire): RadixMetric into PrivacyBundle , consuming radix::radix_mappings

add proptest dep, to verify algebraic properties (factorial recurrence, monotonicity, decomposition correctness) across random inputs to catch corner cases unit tests miss

other count paths (brute force already exists; sparse convolution and sasamoto) are out of scope here.

ref:

makes sense?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions