Skip to content

feat(privacy): add amount-based privacy term - #2

Open
bc1cindy wants to merge 5 commits into
fungi-protocol:developfrom
bc1cindy:privacy-term
Open

feat(privacy): add amount-based privacy term#2
bc1cindy wants to merge 5 commits into
fungi-protocol:developfrom
bc1cindy:privacy-term

Conversation

@bc1cindy

Copy link
Copy Markdown

adds PrivacyTerm::evaluate(mine, theirs) -> [0,1]: each of my coins gets a score for how well it hides among the other users' amounts, combined with a generalized mean, which is a formula where the exponent slides from "worst coin dominates" (min) through harmonic and arithmetic up to max. Default is harmonic (-1.0), so a poorly covered coin drags the result down

per-coin scoring lives behind the CoinScore trait, with a placeholder for now and the real subset-sum backend plugs in later without changing the term. The "dense enough" threshold semantics land with that backend, where the count gets normalized.

property-tested: the result stays in [0,1] (empty mine -> 1.0). adding a not-mine amount never lowers the term, for any exponent. The optimized mean matches a naive implementation of the power-mean definition (oracle)

closes #1

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

privacy term for the cost function

2 participants