Documentation ¶
Index ¶
- Variables
- func CheckMerkleChain(leaf []byte, index uint32, merkleHashes [][]byte, merkleRoot []byte) error
- func KeysAndAddressFromHexString(s string, chainParams *chaincfg.Params) (*dcrsecp256k1.PrivateKey, *dcrsecp256k1.PublicKey, *btcutil.AddressPubKeyHash, ...)
- func MerkleRootFromBlockHeader(bh *BlockHeader) []byte
- func PrivKeyFromHexString(s string) (*dcrsecp256k1.PrivateKey, error)
- func SignTx(btx *wire.MsgTx, payToScript []byte, privateKey *dcrsecp256k1.PrivateKey, ...) error
- func ValidateMerkleRoot(txHashEncoded string, merkleProofEncoded []string, txIndex uint32, ...) error
- type BlockHeader
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidMerkle = errors.New("invalid merkle")
Functions ¶
func CheckMerkleChain ¶
func KeysAndAddressFromHexString ¶
func KeysAndAddressFromHexString(s string, chainParams *chaincfg.Params) (*dcrsecp256k1.PrivateKey, *dcrsecp256k1.PublicKey, *btcutil.AddressPubKeyHash, 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
Click to show internal directories.
Click to hide internal directories.