Skip to main content
Version: Canary 🚧

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​

This section walks you through the process of installing the Lace Midnight Preview wallet, creating a new wallet, and getting test tokens.

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.

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.
warning

Write down your seed phrase on paper and store it in a secure, offline location. Never store it digitally or share it.

4
Confirm your seed phrase to complete the setup.

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

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​

This section walks you through the process of installing the Compact compiler and setting a default compiler version.

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

Update your shell PATH​

Make sure the Compact binary is in your shell's PATH to run it from any directory. This is done automatically by the installer script. If you want to manually add the binary to your PATH, run the following command:

export PATH="$HOME/.compact/bin:$PATH"

After that, reload your shell configuration to apply the changes:

source ~/.zshrc # or source ~/.bashrc

Update the compiler version​

Update the compiler version to the latest version:

compact update

This will download the latest version of the Compact compiler and set it as the default version.

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​

This section walks you through the process of installing Docker Desktop and running the proof server.

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):

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 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.

Troubleshoot​

This section covers some of the issues you'll likely encounter when installing the development environment and how to resolve them.

Compact binary not found​

If you get the following error:

compact: command not found

This means the Compact binary is not in your PATH. Follow the instructions in Update your shell PATH to add it to your PATH.