def decode_base58_address(addr)
      hex = Base58.decode(addr)
      if hex.size == 50 && calc_checksum(hex[0...-8]) == hex[-8..-1]
        raise 'Invalid version bytes.' unless [Bitcoin.chain_params.address_version, Bitcoin.chain_params.p2sh_version].include?(hex[0..1])
        [hex[2...-8], hex[0..1]]
      else
        raise 'Invalid address.'
      end
    end
def decode_base58_address(addr)
      hex = Base58.decode(addr)
      if hex.size == 50 && calc_checksum(hex[0...-8]) == hex[-8..-1]
        raise 'Invalid version bytes.' unless [Bitcoin.chain_params.address_version, Bitcoin.chain_params.p2sh_version].include?(hex[0..1])
        [hex[2...-8], hex[0..1]]
      else
        raise 'Invalid address.'
      end
    end
decode Base58 check encoding address.
 @param [String] addr address.
 @return [Array] hex and address version