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 Name | Description |
|---|---|
| ecdsa_basic_keygen_and_sign | Basic threshold ECDSA key generation and signing. |
| ecdsa_export_import_private_key | Export/import the full private key from distributed shares. |
| ecdsa_key_derivation | Key derivation operations, including xpub/xpriv. |
| ecdsa_secret_share_refresh | Refresh secret shares while keeping the same public key. |
| ecdsa_threshold_resharing | Change threshold/party composition while keeping the same public key. |
Ed25519 Examples
| Example Name | Description |
|---|---|
| ed25519_basic_keygen_and_sign | Basic threshold Ed25519 key generation and signing. |
| ed25519_export_import_private_key | Export/import the full private key from distributed shares. |
| ed25519_key_derivation | Key derivation operations, including spub/spriv. |
| ed25519_secret_share_refresh | Refresh secret shares while keeping the same public key. |
| ed25519_threshold_resharing | Change threshold/party composition while keeping the same public key. |
BIP340 Examples
| Example Name | Description |
|---|---|
| bip340_basic_keygen_and_sign | Basic threshold BIP340 (Schnorr) key generation and signing. |
| bip340_export_import_private_key | Export/import the full private key from distributed shares. |
| bip340_key_derivation | Key derivation operations, including xpub/xpriv with Taproot tweaking support. |
| bip340_secret_share_refresh | Refresh secret shares while keeping the same public key. |
| bip340_threshold_resharing | Change 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.