bulk-keychain
A simple high perf signing lib for BULK txns - Python bindings.
Installation
pip install bulk-keychain
Quick Start
from bulk_keychain import Keypair, Signer
# Generate a new keypair
keypair = Keypair()
print(f"Public key: {keypair.pubkey}")
# Or import from base58
# keypair = Keypair.from_base58("your-secret-key...")
# Create a signer
signer = Signer(keypair, "devnet")
# Sign a limit order
signed = signer.sign({
"type": "order",
"symbol": "BTC-USD",
"is_buy": True,
"price": 100000.0,
"size": 0.1,
"order_type": {"type": "limit", "tif": "GTC"}
})
# Submit to API
import requests
response = requests.post(
"https://api.bulk.exchange/api/v1/order",
json={
"actions": signed["actions"],
"nonce": signed["nonce"],
"account": signed["account"],
"signer": signed["signer"],
"signature": signed["signature"],
}
)
Order Types
Limit Order
{
"type": "order",
"symbol": "BTC-USD",
"is_buy": True,
"price": 100000.0,
"size": 0.1,
"order_type": {"type": "limit", "tif": "GTC"} # GTC, IOC, or ALO
}
Market Order
{
"type": "order",
"symbol": "BTC-USD",
"is_buy": True,
"price": 0.0,
"size": 0.1,
"order_type": {"type": "market", "is_market": True, "trigger_px": 0.0}
}
Cancel Order
{
"type": "cancel",
"symbol": "BTC-USD",
"order_id": "order-id-base58"
}
Cancel All Orders
{
"type": "cancel_all",
"symbols": ["BTC-USD"] # or [] for all symbols
}
Builder Codes
Builder codes are optional builder-code fees for routed limit and market
orders. Python order input uses builder_code; API JSON emits builderCode on
orders and abc/rbc approval actions. When builder_code is absent, it
contributes no signing bytes.
Batch Signing
For high-frequency trading, sign many transactions in parallel:
# Sign all at once - each order becomes one transaction
signed_txs = signer.sign_all(orders)
For multi-order atomic transactions, batch order_ids are optional:
signer.set_compute_batch_order_ids(True) # default False for max performance
grouped = signer.sign_group([entry_order, stop_loss, take_profit])
print(grouped.get("order_ids"))
API Reference
Keypair
# Generate new keypair
keypair = Keypair()
# Import from base58
keypair = Keypair.from_base58("secret-key-base58")
# Import from bytes (32 or 64 bytes)
keypair = Keypair.from_bytes(bytes_data)
# Properties and methods
keypair.pubkey # Public key as base58 string
keypair.to_base58() # Full keypair as base58 (64 bytes)
keypair.to_bytes() # Full keypair as bytes
keypair.secret_key() # Secret key as bytes (32 bytes)
Signer
# Create signer
signer = Signer(keypair, "devnet")
signer = Signer.from_base58("secret-key-base58", "devnet")
# With nonce management
signer = Signer.with_nonce_manager(keypair, "timestamp", "devnet")
signer = Signer.with_nonce_manager(keypair, "counter", "devnet")
signer = Signer.with_nonce_manager(keypair, "high_frequency", "devnet")
# Optional ID computation controls
signer.set_compute_order_id(True) # default True
signer.set_compute_batch_order_ids(False) # default False
signer.computes_order_id()
signer.computes_batch_order_ids()
# Sign operations
signed = signer.sign(order, nonce=None)
signed = signer.sign_group([order1, order2], nonce=None)
signed = signer.sign_faucet(nonce=None)
signed = signer.sign_agent_wallet(agent_pubkey, delete=False, nonce=None)
signed = signer.sign_user_settings(max_leverage=[("BTC-USD", 5.0)], nonce=None)
signed = signer.sign_oracle_prices([(1704067200000000000, "BTC-USD", 102500.0)], nonce=None)
signed = signer.sign_pyth_oracle([(1704067200000000000, 1, 10250000000000, -8)], nonce=None)
signed = signer.sign_whitelist_faucet(target_pubkey, whitelist=True, nonce=None)
signed = signer.sign_approve_builder_code(builder_pubkey, fee=5, nonce=None)
signed = signer.sign_revoke_builder_code(builder_pubkey, nonce=None)
signed_list = signer.sign_all(orders, base_nonce=None)
Tuple formats:
sign_oracle_prices:(timestamp, asset, price)sign_pyth_oracle:(timestamp, feed_index, price, exponent)
Utilities
from bulk_keychain import random_hash, current_timestamp, validate_pubkey, validate_hash
# Generate random hash for client order IDs
client_id = random_hash()
# Get the current Unix timestamp in nanoseconds
ts = current_timestamp()
# Validate base58 strings
is_valid = validate_pubkey("pubkey-base58")
is_valid = validate_hash("hash-base58")
Compute order ID without a signer/private key:
from bulk_keychain import compute_order_id_from_order
order_id = compute_order_id_from_order(
{"type": "order", "symbol": "BTC-USD", "is_buy": True, "price": 100000.0, "size": 0.1},
nonce=1704067200000,
account="your-account-pubkey",
)
# Compact API order JSON is also supported:
order_id_compact = compute_order_id_from_order(
{"l": {"c": "BTC-USD", "b": True, "px": 100000.0, "sz": 0.1, "r": False, "tif": "GTC"}},
nonce=1704067200000,
account="your-account-pubkey",
)
Release files for bulk-keychain 0.1.27
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bulk_keychain-0.1.27.tar.gz | 65.8 kB | Details |
Built distributions (wheels)
Total release size: 6.5 MB
Release files / bulk_keychain-0.1.27.tar.gz
| Download URL | bulk_keychain-0.1.27.tar.gz |
|---|---|
| Size | 65.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26f6f1f9dd07a631b21e8a6ff33cc89a43b041c173f57673176bf39ea0743e72
|
|
BLAKE2b-256 checksum How to use checksums |
47d5734b9bdfa5218e1468b5eee00665492db2a96ad7f3ce79b2755a66629630
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bulk_keychain-0.1.27-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 522.1 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d3281f7e5d7460c2b53a10284a48d72b708fbc67e6bc3b8141d90485bad382e4
|
|
BLAKE2b-256 checksum How to use checksums |
dd6de426a84e75fec784f6edf229d7e74718dc6d0bca38ca0059c4a5af5da0e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bulk_keychain-0.1.27-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 505.6 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
f9d97527494f56dc802a6a870255586b8bceeea6280667d65d8fcd99245ab7f0
|
|
BLAKE2b-256 checksum How to use checksums |
2d1afb06459a2a1348d41b101e04189b0d56e890db44fa2056826793c780dbfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp312-cp312-win_amd64.whl
| Download URL | bulk_keychain-0.1.27-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 374.2 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
71b241fe0bbf9f1a58f50ec1c7397cb97b2fae4f9ef023cfd8d6d1977c9f0f1a
|
|
BLAKE2b-256 checksum How to use checksums |
c854dbf440dd7de174eac52b68573a1dba4eb487aaee85270da90e825830aa46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bulk_keychain-0.1.27-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 521.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
8a05068303a258e9d80f18e66a30d99217e770cf9dc8bb7e1a846cbd0d0e5ef8
|
|
BLAKE2b-256 checksum How to use checksums |
e1e12430eb3ba3dac7cae44af06b4f7607e0fda3af57c67073c4ca9f820cbb3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bulk_keychain-0.1.27-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 504.6 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
9086f8171650d92863cd78e8ecd9b8eedbda3dbfbdda6120c2cd2a27e7e11ae4
|
|
BLAKE2b-256 checksum How to use checksums |
eeb46e8b0bb7c0716dec4adb29ec96d1ba7b2e0ec5d45f126f21c394503b6de1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | bulk_keychain-0.1.27-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 455.7 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1fbf61b382d5037a094c851d1cab08255d5ff88e2543e4be081b81c85d813c86
|
|
BLAKE2b-256 checksum How to use checksums |
60be4da6543389679d411d9cf7ef7e2797967e89e807e86b34e4dfec0b1516cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | bulk_keychain-0.1.27-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 496.8 kB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
4d016848a5c26037d0b55d0ebe52969d2337ce0d7bb9e16f3a77a2764b59f28a
|
|
BLAKE2b-256 checksum How to use checksums |
17f1c94bf20489009d0b9bdf8e33f5559e08eb9076f2b9e09100880707c279c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bulk_keychain-0.1.27-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 523.3 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
f26dc265ef742f8c94a9e66d065501f9e372f629df42b28ad191f1e07edd5be9
|
|
BLAKE2b-256 checksum How to use checksums |
f405c0a787b78bc724ea8b395bc76c7e1523bee1e554f8d7f9fd744dec538985
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bulk_keychain-0.1.27-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 508.1 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
9a0fefb7da06ee28e70d2fdd72c1b86da0c863c1df79246367964157a6e87748
|
|
BLAKE2b-256 checksum How to use checksums |
02c1d4443b049854e194b9fd25c698f7671646cbdb4a8295f0845562094b188a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bulk_keychain-0.1.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 523.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2937bc07f26875e05ee97c303e4fff2f0cc8c3d6421d411d4dc758951e94acc8
|
|
BLAKE2b-256 checksum How to use checksums |
b00a6a5c1bf759ba7f7c8420beccd4fca32433802b9cff9ccbf7d79fd55f4656
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bulk_keychain-0.1.27-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 508.4 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
4ce128057ec49a81503ed0861aab8be7e86181caac50800b1b20c5f411d16908
|
|
BLAKE2b-256 checksum How to use checksums |
ab317d7fa8a003e737a69d3889d0a1650db6ba2217c29a27098ddcc5516e4e4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bulk_keychain-0.1.27-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 524.6 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
c85f07d6d6070d2c894a9bba2615743e7773ff8b3a4e00e4a4aa4b738168234e
|
|
BLAKE2b-256 checksum How to use checksums |
49ffbd71fac412eb0963998c3caa4faeddae38288c744ba963126b5eefde42de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / bulk_keychain-0.1.27-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bulk_keychain-0.1.27-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 509.2 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
7ebc05603ff7203df53c82511b19dc89bf2565f9135327cf407738081c31b804
|
|
BLAKE2b-256 checksum How to use checksums |
b4cbf6db6722788e4e7fe102c2a7ed6d6a022717317713a7354674318ac846dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency log