Documentation ¶
Overview ¶
Package unlocker comment
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 the 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(ctx 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 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`