Midnight Testnet Walkthrough
The Midnight testnet lets you experiment with privacy-preserving smart contracts before Kukolu mainnet goes fully open. This walkthrough takes you from a fresh setup to running the canonical counter DApp example — the 'Hello World' of Midnight development.
Getting testnet DUST
DUST is Midnight's native fee token. For the testnet, you can obtain testnet DUST from the Midnight faucet at faucet.midnight.network. Connect your Midnight Lace wallet (see the next section), copy your testnet address, and request DUST from the faucet. Faucet requests are typically fulfilled within a minute.
Testnet DUST has no monetary value — it exists purely for testing. Request as much as you need for your experiments; the faucet is rate-limited but generous.
Installing Midnight Lace wallet
The Midnight Lace wallet is the official wallet for Midnight, built as a fork of Cardano's Lace wallet with support for Midnight's shielded state and proof generation. Download it from the official Midnight website (midnight.network) by following the wallet installation link.
During setup, create a new wallet and securely record your seed phrase (same principle as any blockchain wallet — write it on paper, store it safely). The Midnight Lace wallet manages both your public address (for receiving DUST) and your shielded state (for privacy features). Switch the network to Testnet in the wallet settings before requesting faucet DUST.
Setting up the development environment
Install Node.js 18+ and npm. Install the Midnight SDK globally with `npm install -g @midnight-ntwrk/midnight-js-sdk` (check the official docs for the current package name and version — the SDK is actively developed and package names may change between releases).
Install the Compact compiler following the instructions at docs.midnight.network/install. The Compact compiler is distributed as a standalone binary for Linux, macOS, and Windows. Add it to your PATH.
Running the counter DApp example
Clone the official Midnight examples repository: `git clone https://github.com/midnight-ntwrk/midnight-sdk-starter`. Navigate to the counter example directory: `cd midnight-sdk-starter/counter`.
Install dependencies with `npm install`. Open `src/counter.compact` to see the Compact contract — it defines a public counter value and an increment operation with a ZK proof. Review `src/index.ts` to see how the TypeScript off-chain code uses the Midnight SDK to call the contract.
Run `npm run start` to execute the DApp against the testnet. The script will: connect to the Midnight testnet RPC, deploy the counter contract, call increment, and print the updated counter value. Watch the terminal output — it will show proof generation (taking a few seconds) followed by transaction confirmation.
What to explore next
After the counter example, explore the token example in the same repository — it demonstrates private token balances and transfer proofs, a more realistic privacy use case. The Midnight documentation at docs.midnight.network has a full tutorial series covering credential issuance, private voting, and confidential DeFi patterns.
Join the Midnight Discord (linked from midnight.network) to connect with other developers, report testnet issues, and follow SDK release announcements. The ecosystem is early-stage and active developer participation is welcome and influential.
Key Takeaways
- Get testnet DUST from the Midnight faucet at faucet.midnight.network using your Midnight Lace wallet address.
- Install the Midnight Lace wallet from midnight.network; switch to Testnet mode before requesting DUST.
- The counter DApp in the midnight-sdk-starter repository is the canonical starting point for Midnight development.
- Running the counter DApp demonstrates live proof generation (client-side, takes a few seconds) and testnet transaction confirmation.
- After the counter example, explore the token example and Midnight Discord for further learning and community support.