Skip to main content

Crate dynamic_waas_sdk

Crate dynamic_waas_sdk 

Source
Expand description

§dynamic-waas-sdk

Rust SDK for Dynamic Labs WaaS — create and manage MPC wallets from a backend service.

Stateless v1 contract: every operation that touches an existing wallet takes explicit wallet_properties + external_server_key_shares parameters. Nothing is held inside the client across calls. See the design doc at docs/design/rust-sdk.md for the full contract.

§Quick start

use dynamic_waas_sdk::{DynamicWalletClient, DynamicWalletClientOpts};

let mut client = DynamicWalletClient::new(
    DynamicWalletClientOpts::new("env-id"),
)?;
client.authenticate_api_token("dyn_...").await?;

let wp = client.fetch_wallet_metadata("0xabc...").await?;

For chain-specific signing, depend on dynamic-waas-sdk-evm or dynamic-waas-sdk-svm (T8/T9 in the rust-sdk epic).

Modules§

mpc_config
MPC scheme configuration ported from python/dynamic_wallet_sdk/mpc_config.py.

Structs§

BackupLocationInfo
DecryptedWebhookData
Result of decrypting a delegated-wallet webhook.
DelegatedWalletClient
Customer-side delegated WaaS client. Acts on behalf of one end-user wallet at a time using a delegated API key sourced from a webhook.
DelegatedWalletClientOpts
Construction options for DelegatedWalletClient.
DynamicWalletClient
Top-level WaaS client. Authenticate once, then pass it around. All per-wallet state is supplied explicitly to each method.
DynamicWalletClientOpts
Construction options for DynamicWalletClient. #[non_exhaustive] so we can add fields non-breakingly.
EcdsaSignature
ECDSA signature in canonical form.
EncryptedDelegatedPayload
Wire format of one encrypted webhook field.
KeyShareBackupInfo
Per-share backup pointer metadata. Returned by mutating ops (refresh_wallet, reshare, update_password) and persisted alongside the corresponding WalletProperties in the customer’s cache.
KeygenOpts
Options for run_keygen.
KeygenOptsEd25519
KeygenOutput
Output of run_keygen — the building block chain clients use to implement create_wallet_account.
KeygenOutputEd25519
MessageHash
32-byte hash used as input to ECDSA signing.
RefreshResult
ReshareResult
ServerKeyShare
SignOpts
Options for run_sign_ecdsa. All fields required.
SignOptsEd25519
UpdatePasswordResult
WalletProperties
Non-sensitive wallet metadata. Safe for normal caches.

Enums§

BackupLocation
Where a key share is stored. Mirrors BackupLocation enum from the Python SDK (python/dynamic_wallet_sdk/constants.py).
ChainName
Chain identifier — matches Python ChainType and Node ChainName.
Environment
Error
MpcError
ThresholdSignatureScheme
MPC threshold signature scheme.

Functions§

decrypt_delegated_webhook_data
Decrypt the two encrypted blobs delivered in a delegated-wallet webhook (the server key share + the per-wallet API key) using the customer’s RSA private key.
run_backup_dynamic
Encrypt the customer’s shares with password, upload them to Dynamic’s backup store, then mark the wallet active with one BackupLocation::Dynamic per share.
run_export_ecdsa
Export an ECDSA wallet’s xpriv. Caller is the only “exporter” — server
run_export_ed25519
Export an Ed25519 (Solana) wallet’s private key. Returns the raw bytes the engine delivers — Solana hands back a 64-byte expanded keypair (seed || pubkey). Chain clients extract the seed if they want the 32-byte form.
run_keygen
run_keygen_ed25519
run_mark_external_no_backup
Mark the wallet active without uploading anything to Dynamic’s backup store. Used when the caller has set back_up_to_dynamic=false — they’re vaulting shares themselves and only need the relay to flip the wallet from “pending” → “active”.
run_recover_key_shares
Recover the customer’s shares from Dynamic’s backup store, decrypt with password, and return them. The caller re-vaults the result.
run_sign_ecdsa
run_sign_ed25519
Returns the raw 64-byte Ed25519 signature.

Type Aliases§

Result