Documentation
¶
Overview ¶
Package bitcoin reads a Bitcoin wallet from its extended public key (xpub, ypub or zpub): addresses are derived locally, history and balances come from an Esplora API (mempool.space by default, or your own instance). Litecoin, Dogecoin and Bitcoin Cash are read the same way (see Coin).
Index ¶
Constants ¶
View Source
const (
// GapLimit is how many unused addresses in a row end a chain (BIP44).
GapLimit = 20
)
Variables ¶
View Source
var ( Bitcoin = Coin{Name: "Bitcoin", Symbol: "BTC", /* contains filtered or unexported fields */} Litecoin = Coin{Name: "Litecoin", Symbol: "LTC", /* contains filtered or unexported fields */} Dogecoin = Coin{Name: "Dogecoin", Symbol: "DOGE", /* contains filtered or unexported fields */} BitcoinCash = Coin{Name: "Bitcoin Cash", Symbol: "BCH", /* contains filtered or unexported fields */} )
Functions ¶
Types ¶
type Coin ¶
type Coin struct {
Name string // "Bitcoin"
Symbol string // "BTC"
// contains filtered or unexported fields
}
Coin is a blockchain built like Bitcoin (UTXO, BIP32 keys): Litecoin, Dogecoin and Bitcoin Cash differ only in how keys and addresses are written, and in which public servers index them.
func (Coin) ValidAddress ¶
ValidAddress reports whether a is one address of the coin (legacy, nested or native segwit, taproot). Bitcoin Cash addresses are not read alone: its wallets always give an extended public key.
Click to show internal directories.
Click to hide internal directories.