vpsbt

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VPacketVersionV0 uint8 = 0
	VPacketVersionV1 uint8 = 1
)

VPacket versions.

View Source
const (
	VOutputTypeSimple    uint8 = 0
	VOutputTypeSplitRoot uint8 = 1
)

VOutput types.

View Source
const (
	AssetVersionV0 uint8 = 0
	AssetVersionV1 uint8 = 1
)

Asset versions.

View Source
const (
	// MainnetHRP is the HRP for mainnet.
	MainnetHRP = "tapbc"

	// TestnetHRP is the HRP for testnet.
	TestnetHRP = "taptb"

	// Testnet4HRP is the HRP for testnet4.
	Testnet4HRP = "taptb"

	// RegTestHRP is the HRP for regtest.
	RegTestHRP = "taprt"

	// SigNetHRP is the HRP for "the" signet.
	SigNetHRP = "taptb"

	// SimNetHRP is the HRP for simnet.
	SimNetHRP = "tapsb"
)

Network HRPs for chain params.

View Source
const (
	BIP0043Purpose         = 1017
	HardenedKeyStart       = 0x80000000
	TaprootAssetsKeyFamily = 212
)

BIP-0043 purpose for key derivation (same as LND).

Variables

This section is empty.

Functions

This section is empty.

Types

type InteractiveVPacket

type InteractiveVPacket struct {
	// AssetID is the 32-byte asset identifier.
	AssetID [32]byte

	// Amount is the number of asset units to send.
	Amount uint64

	// ScriptKey is the receiver's script key (tweaked Taproot output key).
	ScriptKey [33]byte

	// AnchorInternalKey is the receiver's anchor output internal key.
	AnchorInternalKey [33]byte

	// AnchorKeyLocator identifies the anchor key's derivation path.
	AnchorKeyLocator KeyLocator

	// AltLeaves optionally carries auxiliary Taproot leaves that should be
	// committed to the output's Taproot Asset tree.
	AltLeaves [][]byte

	// LockTime is the optional lock time for the output.
	LockTime uint64

	// RelativeLockTime is the optional relative lock time.
	RelativeLockTime uint64

	// AnchorOutputIndex is the index of the anchor output in the BTC tx.
	AnchorOutputIndex uint32

	// AssetVersion is the version of the asset (V0 or V1).
	AssetVersion uint8

	// NetworkHRP is the chain params HRP.
	NetworkHRP string

	// CoinType is the BIP-44 coin type for derivation paths.
	CoinType uint32
}

InteractiveVPacket represents a minimal virtual packet for interactive sends. This contains only the fields needed to create a vPacket that can be funded by the tapd daemon.

func (*InteractiveVPacket) Encode

func (v *InteractiveVPacket) Encode() ([]byte, error)

Encode serializes the interactive vPacket to bytes that can be passed to FundVirtualPsbt.

type KeyLocator

type KeyLocator struct {
	// Family is the hardened key family.
	Family uint32

	// Index is the non-hardened key index.
	Index uint32
}

KeyLocator identifies the derivation path for a BIP32 key.

Jump to

Keyboard shortcuts

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