Skip to main content

Module threshold_json

Module threshold_json 

Source
Expand description

JSON facade for crate::threshold (FROST threshold signing).

The threshold core works in typed Rust. This facade presents every step as JSON-in / JSON-out with binary fields as standard base64 strings, matching the convention the rest of the FFI-facing core uses (see crate::robotics_json), so UniFFI, the C ABI, and WASM all share one implementation instead of re-deriving the plumbing per language.

Functions§

aggregate
Combine signature shares into the final signature. commitments_json and shares_json are JSON objects mapping each signer’s base64 identifier to its base64 commitment / signature share respectively. group_public_key_json is the group_public_key object from generate_key. Returns the raw 64-byte Ed25519 signature, verifiable with the same verify used for any other Vouch credential.
commit
Round 1 for one signer. key_share_json is one entry from generate_key’s shares array. Returns JSON {"nonces": b64, "commitments": b64}. The nonces field is SECRET: keep it only on this signer’s device, use it for exactly one sign_share call, then discard it.
generate_key
Mint a fresh threshold-native Ed25519 identity. Returns JSON: {"shares": [{"identifier": b64, "key_package": b64}, ...], "group_public_key": {"verifying_key": b64, "public_key_package": b64}}
sign_share
Round 2 for one signer. commitments_json is a JSON object mapping each participating signer’s base64 identifier to its base64 commitment (including this signer’s own). Returns the base64-encoded signature share.