bitcoinlib.main module


This is a decorator which can be used to mark functions as deprecated. It will result in a warning being emitted when the function is used.


Derive address encoding (base58 or bech32) from transaction witness type

Parameters:witness_type (str) – Witness type: legacy, p2sh-segwit or segwit
Return str:
bitcoinlib.main.script_type_default(witness_type=None, multisig=False, locking_script=False)[source]

Determine default script type for provided witness type and key type combination used in this library.

  • witness_type (str) – Type of wallet: standard or segwit
  • multisig (bool) – Multisig key or not, default is False
  • locking_script (bool) – Limit search to locking_script. Specify False for locking scripts and True for unlocking scripts
Return str:

Default script type