Sha256: 09b69dc0d97aa62d496ce90185dbe63d32fc77d1c3d663623f2c2df608511865

Contents?: true

Size: 1.59 KB

Versions: 27

Compression:

Stored size: 1.59 KB

Contents

[Index](index.md)

BTC::PublicKeyAddress
=====================

A subclass of [BTC::Address](address.md) that represents an address based on the public key (pay-to-public-key-hash, P2PKH).

Initializers
------------

#### new(string: *String*)

Returns a new address by parsing a [Base58Check](base58.md)-encoded string that must represent a valid P2PKH address.

#### new(hash: *String*, network: *BTC::Network*)

Returns a new address with a 20-byte binary string `hash`.

If `network` is not specified, [BTC::Network.default](network.md#default) is used.

#### new(public_key: *String*, network: *BTC::Network*)

Returns a new address with a hash of the binary string `public_key`.

If `network` is not specified, [BTC::Network.default](network.md#default) is used.

#### new(key: *BTC::Key*, network: *BTC::Network*)

Returns a new address with a hash of the `key.public_key`.

If `network` is not specified, `key.network` is used.


Instance Methods
----------------

#### hash

Returns a 20-byte binary hash stored within the address.

#### to_s

Returns string representation of the address in [Base58Check](base58.md) encoding.

#### network

Returns a [BTC::Network](network.md) instance based on the version prefix of the address (mainnet or testnet).

#### version

Returns an integer value of the one-byte prefix of the address. 0 for mainnet, 111 for testnet.

#### public_address

Returns `self`.

#### p2pkh?

Returns `true`.

#### p2sh?

Returns `false`.

#### script

Returns [BTC::Script](script.md) instance that can be used in the [transaction output](transaction_output.md) to send bitcoins to this address.




Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
btcruby-1.0.6 documentation/p2pkh.md
btcruby-1.0.5 documentation/p2pkh.md
btcruby-1.0.4 documentation/p2pkh.md
btcruby-1.0.3 documentation/p2pkh.md
btcruby-1.0.2 documentation/p2pkh.md
btcruby-1.0.1 documentation/p2pkh.md
btcruby-1.0.0 documentation/p2pkh.md