Install & Compatibility
Where this runs
tested against v0.29.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.078s · 53.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.0s · import 0.080s · 54MB
51MB installed
● package 51MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Message
✓ from solders.message import Message
Keypair
✓ from solders.keypair import Keypair
Instruction
✓ from solders.instruction import Instruction
Hash
✓ from solders.hash import Hash
Transaction
✓ from solders.transaction import Transaction
Pubkey
✓ from solders.pubkey import Pubkey
Client
✓ from solana.rpc.api import Client
For network interaction, used in conjunction with solana-py
This quickstart demonstrates how to create a basic Solana transaction using `solders` primitives. It generates a keypair, defines an instruction, constructs a message, and finally builds a transaction. Note that `solders` focuses on data structures and cryptography; network interaction (like sending the transaction) is typically handled by `solana-py`.
from solders.message import Message
from solders.keypair import Keypair
from solders.instruction import Instruction
from solders.hash import Hash
from solders.transaction import Transaction
from solders.pubkey import Pubkey
# Generate a new keypair for the payer (replace with a real keypair in production)
payer = Keypair()
# Define a program ID and some arbitrary instruction data
program_id = Pubkey.new_unique() # Using new_unique for a placeholder program ID
arbitrary_instruction_data = bytes([1, 2, 3])
accounts = [] # For a simple instruction, no accounts might be needed
# Create an instruction
instruction = Instruction(program_id, arbitrary_instruction_data, accounts)
# Create a message from the instruction and payer's public key
message = Message([instruction], payer.pubkey())
# Replace with a real blockhash from an RPC call in a real application
# For demonstration, we use a default hash.
blockhash = Hash.default()
# Create a transaction
tx = Transaction([payer], message, blockhash)
# In a real application, you would sign and send the transaction:
# from solana.rpc.api import Client
# rpc_client = Client("https://api.devnet.solana.com") # Example RPC URL
# # For this example, we won't actually send the transaction.
# # signature = rpc_client.send_transaction(tx).value
# # print(f"Transaction sent: {signature}")
print("Transaction created successfully (not sent in this example).")
print(f"Payer Public Key: {payer.pubkey()}")
print(f"Transaction Message: {message}")
print(f"Transaction: {tx}")
Debug
Known issues
breakingIn version `0.25.0`, the `solders.bankrun` module was removed in favor of `solders.litesvm`. Users migrating from older versions need to update their testing infrastructure to use `litesvm`.fixMigrate code using `solders.bankrun` to `solders.litesvm`.
affects: >=0.25.0
breakingAs of version `0.25.0`, methods named `to_bytes_array` were renamed to `to_bytes` to accurately reflect the changed return types.fixUpdate calls from `obj.to_bytes_array()` to `obj.to_bytes()`.
affects: >=0.25.0
breakingIn version `0.18.0`, transaction processing methods were refactored. `process_transaction_with_metadata` was renamed to `process_transaction`, and older methods like `process_transaction_with_preflight` were removed due to being considered 'footguns'.fixReview and update transaction processing logic, using the current `process_transaction` method.
affects: >=0.18.0
breakingWhen `solana-py` (which uses `solders` internally) updated its RPC parsing to use `solders`, many RPC methods now return strongly typed objects from `solders.rpc.responses` instead of raw dictionaries. This change affects how RPC results are accessed and processed.fixUpdate code to expect and process `solders.rpc.responses` objects instead of dictionaries for RPC call results. For example, `client.get_balance()` now returns `GetBalanceResp`.
affects: solana-py versions integrated with solders >=0.18.0
breakingRelated to `solana-py`'s internal use of `solders`, the `Transaction.__init__` method no longer accepts a `signatures` argument. `Transaction.populate` should be used instead to construct transactions with specific signatures. Additionally, `Transaction.add_signer` was removed.fixUse `Transaction.populate(signatures)` for adding signatures after transaction creation, and avoid `Transaction.add_signer`.
affects: solana-py versions integrated with solders >=0.18.0
gotchaUsers have reported issues with version mismatches between `solana-py` and `solders`, particularly concerning versioned transactions and unexpected `proxy` arguments in `Client` initialization. It is crucial to ensure compatible versions of both libraries are installed.fixCarefully pin the versions of `solana-py` and `solders` to known compatible combinations and consult both libraries' changelogs for guidance.
affects: All versions when used with `solana-py`
deprecatedPickle support was removed in version `0.25.0`. Applications relying on Python's `pickle` module for serializing `solders` objects will need to transition to alternative serialization methods (e.g., JSON support was added to most classes).fixUpdate serialization logic to use methods other than `pickle`, such as the new JSON serialization capabilities.
affects: >=0.25.0
Errors
Common errors & fixes
TypeError: an integer is required (got type str)
The `solders.pubkey.Pubkey` constructor expects bytes or an integer, not a base58 string directly.
fixUse `Pubkey.from_string("BASE58_STRING_HERE")` to create a `Pubkey` from a base58 string. AttributeError: 'Pubkey' object has no attribute 'to_base58'
In `solders`, the method to get the base58 string representation of a `Pubkey` is `to_base58_string()`, not `to_base58()` as found in `solana-py`.
fixReplace `my_pubkey.to_base58()` with `my_pubkey.to_base58_string()`.
AttributeError: 'Keypair' object has no attribute 'public_key'
In `solders`, the `Keypair` object provides its public key via the `pubkey()` method, not a `public_key` attribute as found in `solana-py`.
fixReplace `keypair_object.public_key` with `keypair_object.pubkey()`.
ModuleNotFoundError: No module named 'solders.PublicKey'
The module names in `solders` are lowercase (e.g., `pubkey`), while the class names are title-cased (e.g., `Pubkey`).
fixUse `from solders.pubkey import Pubkey` (or `from solders.keypair import Keypair`) to correctly import the class.
Upgrade
Version history
0.29.0latest on PyPI · released Aug 13, 2026
Audit
Dependencies
No dependency data recorded yet.