---
name: "pybtctool"
section: "1"
platform: "linux"
package: "pybtctool"
version: "1.1.42-1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/pybtctool"
---

# pybtctool(1)

command interface for Bitcoin signatures and transactions

## NAME

**pybtctool** - command interface for Bitcoin signatures and transactions

## SYNOPSIS

**pybtctool** \[**-sBbJj**\] *COMMAND* \[**,** *COMMAND\_ARG*\] ...

## DESCRIPTION

**pybtctool** has a set of commands for interacting with the Bitcoin network.

With a command, you can generate a signature, hash, seed, or address; serialise or deserialise standard data formats; query the blockchain; and many more operations.

## OPTIONS

- **-s**

  The -s option lets you read arguments from the command line.

- **-b**

  The -b option lets you read binary data as an argument.

- **-j** **-J**

  The -j option lets you read JSON from the command line (-J to split a JSON list into multiple arguments).

## COMMANDS

Presently supported commands are:

### Key manipulation

- **privkey\_to\_pubkey**

  *privkey* -\> pubkey

- **privtopub**

  *privkey* -\> pubkey

- **pubkey\_to\_address**

  *pubkey* -\> address

- **pubtoaddr**

  *pubkey* -\> address

- **privkey\_to\_address**

  *privkey* -\> address

- **privtoaddr**

  *privkey* -\> address

### Key arithmetic

- **add**

  *key1 key2* -\> key1 + key2 (works on privkeys or pubkeys)

- **multiply**

  *pubkey privkey* -\> returns pubkey \* privkey

### ECDSA operations

- **ecdsa\_sign**

  *message privkey* -\> sig

- **ecdsa\_verify**

  *message sig pubkey* -\> True/False

- **ecdsa\_recover**

  *message sig* -\> pubkey

### Random data

- **random\_key**

  \-\> privkey

- **random\_electrum\_seed**

  \-\> electrum seed

### Electrum operations

- **electrum\_stretch**

  *seed* -\> secret exponent

- **electrum\_privkey**

  *seed or secret exponent i type* -\> privkey

- **electrum\_mpk**

  *seed or secret exponent* -\> master public key

- **electrum\_pubkey**

  *seed or secret exponend or mpk* -\> pubkey

### BIP-32 operations

- **bip32\_master\_key**

  *seed* -\> bip32 master key

- **bip32\_ckd**

  *private or public bip32 key i* -\> child key

- **bip32\_privtopub**

  *private bip32 key* -\> public bip32 key

- **bip32\_extract\_key**

  *private or public bip32\_key* -\> privkey or pubkey

### Transaction operations

- **deserialize**

  *hex or bin transaction* -\> JSON tx

- **serialize**

  *JSON tx* -\> hex or bin tx

- **mktx**

  *inputs outputs* -\> tx

- **mksend**

  *inputs outputs change\_addr fee* -\> tx

- **sign**

  *tx i privkey* -\> tx with index i signed with privkey

- **multisign**

  *tx i script privkey* -\> signature

- **apply\_multisignatures**

  *tx i script sigs* -\> tx with index i signed with sigs

- **scriptaddr**

  *script* -\> P2SH address

- **mk\_multisig\_script**

  *pubkeys k n* -\> k-of-n multisig script from pubkeys

- **verify\_tx\_input**

  *tx i script sig pub* -\> True/False

- **tx\_hash**

  *hex or bin tx* -\> hash

### Blockchain operations

- **history**

  *address1 address2 etc.* -\> outputs to those addresses

- **unspent**

  *address1 address2 etc.* -\> unspent outputs to those addresses

- **fetchtx**

  *txash* -\> tx if present

- **pushtx**

  *hex or bin tx* -\> tries to push to blockchain.info/pushtx

### Serialisation operations

- **access**

  *JSON list or object prop* -\> desired property of that json object

- **multiaccess**

  *JSON list prop* -\> like **access**, but mapped across each list element

- **slice**

  *JSON list start end* -\> given slice of the list

- **count**

  *JSON list* -\> number of elements

- **sum**

  *JSON list* -\> sum of all values

## SEE ALSO

Project page for ‘pybitcointools’ ⟨https://github.com/vbuterin/pybitcointools⟩.
