note

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Note

type Note struct {
	Preimage [preimageSize]byte
	Value    uint32
}

Note contains the data of a note

func NewNote

func NewNote(value uint32) (*Note, error)

NewNote generate a new note data struct with a random preimage and the given value

func NewNoteFromString

func NewNoteFromString(s string) (*Note, error)

NewNoteFromString converts a base58 encoded string with HRP to a Note

func (Note) BIP322Input

func (n Note) BIP322Input() (*bip322.Input, error)

func (*Note) Deserialize

func (n *Note) Deserialize(data []byte) error

Deserialize converts a byte slice to Data

func (Note) PreimageHash

func (n Note) PreimageHash() [preimageSize]byte

func (*Note) Serialize

func (n *Note) Serialize() []byte

Serialize converts Note's data to a byte slice

func (Note) String

func (n Note) String() string

String converts the Note to a base58 encoded string with HRP

func (Note) VtxoScript

func (n Note) VtxoScript() script.TapscriptsVtxoScript

type NoteClosure

type NoteClosure struct {
	PreimageHash [preimageSize]byte
}

implements tree.Closure interface, can't be used in a classic vtxo script but only in the fake vtxo note script

func (*NoteClosure) Decode

func (n *NoteClosure) Decode(script []byte) (bool, error)

Decode attempts to decode a script into a NoteClosure

func (*NoteClosure) Script

func (n *NoteClosure) Script() ([]byte, error)

Script returns the tapscript for the note closure

func (*NoteClosure) Witness

func (n *NoteClosure) Witness(controlBlock []byte, opts map[string][]byte) (wire.TxWitness, error)

Witness returns the witness stack for spending the fake vtxo note

Jump to

Keyboard shortcuts

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