/core-concepts:data-modelsfrom core-concepts
Explains Midnight's UTXO and account token paradigms, covering shielded tokens, nullifiers, commitments, and double-spend prevention. Guides choosing based on privacy, parallelism, and complexity.
Ships in core-concepts. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Midnight supports two distinct token paradigms: UTXO-based ledger tokens and account-based contract tokens. Choose based on privacy requirements and use case complexity.
| Requirement | Use UTXO (Ledger Tokens) | Use Account (Contract Tokens) |
|---|---|---|
| Privacy critical | Yes - independent, shieldable | Less native privacy than UTXO; shielded contract tokens in development |
| Parallel processing | Yes - no ordering deps | No - sequential nonce |
| Simple transfers | Yes | Overkill |
| Complex DeFi logic | Limited | Yes |
| Gaming state machines | No | Yes |
| Governance/delegation | No | Yes |
UTXO = Unspent Transaction Output. Each token is a discrete digital coin that must be spent entirely.
Creation -> Existence -> Consumption -> Prevention of Reuse
Unlike Bitcoin, which references prior outputs directly by txid+index (revealing which coin was spent), Midnight uses nullifiers:
Each coin carries a value, token type, and unique nonce. The nullifier is a hash derived from the coin data and the spending key.
Privacy benefit: The nullifier is computed from the raw coin data and the spending key, not from the commitment. This means the nullifier reveals nothing about which coin commitment was spent.
Each UTXO independently chooses privacy level:
Maintain address-to-balance mappings within Compact contracts, following patterns inspired by OpenZeppelin-style token standards adapted for Compact.
| Aspect | Account Model Limitation |
|---|---|
| Privacy | Less native privacy than UTXO; shielded contract tokens in development |
| Ordering | Nonce creates sequential dependency |
| MEV | Mempool visibility enables front-running |
| Scalability | Redundant computation on every node |
Midnight's ledger has two components:
Token types are 256-bit collision-resistant hashes:
For detailed technical information:
references/utxo-mechanics.md - Complete UTXO lifecycle, nullifier computationreferences/ledger-structure.md - Zswap state internals, Merkle tree detailsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub midnightntwrk/midnight-expert --plugin core-concepts6 skills in this plugin
/architecturecore-concepts:architectureThis skill should be used when the user asks about Midnight network architecture, transaction structure, guaranteed vs fallible sections, Zswap/Kachina integration, ledger and state management, cryptographic binding, balance verification, nullifiers, address derivation, transaction merging, atomic swaps, fee handling, or the privacy model separating private and public domains./privacy-patternscore-concepts:privacy-patternsThis skill should be used when understanding privacy-preserving design patterns, including commitment schemes, nullifier patterns, Merkle tree membership proofs, anonymous authentication, commit-reveal protocols, selective disclosure, domain separation, and privacy boundaries in on-chain data./protocolscore-concepts:protocolsThis skill should be used when the user asks about Kachina smart contract protocol, Zswap token transfers, atomic swaps, shielded transfers, offers, coins, nullifiers, commitments, confidential smart contracts, the two-state model (public/private state), token minting, how ZK proofs enable privacy in Midnight protocol transactions, or private transaction mechanisms./tokenomicscore-concepts:tokenomicsThis skill should be used when the user asks about Midnight tokens, NIGHT token, DUST resource, token distribution, Glacier Drop, Scavenger Mine, block rewards, tokenomics whitepaper, STAR denomination, token economics, dual-token model, MEV resistance, token supply, or how transaction fees work in Midnight./zero-knowledgecore-concepts:zero-knowledgeThis skill should be used when the user asks about zero-knowledge proofs, ZK SNARKs, witness data, prover/verifier roles, constraint systems, proof generation, proof verification, privacy boundaries, or how Midnight uses ZK cryptography for transaction privacy and data protection.Other plugins' skills for the same job