Namespace NArk.Core.Assets
Classes
- AssetGroup
A group of asset inputs and outputs with optional AssetId, control asset, and metadata. Binary layout: [1B presence flags] [if 0x01: 34B AssetId] [if 0x02: AssetRef (variable)] [if 0x04: varint mdCount + Metadata[]] [varint inputCount][AssetInput...] [varint outputCount][AssetOutput...]
- AssetId
34-byte asset identifier: 32-byte genesis txid + uint16 group index. Binary layout: [32B txid][2B groupIndex LE]
- AssetInput
An input in an asset group, referencing a transaction input (vin) and amount. Binary layout: Local (type=1): [0x01][2B vin LE][varint amount] Intent (type=2): [0x02][32B txid][2B vin LE][varint amount]
- AssetMetadata
Key-value metadata entry for an asset group. Binary layout: [varslice key][varslice value]
- AssetOutput
An output in an asset group, referencing a transaction output (vout) and amount. Binary layout: [0x01 type][2B vout LE][varint amount]
- AssetPacketBuilder
Builds an asset packet OP_RETURN TxOut from pre-mapped asset input/output tuples. Callers are responsible for mapping their own vin/vout indices (e.g. applying BIP322 +1 offset).
- AssetRef
Reference to an asset, either by full AssetId or by group index within a Packet. Binary layout: ByID: [0x01][34B AssetId] ByGroup: [0x02][2B groupIndex LE]
- BufferReader
Binary deserialization helper using unsigned LEB128 varint encoding, matching the Go/TypeScript asset encoding implementations.
- BufferWriter
Binary serialization helper using unsigned LEB128 varint encoding, matching the Go/TypeScript asset encoding implementations.
- Extension
An extension blob carried in a Bitcoin OP_RETURN output. Wire format: OP_RETURN <push: [ARK magic 0x41524B][type(1B) varint(len) data]...> Each record is a typed packet with explicit LEB128 varint length framing. Duplicate packet types are rejected. At least one packet is required.
- MetadataList
An ordered list of AssetMetadata entries with Merkle hash support. The Merkle tree uses BIP340 tagged hashes with tags "ArkadeAssetLeaf" and "ArkadeAssetBranch".
- Packet
A collection of AssetGroups representing the asset packet (type 0x00) inside an Extension. Raw wire format: varint(groupCount) + AssetGroup...
- UnknownPacket
Opaque packet type for unknown/future TLV records. Round-trips the raw data without interpreting it.
Interfaces
- IExtensionPacket
A typed data record that can be carried inside an Extension OP_RETURN output. Each packet type is identified by a single byte and serialized as: type(1B) + varint(len) + data
- ISpendExtensionPacketProvider
Plug-point that lets a higher layer (e.g.
NArk.Arkade) contribute extra IExtensionPacket records to the single Extension OP_RETURN a spend carries, withoutNArk.Coretaking a dependency on that layer. Mirrors the roleIBatchSessionExtensionplays for batch flows, but for the offchain spend path.