module Bitcoin

Overview

implements the bitcoin address space

Defined in:

address.cr

Class Method Summary

Class Method Detail

def self.address_from_private(priv : String, version = "00") #

generates a bitcoin address from a private key


[View source]
def self.address_from_public_key(pub : String, version = "00") #

generates a bitcoin address for any public key; compressed and uncompressed version 0x00 = btc mainnet; pass different versions for different networks


[View source]
def self.address_from_public_point(p : Secp256k1::EC_Point, version = "00") #

generates a bitcoin address from an public key ec point


[View source]
def self.new_mini_private_key #

generates a new mini private key (30 characters, base-57)


[View source]
def self.private_key_from_mini(m : String) #

gets a private key from a mini key


[View source]
def self.private_key_from_wif(w : String) #

gets a private key from a wallet import format


[View source]
def self.wif_compressed_from_private(k : BigInt, version = "80") #

to indicate a compressed key to be used, append a "01" byte


[View source]
def self.wif_from_private(k : BigInt, version = "80", compr = "") #

gets a base-58 wallet import format from private key


[View source]
def self.wif_is_valid?(w : String) #

validates wether a wif has a correct checksum


[View source]