core-concepts:protocols

Explain Midnight's Kachina and Zswap protocols for private smart contracts and shielded token transfers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Midnight protocols introduce confidential computation and shielded token transfer mechanics, enabling developers to reason about on-chain public state alongside private data and to evaluate privacy guarantees for smart contracts.

Core Features & Use Cases

  • Kachina Protocol enables confidential, general-purpose smart contracts with privacy-preserving execution on-chain.
  • Zswap Protocol provides shielded token transfers and atomic swaps with privacy guarantees and balance verification.
  • Use cases include DeFi with private balances, confidential asset issuance, and contract-driven private data workflows.

Quick Start

Summarize how Kachina and Zswap enable private, two-state smart contracts and shielded token transfers.

Frequently Asked Questions about core-concepts:protocols

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

FAQPage Schema
How do confidential smart contracts maintain privacy for on-chain computations?

Confidential smart contracts use a two-state model, separating public state from private data. Protocols like Kachina leverage zero-knowledge proofs to execute computations on-chain while keeping private inputs shielded.

What is the Zswap protocol and how does it enable shielded token transfers?

The Zswap protocol provides shielded token transfers and atomic swaps by using zero-knowledge proofs for balance verification. This ensures transaction privacy while cryptographically guaranteeing that token balances remain valid.

How do Kachina and Zswap interact to support private DeFi applications?

Kachina handles general-purpose private smart contract execution, while Zswap manages shielded token transfers and atomic swaps. Together they enable DeFi use cases like private balances and confidential asset issuance.

When do I need zero-knowledge proofs and Merkle proofs for private state verification?

Zero-knowledge proofs verify private computations without exposing data, and Merkle proofs establish private state membership within the two-state model. Both are required when integrating shielded contract logic.

Can I use Midnight's confidential contracts for atomic swaps with privacy guarantees?

Yes, the Zswap protocol enables atomic swaps with privacy guarantees. It uses zero-knowledge proofs to verify balances cryptographically without revealing transaction details or participant identities.

What are the integration requirements for token issuance in confidential smart contracts?

Token issuance requires integrating with the two-state model to manage public and private states, using Zswap for shielded transfers and Kachina for contract logic. Developers must handle Merkle proofs and ZK proof generation.