> For the complete documentation index, see [llms.txt](https://docs.midnight.network/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[​](#common-tasks "Direct link to Common tasks")

[✦](https://docs.midnight.network/guides/networks-and-environments.md)

### [Connect to a network](https://docs.midnight.network/guides/networks-and-environments.md)

[Choose between the local, Preview, Preprod, and Mainnet networks, then point your DApp at the right network ID and endpoints.](https://docs.midnight.network/guides/networks-and-environments.md)

[Choose a network→](https://docs.midnight.network/guides/networks-and-environments.md)

[✦](https://docs.midnight.network/guides/acquire-tokens.md)

### [Fund a wallet](https://docs.midnight.network/guides/acquire-tokens.md)

[Get tNIGHT from the faucet and register it for DUST generation, so that your wallet can pay transaction fees.](https://docs.midnight.network/guides/acquire-tokens.md)

[Get test tokens→](https://docs.midnight.network/guides/acquire-tokens.md)

[✦](https://docs.midnight.network/guides/deploy-and-operate.md)

### [Deploy a smart contract](https://docs.midnight.network/guides/deploy-and-operate.md)

[Configure the Midnight.js providers, deploy a Compact contract to a network, observe its state, and keep it updatable.](https://docs.midnight.network/guides/deploy-and-operate.md)

[Deploy your contract→](https://docs.midnight.network/guides/deploy-and-operate.md)

[✦](https://docs.midnight.network/guides/security-best-practices.md)

### [Secure a smart contract](https://docs.midnight.network/guides/security-best-practices.md)

[Authenticate callers, validate inputs, enforce deadlines, and prevent replay attacks, with a test that proves each control.](https://docs.midnight.network/guides/security-best-practices.md)

[Secure your contract→](https://docs.midnight.network/guides/security-best-practices.md)

## All guides[​](#all-guides "Direct link to All guides")

### Set up your environment[​](#set-up-your-environment "Direct link to Set up your environment")

* [Networks and environments](https://docs.midnight.network/guides/networks-and-environments.md): choose a network, look up its endpoints, run a local network, and prepare for Mainnet.
* [Run the proof server](https://docs.midnight.network/guides/run-proof-server.md): start the proof server from Docker Desktop, for wallet users rather than DApp builders.
* [Prove locally](https://docs.midnight.network/guides/local-proving.md): run a local proof server or delegate proving to the wallet, see what a proof server receives, and learn why remote proving isn't recommended.
* [Windows Compact setup](https://docs.midnight.network/guides/windows-compact-setup.md): set up WSL, Docker Desktop, the proof server, and the Compact compiler on Windows.
* [Set up Bun for Midnight development](https://docs.midnight.network/how-to/bun-runtime-midnight.md): 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-and-pay-fees "Direct link to Fund a wallet and pay fees")

* [Fund a wallet](https://docs.midnight.network/guides/acquire-tokens.md): get tNIGHT from the faucet and register it for DUST generation, in Lace or with the wallet SDK.
* [Manage DUST](https://docs.midnight.network/guides/manage-dust.md): read DUST balances, estimate a fee, send several transactions from one wallet, and resolve DUST errors.
* [Run a wallet in Node.js](https://docs.midnight.network/guides/node-server-wallet.md): build a wallet from a seed in a Node.js process, keep its state across restarts, and deploy from a script.
* [DUST sponsorship](https://docs.midnight.network/guides/dust-sponsorship.md): pay DUST fees on behalf of your users.

### Test, deploy, and secure a smart contract[​](#test-deploy-and-secure-a-smart-contract "Direct link to Test, deploy, and secure a smart contract")

* [Build a private smart contract](https://docs.midnight.network/guides/build-a-private-smart-contract.md): keep data on-device, disclose only what is needed, then compile and test the contract locally.
* [Use Compact contracts from JavaScript](https://docs.midnight.network/guides/compact-javascript-runtime.md): implement witnesses, call circuits, and write unit tests for a compiled contract.
* [Manage private state with witnesses](https://docs.midnight.network/guides/private-state-witnesses.md): declare witnesses in Compact, implement them in TypeScript, wire up private state, and avoid common pitfalls.
* [Deploy and operate a contract](https://docs.midnight.network/guides/deploy-and-operate.md): configure the Midnight.js providers, deploy a contract, observe its state, and keep it updatable.
* [Security and best practices](https://docs.midnight.network/guides/security-best-practices.md): authenticate callers, validate inputs, enforce deadlines, and prevent replay attacks.

### Connect a wallet to a frontend[​](#connect-a-wallet-to-a-frontend "Direct link to Connect a wallet to a frontend")

* [Create a React wallet connector](https://docs.midnight.network/guides/react-wallet-connect.md): connect a React application to a Midnight wallet through the DApp Connector API.
* [Create a Next.js wallet connector](https://docs.midnight.network/guides/nextjs-wallet-connect.md): connect a Next.js application to a Midnight wallet through the DApp Connector API.
* [Build a browser DApp](https://docs.midnight.network/guides/browser-dapp.md): build the Midnight.js providers from a connected wallet, then deploy a contract, call a circuit, and read private state.

### Index contract state and build across chains[​](#index-contract-state-and-build-across-chains "Direct link to Index contract state and build across chains")

* [Index contract state with EffectStream](https://docs.midnight.network/guides/index-state-with-effectstream.md): watch a Midnight contract and serve its public state over HTTP.
* [Build a cross-chain DApp with EffectStream](https://docs.midnight.network/guides/build-cross-chain-dapp-with-effectstream.md): run a template whose state lives on Midnight and an EVM chain.
