OpenDLT Accumulate Rust SDK
Production-ready Rust SDK for the Accumulate blockchain protocol. Supports all signature types, V2/V3 API endpoints, and provides a high-level signing API with automatic version tracking.
Features
- Multi-Signature Support: Ed25519, RCD1, BTC, ETH, RSA-SHA256, ECDSA-SHA256
- Smart Signing: Automatic signer version tracking with
SmartSigner - Complete Protocol: All transaction types and account operations
- Async/Await: Modern async Rust with tokio runtime
- Network Ready: Mainnet, Testnet (Kermit), and local DevNet support
Installation
Add to your Cargo.toml:
[]
= "2.0"
= { = "1", = ["rt-multi-thread", "macros"] }
Quick Start
use ;
use Url;
async
Smart Signing API
The SmartSigner class handles version tracking automatically:
use ;
use Url;
async
QuickStart API
For the simplest possible experience, use QuickStart:
use QuickStart;
async
Supported Signature Types
| Type | Description | Use Case |
|---|---|---|
| Ed25519 | Default signature type | Recommended for all new accounts |
| LegacyED25519 | Legacy Ed25519 format | Backward compatibility |
| RCD1 | Factom RCD1 signature | Factom ecosystem compatibility |
| BTC | Bitcoin secp256k1 | Bitcoin ecosystem integration |
| ETH | Ethereum secp256k1 + keccak256 | Ethereum ecosystem integration |
| RSA-SHA256 | RSA with SHA-256 | Enterprise/legacy systems |
| ECDSA-SHA256 | ECDSA P-256 curve | Standard ECDSA operations |
Transaction Builders
Build transactions using the TxBody struct:
use TxBody;
// Send tokens
send_tokens_single;
// Add credits
add_credits;
// Create ADI
create_identity;
// Create token account
create_token_account;
// Create custom token
create_token;
// Write data
write_data;
// Key management
update_key_page_add_key;
update_key_page_set_threshold;
Network Endpoints
use ;
use Url;
// Kermit Testnet (recommended for development)
let client = new_with_options.await?;
// Local DevNet
let client = new_with_options.await?;
// Custom endpoint
let client = new_with_options.await?;
Examples
See examples/v3/ for the core V3 API examples:
| Example | Description |
|---|---|
example_01_lite_identities |
Lite identity and token account operations |
example_02_adi_creation |
ADI creation with key books |
example_03_token_accounts |
Token account management |
example_04_data_accounts |
Data account operations |
example_05_adi_to_adi_transfer |
ADI-to-ADI token transfers |
example_06_custom_tokens |
Custom token creation and issuance |
example_07_query_operations |
Query accounts, transactions, and network status |
example_08_query_transactions |
Transaction querying patterns |
example_09_key_management |
Key page operations (add/remove keys) |
example_10_threshold_updates |
Multi-sig threshold management |
example_11_quickstart_demo |
Ultra-simple QuickStart API demo |
example_12_multi_signature_workflow |
Complete multi-sig workflow |
example_13_adi_to_adi_transfer_with_header_options |
ADI transfers with header options (memo, metadata, expire, etc.) |
Additional examples are available in examples/misc/.
Run any example:
Project Structure
src/
├── lib.rs # Public API facade
├── client.rs # AccumulateClient implementation
├── helpers.rs # SmartSigner, TxBody, QuickStart, utilities
├── json_rpc_client.rs # V2/V3 JSON-RPC client
├── codec/ # Binary encoding (TLV format)
├── crypto/ # Ed25519 and signature implementations
├── generated/ # Protocol types from YAML definitions
└── protocol/ # Transaction and envelope builders
examples/
├── v3/ # Core V3 API examples
├── misc/ # Additional / legacy examples
tests/
├── unit/ # Unit tests
├── integration/ # Network integration tests
└── conformance/ # Cross-implementation compatibility
Development
Running Tests
Code Quality
Building Examples
Error Handling
All API methods return Result<T, JsonRpcError>:
use JsonRpcError;
match client.v3_client..await
License
MIT License - see LICENSE for details.