P2WPKH#

class defichain.transactions.address.P2WPKH(network: Any, address: str)#
static from_publicKey(network: Any, publicKey: str) P2WPKH#

Generates a P2WPKH address object from the given public key

Parameters:
  • network (Network) – (required) The network in witch the public key should be used

  • publicKey (str) – (required) public key

Returns:

P2WPKH - returns the P2WPKH address object

static from_privateKey(network: Any, privateKey: str) P2WPKH#

Generates a P2WPKH address object from the given private key

Parameters:
  • network (Network) – (required) The network in witch the private key should be used

  • privateKey (str) – (required) private key

Returns:

P2WPKH - returns the P2WPKH address object

static from_scriptPublicKey(network: Any, scriptPublicKey: str) P2WPKH#

Generates a P2WPKH address object from the given script private key

Parameters:
  • network (Network) – (required) The network in witch the script public key should be used

  • scriptPublicKey (str) – (required) script public key

Returns:

P2WPKH - returns the P2WPKH address object

get_addressType() str#

Gets the address type

Returns:

AddressType

get_scriptPublicKey() str#

Calculates the script public key

Returns:

string - script public key

get_redeemScript() str#

Calculates the redeem script

Returns:

string - redeem script

get_bytes_scriptPublicKey() bytes#

Calculates the script public key

Returns:

bytes - script public key

get_bytes_redeemScript() bytes#

Calculates the redeem script

Returns:

bytes - redeem script