pub struct ThresholdPolicy {
pub threshold: u8,
pub signers: Vec<String>,
pub policy_id: String,
pub scope: Option<Capability>,
pub ceremony_endpoint: Option<String>,
}Expand description
Policy for threshold signature operations (M-of-N).
This struct defines the parameters for FROST (Flexible Round-Optimized Schnorr Threshold) signature operations. FROST enables M-of-N threshold signing where at least M participants must cooperate to produce a valid signature, but no single participant can sign alone.
§Protocol Choice: FROST
FROST was chosen over alternatives for several reasons:
- Ed25519 native: Works with existing Ed25519 key infrastructure
- Round-optimized: Only 2 rounds for signing (vs 3+ for alternatives)
- Rust ecosystem:
frost-ed25519crate from ZcashFoundation is mature - Security: Proven secure under discrete log assumption
§Key Generation Approaches
Two approaches exist for generating threshold key shares:
-
Trusted Dealer: One party generates the key and distributes shares
- Simpler to implement
- Single point of failure during key generation
- Appropriate for org-controlled scenarios
-
Distributed Key Generation (DKG): Participants jointly generate key
- No single party ever sees the full key
- More complex, requires additional round-trips
- Better for trustless scenarios
§Integration with Auths
Threshold policies can be attached to high-value operations like:
sign-release: Release signing requires M-of-N approversrotate-keys: Key rotation requires multi-party approvalmanage-members: Adding admins requires quorum
§Example
let policy = ThresholdPolicy {
threshold: 2,
signers: vec![
"did:key:alice".to_string(),
"did:key:bob".to_string(),
"did:key:carol".to_string(),
],
policy_id: "release-signing-v1".to_string(),
scope: Some(Capability::sign_release()),
ceremony_endpoint: Some("wss://auths.example/ceremony".to_string()),
};
// 2-of-3: Any 2 of Alice, Bob, Carol can sign releases§Storage
Key shares are NOT stored in Git refs (they are secrets). Options:
- Platform keychain (macOS Keychain, Windows Credential Manager)
- Hardware security modules (HSMs)
- Secret managers (Vault, AWS Secrets Manager)
The policy itself (public info) is stored in Git at:
refs/auths/policies/threshold/<policy_id>
Fields§
§threshold: u8Minimum signers required (M in M-of-N)
signers: Vec<String>Total authorized signers (N in M-of-N) - DIDs of participants
policy_id: StringUnique identifier for this policy
scope: Option<Capability>Scope of operations this policy covers (optional)
ceremony_endpoint: Option<String>Ceremony coordination endpoint (e.g., WebSocket URL for signing rounds)
Implementations§
Trait Implementations§
Source§impl Clone for ThresholdPolicy
impl Clone for ThresholdPolicy
Source§fn clone(&self) -> ThresholdPolicy
fn clone(&self) -> ThresholdPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more