For the complete documentation index, see llms.txt
Guides
Find the guide for the task in front of you, from choosing a network to deploying a smart contract. Start with one of the common tasks below, or pick a guide from the full list.
Common tasks
Connect to a network
Choose between the local, Preview, Preprod, and Mainnet networks, then point your DApp at the right network ID and endpoints.
Fund a wallet
Get tNIGHT from the faucet and register it for DUST generation, so that your wallet can pay transaction fees.
Deploy a smart contract
Configure the Midnight.js providers, deploy a Compact contract to a network, observe its state, and keep it updatable.
Secure a smart contract
Authenticate callers, validate inputs, enforce deadlines, and prevent replay attacks, with a test that proves each control.
All guides
Set up your environment
- Networks and environments: choose a network, look up its endpoints, run a local network, and prepare for Mainnet.
- Run the proof server: start the proof server from Docker Desktop, for wallet users rather than DApp builders.
- Prove transactions locally: learn why proving runs on your machine, then run a proof server and connect your DApp to it.
- Windows Compact setup: set up WSL, Docker Desktop, the proof server, and the Compact compiler on Windows.
- Set up Bun for Midnight development: install Bun and the Compact compiler, then compile a contract and use it from a Bun application.
Fund a wallet and pay fees
- Fund a wallet: get tNIGHT from the faucet and register it for DUST generation, in Lace or with the wallet SDK.
- Manage DUST: read DUST balances, estimate a fee, send several transactions from one wallet, and resolve DUST errors.
- DUST sponsorship: pay DUST fees on behalf of your users.
Test, deploy, and secure a smart contract
- Use Compact contracts from JavaScript: implement witnesses, call circuits, and write unit tests for a compiled contract.
- Deploy and operate a contract: configure the Midnight.js providers, deploy a contract, observe its state, and keep it updatable.
- Security and best practices: authenticate callers, validate inputs, enforce deadlines, and prevent replay attacks.
Connect a wallet to a frontend
- Create a React wallet connector: connect a React application to a Midnight wallet through the DApp Connector API.
- Create a Next.js wallet connector: connect a Next.js application to a Midnight wallet through the DApp Connector API.
Index contract state and build across chains
- Index contract state with EffectStream: watch a Midnight contract and serve its public state over HTTP.
- Build a cross-chain DApp with EffectStream: run a template whose state lives on Midnight and an EVM chain.