Exapedia / Tools / Python blockchain libraries Python blockchain libraries Updated Nov 2026
Python blockchain libraries read chain data, build and sign transactions, and call smart contracts from Python code. Signing happens locally with a private key before a client sends the transaction to a node over JSON-RPC. These libraries let wallets, trading bots, and AI agents act on Ethereum, Solana, and Bitcoin.
Popularity eth-utils eth-abi eth-keys eth-account web3 Solders Solana.py python-bitcoinlib FAQ Popularity eth-utils has the most monthly downloads in this comparison, at 8.2M .
Library Monthly downloads Stars Last release License eth-utils 8.2M
337 Mar 2026 MIT eth-abi 7.7M
256 Aug 2026 MIT eth-keys 6.4M
177 Aug 2026 MIT eth-account 6.3M
314 Aug 2026 MIT web3 5.5M
5.5K Aug 2026 MIT Solders 1.7M
450 Aug 2026 Unresolved Solana.py 853.1K
1.4K Nov 2026 MIT python-bitcoinlib 568.9K
1.9K Jun 2023 LGPL-3.0-or-later Downloads: PyPI , last thirty days. Stars and releases: GitHub. Amber: no release in over a year.
Libraries and code examples Provides common utility functions for Python code that works with Ethereum.
Downloads / mo 8.2M
Stars 337
Last release 6.0.0
License MIT $ python -m pip install eth-utils Copy
from eth_utils import to_checksum_address
address = to_checksum_address('0xd3cda913deb6f67967b99d67acdfa1712c293601')
eth-utils examples From open-source projects on GitHub @to_tuple
def normalize_filter_params(from_block, to_block, address, topics):
yield from_block
yield to_block
if address is None:
yield address
elif is_address(address):
yield to_canonical_address(address)
elif is_list_like(address):
yield tuple(to_canonical_address(item) for item in address)
else:
raise TypeError(f"Address is not in a recognized format: {address}")
if topics is None:
yield topics
elif is_valid_topic_array(topics):
yield tuple(
normalize_topic_list(item) if is_list_like(item) else normalize_topic(item)
for item in topics
)
else:
raise TypeError(f"Topics are not in a recognized format: {address}")
Show full example Encodes and decodes Ethereum ABI data.
Downloads / mo 7.7M
Stars 256
Last release 6.0.0
License MIT $ python -m pip install eth-abi Copy
from eth_abi import encode
encoded = encode(['uint256'], [12345])
eth-abi examples From open-source projects on GitHub def encode_calldata(self, abi: ConstructorABI | MethodABI, *args) -> HexBytes:
if not abi.inputs:
return HexBytes("")
parser = StructParser(abi)
arguments = parser.encode_input(args)
input_types = [i.canonical_type for i in abi.inputs]
python_types = tuple(self._python_type_for_abi_type(i) for i in abi.inputs)
converted_args = self.conversion_manager.convert(arguments, python_types)
encoded_calldata = encode(input_types, converted_args)
return HexBytes(encoded_calldata)
Show full example Provides a common API for Ethereum key operations.
Downloads / mo 6.4M
Stars 177
Last release 0.8.0
License MIT $ python -m pip install eth-keys Copy
from eth_keys import keys
private_key = keys.PrivateKey(b'\x01' * 32)
signature = private_key.sign_msg(b'a message')
eth-keys examples From open-source projects on GitHub def ecrecover(computation: ComputationAPI) -> ComputationAPI:
computation.consume_gas(constants.GAS_ECRECOVER, reason="ECRecover Precompile")
data = computation.msg.data_as_bytes
raw_message_hash = data[:32]
message_hash = pad32r(raw_message_hash)
v_bytes = pad32r(data[32:64])
v = big_endian_to_int(v_bytes)
r_bytes = pad32r(data[64:96])
r = big_endian_to_int(r_bytes)
s_bytes = pad32r(data[96:128])
s = big_endian_to_int(s_bytes)
try:
validate_lt_secpk1n(r, title="ECRecover: R")
validate_lt_secpk1n(s, title="ECRecover: S")
validate_lte(v, 28, title="ECRecover: V")
validate_gte(v, 27, title="ECRecover: V")
except ValidationError:
return computation
canonical_v = v - 27
try:
signature = keys.Signature(vrs=(canonical_v, r, s))
public_key = signature.recover_public_key_from_msg_hash(message_hash)
except BadSignature:
return computation
address = public_key.to_canonical_address()
padded_address = pad32(address)
computation.output = padded_address
return computation
Show full example Signs Ethereum transactions and messages using local private keys.
Downloads / mo 6.3M
Stars 314
Last release 0.14.0
License MIT Strengths Works without a node connection . Create accounts and sign locally before choosing a broadcaster. Signs structured Ethereum messages . Use sign_typed_data for structured message signatures. Limitations Typed-data signing remains unaudited . The typed-data implementation has not undergone an external audit. Raw hashes need trusted origins . Prefer sign_message over signing a hash supplied by someone else. $ python -m pip install eth-account Copy
from eth_account import Account
account = Account.create()
Reads Ethereum blockchain data and interacts with smart contracts.
Downloads / mo 5.5M
Stars 5.5K
Last release 8.0.0
License MIT Strengths Reads and calls smart contracts . Use one client for blocks, transactions, and contract interactions. Offers multiple connection transports . Choose HTTP, IPC, or WebSocket connections to the node. Limitations Live reads need a node . Configure a provider connection before querying live Ethereum state. Test provider needs extra dependencies . Install the tester extra for the local Ethereum test provider. $ pip install "web3[tester]" Copy
from web3 import Web3, EthereumTesterProvider
w3 = Web3(EthereumTesterProvider())
block = w3.eth.get_block('latest')
Provides Solana keypairs, transaction types, and RPC message codecs.
Downloads / mo 1.7M
Stars 450
Last release 0.29.0
License Unresolved Strengths Builds typed RPC messages . Serialize RPC requests to JSON and parse typed responses. Supports partial transaction signing . Collect signatures without sharing each signer’s private key. Limitations RPC networking needs solana-py . Use solana-py to send requests to an RPC server. Token clients live elsewhere . Use solana-py for SPL Token and Memo clients. $ pip install solders Copy
from solders.keypair import Keypair
keypair = Keypair()
public_key = keypair.pubkey()
Solders examples From open-source projects on GitHub async def main():
rpc = AsyncClient("https://api.devnet.solana.com")
sender = Keypair()
recipient = Keypair()
LAMPORTS_PER_SOL = 1_000_000_000
transfer_amount = LAMPORTS_PER_SOL // 100 # 0.01 SOL
async with rpc:
# Get latest blockhash
latest_blockhash = await rpc.get_latest_blockhash()
# Create transfer instruction
transfer_instruction = transfer(
TransferParams(from_pubkey=sender.pubkey(), to_pubkey=recipient.pubkey(), lamports=transfer_amount)
)
# Create message
message = MessageV0.try_compile(
payer=sender.pubkey(),
instructions=[transfer_instruction],
address_lookup_table_accounts=[],
recent_blockhash=latest_blockhash.value.blockhash,
)
# Create and sign transaction
transaction = VersionedTransaction(message, [sender])
print(f"Sender: {sender.pubkey()}")
print(f"Recipient: {recipient.pubkey()}")
print(f"Transfer Amount: {transfer_amount / LAMPORTS_PER_SOL} SOL")
print(f"Transaction created successfully")
Show full example Connects Python applications to Solana RPC and token programs.
Downloads / mo 853.1K
Stars 1.4K
Last release 0.42.0
License MIT Strengths Provides an asynchronous RPC client . Use AsyncClient with a context manager for connection cleanup. Manages subscription handles . Use returned handles to unsubscribe from the original connection. Limitations Core types live in solders . Import keypairs and transaction types from the solders package. Signature subscriptions are one-shot . Unsubscribing after their notification raises ValueError. $ pip install solana Copy
import asyncio
from solana.rpc.async_api import AsyncClient
async def main():
async with AsyncClient('https://api.devnet.solana.com') as client:
return await client.is_connected()
asyncio.run(main())
Provides general tools for the Bitcoin protocol.
Downloads / mo 568.9K
Stars 1.9K
Last release 0.12.2
License LGPL-3.0-or-later $ pip install python-bitcoinlib Copy
from bitcoin.core import CMutableTransaction
transaction = CMutableTransaction()
wire = transaction.serialize()
For coding agents
Found your blockchain library? Help your agent use it. Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.
Claude Code Cursor Codex VS Code Devin Devin Desktop Gemini CLI OpenCode
Run in your terminal
claude plugin install exa@claude-plugins-official Copy Add to ~/.cursor/mcp.json
{
"mcpServers": {
"exa": {
"url": "https://mcp.exa.ai/mcp"
}
}
} Copy Open in your browser, then install the Exa plugin
https://chatgpt.com/plugins/exa Copy Add to .vscode/mcp.json
{
"servers": {
"exa": {
"type": "http",
"url": "https://mcp.exa.ai/mcp"
}
}
} Copy In Devin, open Customize, then MCPs, and add a custom HTTP server with this URL
https://mcp.exa.ai/mcp Copy Add to ~/.config/devin/mcp_config.json
{
"mcpServers": {
"exa": {
"serverUrl": "https://mcp.exa.ai/mcp"
}
}
} Copy Add to ~/.gemini/settings.json
{
"mcpServers": {
"exa": {
"httpUrl": "https://mcp.exa.ai/mcp"
}
}
} Copy Add to opencode.json
{
"mcp": {
"exa": {
"type": "remote",
"url": "https://mcp.exa.ai/mcp"
}
}
} Copy