io.github.daedalus/mcp-python-bitcoinlib
An MCP server that exposes the python-bitcoinlib API
Versions
0.1.0latestTools 20
generate_private_key Generate a random private key and return it as a 32-byte hex string.
privkey_to_wif Convert a private key (hex) to WIF format. Args: privkey: Private key as a 32-byte hex string. compressed: Whether to produce a compressed WIF (default: True). Returns: WIF-encoded private key.
wif_to_privkey Convert a WIF-encoded private key back to hex. Args: wif: WIF-encoded private key. Returns: Private key as a 32-byte hex string.
privkey_to_pubkey Get the public key from a private key. Args: privkey: Private key as a 32-byte hex string. compressed: Whether to produce a compressed public key (default: True). Returns: Public key as a hex string.
pubkey_to_address Convert a public key to an address. Args: pubkey: Public key as a hex string (33 or 65 bytes). address_type: Address type - "p2pkh", "p2sh", "p2wpkh", or "p2wsh". Returns: Bitcoin address.
pubkey_to_p2sh_p2wpkh_redeemscript Get the P2SH-P2WPKH redeemScript for a public key. Args: pubkey: Public key as a hex string. Returns: The redeemScript as hex.
address_to_script Get the script from an address. Args: address: Bitcoin address. Returns: The script as hex.
create_transaction Create an unsigned Bitcoin transaction. Args: outputs: List of dicts with 'address' and 'satoshi' keys. fee: Transaction fee in satoshis (default: 1000). version: Transaction version (default: 2). Returns: Dictionary with transaction hex and details.
serialize_transaction Serialize and deserialize a transaction. Args: tx_hex: Transaction as hex string. Returns: Dictionary with transaction details.
sign_transaction Sign a transaction input with a private key. Args: tx_hex: Transaction as hex string. privkey: Private key as hex string. sighash_type: Sighash type (default: 1 = SIGHASH_ALL). Returns: Signed transaction as hex.
parse_script Parse a script into its opcodes. Args: script_hex: Script as hex string. Returns: List of opcode names and data.
create_p2pkh_script Create a P2PKH script from a public key hash. Args: pubkey_hash: Public key hash as hex. Returns: P2PKH script as hex.
create_p2wpkh_script Create a P2WPKH script from a public key hash. Args: pubkey_hash: Public key hash as hex. Returns: P2WPKH script as hex.
sha256_hex Compute SHA256 hash. Args: data: Input data as hex string. Returns: SHA256 hash as hex.
ripemd160_hex Compute RIPEMD160 hash. Args: data: Input data as hex string. Returns: RIPEMD160 hash as hex.
hash160_hex Compute Hash160 (SHA256 then RIPEMD160). Args: data: Input data as hex string. Returns: Hash160 as hex.
hash256_hex Compute double SHA256. Args: data: Input data as hex string. Returns: Double SHA256 as hex.
verify_signature Verify an ECDSA signature. Args: signature: Signature as hex. pubkey: Public key as hex. message: Message that was signed. Returns: True if signature is valid.
sign_message Sign a message with a private key. Args: message: Message to sign. privkey: Private key as hex. Returns: Signature as hex.
validate_address Validate a Bitcoin address for a given network. Args: address: Bitcoin address to validate. network: Network name - "main", "testnet", "signet" (default: "main"). Returns: Dictionary with validation result and details.
Permissions 0
No permissions indexed yet.