Skip to main content

Installation

Get started with Midnight, whether you are here to use privacy-preserving applications or to build them. The installation process includes setting up the Lace wallet, obtaining test tokens, and configuring the development environment.

Prerequisites

Before you begin, ensure you have:

  • Google Chrome browser installed
  • Basic familiarity with command-line operations
  • Administrative privileges on your computer (for installing Docker and Compact)

Install the Lace Midnight Preview wallet

1. Download and install the Lace wallet extension

Lace Midnight Preview wallet is a browser extension wallet for the Midnight network. It is currently only compatible with Google Chrome.

1
Open the Google Chrome browser.
2
Install the Lace wallet extension from the Chrome Web Store: https://chromewebstore.google.com/detail/lace-beta/hgeekaiplokcnmakghbdfbgnlfheichg.
3
Click Add to Chrome and confirm by clicking Add extension.
4
Pin the extension to your toolbar for easy access (recommended).

Verification: The Lace wallet icon appears in your Chrome toolbar.

2. Create your wallet

Your wallet is protected by a seed phrase, which acts as your master key. Keep it secret and safe.

1
Click the Lace wallet icon in your toolbar.
2
Select Create a new wallet.
3
Choose a strong password.
4
Crucially: Write down your seed phrase on paper and store it in a secure, offline location. Never store it digitally or share it.
5
Confirm your seed phrase to complete the setup.

Verification: Your wallet dashboard opens, showing a 0 tDUST balance.

3. Get test tokens (tDUST)

tDUST is the token used on the Midnight Testnet. It has no real-world value and is used for testing transactions and interacting with applications.

1
In your Lace wallet, click Receive and copy your wallet address.
2
Go to the Testnet Faucet: https://midnight.network/test-faucet/.
3
Paste your address into the form and click Request tDUST.
4
Wait a few minutes for the tokens to arrive.

Verification: Your Lace wallet shows a new balance of tDUST tokens.

You are now ready to interact with DApps. To start building on Midnight, continue with these additional setup steps for the development environment.

Install Compact

4. Install Compact using the installer script

Compact is Midnight's dedicated smart contract language for creating applications (DApps) that allow developers to express the amount of data protection that works for them.

Use the following command to install the pre-built binaries:

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/midnightntwrk/compact/releases/download/compact-v0.2.0/compact-installer.sh | sh

5. Update your shell PATH

Make sure the Compact binary is in your shell's PATH to run it from any directory. Your shell needs to be updated after installation.

6. Verify the Compact installation

1
Run compact --version to print version of Compact.
2
Run which compact to print installation path.
compact --version # print version of Compact
which compact # print installation path

Verification: These commands return the Compact version number and installation path.

Set up the proof server

7. Install Docker Desktop

The proof server is required to generate zero-knowledge proofs for transactions locally. It runs as a background service using Docker.

If you don't have Docker, download and install Docker for your operating system (macOS, Windows, or Linux):

8. Run the proof server

Use the following command to start the proof-server in your terminal:

docker run -p 6300:6300 midnightnetwork/proof-server -- midnight-proof-server --network testnet

This command occupies the terminal window while running.

Verification: The terminal displays logs indicating the server is running and listening at http://localhost:6300.

note

To use a local proof-server with Lace Midnight Preview wallet, go to Settings > Midnight and select Local (http://localhost:6300).

Install Compact VS Code extension

9. Download the Compact VS Code extension

The Compact VS Code extension provides helpful syntax highlighting and code snippets.

1
Download the VSIX package from the Compact VS Code extension release page.
2
In VS Code go to Extensions, then Install from VSIX and select the extension file.

Verification: You now see Compact Language Support extension in your installed VS Code extensions.

Your development environment is now configured. You are ready to start building privacy-preserving applications on Midnight.