# Rust SDK Examples

Below is a summary of the available Rust SDK examples for the ECDSA, Ed25519, BIP340, and ExportableEd25519 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:

```bash
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.                        |

## ExportableEd25519 Examples

| Example Name                | Description                                                                                 |
|----------------------------|---------------------------------------------------------------------------------------------|
| exportable\_ed25519\_basic\_keygen\_and\_sign       | Basic threshold ExportableEd25519 key generation (sample/receive) and signing.  |
| exportable\_ed25519\_export\_import\_private\_key   | Export/import the raw 32-byte Ed25519 private key from distributed shares.      |
| exportable\_ed25519\_secret\_share\_refresh        | Refresh secret shares while keeping the same public key.                        |
| exportable\_ed25519\_threshold\_resharing         | Change threshold/party composition while keeping the same public key.           |

Note that ExportableEd25519 has no key-derivation example: the scheme does not support derivation paths (see [Exportable Ed25519 Keys](/rust/exportable_ed25519)).

:::note[Source Code]
See the `examples/ecdsa/`, `examples/ed25519/`, `examples/bip340/`, and `examples/exportable_ed25519/` folders in the crate for full code and usage details.
:::
