confium-examples 0.5.0

Runnable example binaries demonstrating Confium threshold cryptography
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3
"""Confium CMP20 DKG + sign in Python.

    pip install confium
    python threshold_python_quickstart.py
"""

from confium.tc import Cmp20

# DKG: 2-of-3 threshold key
kg = Cmp20.keygen(threshold=2, parties=3)
print(f"Public key: {len(kg.public_key)} bytes")
print(f"Shares: {len(kg.shares)}")

# Sign with threshold shares
sig = Cmp20.sign(kg.shares, threshold=2, message=b"hello, threshold world")
print(f"Signature: {len(sig)} bytes")
print("✅ Done")