compact-core:compact-tokens

Guide Midnight token design and implementation for shielded and unshielded workflows.

37|9|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/devrelaicom/midnight-expert --skill compact-core-compact-tokens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compact-core:compact-tokens
Source: https://github.com/devrelaicom/midnight-expert/tree/main/plugins/compact-core/skills/compact-tokens
Command: npx skills add https://github.com/devrelaicom/midnight-expert --skill compact-core-compact-tokens

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Helps developers choose, implement, and operate token models on Midnight by explaining when to use shielded ledger tokens, unshielded ledger tokens, or contract-based tokens and how to perform minting, sending, receiving, and burning correctly.

Core Features & Use Cases

  • Decision guidance: Clear criteria to pick shielded vs unshielded tokens based on privacy, auditability, and programmability needs.
  • Operational reference: Complete signatures and usage patterns for mintShieldedToken, sendShielded, mintUnshieldedToken, sendUnshielded, receiveShielded, receiveUnshielded, mergeCoin, and nonce management.
  • Practical patterns: Examples for fungible, non-fungible, and multi-token contracts, handling change, supply-tracking caveats, and OpenZeppelin Compact patterns and limitations.

Quick Start

Ask the skill to explain when to use shielded vs unshielded tokens for your Compact contract and provide concrete mint/send/receive patterns and safety caveats.

Frequently Asked Questions about compact-core:compact-tokens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between shielded and unshielded tokens for a Midnight Compact contract?

Shielded tokens provide privacy, while unshielded tokens offer auditability and programmability. Choose based on whether your Midnight Compact contract requires transaction confidentiality or transparent ledger tracking.

How do I mint and send Midnight tokens in a Compact contract?

Mint Midnight tokens using mintShieldedToken or mintUnshieldedToken, then transfer them via sendShielded or sendUnshielded functions. The skill provides precise signatures and usage patterns for both workflows.

What is the best way to manage nonces when sending shielded tokens on Midnight?

Nonce management for Midnight shielded tokens requires careful tracking to prevent replay issues. The skill provides operational reference patterns for managing nonces alongside sendShielded and receiveShielded workflows.

Can I implement fungible, non-fungible, and multi-token contracts using Midnight tokens?

Yes, Midnight tokens support fungible, non-fungible, and multi-token contract implementations. The skill provides practical patterns including color derivation and balance-checking best practices for these contract types.

What are the limitations of using OpenZeppelin Compact patterns for token contracts?

OpenZeppelin Compact patterns for Midnight tokens have specific limitations regarding supply-tracking and change handling. The skill details these caveats alongside safety precautions for shielded and unshielded token workflows.

How does zswap work with shielded and unshielded Midnight tokens?

Zswap operations integrate with Midnight token workflows to exchange shielded and unshielded assets. The skill provides function signatures and integration patterns for engineers implementing zswap operations within their contracts.