params

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// BCH_MainNet represents the bitcoin main net
	BCH_MainNet = &bchParams{
		prefix:           "bitcoincash",
		pubKeyHashAddrID: 0x00,
		scriptHashAddrID: 0x05,
		privateKeyID:     0x80,
	}
	// BCH_TestNet represents the bitcoin test net
	BCH_TestNet = &bchParams{
		prefix:           "bchtest",
		pubKeyHashAddrID: 0x6f,
		scriptHashAddrID: 0xc4,
		privateKeyID:     0xef,
	}
	// BCH_RegressionNet represents the bitcoin regression test net
	BCH_RegressionNet = &bchParams{
		prefix:           "bchreg",
		pubKeyHashAddrID: 0x6f,
		scriptHashAddrID: 0xc4,
		privateKeyID:     0xef,
	}
	// BCH_SimNet represents the bitcoin simulation net
	BCH_SimNet = &bchParams{
		prefix:           "bchsim",
		pubKeyHashAddrID: 0x3f,
		scriptHashAddrID: 0x7b,
		privateKeyID:     0x64,
	}
)
View Source
var (

	// BTC_MainNet represents the bitcoin main net
	BTC_MainNet = &btcParams{
		pubKeyHashAddrID: 0x00,
		scriptHashAddrID: 0x05,
		privateKeyID:     0x80,
	}
	// BTC_TestNet represents the bitcoin test net
	BTC_TestNet = &btcParams{
		pubKeyHashAddrID: 0x6f,
		scriptHashAddrID: 0xc4,
		privateKeyID:     0xef,
	}
	// BTC_RegressionNet represents the bitcoin regression test net
	BTC_RegressionNet = &btcParams{
		pubKeyHashAddrID: 0x6f,
		scriptHashAddrID: 0xc4,
		privateKeyID:     0xef,
	}
	// BTC_SimNet represents the bitcoin simulation net
	BTC_SimNet = &btcParams{
		pubKeyHashAddrID: 0x3f,
		scriptHashAddrID: 0x7b,
		privateKeyID:     0x64,
	}
)
View Source
var (

	// DCR_MainNet represents the bitcoin main net
	DCR_MainNet = &dcrParams{
		pubKeyHashAddrID: [2]byte{0x07, 0x3f},
		scriptHashAddrID: [2]byte{0x07, 0x1a},
		privateKeyID:     [2]byte{0x22, 0xde},
	}
	// DCR_TestNet represents the bitcoin test net
	DCR_TestNet = &dcrParams{
		pubKeyHashAddrID: [2]byte{0x0f, 0x21},
		scriptHashAddrID: [2]byte{0x0e, 0xfc},
		privateKeyID:     [2]byte{0x23, 0x0e},
	}
	// DCR_RegressionNet represents the bitcoin regression test net
	DCR_RegressionNet = &dcrParams{
		pubKeyHashAddrID: [2]byte{0x0e, 0x00},
		scriptHashAddrID: [2]byte{0x0d, 0xdb},
		privateKeyID:     [2]byte{0x22, 0xfe},
	}
	// DCR_SimNet represents the bitcoin simulation net
	DCR_SimNet = &dcrParams{
		pubKeyHashAddrID: [2]byte{0x0e, 0x91},
		scriptHashAddrID: [2]byte{0x0e, 0x6c},
		privateKeyID:     [2]byte{0x23, 0x07},
	}
)
View Source
var (
	// DOGE_MainNet represents the dogecoin main net
	DOGE_MainNet = &dogeParams{
		pubKeyHashAddrID: 0x1E,
		scriptHashAddrID: 0x16,
		privateKeyID:     0x9E,
	}
	// DOGE_TestNet represents the dogecoin test net
	DOGE_TestNet = &dogeParams{
		pubKeyHashAddrID: 0x71,
		scriptHashAddrID: 0xC4,
		privateKeyID:     0xF1,
	}
	// DOGE_RegressionNet represents the dogecoin regression test net
	DOGE_RegressionNet = &dogeParams{
		pubKeyHashAddrID: 0x6F,
		scriptHashAddrID: 0xc4,
		privateKeyID:     0xEF,
	}
)
View Source
var (
	// LTC_MainNet represents the litecoin main net
	LTC_MainNet = &ltcParams{
		pubKeyHashAddrID: 0x30,
		scriptHashAddrID: 0x32,
		privateKeyID:     0xB0,
	}
	// LTC_TestNet represents the litecoin test net
	LTC_TestNet = &ltcParams{
		pubKeyHashAddrID: 0x6f,
		scriptHashAddrID: 0x3a,
		privateKeyID:     0xef,
	}
	// LTC_SimNet represents the litecoin simulation net
	LTC_SimNet = &ltcParams{
		pubKeyHashAddrID: 0x3f,
		scriptHashAddrID: 0x7b,
		privateKeyID:     0x64,
	}
	// LTC_RegressionNet represents the litecoin regression test net
	LTC_RegressionNet = &ltcParams{
		pubKeyHashAddrID: 0x6f,
		scriptHashAddrID: 0x3a,
		privateKeyID:     0xef,
	}
)

Functions

This section is empty.

Types

type Chain

type Chain int
const (
	MainNet Chain = iota
	TestNet
	SimNet
	RegressionNet
)

func ParseChain

func ParseChain(s string) (Chain, error)

func (Chain) MarshalYAML

func (v Chain) MarshalYAML() (interface{}, error)

func (*Chain) Set

func (v *Chain) Set(sv string) error

func (Chain) String

func (v Chain) String() string

func (*Chain) UnmarshalYAML

func (v *Chain) UnmarshalYAML(unmarshal func(interface{}) error) error

type InvalidChainError

type InvalidChainError string

func (InvalidChainError) Error

func (e InvalidChainError) Error() string

type Params

type Params interface {
	// P2PK returns the p2pk address of the public key
	P2PK(pub []byte) (string, error)
	// P2PKH returns the p2pkh address of the public key hash
	P2PKH(pubHash []byte) (string, error)
	// P2PKHFromKey returns the p2pkh address of the public key
	P2PKHFromKey(pub []byte) (string, error)
	// P2SH returns the p2sh address of the script hash
	P2SH(scriptHash []byte) (string, error)
	// P2SHFromScript returns the p2sh address of the script
	P2SHFromScript(script []byte) (string, error)
	// AddressToScript converts an addres to a script
	AddressToScript(addr string) ([]byte, error)
}

Params represents the parameters of a utxo crypto

Jump to

Keyboard shortcuts

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