Skip to main content

Dynamic MPC Wallet SDK for Python — create and manage multi-party computation wallets for EVM and Solana

Project description

Dynamic Wallet SDK for Python

A Python SDK for Dynamic's MPC (Multi-Party Computation) wallet infrastructure. Create, sign with, broadcast from, and manage non-custodial wallets from Python — no browser required.

Installation

pip install dynamic-wallet-sdk

Pre-built wheels are provided for Linux (x86_64, ARM64) and macOS (x86_64, Apple Silicon). No Rust toolchain required.

Requirements

Quick Start

EVM Wallet

import asyncio
from dynamic_wallet_sdk.evm.client import DynamicEvmWalletClient

async def main():
    async with DynamicEvmWalletClient("your-environment-id") as client:
        await client.authenticate_api_token("your-api-token")

        # Create wallet (MPC keygen). Returns WalletProperties.
        wp = await client.create_wallet_account(password="backup-password")
        address = wp.account_address
        print(f"Created EVM wallet: {address}")

        # Sign a message (EIP-191)
        signature = await client.sign_message(message="Hello, Dynamic!", address=address)
        print(f"Signature: {signature}")

        # Sign EIP-712 typed data
        typed_data = {
            "types": {...},
            "primaryType": "...",
            "domain": {...},
            "message": {...},
        }
        sig = await client.sign_typed_data(address, typed_data)

        # Sign a legacy transaction and broadcast it
        tx = {
            "to": "0xRecipient...",
            "value": 0,
            "nonce": 0,
            "gas": 21000,
            "gasPrice": 20_000_000_000,
            "chainId": 1,
            "data": "0x",
        }
        tx_hash = await client.send_transaction(
            address=address, tx=tx, rpc_url="https://mainnet.infura.io/v3/YOUR_KEY"
        )
        print(f"Tx hash: {tx_hash}")

asyncio.run(main())

Solana (SVM) Wallet

import asyncio
from dynamic_wallet_sdk.svm.client import DynamicSvmWalletClient

async def main():
    async with DynamicSvmWalletClient("your-environment-id") as client:
        await client.authenticate_api_token("your-api-token")

        wp = await client.create_wallet_account(password="backup-password")
        address = wp.account_address
        print(f"Created Solana wallet: {address}")

        signature = await client.sign_message(message="Hello from Solana!", address=address)
        print(f"Signature (base58): {signature}")

        # Sign a transaction message and broadcast it
        message_bytes = bytes(...)   # serialized Solana tx message
        tx_sig = await client.send_transaction(
            address=address,
            message_bytes=message_bytes,
            rpc_url="https://api.mainnet-beta.solana.com",
        )
        print(f"Tx signature: {tx_sig}")

asyncio.run(main())

Delegated Signing

For server-side signing where key shares are held by your server:

from dynamic_wallet_sdk.delegated.client import (
    create_delegated_evm_client,
    delegated_sign_message,
)
from dynamic_wallet_sdk.delegated.decrypt import decrypt_delegated_webhook_data

# 1. Decrypt the webhook payload you received from Dynamic
decrypted = decrypt_delegated_webhook_data(
    private_key_pem=rsa_private_key,
    encrypted_delegated_key_share=webhook["encryptedDelegatedShare"],
    encrypted_wallet_api_key=webhook["encryptedWalletApiKey"],
)

# 2. Create a client and sign
client = await create_delegated_evm_client("env-id", "api-key")
sig = await delegated_sign_message(
    client,
    wallet_id="wallet-id",
    wallet_api_key=decrypted.decrypted_wallet_api_key,
    key_share=decrypted.decrypted_delegated_share["secretShare"],
    message="0x...",
    chain_name="EVM",
    is_formatted=True,
)

Key Concepts

Key Backup and Recovery

Pass a password to create_wallet_account() to encrypt and back up key shares at keygen time. The password is never sent to Dynamic — only AES-256-GCM ciphertext is stored.

Auto-recovery on sign: pass password= directly to any sign call and the SDK will recover shares automatically if they are not already in memory:

# Shares were lost (process restarted, etc.) — just pass password= and signing works
signature = await client.sign_message(
    message="Hello!", address=address, password="backup-password"
)

Explicit recovery:

shares = await client.recover_key_shares(address, password="backup-password")

Session Rehydration

To rehydrate a known wallet in a new session without fetching all user wallets:

wp = await client.load_wallet(address)
# wp.account_address, wp.wallet_id, and backup metadata are populated
# Signing with password= will auto-recover key shares as needed

Transaction Broadcasting

Every chain client exposes two broadcast patterns:

send_transaction() — sign and broadcast in one call:

# EVM
tx_hash = await evm_client.send_transaction(address, tx, rpc_url="https://...")

