Documentation ¶
Overview ¶
Package internal holds all the relevant tools to actually build and validate signed message.
Index ¶
- func CreateMagicMessage(message string) string
- func GeneratePublicKeyHash(recoveryFlag int, publicKey *btcec.PublicKey) []byte
- func ValidateP2PKH(recoveryFlag int, pubkeyHash []byte, addr btcutil.Address, ...) (bool, error)
- func ValidateP2SH(recoveryFlag int, pubkeyHash []byte, addr btcutil.Address, ...) (bool, error)
- func ValidateP2TR(recoveryFlag int, pubKey *btcec.PublicKey, addr btcutil.Address, ...) (bool, error)
- func ValidateP2WPKH(recoveryFlag int, pubkeyHash []byte, addr btcutil.Address, ...) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMagicMessage ¶
CreateMagicMessage builds a properly signed message.
func GeneratePublicKeyHash ¶
GeneratePublicKeyHash returns the public key hash, either compressed or uncompressed, depending on the recovery flag.
func ValidateP2PKH ¶
func ValidateP2PKH(recoveryFlag int, pubkeyHash []byte, addr btcutil.Address, net *chaincfg.Params) (bool, error)
ValidateP2PKH ensures that the passed P2PKH address matches the address generated from the public key hash, recovery flag and network.
func ValidateP2SH ¶
func ValidateP2SH(recoveryFlag int, pubkeyHash []byte, addr btcutil.Address, net *chaincfg.Params) (bool, error)
ValidateP2PKH ensures that the passed P2SH address matches the address generated from the public key hash, recovery flag and network.
func ValidateP2TR ¶ added in v0.6.0
func ValidateP2TR(recoveryFlag int, pubKey *btcec.PublicKey, addr btcutil.Address, net *chaincfg.Params) (bool, error)
ValidateP2TR ensures that the passed P2TR address matches the address generated from the public key hash, recovery flag and network.
Only addresses without a tapscript are allowed because the verification is using the internal key.
Types ¶
This section is empty.