A Python3 SegWit-compliant library which provides tools to handle Bitcoin data structures in a simple fashion.
TransactionFactory
class that can instantiate either a Transaction
or a SegWitTransaction
from json, hex or bytesAddress
class now have a to_script
method that generates the corresponding scriptPubKeyLocktime
and Sequence
classesLocktime
/Sequence
as input so that the spend
method can automatically fill in locktime and sequence numbers in the resulting signed transactionsThe following changes can break backward compatibility:
TimelockScript
has been renamed to AbsoluteTimelockScript
Transaction
now fails when trying to unhexlify
a SegWitTransaction
and vice versaBaseAddress
has been renamed to Address
, Address
to ClassicAddress
StackData
serialisationcheck_network
flag, now expect a strict
flag with the same semanticsscript_pubkey
s that were previously recognised as 'nonstandard'
will now be recognised as the appropriate type if strict is set to False
address()
and to_address()
in scriptsto_address()
method in scripts no longer exists__eq__
methods on Block
and Transaction
TxIn.from_json
method now properly instantiates CoinBaseScriptSig
where appropriateScripts
unhexlify method now works as expected (i.e. no identification is performed on the unhexlifying of Script
s, ScriptPubKey
s and ScriptSig
s)Breaks the following functionality:
BaseScript
class now needs to be refactored to use the opcodes
module:
opcode_to_int
int_to_opcode
opcode_to_hex
hex_to_opcode
CouldNotEncode
exception in codecsforce=False
option in network setupcheck_network=True
in address validity checkPrivateKey
classto_wif()
method in PrivateKey
.json
extension to test vectorsOP_1NEGATE
to_json()
P2wshV0Script
Some conversions from private key to public key might change as now PrivateKey
remembers if it was created from a WIF format that demanded the generation of a compressed public key.