# SVM
tx_sig = await svm_client.send_transaction(address, message_bytes, rpc_url="https://...")

Standalone utilities — sign first, broadcast separately:

from dynamic_wallet_sdk.evm import broadcast_raw_transaction
from dynamic_wallet_sdk.svm import attach_signature, broadcast_raw_transaction as svm_broadcast

# EVM: build the signed raw tx yourself, then broadcast
tx_hash = await broadcast_raw_transaction(signed_tx_hex, rpc_url)

# SVM: attach signature to message bytes, then broadcast
signed_tx = attach_signature(message_bytes, sig_hex)   # → bytes
tx_sig    = await svm_broadcast(signed_tx, rpc_url)

RPC URLs are supplied by the developer — use any JSON-RPC node (Infura, Alchemy, Helius, QuickNode, a local node, etc.). The SDK is RPC-provider-agnostic.

Threshold Signature Schemes

The SDK supports two TSS configurations:

Scheme Parties Threshold Client Shares Server Shares
TWO_OF_TWO 2 2 1 1
TWO_OF_THREE 3 2 2 1

Chain Support

Chain Algorithm Client Class
EVM ECDSA DynamicEvmWalletClient
SVM (Solana) Ed25519 DynamicSvmWalletClient

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamic_wallet_sdk-0.6.1.tar.gz (111.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dynamic_wallet_sdk-0.6.1-cp311-abi3-manylinux_2_28_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

dynamic_wallet_sdk-0.6.1-cp311-abi3-manylinux_2_28_aarch64.whl (4.7 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

dynamic_wallet_sdk-0.6.1-cp311-abi3-macosx_11_0_arm64.whl (4.9 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

dynamic_wallet_sdk-0.6.1-cp311-abi3-macosx_10_12_x86_64.whl (5.0 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file dynamic_wallet_sdk-0.6.1.tar.gz.

File metadata

  • Download URL: dynamic_wallet_sdk-0.6.1.tar.gz
  • Upload date:
  • Size: 111.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dynamic_wallet_sdk-0.6.1.tar.gz
Algorithm Hash digest
SHA256 938a7c4ea48951827b94e7e98752971547377a6ab5b53dbaf1b12a1e1f464d4b
MD5 c41751bfefb85fba48d89cbfa059728e
BLAKE2b-256 4af71cfa1bcc8ef426f33c588e980f609b70c5b68c51d2edf1284169adba9dac

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynamic_wallet_sdk-0.6.1.tar.gz:

Publisher: python-publish.yml on dynamic-labs/dynamic-waas-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dynamic_wallet_sdk-0.6.1-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dynamic_wallet_sdk-0.6.1-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f83aad49060feeb21261572012005dfdc5dee89a36c2507f75602450cac53bbc
MD5 86e0b0224aed9ef8986ebe3a483d8fd4
BLAKE2b-256 56ee084445ec48cf098cdff296bec2b228366c88baf1e3816d6a2b314ca11cc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynamic_wallet_sdk-0.6.1-cp311-abi3-manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on dynamic-labs/dynamic-waas-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dynamic_wallet_sdk-0.6.1-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dynamic_wallet_sdk-0.6.1-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4ef93598b9b43bbc4fb482359090bb82e5504815a5ddb5a28ff5dcea1053dc32
MD5 358f7d084a281f977e51d6d12361cd88
BLAKE2b-256 e1e50db73bbccd4d4837a39bc30f5a8aa06ec3690dee2dd08a2931caf2ac1859

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynamic_wallet_sdk-0.6.1-cp311-abi3-manylinux_2_28_aarch64.whl:

Publisher: python-publish.yml on dynamic-labs/dynamic-waas-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dynamic_wallet_sdk-0.6.1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dynamic_wallet_sdk-0.6.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e1f07cc7e775d4f8cca54e3586f67814ce4351b38c5fdddd982daab4577750ab
MD5 889cfc9de61a14f13ec8e483cba2f15d
BLAKE2b-256 22b94d98d5f5cc8bebd0a100898323285f7fbd6ffcf33cb1f0354e2000669cda

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynamic_wallet_sdk-0.6.1-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on dynamic-labs/dynamic-waas-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dynamic_wallet_sdk-0.6.1-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dynamic_wallet_sdk-0.6.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 61052e5d6a5827fb5376100056ffef0fc882ac25fc11882b4ce0340af1100b8e
MD5 34012a3d63243c902e4106db6ec9c2b3
BLAKE2b-256 272d5d350c76ffd8caa04974b2cabd7cfbf38a19e47eb91db73df6437d5b81f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for dynamic_wallet_sdk-0.6.1-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on dynamic-labs/dynamic-waas-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page