Skip to content

Templates and Assets

This page is the catalogue of what you can build, and how private it is:

  • The four resource types and the privacy posture of each.
  • The built-in templates shipped with the engine.
  • The recurring application patterns — token, NFT, stablecoin, liquidity pool, HTLC, escrow, games — each with a one-line privacy note.
  • Where to go for the mechanics.

A resource’s type is the single most important decision for its privacy properties. The engine defines exactly four (crates/template_lib_types/src/resource_type.rs):

pub enum ResourceType {
Fungible, // public, interchangeable
NonFungible, // public, individually identified
Confidential, // amounts hidden, balances in vaults
Stealth, // amounts and owners hidden, funds are UTXOs
}
TypeBalances visible?Owners visible?Funds live inBuilder
Public FungibleYesYesVaultsResourceBuilder::public_fungible()
Public Non-FungibleYes (per NFT)YesVaultsResourceBuilder::non_fungible()
ConfidentialNoYes (the vault’s component)VaultsResourceBuilder::confidential()
StealthNoNoUTXOsResourceBuilder::stealth()

The four types are easier to hold in the head as a two-by-two. There are two independent questions — can you see the amount? and can you see the owner? — and each type answers them:

The design space of a resourceTwo independent questions. Each resource type is one answer.amount visibleamount hiddenowner visibleowner hiddenPublicFungible · Non-Fungiblebalances and owners are plaintextConfidentialamount hidden, owner knowna balance, hidden inside a vault—no resource type hereStealthamount and owner hiddenfunds are one-time UTXOsThe engine offers three of these four cells. There is no resource type for a public amount with a hidden owner.

The baseline: a currency with no privacy. Balances and transfers are plaintext on-chain. It is the right choice for assets that should be transparent — governance tokens, publicly auditable treasuries — and it is cheap, because there is nothing to prove.

Like a fungible resource, but each unit has an identity (NonFungibleId) and can carry mutable data. Ownership and contents are public. This is the type for collectibles, receipts, and access badges — tokens whose whole point is that they can be pointed at.

The first privacy layer: a fungible resource whose amounts are hidden. Balances sit in vaults as Pedersen commitments, so an observer can see that a vault holds funds but not how much. Ownership is still tied to the vault’s component — so confidential hides the amount, not the account. It is the natural fit for a private balance that still interacts with public components.

The strongest layer: a resource whose outputs are UTXOs rather than vault balances. Each output carries a one-time stealth address, so neither the amount nor the owner is linkable on-chain. The native token, TARI, is stealth. Use stealth when ownership itself is sensitive — payments, bearer assets, anything where linking two transactions to the same party would be a problem.


Four templates ship compiled into the engine, always available (crates/template_builtin/src/templates.rs):

TemplatePurpose
AccountThe standard account component: holds vaults, gates withdrawals by owner rule.
NftFaucetMints a non-fungible resource and hands out NFTs.
XtrFaucetThe testnet TARI faucet, used in examples to fund an account.
TwoResourceLiquidityPoolAn AMM-style pool over two resources — the reference DeFi primitive.

The Account template is worth singling out: it is the component most user funds actually sit in, and it is the seam between public and private funds. Depositing into an account vault is a public move; converting a bucket to stealth UTXOs is the private one. Most privacy questions reduce to which side of the account boundary a transfer happens on.


Each pattern below is a composition of the four resource types and condition trees. The “privacy posture” line is the honest summary of what leaks.

PatternBuilt fromPrivacy posture
Fungible tokenPublic Fungible or Confidential, with a mint authorityPublic type is fully transparent; confidential hides balances but not the accounts.
NFT / collectionPublic Non-FungiblePublic by design — ownership is the point.
StablecoinStealth, with a revealed mint/burn boundaryHolder transfers private; supply events revealed so supply is auditable. See Stablecoins.
Liquidity poolTwo resources + a vault pair (see TwoResourceLiquidityPool)Pool reserves are public to be swappable; LP tokens inherit the underlying resources’ privacy.
HTLC / atomic swapA stealth output with a two-leaf condition tree (hashlock + timelock)Amount hidden; the revealed leaf discloses the preimage branch taken.
EscrowA stealth output with a release leaf and a refund leaf; optionally covenantsFunds hidden throughout; only the exercised branch is revealed.
Guessing gameA component + a resource vault; hashed commitment to the secretGame state is public; see Privacy for why commitments are cheap to add.
Bearer assetA stealth resource with key-path-only outputsFully private: possession is the credential, no registry names an owner.

Three of those patterns — HTLC, escrow, and atomic swaps — rest on the same mechanism: a spend condition that is a tree of branches. Understanding the tree explains all three at once.

How a spend condition is committedOne root goes on chain. The branches stay off it until one is used.condition rootthe only thing stored on the outputClaim pathHashLock(preimage)andBeforeEpoch(deadline)spending reveals this leaf and its proofRefund pathAfterEpoch(deadline)andAccessRule(funder)never revealed unless this path is takenBecause only the root is published, the unused branch stays secret: a spend opens one door, not the whole policy.

A short decision path:

  1. Must an outsider audit the asset? If yes, start public.
  2. Must balances be hidden? Choose confidential.
  3. Must the owner be hidden as well? Choose stealth.
  4. Must an auditor see hidden amounts? Add a view key to a confidential or stealth resource.

Then design the boundaries: every application has a few places where value must be revealed — the fee, a mint, an interaction with a public pool. The privacy of the whole system is the privacy of its leakiest boundary, so identify those first.


  • Four resource types: Public Fungible, Public Non-Fungible, Confidential, Stealth.
  • Confidential hides amounts; Stealth hides amounts and owners.
  • Four built-in templates ship with the engine: Account, NftFaucet, XtrFaucet, TwoResourceLiquidityPool.
  • The Account template is the seam between public and private funds.
  • The common application patterns — token, NFT, stablecoin, pool, HTLC, escrow, games — are all compositions of these types and condition trees.
  • Privacy is set by the leakiest boundary, not by the asset type alone.

Next: the economics of the native token — Tokenomics.