nut14

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NUT14ErrCode cashu.CashuErrCode = 30004
)

Variables

View Source
var (
	InvalidPreimageErr = cashu.Error{Detail: "Invalid preimage for HTLC", Code: NUT14ErrCode}
	InvalidHashErr     = cashu.Error{Detail: "Invalid hash in secret", Code: NUT14ErrCode}
)

NUT-14 specific errors

Functions

func AddWitnessHTLC

func AddWitnessHTLC(
	proofs cashu.Proofs,
	secret nut10.WellKnownSecret,
	preimage string,
	signingKey *btcec.PrivateKey,
) (cashu.Proofs, error)

AddWitnessHTLC will add the preimage to the HTLCWitness. It will also read the tags in the secret and add the signatures if needed.

func AddWitnessHTLCToOutputs

func AddWitnessHTLCToOutputs(
	outputs cashu.BlindedMessages,
	preimage string,
	signingKey *btcec.PrivateKey,
) (cashu.BlindedMessages, error)

Types

type HTLCWitness

type HTLCWitness struct {
	Preimage   string   `json:"preimage"`
	Signatures []string `json:"signatures"`
}

Jump to

Keyboard shortcuts

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