Skip to content

Conversation

@0xsecaas
Copy link
Contributor

@0xsecaas 0xsecaas commented Nov 13, 2025

related to #18
related to #57


Part 1/4: Document threshold semantics and security assumptions across schemes

Part 2/4: Persist and enforce threshold invariants across key refresh APIs
Part 3/4: Implement scheme-specific hardcoded threshold validation
Part 4/4: Mirror threshold validation and checks in MPC repo

@0xsecaas 0xsecaas changed the title Document threshold policies and security assumptions [1/4] Document threshold policies and security assumptions Nov 13, 2025
Comment on lines +7 to +9
**The tuple `(N, f, t)` chosen at key generation is fixed for all subprotocols**
(keygen → presign/offline → signing → refresh → resharing).
Any deviation **must be rejected** unless explicitly whitelisted by `SchemeRules`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be accurate. During resharing we might need to change the threshold $t$, and with it $f$.
CC: @SimonRastikian @netrome

On a related note, in which cases $f = t - 1$ is not true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gilcu3 true (for current implementation).

I should've mentioned in a Planned policy:
once ThresholdPolicy/SchemeRules land ([step 3/4]), the default will be:

(N,f,t) stays fixed unless the SchemeRules entry for that scheme allows otherwise.


The What (Goal):

Make the constraints explicit and impossible to miss.

The How (Approach):

  • Modify APIs so that mismatched thresholds (e.g., refresh with different threshold) are rejected (step 2/4) unless explicitly intended and supported (step 3/4):
    • Introduce scheme-specific hardcoded rules over allowable threshold.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, probably in the future PRs then it will make sense. Although also maybe worth asking, do we have a variable for $f$ because at some point that invariant $f = t-1$ might not hold anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet; today we only persist threshold and infer f = t − 1. To allow future schemes where t != f + 1, we should add explicit (N, f, t) metadata (ThresholdMeta) to keys/shares/transcripts and pass f (or at least store it alongside t) so the validator can enforce or relax the relation via SchemeRules.

Updated part of the document: link

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still torn by:

**The tuple `(N, f, t)` chosen at key generation is fixed for all subprotocols**  
(keygen → presign/offline → signing → refresh → resharing).

I would reduce it to presign/offline → signing → refresh as for keygen and specially resharing we need the ability to change the parameters in the tuple


| Misconfiguration | Failure Mode |
| ------------------------------------------- | --------------------------------------------------------------------- |
| `f >= N/3` in DKG | Broadcast assumptions break; safety and liveness lost. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for that type of comparison we should be more precise, as $N/3$ might not be an integer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @gilcu3 for your input.

Would this be more precise?

+`f >= floor(N / 3)` in DKG 

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, wherever we use fractions and compare them with integers we should be explicit: using floor or ceil

## Persistence Requirement

All keys, shares, or transcripts that leave the protocol must embed `(N, f, t)` so future API calls can enforce invariants even if the caller did not store them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+Treat this as a `ThresholdMeta` record that every subprotocol must serialize and verify.

+Keep `f` explicit even when `t = f + 1`. The current schemes tie `t` to `f`, but future `SchemeRules` may relax that relation; persisting both prevents silent downgrades if a protocol later allows `t != f + 1`.

@gilcu3
Copy link
Contributor

gilcu3 commented Dec 3, 2025

@0xsecaas is this ready for review again?

@0xsecaas 0xsecaas requested a review from gilcu3 December 3, 2025 09:46
@gilcu3 gilcu3 requested a review from SimonRastikian December 3, 2025 09:50
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.46%. Comparing base (1e03b9c) to head (5a90b6c).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
+ Coverage   87.92%   88.46%   +0.53%     
==========================================
  Files          41       50       +9     
  Lines        9046     9733     +687     
  Branches     9046     9733     +687     
==========================================
+ Hits         7954     8610     +656     
- Misses        645      673      +28     
- Partials      447      450       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@gilcu3 gilcu3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some inaccuracies that we need to agree upon here. Lets follow the conversation in the PR comments

- **Fault tolerance:**
`f <= floor(N / 3)` due to asynchronous reliable broadcast.
- **Threshold:**
`t = f + 1` (design choice; distinct from `N - f`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by "design choice; distinct from N - f"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I say the DKG uses a design choice, I mean its threshold is explicitly set to t = f + 1 because that’s the minimum needed to block f colluding adversaries from recovering the secret.
This is not the same as N - f, which is simply the worst-case count of honest parties.

They differ for a reason: tying t to N - f would force every honest participant to be involved in reconstruction. Using t = f + 1 avoids that—DKG security only depends on resisting f adversaries, not on the total number of honest nodes. It keeps the quorum minimal, avoids accidental assumptions about honesty counts, and gives better liveness under churn.

@0xsecaas 0xsecaas requested a review from gilcu3 December 3, 2025 13:54
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.

3 participants