compact-core:language-reference

Document Compact smart contract types, syntax, and modules for Midnight Network.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/aaronbassett/midnight-knowledgebase --skill compact-core-language-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compact-core:language-reference
Source: https://github.com/aaronbassett/midnight-knowledgebase/tree/main/plugins/compact-core/skills/language-reference
Command: npx skills add https://github.com/aaronbassett/midnight-knowledgebase --skill compact-core-language-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides a complete, centralized reference for the Compact smart contract language used on Midnight Network, enabling developers to quickly look up types, syntax, and module patterns without hunting through scattered sources.

Core Features & Use Cases

  • Comprehensive type reference covering primitives (Field, Boolean, Uint<N>), composite types (struct, enum, Vector, Bytes), and special types (Opaque).
  • Circuit and witness syntax with practical examples, plus guidance on control flow, modules, and common best practices for writing robust contracts.
  • Quick lookup and learning support for engineers, educators, and new contributors needing authoritative language guidance.

Quick Start

Look up a specific type or syntax in the Compact language reference to accelerate contract development.

Frequently Asked Questions about compact-core:language-reference

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

FAQPage Schema
What primitive and composite types does the Compact language support for Midnight smart contracts?

You can look up circuit and witness syntax directly in the Compact language reference, which provides practical examples and guidance on control flow patterns. It covers module usage and common best practices for writing robust smart contracts on the Midnight Network.

How do I use modules and control flow when writing Compact contracts?

The Compact language reference provides module documentation and control flow patterns to structure your smart contracts. It includes practical examples of circuit and witness syntax, enabling you to organize contract logic and apply common best practices for robust development.

Can I find syntax examples for witnesses and circuits in the Compact language reference?

Yes, the Compact language reference includes circuit and witness syntax with practical examples. It covers how to define and manage witnesses within circuits, providing the syntax needed to implement zero-knowledge proofs in Midnight smart contracts.

When should I use the Opaque type in Compact circuit programming?

The Opaque type is a special type in the Compact language reference used for specific circuit programming scenarios on Midnight Network. You should consult the reference to understand its constraints and how it differs from primitive and composite types when designing smart contracts.

Does the Compact language reference cover best practices for writing robust smart contracts?

Yes, the Compact language reference provides guidance on common best practices for writing robust contracts. It covers control flow, module usage, and circuit syntax to ensure engineers, educators, and new contributors follow authoritative language guidelines for Midnight Network development.