Class: Cryptos::Bitcoin::Address

Inherits:
Address
  • Object
show all
Defined in:
lib/cryptos/bitcoin/address.rb

Instance Attribute Summary

Attributes inherited from Address

#public_key, #testnet

Instance Method Summary collapse

Methods inherited from Address

#generate, #get_balance, #import, #initialize, #p2pkh, #p2sh, #to_hash160, to_hash160, #to_s

Methods included from Utils::Hashes

#hash160, #hash256, #ripemd160, #sha256

Methods included from Cryptos::Base58

#base58_decode, #base58_encode

Methods included from Utils::Bytes

#bignum_to_bytes, #bytes_to_bignum

Constructor Details

This class inherits a constructor from Cryptos::Address

Instance Method Details

#p2pkh_prefixObject



4
5
6
# File 'lib/cryptos/bitcoin/address.rb', line 4

def p2pkh_prefix
  testnet ? 0x6f : 0x00
end

#p2sh_prefixObject



8
9
10
# File 'lib/cryptos/bitcoin/address.rb', line 8

def p2sh_prefix
  testnet ? 0xc4 : 0x05
end