Changes for version 4.003

  • Public interface changes
    • Bitcoin::Crypto::Script::Tree:
      • added get_tapleaf_script method
      • added get_tapleaf_version method
    • Bitcoin::Crypto::Transaction:
      • added had_witness_flag attribute
      • removed flags parameter from get_digest method
      • added sign method
      • added verify_standard method
      • added txid method
      • added wtxid method
    • Bitcoin::Crypto::Transaction::Input:
      • method script_base is now internal use only, as it depends on other parts to deliver correct results
    • Bitcoin::Crypto::Transaction::Flags:
      • added new_full method
      • renamed strict_signatures flag to der_signatures
      • renamed nulldummy flag to null_dummy
      • added strict_sigantures method
      • added signature_pushes_only flag
      • added minimal_if flag
      • added compressed_pubkeys flag
      • added strict_encoding flag
      • added low_s_signatures flag
      • added minimal_data flag
      • added null_fail flag
      • added clean_stack flag
      • added const_script flag
      • added known_witness flag
      • added illegal_upgradeable_nops flag
    • Bitcoin::Crypto::Transaction::UTXO:
      • added unload method
      • added registered_count method
    • Bitcoin::Crypto::Block:
      • added pos parameter to from_serialized method
    • Bitcoin::Crypto::Types:
      • added TransactionFlags type
      • added BitcoinSecret type
    • Bitcoin::Crypto::Script:
      • added get_raw_address method
      • added has_errors method
      • added assert_valid method
    • added Bitcoin::Crypto::Secret class
    • added Bitcoin::Crypto::Script::Compiler::Opcode class
    • added exporting mechanism for Bitcoin::Crypto::Constants
    • removed ScriptSuccess exception class
    • removed ScriptSyntax exception class
  • Documentation
    • Bitcoin::Crypto::Manual has been rewritten and extended
    • Bitcoin::Crypto::Manual::Transactions has been merged into base manual
    • Bitcoin::Crypto::Manual::Taproot has been merged into base manual
  • Improvements and behavior changes
    • module now stores secrets in inside-out objects, and is aware of Crypt::SecretBuffer
    • future segwit versions are now recognized as UNKNOWN_SEGWIT script types
    • Script's is_native_segwit method will now return true for future segwit versions
    • flags can now be passed to verify function as a hashref
    • most error messages no longer contain double error position
    • errors reported by script execution should now do a better job at pinpointing the issue
    • added disabled script opcodes
    • transaction dumps now include more readable dumps of scripts
    • transaction verification and deserialization speed has been optimized
    • module can now take advantage of various XS modules that speed up Moo
  • Fixes
    • get_taproot_output_key yields the same key if called on a taproot_output key
    • has_witness method in inputs now only yields true if there is at least one element in the witness stack
    • subscript generation now correctly deletes signatures (FindAndDelete)
    • push_bytes in Scripts will now include OP_1NEGATE for value 0x81
    • OP_1NEGATE is now correctly recognized as a pushop
    • OP_CHECKMULTISIG now correctly fails without the dangling stack element
    • OP_CHECKMULTISIG now correctly allows uncompressed public keys in segwit (like OP_CHECKSIG)
    • OP_CHECKMULTISIG now uses the correct order of evaluating its arguments
    • OP_CHECKMULTISIG now correctly handles empty signatures and public keys
    • OP_CHECKMULTISIG now allows zero pubkeys or signatures
    • OP_CHECKMULTISIG now disallows invalid numbers of pubkeys or signatures (negative or more than 20)
    • OP_CHECKMULTISIG now exits early if the number of signatures left to check is greater than pubkeys
    • OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY now correctly do not remove their argument from stack
    • coinbase transactions now check if they have at least 2 bytes of coinbase input data
    • transactions now check if value of any output is greater than max_money constant
    • transactions now check if any input is duplicated
    • disabling der_signatures flag now causes non-strictly encoded signatures to validate
    • detecting coinbase transaction is now stricter
    • verifying numbers on script stack is now correctly based on bytelength and not numeric value
    • pushing byte \x00 to a script is now done by adding \x0100 instead of OP_0, which adds an empty vector
    • pushing number 0 to a script stack is now done by adding an empty vector
    • non-segwit inputs containing witness data now fail script validation
    • p2sh inputs now check for only push opcodes signature, regardless of signature_pushes_only flag
    • multiple OP_ELSE are now handled correctly
    • 520 byte limit on script element size is now correctly checked on script compilation
    • 10000 byte script size limit is now enforced
    • 201 non-push opcode limit is now enforced
    • fixed a cyclical references memory leak in scripts
    • P2MS scripts with zero or more than 15 keys or signatures are now recognized
    • script type and address is now cleared if more data is added to a script
    • fixed an issue where cloning a transaction did not clear its internal digest object
  • Breaking changes
    • module now requires perl version 5.14.0 (was 5.10.1)
    • module now uses plain perl numbers instead of BigInts on 64 bit perls:
      • representing script stack elements as numbers occasionally may overflow 32 bits
      • satoshi values very frequently overflow 32 bits
      • most of the time, these numbers can be used as perl numbers, and the internal representation is opaque
      • if this causes problems, BITCOIN_CRYPTO_USE_BIGINTS environmental variable can be set to a true value
      • this change vastly improves performance of the module on 64 bit
    • compile method from Bitcoin::Crypto::Script::Runner has been removed
      • this method's usage was unclear and it was marked as it was marked as advanced / internal only
      • use operations method from Bitcoin::Crypto::Script to compile a script

