# Functions

AssembleGroupKeyFromWitness constructs a group key given a group witness generated externally.
AssetCommitmentKey returns a key which can be used to locate an asset within an AssetCommitment that is specific to a particular owner (script key).
AssetCustomGroupKey constructs a new asset group key and anchor asset from a given asset genesis.
BranchNodesRootHash returns the root hash of a Tapscript tree built from the tapHashes stored in a TapBranchNodes object.
CheckTapLeafSanity asserts that a TapLeaf script is smaller than the maximum witness size, and that the TapLeaf version is Tapscript v0.
CheckTapLeavesSanity asserts that a slice of TapLeafs is below the maximum size, and that each leaf passes a sanity check for script version and size.
No description provided by the author
No description provided by the author
ComputeTaprootScript computes the on-chain SegWit v1 script, known as Taproot, based on the given `witnessProgram`.
DecodeGenesis decodes an asset genesis.
No description provided by the author
DecodeTapLeaf decodes a byte slice containing a TapLeaf TLV record prefixed with a varint indicating the length of the record.
No description provided by the author
DeriveBurnKey derives a provably un-spendable but unique key by tweaking the public NUMS key with a tap tweak: burnTweak = h_tapTweak(NUMSKey || outPoint || assetID || scriptKey) burnKey = NUMSKey + burnTweak*G The firstPrevID must be the PrevID from the first input that is being spent by the virtual transaction that contains the burn.
DeriveGroupKey derives an asset's group key based on an internal public key descriptor, the original group asset genesis, and the asset's genesis.
No description provided by the author
No description provided by the author
EncodeTapLeaf encodes a TapLeaf into a byte slice containing a TapLeaf TLV record, prefixed with a varint indicating the length of the record.
No description provided by the author
EqualKeyDescriptors returns true if the two key descriptors are equal.
FromBranch creates a TapscriptTreeNodes object from a TapBranchNodes object.
FromLeaves creates a TapscriptTreeNodes object from a TapLeafNodes object.
No description provided by the author
No description provided by the author
GenesisPrevOutFetcher returns a Taproot Asset input's `PrevOutFetcher` to be used throughout signing when the input asset is a genesis grouped asset.
GetBranch returns an Option containing a copy of the internal TapBranchNodes, if it exists.
GetLeaves returns an Option containing a copy of the internal TapLeafNodes, if it exists.
No description provided by the author
No description provided by the author
GroupPubKey derives a tweaked group key from a public key and two tweaks; the single tweak is the asset ID of the group anchor asset, and the tapTweak is the root of a tapscript tree that commits to script-based conditions for reissuing assets as part of this asset group.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
InputGenesisAssetPrevOut returns a TxOut that represents the input asset in a Taproot Asset virtual TX, but uses tweaked group key of the input asset to enable group witness validation.
IsBurnKey returns true if the given script key is a valid burn key for the given witness.
IsGroupSig checks if the given witness represents a key path spend of the tweaked group key.
IsSplitCommitWitness returns true if the witness is a split-commitment witness.
No description provided by the author
No description provided by the author
LeafNodesRootHash returns the root hash of a Tapscript tree built from the TapLeaf nodes in a TapLeafNodes object.
New instantiates a new asset with a genesis asset witness.
NewAssetNoErr creates an asset and fails the test if asset creation fails.
NewGroupKeyRequest constructs and validates a group key request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewMockGenesisSigner creates a new MockGenesisSigner instance given the passed public key.
NewScriptKey constructs a ScriptKey with only the publicly available information.
NewScriptKeyBip86 constructs a ScriptKey tweaked BIP-0086 style.
NewSpecifierFromGroupKey creates a new specifier that specifies an asset by its group public key.
NewSpecifierFromId creates a new specifier that specifies an asset by its ID.
NewSpecifierOptionalGroupKey creates a new specifier that specifies an asset by its ID and an optional group key.
NewSpecifierOptionalGroupPubKey creates a new specifier that specifies an asset by its ID and an optional group public key.
NewTapBranchHash takes the raw tap hashes of the left and right nodes and hashes them into a branch.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ParseGroupSig parses a group signature that was stored as a group witness in the DB.
ParseGroupWitness parses a group witness that was stored as a TLV stream in the DB.
No description provided by the author
No description provided by the author
RandAsset creates a random asset of the given type for testing.
RandAssetType creates a random asset type.
RandAssetWithValues creates a random asset with the given genesis and keys for testing.
RandGenesis creates a random genesis for testing.
RandGroupKey creates a random group key for testing.
RandGroupKeyWithSigner creates a random group key for testing, and provides the signer for reissuing assets into the same group.
RandID creates a random asset ID.
RandScriptKey creates a random script key for testing.
RandSerializedKey creates a random serialized key for testing.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SerializeGroupWitness serializes a group witness into a TLV stream suitable for storing in the DB.
SignOutputRaw creates a signature for a single input.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TapCommitmentKey is the key that maps to the root commitment for a specific asset within a TapCommitment.
TapTreeNodesFromBranch creates a TapscriptTreeNodes object from a TapBranch.
TapTreeNodesFromLeaves sanity checks an ordered list of TapLeaf objects and constructs a TapscriptTreeNodes object if all leaves are valid.
ToBranch returns an encoded TapBranchNodes object.
ToLeaves returns the TapLeaf slice inside a TapLeafNodes object.
ToSerialized serializes a public key in its 33-byte compressed form.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ValidateAssetName validates an asset name (the asset's genesis tag).
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
VirtualGenesisTxIn computes the single input of a Taproot Asset virtual transaction that represents a grouped asset genesis.
VirtualTxInPrevOut returns the prevout of the Taproot Asset virtual transaction's single input as a hash of the root node's key concatenated by its sum.
VirtualTxWithInput returns a copy of the `virtualTx` amended to include all input-specific details.
WithAssetVersion can be used to create an asset with a custom version.
No description provided by the author
No description provided by the author
WitnessEncoderWithType is a wrapper around WitnessEncoder that allows the caller to specify th witness type.

# Constants

Collectible is a unique asset, one that cannot be represented in multiple units.
EncodeNormal normal is the normal encoding type for an asset.
EncodeSegwit denotes that the witness vector field is not to be encoded.
No description provided by the author
Types for future asset format.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MaxAssetEncodeSizeBytes is the size we expect an asset to not exceed in its encoded form.
MaxAssetNameLength is the maximum byte length of an asset's name.
MetaHashLen is the length of the metadata hash.
Normal is an asset that can be represented in multiple units, resembling a divisible asset.
ScriptV0 represents the initial asset script version of the Taproot Asset protocol.
TapBranchNodesLen is the length of a TapBranch represented as a byte arrray.
TaprootAssetsKeyFamily is the key family used to generate internal keys that tapd will use creating internal taproot keys and also any other keys used for asset script keys.
V0 is the initial Taproot Asset protocol version.
V1 is the version of asset serialization that doesn't include the witness field when creating a TAP commitment.
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

ErrByteSliceTooLarge is returned when an encoded byte slice is too large.
ErrInvalidTapBranch is returned when decoding a slice of byte slices to a TapBranch, and there are not exactly two slices.
ErrTooManyInputs is returned when an asset TLV atempts to reference too many inputs.
ErrTreeNotFound is returned when a TapscriptTreeManager attempts to load a Tapscript tree, but found no tree nodes.
ErrUnknownVersion is returned when an asset with an unknown asset version is being used.
ErrUnwrapAssetID is an error type which is returned when an asset ID cannot be unwrapped from a specifier.
NUMSBytes is the NUMs point we'll use for un-spendable script keys.
No description provided by the author
No description provided by the author
No description provided by the author
ZeroPrevID is the blank prev ID used for genesis assets and also asset split leaves.

# Structs

Asset represents a Taproot asset.
AssetGroup holds information about an asset group, including the genesis information needed re-tweak the raw key.
No description provided by the author
ChainAsset is a wrapper around the base asset struct that includes information detailing where in the chain the asset is currently anchored.
No description provided by the author
Genesis encodes an asset's genesis metadata which directly maps to its unique ID within the Taproot Asset protocol.
GroupKey is the tweaked public key that is used to associate assets together across distinct asset IDs, allowing further issuance of the asset to be made possible.
GroupKeyRequest contains the essential fields used to derive a group key.
GroupKeyReveal is a type for representing the data used to derive the tweaked key used to identify an asset group.
GroupVirtualTx contains all the information needed to produce an asset group witness, except for the group internal key descriptor (or private key).
MockGenesisSigner implements the GenesisSigner interface using a raw private key.
No description provided by the author
PendingGroupWitness specifies the asset group witness for an asset seedling in an unsealed minting batch.
PrevID serves as a reference to an asset's previous input.
ScriptKey represents a tweaked Taproot output key encumbering the different ways an asset can be spent.
Specifier is a type that can be used to specify an asset by its ID, its asset group public key, or both.
SplitCommitment represents the asset witness for an asset split.
TapBranchNodes represents the tapHashes of the child nodes of a TapBranch.
TapLeafNodes represents an ordered list of TapLeaf objects, that have been checked for their script version and size.
TapscriptTreeNodes represents the two supported ways to define a tapscript tree to be used as a sibling for a Taproot Asset commitment, an asset group key, or an asset script key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TweakedScriptKey is an embedded struct which is primarily used by wallets to be able to keep track of the tweak of a script key alongside the raw key derivation information.
No description provided by the author
No description provided by the author
Witness is a nested TLV stream within the main Asset TLV stream that contains the necessary data to verify the movement of an asset.

# Interfaces

ChainLookup is an interface that allows an asset validator to look up certain information about asset related transactions on the backing chain.
GenesisSigner is used to sign the assetID using the group key public key for a given asset.
GenesisTxBuilder is used to construct the virtual transaction that represents asset minting for grouped assets.
TapscriptTreeManager is used to persist a Tapscript tree, represented as either a slice of TapLeafs or a TapBranch.

# Type aliases

EncodeType is used to denote the type of encoding used for an asset.
ID serves as a unique identifier of an asset, resulting from: sha256(genesisOutPoint || sha256(tag) || sha256(metadata) || outputIndex || assetType).
LeafTlvType represents the different TLV types for Asset Leaf TLV records.
NewAssetOpt is used to modify how a new asset is to be created.
ScriptVersion denotes the asset script versioning scheme.
SerializedKey is a type for representing a public key, serialized in the compressed, 33-byte form.
Type denotes the asset types supported by the Taproot Asset protocol.
Version denotes the version of the Taproot Asset protocol in effect for an asset.
WitnessTlvType represents the different TLV types for Asset Witness TLV records.