{"id":4765,"library":"solders","title":"Solders","description":"Solders is a high-performance Python toolkit for Solana, providing robust solutions for core SDK functionalities like keypairs, pubkeys, transaction signing and serialization, and RPC request/response parsing. It serves as a Python binding to the Solana Rust SDK, aiming to avoid reimplementing Solana logic in pure Python. While `solana-py` handles network interaction and SPL token clients, `solders` focuses on low-level primitives and offers a `litesvm` module for faster integration testing. The library is actively maintained with frequent updates, with the current version being 0.27.1.","status":"active","version":"0.27.1","language":"python","source_language":"en","source_url":"https://github.com/kevinheavey/solders","tags":["solana","blockchain","cryptocurrency","rust-bindings","web3","sdk","high-performance"],"install":[{"cmd":"pip install solders","lang":"bash","label":"Install solders"}],"dependencies":[],"imports":[{"symbol":"Message","correct":"from solders.message import Message"},{"symbol":"Keypair","correct":"from solders.keypair import Keypair"},{"symbol":"Instruction","correct":"from solders.instruction import Instruction"},{"symbol":"Hash","correct":"from solders.hash import Hash"},{"symbol":"Transaction","correct":"from solders.transaction import Transaction"},{"symbol":"Pubkey","correct":"from solders.pubkey import Pubkey"},{"note":"For network interaction, used in conjunction with solana-py","symbol":"Client","correct":"from solana.rpc.api import Client"}],"quickstart":{"code":"from solders.message import Message\nfrom solders.keypair import Keypair\nfrom solders.instruction import Instruction\nfrom solders.hash import Hash\nfrom solders.transaction import Transaction\nfrom solders.pubkey import Pubkey\n\n# Generate a new keypair for the payer (replace with a real keypair in production)\npayer = Keypair()\n\n# Define a program ID and some arbitrary instruction data\nprogram_id = Pubkey.new_unique() # Using new_unique for a placeholder program ID\narbitrary_instruction_data = bytes([1, 2, 3])\naccounts = [] # For a simple instruction, no accounts might be needed\n\n# Create an instruction\ninstruction = Instruction(program_id, arbitrary_instruction_data, accounts)\n\n# Create a message from the instruction and payer's public key\nmessage = Message([instruction], payer.pubkey())\n\n# Replace with a real blockhash from an RPC call in a real application\n# For demonstration, we use a default hash.\nblockhash = Hash.default() \n\n# Create a transaction\ntx = Transaction([payer], message, blockhash)\n\n# In a real application, you would sign and send the transaction:\n# from solana.rpc.api import Client\n# rpc_client = Client(\"https://api.devnet.solana.com\") # Example RPC URL\n# # For this example, we won't actually send the transaction.\n# # signature = rpc_client.send_transaction(tx).value\n# # print(f\"Transaction sent: {signature}\")\n\nprint(\"Transaction created successfully (not sent in this example).\")\nprint(f\"Payer Public Key: {payer.pubkey()}\")\nprint(f\"Transaction Message: {message}\")\nprint(f\"Transaction: {tx}\")","lang":"python","description":"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`."},"warnings":[{"fix":"Migrate code using `solders.bankrun` to `solders.litesvm`.","message":"In 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`.","severity":"breaking","affected_versions":">=0.25.0"},{"fix":"Update calls from `obj.to_bytes_array()` to `obj.to_bytes()`.","message":"As of version `0.25.0`, methods named `to_bytes_array` were renamed to `to_bytes` to accurately reflect the changed return types.","severity":"breaking","affected_versions":">=0.25.0"},{"fix":"Review and update transaction processing logic, using the current `process_transaction` method.","message":"In 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'.","severity":"breaking","affected_versions":">=0.18.0"},{"fix":"Update code to expect and process `solders.rpc.responses` objects instead of dictionaries for RPC call results. For example, `client.get_balance()` now returns `GetBalanceResp`.","message":"When `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.","severity":"breaking","affected_versions":"solana-py versions integrated with solders >=0.18.0"},{"fix":"Use `Transaction.populate(signatures)` for adding signatures after transaction creation, and avoid `Transaction.add_signer`.","message":"Related 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.","severity":"breaking","affected_versions":"solana-py versions integrated with solders >=0.18.0"},{"fix":"Carefully pin the versions of `solana-py` and `solders` to known compatible combinations and consult both libraries' changelogs for guidance.","message":"Users 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.","severity":"gotcha","affected_versions":"All versions when used with `solana-py`"},{"fix":"Update serialization logic to use methods other than `pickle`, such as the new JSON serialization capabilities.","message":"Pickle 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).","severity":"deprecated","affected_versions":">=0.25.0"}],"env_vars":null,"search_vec":"'0.27.1':90 'activ':80 'aim':41 'avoid':43 'bind':35,96 'blockchain':92 'client':60 'core':16 'cryptocurr':93 'current':87 'faster':74 'focus':62 'frequent':83 'function':18 'handl':54 'high':6,100 'high-perform':5,99 'integr':75 'interact':56 'keypair':20 'level':66 'librari':78 'like':19 'litesvm':71 'logic':46 'low':65 'low-level':64 'maintain':81 'modul':72 'network':55 'offer':69 'pars':29 'perform':7,101 'primit':67 'provid':12 'pubkey':21 'pure':48 'py':53 'python':8,34,49 'reimplement':44 'request/response':28 'robust':13 'rpc':27 'rust':39,95 'rust-bind':94 'sdk':17,40,98 'serial':25 'serv':31 'sign':23 'solana':11,38,45,52,91 'solana-pi':51 'solder':1,2,61 'solut':14 'spl':58 'test':76 'token':59 'toolkit':9 'transact':22 'updat':84 'version':88 'web3':97","created_at":"2026-04-12T14:06:39.138455+00:00","updated_at":"2026-04-16T21:56:54.529195+00:00","problems":[{"fix":"Use `Pubkey.from_string(\"BASE58_STRING_HERE\")` to create a `Pubkey` from a base58 string.","cause":"The `solders.pubkey.Pubkey` constructor expects bytes or an integer, not a base58 string directly.","error":"TypeError: an integer is required (got type str)"},{"fix":"Replace `my_pubkey.to_base58()` with `my_pubkey.to_base58_string()`.","cause":"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`.","error":"AttributeError: 'Pubkey' object has no attribute 'to_base58'"},{"fix":"Replace `keypair_object.public_key` with `keypair_object.pubkey()`.","cause":"In `solders`, the `Keypair` object provides its public key via the `pubkey()` method, not a `public_key` attribute as found in `solana-py`.","error":"AttributeError: 'Keypair' object has no attribute 'public_key'"},{"fix":"Use `from solders.pubkey import Pubkey` (or `from solders.keypair import Keypair`) to correctly import the class.","cause":"The module names in `solders` are lowercase (e.g., `pubkey`), while the class names are title-cased (e.g., `Pubkey`).","error":"ModuleNotFoundError: No module named 'solders.PublicKey'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.29.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/kevinheavey/solders","docs":"https://kevinheavey.github.io/solders/","changelog":"https://github.com/kevinheavey/solders/blob/main/CHANGELOG.md","pypi":"https://pypi.org/project/solders/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}