bitcoin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMerkle = errors.New("invalid merkle")

Functions

func CheckMerkleChain

func CheckMerkleChain(leaf []byte, index uint32, merkleHashes [][]byte, merkleRoot []byte) error

func MerkleRootFromBlockHeader

func MerkleRootFromBlockHeader(bh *BlockHeader) []byte

func PrivKeyFromHexString

func PrivKeyFromHexString(s string) (*dcrsecp256k1.PrivateKey, error)

func SignTx

func SignTx(btx *wire.MsgTx, payToScript []byte, privateKey *dcrsecp256k1.PrivateKey, publicKey *dcrsecp256k1.PublicKey) error

func ValidateMerkleRoot

func ValidateMerkleRoot(txHashEncoded string, merkleProofEncoded []string, txIndex uint32, merkleRootEncoded string) error

ValidateMerkleRoot accepts encoded hashes of the hashes in question, i.e. the tx hash, merkle proof steps, and merkle root. and the index of the transaction. returns nil if the merkle proof is valid

Types

type BlockHeader

type BlockHeader [80]byte

func RawBlockHeaderFromSlice

func RawBlockHeaderFromSlice(s []byte) (*BlockHeader, error)

func (*BlockHeader) String

func (bh *BlockHeader) String() string

Jump to

Keyboard shortcuts

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