Skip to main content
Version: 1.5

Rust SDK Examples

Below is a summary of the available Rust SDK examples for ECDSA, Ed25519, and BIP340 schemes. Each example demonstrates a key feature or advanced operation.

To view and run the examples, download the crate from the Sodot Artifactory and use tar -xvf <crate_name>.crate to extract it and access the crate source. Inside the extracted folder, you can run any example with:

cargo run --example <example_name>

ECDSA Examples

Example NameDescription
ecdsa_basic_keygen_and_signBasic threshold ECDSA key generation and signing.
ecdsa_export_import_private_keyExport/import the full private key from distributed shares.
ecdsa_key_derivationKey derivation operations, including xpub/xpriv.
ecdsa_secret_share_refreshRefresh secret shares while keeping the same public key.
ecdsa_threshold_resharingChange threshold/party composition while keeping the same public key.

Ed25519 Examples

Example NameDescription
ed25519_basic_keygen_and_signBasic threshold Ed25519 key generation and signing.
ed25519_export_import_private_keyExport/import the full private key from distributed shares.
ed25519_key_derivationKey derivation operations, including spub/spriv.
ed25519_secret_share_refreshRefresh secret shares while keeping the same public key.
ed25519_threshold_resharingChange threshold/party composition while keeping the same public key.

BIP340 Examples

Example NameDescription
bip340_basic_keygen_and_signBasic threshold BIP340 (Schnorr) key generation and signing.
bip340_export_import_private_keyExport/import the full private key from distributed shares.
bip340_key_derivationKey derivation operations, including xpub/xpriv with Taproot tweaking support.
bip340_secret_share_refreshRefresh secret shares while keeping the same public key.
bip340_threshold_resharingChange threshold/party composition while keeping the same public key.
Source Code

See the examples/ecdsa/, examples/ed25519/, and examples/bip340/ folders in the repository for full code and usage details.