bitcoin

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2018 License: MIT Imports: 5 Imported by: 3

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

func Base58CheckEncode(ver uint8, b []byte) (string, error)

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

func ToBTCAddress(pubKey ecdsa.PublicKey) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL