bitcoin.address package¶
Addresses module.
Contains models to handle Bitcoin addresses
-
class
bitcoin.address.
P2PKHAddress
(public_key_hash: bytes)[source]¶ Bases:
object
Models a legacy P2PKH Address
-
__init__
(public_key_hash: bytes) → None[source]¶ Initializes a P2PKH given its public key hash.
Modifies the attribute
_script_hash
Parameters: public_key_hash – public key hash to set
Raises: AssertionError
– public_key_hash argument is not a bytes objectAddressPKHLengthError
– public_key_hash argument has not the proper length of a public key hash
-
do_things
(obj: str) → bytes[source]¶ Does some things.
Parameters: obj – object of options Returns: things modified by obj
as bytes
-
public_key_hash
¶ Returns the public key hash stored in the address.
Getter: Returns the public key hash as bytes object Setter: Sets the public key hash, while verifying the length and type
-
-
class
bitcoin.address.
P2SHAddress
(script_hash: bytes)[source]¶ Bases:
object
Models a legacy P2SH Address
-
__init__
(script_hash: bytes) → None[source]¶ Initializes a P2SH given its script hash.
Modifies the attribute
_script_hash
Parameters: script_hash – script hash to set
Raises: AssertionError
– script_hash argument is not a bytes objectAddressSHLengthError
– script_hash argument has not the proper length of a script hash
-
do_things
(obj: str) → bytes[source]¶ Does some things.
Parameters: obj – object of options Returns: things modified by obj
as bytes
-
script_hash
¶ Returns the public key hash stored in the address.
Getter: Returns the script hash as bytes object Setter: Sets the script hash, while verifying the length and type
-