util

package
v0.0.0-...-d990fe8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CombinePrivateKeys

func CombinePrivateKeys(keys ...*btcec.PrivateKey) *btcec.PrivateKey

CombinePrivateKeys takes a set of private keys and combines them in the same way as done for public keys. This only works if you know *all* of the private keys. If you don't, we'll do something with returning a scalar coefficient... I don't know how that's going to work. Schnorr stuff isn't decided yet.

func DecryptECIES

func DecryptECIES(priv *btcec.PrivateKey, cipherText []byte) ([]byte, error)

func DirectWPKHScriptFromAddress

func DirectWPKHScriptFromAddress(adr string) ([]byte, error)

func DirectWPKHScriptFromPKH

func DirectWPKHScriptFromPKH(pkh [20]byte) []byte

func DirectWSHScriptFromAddress

func DirectWSHScriptFromAddress(adr string) ([]byte, error)

func DirectWSHScriptFromSH

func DirectWSHScriptFromSH(sh [32]byte) []byte

func EncryptECIES

func EncryptECIES(pubKey [33]byte, msg []byte) ([]byte, error)

func IsConnectionError

func IsConnectionError(err error) bool

func KeyHashFromPkScript

func KeyHashFromPkScript(pkscript []byte) []byte

func PrintTx

func PrintTx(tx *wire.MsgTx)

Types

type CombinablePubKeySlice

type CombinablePubKeySlice []*btcec.PublicKey

PubKeySlice are slices of pubkeys, which can be combined (and sorted)

func (CombinablePubKeySlice) ComboCommit

func (p CombinablePubKeySlice) ComboCommit() chainhash.Hash

ComboCommit generates the "combination commitment" which contributes to the hash-coefficient for every key being combined.

func (CombinablePubKeySlice) Len

func (p CombinablePubKeySlice) Len() int

func (CombinablePubKeySlice) Less

func (p CombinablePubKeySlice) Less(i, j int) bool

func (CombinablePubKeySlice) Swap

func (p CombinablePubKeySlice) Swap(i, j int)

Make PubKeySlices sortable

Jump to

Keyboard shortcuts

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