nut10

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: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSecretFromSpendingCondition added in v0.3.0

func NewSecretFromSpendingCondition(spendingCondition SpendingCondition) (string, error)

func SerializeSecret

func SerializeSecret(secret WellKnownSecret) (string, error)

SerializeSecret returns the json string to be put in the secret field of a proof

Types

type SecretData added in v0.3.0

type SecretData struct {
	Nonce string     `json:"nonce"`
	Data  string     `json:"data"`
	Tags  [][]string `json:"tags"`
}

type SecretKind added in v0.3.0

type SecretKind int
const (
	AnyoneCanSpend SecretKind = iota
	P2PK
	HTLC
)

func (SecretKind) String added in v0.3.0

func (kind SecretKind) String() string

type SpendingCondition added in v0.3.0

type SpendingCondition struct {
	Kind SecretKind
	Data string
	Tags [][]string
}

type WellKnownSecret

type WellKnownSecret struct {
	Kind SecretKind
	Data SecretData
}

func DeserializeSecret

func DeserializeSecret(serializedSecret string) (WellKnownSecret, error)

DeserializeSecret returns Well-known secret struct. It returns error if it's not valid according to NUT-10

Jump to

Keyboard shortcuts

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