Nightcap is Midnight Foundation's Midnight development environment for professionals. Designed to simplify building, testing, and deploying smart contracts and dApps on the Midnight blockchain. Inspired by Ethereum's Hardhat (and many others), Nightcap provides a flexible environment for Midnight developers with features tailored to the unique aspects of the Midnight network.
# Install
pnpm add -D @nightcap/core
# Create a project
npx nightcap init
# Start local network
npx nightcap node
# Compile contracts
npx nightcap compile
# Deploy
npx nightcap deploy- Local Midnight node simulation for rapid development and testing of Compact Contracts
- Automated contract compilation, deployment, and verification workflows
- Plugin architecture to extend functionality for Midnight-specific use cases
- Scriptable tasks for common developer operations
- TypeScript-first with full type safety
- Docker-based local network with snapshot/restore capability
See the docs/ folder for comprehensive documentation:
- Getting Started - Installation and your first project
- Command Reference - All CLI commands and options
- Configuration - Config file reference
- Plugin Development - Creating Nightcap plugins
- Troubleshooting - Common issues and solutions
- Node.js 20 or higher
- Docker (for local network)
- pnpm (recommended)
Run nightcap doctor to verify your environment.
Nightcap is an open source project maintained by the Midnight Foundation. We welcome contributions from the community to help improve and expand its capabilities.
Apache 2.0.
Provides a brief description of the Midnight Foundation's security policy and how to properly disclose security issues.
Provides guidelines for how people can contribute to the Midnight project.
Defines repository ownership rules.
Provides templates for reporting various types of issues, such as: bug report, documentation improvement and feature request.
Provides a template for a pull request.
The Midnight Foundation appreciates contributions, and like many other open source projects asks contributors to sign a contributor License Agreement before accepting contributions. We use CLA assistant (https://github.com/cla-assistant/cla-assistant) to streamline the CLA signing process, enabling contributors to sign our CLAs directly within a GitHub pull request.
The Midnight Foundation uses GitHub Dependabot feature to keep our projects dependencies up-to-date and address potential security vulnerabilities.
The Midnight Foundation uses Checkmarx for application security (AppSec) to identify and fix security vulnerabilities. All repositories are scanned with Checkmarx's suite of tools including: Static Application Security Testing (SAST), Infrastructure as Code (IaC), Software Composition Analysis (SCA), API Security, Container Security and Supply Chain Scans (SCS).
Facilitates two-way data synchronization, automated workflows and streamline processes between: Jira, GitHub issues and Github project Kanban board.
Include the following Software Package Data Exchange (SPDX) short-form identifier in a comment at the top headers of each source code file.
// This file is part of NIGHTCAP.
// Copyright (C) 2025 Midnight Foundation
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.