Documentation
¶
Overview ¶
Package unlocker comment
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrOnlyP2PKHSupported = errors.New("currently only p2pkh supported")
)
Static errors for err113 linter compliance
Functions ¶
func InjectExternalSignerFn ¶
InjectExternalSignerFn allows the injection of an external signing function.
Types ¶
type Getter ¶
type Getter struct {
PrivateKey *bec.PrivateKey
}
Getter implements the `bt.UnlockerGetter` interface. It unlocks a Tx locally, using a bec PrivateKey.
type Simple ¶
type Simple struct {
PrivateKey *bec.PrivateKey
}
Simple implements a simple `bt.Unlocker` interface. It is used to build an unlocking script using a bec Private Key.
func (*Simple) UnlockingScript ¶
func (l *Simple) UnlockingScript(_ context.Context, tx *bt.Tx, params bt.UnlockerParams) (*bscript.Script, error)
UnlockingScript create the unlocking script for a given input using the PrivateKey passed in through the `unlock.Local` struct.
UnlockingScript generates and uses an ECDSA signature for the provided hash digest using the private key as well as the public key corresponding to the private key used. The produced signature is deterministic (same message and same key yield the same signature) and canonical in accordance with RFC6979 and BIP0062.
For example usage, see `examples/create_tx/create_tx.go`