Documentation
¶
Index ¶
- func DecodeAltLeaves(encoded []byte) ([][]byte, error)
- func DeriveBurnKey(prevID PrevID) ([33]byte, error)
- func DeriveSTXOAltLeaves(prevIDs []PrevID) ([][]byte, error)
- func EncodeAltLeaf(scriptVersion uint16, scriptKey [33]byte) ([]byte, error)
- func EncodeAltLeaves(leaves [][]byte) ([]byte, error)
- func ReadVarInt(r io.Reader, scratch []byte) (uint64, error)
- func WriteVarInt(w io.Writer, val uint64, scratch []byte) error
- type Outpoint
- type PrevID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAltLeaves ¶
DecodeAltLeaves decodes a set of alt leaves from the minimal format used by tapd: varint leaf count followed by length-prefixed raw leaf bytes.
func DeriveBurnKey ¶
DeriveBurnKey derives a provably unspendable but unique key by tweaking the public NUMS key with a tap tweak:
burnTweak = h_tapTweak(NUMSKey || outPoint || assetID || scriptKeyXOnly) burnKey = NUMSKey + burnTweak*G
func DeriveSTXOAltLeaves ¶
DeriveSTXOAltLeaves returns the raw alt-leaf TLV blobs for the STXO set implied by the given prev IDs. Each leaf is encoded with script version 0 and a burn-key derived from the prev ID.
func EncodeAltLeaf ¶
EncodeAltLeaf encodes a single alt leaf as a TLV stream. The returned bytes are the per-leaf payloads carried inside the alt-leaves container format used by tapd.
func EncodeAltLeaves ¶
EncodeAltLeaves serializes a list of alt leaves using the minimal format expected by tapd: varint leaf count followed by length-prefixed raw leaf bytes.
func ReadVarInt ¶
ReadVarInt reads a compactly encoded integer as defined by BIP-0174/LND TLV helpers.