Documentation ¶
Index ¶
Constants ¶
View Source
const ( //Base58BitcoinSymbolChart see https://en.bitcoin.it/wiki/Base58Check_encoding Base58BitcoinSymbolChart = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" //PrivateKeyVersionPrefix is the prefix of WIF encoded strings //see https://en.bitcoin.it/wiki/List_of_address_prefixes PrivateKeyVersionPrefix = 0x80 // BitcoinPrivKeyBytesLen defines the length in bytes of a private key for Bitcoin BitcoinPrivKeyBytesLen = 32 )
View Source
const ( //PubKeyCompressedEvenPrefix is the prefix to be used for compressed address format of even keys encoding PubKeyCompressedEvenPrefix = 0x02 //PubKeyCompressedOddPrefix is the prefix to be used for compressed address format of odd keys enconding PubKeyCompressedOddPrefix = 0x03 //PubKeyUncompressedVPrefix is the prefix to be used for uncompressed address format encoding PubKeyUncompressedVPrefix = 0x04 //MainNetworkVPrefix is the prefix that identifes Bitcoin main network MainNetworkVPrefix = 0x00 )
Variables ¶
This section is empty.
Functions ¶
func Base58CheckEncode ¶
Base58CheckEncode encodes the given byte array in Bitcoin into human-typable strings. See https://en.bitcoin.it/wiki/Base58Check_encoding Creating a Base58Check string
func NewBitcoinPrivKey ¶
func NewBitcoinPrivKey(key []byte) (*ecdsa.PrivateKey, error)
NewBitcoinPrivKey creates a valid Bitcoin private key from the given byte slice See https://en.bitcoin.it/wiki/Private_key
func PrivateToWIF ¶
func PrivateToWIF(key ecdsa.PrivateKey) (string, error)
PrivateToWIF encodes the given private key to WIF, following instructions on https://en.bitcoin.it/wiki/Wallet_import_format
func ToBTCAddress ¶
ToBTCAddress converts a Bitcoin public key to a compressed Bitcoin address string. See https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.