Documentation

Main reference to Bitcoin::Crypto

Modules

Bitcoin cryptography in Perl
BIP44 (multi-account hierarchy) implementation
BIP85 (deterministic entropy) implementation
Base58 helpers
Bech32 implementation
Bitcoin block implementation
Bitcoin-related constant values
Path for BIP32 key derivation
Exception classes for Bitcoin::Crypto
Bitcoin extended private keys
Bitcoin extended public keys
"Nothing up my sleeve" key generator
Bitcoin private keys
Bitcoin public keys
Network management class
Partially Signed Bitcoin Transactions
Single field of a PSBT
Single map of a PSBT
Bitcoin Script instance
Bitcoin Script opcode
Bitcoin Script runner
BIP341 Script trees
Storing secrets more safely
Bitcoin script subclass for tapscripts
Bitcoin opcodes specific to tapscript
Bitcoin transaction instance
Result of digesting a transaction
Bitcoin transaction input instance
Bitcoin transaction output instance
Construct a signature for any transaction
Unspent transaction output instance
Bitcoin-specific data types
General Bitcoin utilities

Provides

in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Exception.pm
in lib/Bitcoin/Crypto/Helpers.pm
in lib/Bitcoin/Crypto/Key/Base.pm
in lib/Bitcoin/Crypto/Key/ExtBase.pm
in lib/Bitcoin/Crypto/Role/Compressed.pm
in lib/Bitcoin/Crypto/Role/Key.pm
in lib/Bitcoin/Crypto/Role/Network.pm
in lib/Bitcoin/Crypto/Role/ShallowClone.pm
in lib/Bitcoin/Crypto/Role/SignVerify.pm
in lib/Bitcoin/Crypto/Role/WithDerivationPath.pm
in lib/Bitcoin/Crypto/Script/Common.pm
in lib/Bitcoin/Crypto/Script/Compiler.pm
in lib/Bitcoin/Crypto/Script/Recognition.pm
in lib/Bitcoin/Crypto/Script/Transaction.pm
in lib/Bitcoin/Crypto/Transaction/AutoSigner.pm
in lib/Bitcoin/Crypto/Transaction/Digest.pm
in lib/Bitcoin/Crypto/Transaction/Digest/Config.pm
in lib/Bitcoin/Crypto/Transaction/Signer/CompatP2WPKH.pm
in lib/Bitcoin/Crypto/Transaction/Signer/CompatP2WSH.pm
in lib/Bitcoin/Crypto/Transaction/Signer/CompatSegwit.pm
in lib/Bitcoin/Crypto/Transaction/Signer/CustomLegacy.pm
in lib/Bitcoin/Crypto/Transaction/Signer/Legacy.pm
in lib/Bitcoin/Crypto/Transaction/Signer/P2PKH.pm
in lib/Bitcoin/Crypto/Transaction/Signer/P2SH.pm
in lib/Bitcoin/Crypto/Transaction/Signer/P2TR.pm
in lib/Bitcoin/Crypto/Transaction/Signer/P2WPKH.pm
in lib/Bitcoin/Crypto/Transaction/Signer/P2WSH.pm
in lib/Bitcoin/Crypto/Transaction/Signer/Role/KeyHash.pm
in lib/Bitcoin/Crypto/Transaction/Signer/Role/ScriptHash.pm
in lib/Bitcoin/Crypto/Transaction/Signer/Segwit.pm
in lib/Bitcoin/Crypto/Transaction/Signer/Taproot.pm
in lib/Bitcoin/Crypto/Util/Internal.pm