> ## Documentation Index
> Fetch the complete documentation index at: https://scaffoldstacks.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Local devnet

> Run a full Stacks blockchain locally with optional auto-deploy

Run a complete Bitcoin and Stacks development environment locally with Docker.

## Contents

* [Requirements](#requirements)
* [Start devnet](#start-devnet)
* [Auto-deploy](#auto-deploy)
* [Pre-funded accounts](#pre-funded-accounts)
* [Development workflow](#development-workflow)
* [Stop devnet](#stop-devnet)
* [When to use devnet](#when-to-use-devnet)
* [Limitations](#limitations)

## Requirements

| Requirement    | Notes                 |
| -------------- | --------------------- |
| Docker Desktop | Installed and running |
| Clarinet       | 3.21+                 |
| RAM            | 8 GB+ recommended     |

Verify with:

```bash theme={null}
stacksdapp doctor
```

## Start devnet

```bash theme={null}
stacksdapp dev
```

This starts:

* Bitcoin node
* Stacks node
* Frontend at `http://localhost:3000`
* File watcher for auto-regeneration
* Chain health monitoring (prefixed `[dev]` logs)

Deploy contracts in a second terminal once the node is ready (\~30s):

```bash theme={null}
stacksdapp deploy --network devnet
```

## Auto-deploy

Deploy once the local chain is healthy. No second terminal required.

```bash theme={null}
stacksdapp dev --auto-deploy
```

The supervisor waits for the devnet node, then runs deploy automatically.

## Pre-funded accounts

Devnet includes pre-funded accounts in `contracts/settings/Devnet.toml`:

```toml theme={null}
[accounts.deployer]
mnemonic = "twice kind fence tip hidden tilt action fragile skin nothing glory cousin green tomorrow spring wrist shed math olympic multiply hip blue scout claw"
balance = 100000000000000

[accounts.wallet_1]
mnemonic = "sell invite acquire kitten bamboo drastic jelly vivid peace spawn twice guilt pave pen praise pork crisp unite giggle laundry steel scout cycle marry"
balance = 100000000000000
```

<Warning>
  These are public burner mnemonics for local use only. The CLI prints a safety warning. Never reuse them on testnet or mainnet, and never commit real deployer seeds.
</Warning>

No real STX or external wallet is required for basic debug UI flows on devnet.

## Development workflow

* Edit `.clar` files. Bindings regenerate automatically.
* ABI cache in `contracts/.cache/` skips unchanged work.
* Deploy with `--auto-deploy` or `stacksdapp deploy --network devnet`.
* Test with pre-funded accounts.

## Stop devnet

```bash theme={null}
stacksdapp clean
```

Stops services and removes generated and devnet state.

## When to use devnet

* Complex multi-contract interactions
* Bitcoin-specific features (sBTC, block data)
* Offline development
* Full stack simulation

## Limitations

* Slower than testnet (Docker overhead)
* No real economic incentives
* Limited to local machine
