bitcoin

package
v0.16.10 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BitcoinChainAssetKey    = "c6d0c728-2624-429b-8e0d-d9d19b6592fa"
	BitcoinOmniUSDTAssetKey = "815b0b1a-2764-3736-8faa-42d694fa620a"
)

Variables

View Source
var (
	// ErrChecksumMismatch describes an error where decoding failed due
	// to a bad checksum.
	ErrChecksumMismatch = errors.New("checksum mismatch")

	// ErrUnknownAddressType describes an error where an address can not
	// decoded as a specific address type due to the string encoding
	// beginning with an identifier byte unknown to any standard or
	// registered (via chaincfg.Register) network.
	ErrUnknownAddressType = errors.New("unknown address type")

	// ErrAddressCollision describes an error where an address can not
	// be uniquely determined as either a pay-to-pubkey-hash or
	// pay-to-script-hash address since the leading identifier is used for
	// describing both address kinds, but for different networks.  Rather
	// than assuming or defaulting to one or the other, this error is
	// returned and the caller must decide how to decode the address.
	ErrAddressCollision = errors.New("address collision")
)
View Source
var (
	BitcoinChainId    crypto.Hash
	BitcoinOmniUSDTId crypto.Hash
)

Functions

func DecodeCheckAddress added in v0.13.16

func DecodeCheckAddress(addr string) error

DecodeAddress decodes the string encoding of an address and returns the Address if addr is a valid encoding for a known address type.

The bitcoin network the address is associated with is extracted if possible. When the address does not encode the network, such as in the case of a raw public key, the address will be associated with the passed defaultNet.

func GenerateAssetId

func GenerateAssetId(assetKey string) crypto.Hash

func VerifyAddress

func VerifyAddress(address string) error

func VerifyAssetKey

func VerifyAssetKey(assetKey string) error

func VerifyTransactionHash

func VerifyTransactionHash(hash string) error

Types

type UnsupportedWitnessProgLenError added in v0.13.16

type UnsupportedWitnessProgLenError int

UnsupportedWitnessProgLenError describes an error where a segwit address being decoded has an unsupported witness program length.

func (UnsupportedWitnessProgLenError) Error added in v0.13.16

type UnsupportedWitnessVerError added in v0.13.16

type UnsupportedWitnessVerError byte

UnsupportedWitnessVerError describes an error where a segwit address being decoded has an unsupported witness version.

func (UnsupportedWitnessVerError) Error added in v0.13.16

Jump to

Keyboard shortcuts

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