btc

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package btc provides utilities for BTC - Bitcoin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEncode

func CheckEncode(input []byte, version []byte) string

CheckEncode prepends version bytes and appends a four byte checksum.

func P2PKH

func P2PKH(buf []byte, net *NetworkParams) (addr string, err error)

P2PKH pay to public key hash

func P2SH

func P2SH(buf []byte, net *NetworkParams) (addr string, err error)

P2SH pay to script hash

func P2WPKH

func P2WPKH(buf []byte, net *NetworkParams) (addr string, err error)

P2WPKH pay to witness public key hash

func P2WPKHInP2SH

func P2WPKHInP2SH(buf []byte, net *NetworkParams) (addr string, err error)

P2WPKHInP2SH pay to witness public key hash nested in pay to script hash

func P2WSH

func P2WSH(buf []byte, net *NetworkParams) (addr string, err error)

P2WSH pay to witness script hash

func P2WSHInP2SH

func P2WSHInP2SH(buf []byte, net *NetworkParams) (addr string, err error)

P2WSHInP2SH pay to witness script hash nested in pay to script hash

Types

type NetworkParams

type NetworkParams struct {
	Raw *chaincfg.Params

	PubKeyHashAddrID []byte
	ScriptHashAddrID []byte
}
var MainNetParams NetworkParams

func NewNetworkParams

func NewNetworkParams(raw *chaincfg.Params, pubKeyHashAddrID int64, scriptHashAddrID int64) (net NetworkParams)

func (*NetworkParams) GetRaw

func (np *NetworkParams) GetRaw() *chaincfg.Params

Jump to

Keyboard shortcuts

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