compact-core:basic-start

Deploy a Compact smart contract on a local Midnight devnet.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides a disposable, step-by-step walkthrough that helps developers verify their Midnight development environment and build a minimal Compact smart contract end-to-end on a local devnet without committing artifacts.

Core Features & Use Cases

  • Devnet Setup & Verification: Generate docker compose for node, indexer and proof server, start services, and perform health and sync checks.
  • Contract Lifecycle: Write a Compact contract, compile (fast skip-zk and full with ZK keys), wire witnesses, deploy to a local devnet, and interact with on-chain state.
  • Wallets & Transfers: Create devnet wallets, perform NIGHT airdrops, register DUST, and execute programmatic token transfers; includes a privacy-preserving ticket contract example for commitment/nullifier patterns.
  • Use Case: Ideal for onboarding, local testing, CI smoke tests, and learning Compact language patterns such as witnesses, merkle proofs, and persistent commitments.

Quick Start

Run the basic-start walkthrough to create a temporary project, start a local Midnight devnet, compile and deploy a simple counter contract, and verify it by calling its circuits.

Frequently Asked Questions about compact-core:basic-start

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

FAQPage Schema
How do I set up a local Midnight devnet to test Compact smart contracts?

To set up a local Midnight devnet, you need Docker and Node.js 22 or higher. You generate a docker compose configuration for the node, indexer, and proof server, then start the services and run health and sync checks to verify the environment.

What is the difference between quick compilation and full compilation in the Compact CLI?

Quick compilation in the Compact CLI skips ZK proving keys to speed up the build process, while full compilation generates the necessary proving keys. You use quick compilation for rapid local testing and full compilation when you need to deploy contracts with valid zero-knowledge proofs.

How do I create a Midnight wallet and request NIGHT airdrops for devnet testing?

You create a devnet wallet using the Midnight Wallet SDK and scaffold Node.js scripts to interact with indexer endpoints. Once the wallet is established, you can perform NIGHT airdrops and register DUST to execute programmatic token transfers on the local network.

Can I deploy a privacy-preserving ticket contract using Compact on the Midnight devnet?

Yes, you can deploy a privacy-preserving ticket contract on the Midnight devnet using Compact. The walkthrough includes an example that demonstrates commitment and nullifier patterns, wiring witnesses, and executing token transfers to manage privacy-preserving on-chain state.

Do I need Docker and Node.js 22 to compile and deploy Compact smart contracts?

Yes, Docker and Node.js 22 or higher are required dependencies. Docker is used to run the local Midnight devnet components, while Node.js is necessary to scaffold the deployment scripts and use the Midnight Wallet SDK for contract interaction.

Why does my Compact contract deployment require witness wiring on the devnet?

Witness wiring is required because Compact contracts rely on witnesses to verify private inputs and execute logic securely. By wiring witnesses into your Node.js deployment scripts, you enable the contract to interact with on-chain state and validate merkle proofs or commitments during transactions.