OpenDLT Accumulate Python SDK
Production-ready Python 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 33 transaction types and account operations
- Cross-Platform: Pure Python implementation
- Network Ready: Mainnet, Testnet (Kermit), and local DevNet support
Installation
pip install accumulate-sdk-opendlt
Or install from source:
git clone https://github.com/opendlt/accumulate-python-client.git
cd accumulate-python-client/unified
pip install -e ".[dev]"
Quick Start
from accumulate_client import Accumulate
from accumulate_client.crypto.ed25519 import Ed25519KeyPair
# Connect to Kermit testnet
client = Accumulate(
"https://kermit.accumulatenetwork.io/v2",
v3_endpoint="https://kermit.accumulatenetwork.io/v3",
)
# Generate key pair and derive lite account URLs
kp = Ed25519KeyPair.generate()
lid = kp.derive_lite_identity_url()
lta = kp.derive_lite_token_account_url("ACME")
print(f"Lite Identity: {lid}")
print(f"Lite Token Account: {lta}")
# Query account
account = client.query(lta)
print(f"Account: {account}")
API Levels
The SDK provides three levels of abstraction:
| Level | Class | Best For |
|---|---|---|
| Highest | QuickStart |
Prototyping, scripts, learning |
| Mid | SmartSigner + TxBody |
Production apps with per-transaction control |
| Lowest | Binary encoding helpers | Custom protocols, cross-language testing |
SmartSigner + TxBody (Recommended for most use cases)
SmartSigner handles the full sign/submit/poll lifecycle. Under the hood it:
- Queries the signer version from the network
- Binary-encodes signature metadata, transaction header, and body
- Computes
tx_hash = SHA256(SHA256(header) + SHA256(body)) - Computes and signs
preimage = SHA256(initiator + tx_hash) - Assembles the JSON envelope and submits via V3 JSON-RPC
- Polls until the transaction is delivered or fails
TxBody is a static factory that returns correctly-structured body dicts.
from accumulate_client import Accumulate
from accumulate_client.crypto.ed25519 import Ed25519KeyPair
from accumulate_client.convenience import SmartSigner, TxBody
client = Accumulate("https://kermit.accumulatenetwork.io")
kp = Ed25519KeyPair.generate()
lid = kp.derive_lite_identity_url()
lta = kp.derive_lite_token_account_url("ACME")
signer = SmartSigner(client.v3, kp, lid)
result = signer.sign_submit_and_wait(
principal=lta,
body=TxBody.send_tokens_single(
to_url="acc://recipient.acme/tokens",
amount="100000000", # 1 ACME
),
memo="Payment",
)
if result.success:
print(f"Transaction delivered: {result.txid}")
Supported Signature Types
| Type | Signer Class | Use Case |
|---|---|---|
| Ed25519 | Ed25519Signer |
Default, recommended |
| Legacy Ed25519 | LegacyEd25519Signer |
Pre-signed message format |
| RCD1 | RCD1Signer |
Factom compatibility |
| BTC | BTCSigner |
Bitcoin/Secp256k1 ecosystem |
| ETH | ETHSigner |
Ethereum/Secp256k1 ecosystem |
Signer classes are in accumulate_client.signers.
Transaction Builders
Build transactions using the TxBody class:
from accumulate_client.convenience import TxBody
# Send tokens
TxBody.send_tokens_single(to_url="acc://...", amount="100000000")
# Add credits
TxBody.add_credits(recipient="acc://...", amount=1000000, oracle=oracle_price)
# Create ADI
TxBody.create_identity(url="acc://my-adi.acme", key_book_url="acc://my-adi.acme/book", public_key_hash=key_hash)
# Create token account
TxBody.create_token_account(url="acc://my-adi.acme/tokens", token_url="acc://ACME")
# Create custom token
TxBody.create_token(url="acc://my-adi.acme/mytoken", symbol="MTK", precision=8)
# Write data
TxBody.write_data(entries_hex=[data_hex])
Network Endpoints
from accumulate_client import Accumulate
# Public networks
mainnet = Accumulate.mainnet()
testnet = Accumulate.testnet()
# Kermit testnet (explicit endpoints)
kermit = Accumulate(
"https://kermit.accumulatenetwork.io/v2",
v3_endpoint="https://kermit.accumulatenetwork.io/v3",
)
# Local development
devnet = Accumulate.devnet()
Examples
See examples/v3/ for complete working examples:
| Example | Description |
|---|---|
example_01_lite_identities.py |
Lite identity and token account operations |
example_02_accumulate_identities.py |
ADI creation and credit purchasing |
example_03_adi_token_accounts.py |
ADI token account management |
example_04_data_accounts_entries.py |
Data account creation and WriteData |
example_05_adi_to_adi_transfer.py |
ADI-to-ADI token transfers |
example_06_custom_tokens.py |
Custom token issuer creation |
example_08_query_tx_signatures.py |
Transaction and signature queries |
example_09_key_management.py |
Key page and key book management |
example_10_update_key_page_threshold.py |
Multi-sig threshold updates |
example_11_multi_signature_types.py |
Ed25519, RCD1, BTC, ETH signatures |
example_12_quickstart_demo.py |
Complete zero-to-hero workflow |
example_13_adi_to_adi_transfer_with_header_options.py |
Memo, metadata, expire, hold_until |
example_14_low_level_adi_creation.py |
Same as example_02 but with no convenience methods |
Run any example:
python examples/v3/example_01_lite_identities.py
Project Structure
src/accumulate_client/
├── facade.py # Accumulate unified client (V2/V3)
├── convenience.py # SmartSigner, TxBody, QuickStart, binary encoding helpers
├── crypto/ # Key pair implementations (Ed25519, Secp256k1)
├── signers/ # Signature type classes (Ed25519, RCD1, BTC, ETH)
├── tx/ # Transaction builders and header options
├── types.py # Protocol types (103 types)
├── enums.py # Protocol enums (14 enums)
└── runtime/ # URL handling, codecs, validation
examples/
└── v3/ # V3 API examples (13 examples, multiple API levels)
tests/
├── unit/ # Unit tests
├── integration/ # Network integration tests
└── conformance/ # Cross-implementation compatibility
Development
Running Tests
pytest tests/ # All tests
pytest tests/unit/ # Unit tests only
pytest tests/integration/ # Integration tests (requires network)
Code Quality
ruff check src/
mypy src/
ruff format src/
Self-Check
python tooling/scripts/selfcheck.py
Expected output:
Status: PASS
Checks: 11/11 passed (100.0%)
Enums=14, Types=103, Signatures=16, Transactions=33, API methods=35
Error Handling
from accumulate_client.runtime.errors import (
AccumulateError,
ValidationError,
NetworkError,
)
try:
result = client.submit(envelope)
except ValidationError as e:
print(f"Validation error: {e}")
except NetworkError as e:
print(f"Network error: {e}")
except AccumulateError as e:
print(f"API error: {e.code} - {e}")
License
MIT License - see LICENSE for details.
Links
Metadata
Release files for accumulate-sdk-opendlt 2.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| accumulate_sdk_opendlt-2.5.0.tar.gz | 246.4 kB | Without provenance | Details for accumulate_sdk_opendlt-2.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| accumulate_sdk_opendlt-2.5.0-py3-none-any.whl | Python 3 | none | any | Details for accumulate_sdk_opendlt-2.5.0-py3-none-any.whl |
Total release size: 532.5 kB
Release files / accumulate_sdk_opendlt-2.5.0.tar.gz
| Download URL | accumulate_sdk_opendlt-2.5.0.tar.gz |
|---|---|
| Size | 246.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f2d9a77c2e7457dc611957cd3deac3017ae1a291e214f8898762533d59565448
|
|
BLAKE2b-256 checksum How to use checksums |
db510585e0902c411f6cd8f03ab8c36af37bd11b163e1a77c71e7be4bd315546
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / accumulate_sdk_opendlt-2.5.0-py3-none-any.whl
| Download URL | accumulate_sdk_opendlt-2.5.0-py3-none-any.whl |
|---|---|
| Size | 286.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28320956e5b84206f6efd2edf9a4df73020f80ae2b41222604f5ef313149b4fb
|
|
BLAKE2b-256 checksum How to use checksums |
83a08e463ab93d7471229da7bba67b9aec4e85be208d936e02cb0963d8025e9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for accumulate-sdk-opendlt 2.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.