← All Products
Confium Threshold
Eliminate single points of failure in your signing infrastructure.
Security EngineersDevSecOpsPlatform Engineers
API reference
Canonical code shapes for Confium Threshold, with per-language tabs. Copy-paste-runnable.
Canonical flow: DKG → sign → verify
{`// Cargo.toml: confium-threshold = { version = "0.4", features = ["cmp20"] }
use confium_threshold::cmp20;
// 1. DKG (3 parties, threshold 2)
let keygen = cmp20::keygen(threshold=2, parties=3)?;
// 2. Sign with any 2 of 3 shares
let sig = cmp20::sign(
&[keygen.shares[0].clone(), keygen.shares[1].clone()],
threshold=2,
message=b"hello",
)?;
// 3. Verify with the joint public key
assert!(cmp20::verify(&sig, &keygen.public_key, b"hello")?);`}