> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

# Funding a wallet

Every transaction on Midnight consumes DUST, and DUST comes from NIGHT that you have registered for DUST generation. On the test networks both halves are free: a faucet sends you tNIGHT, and registering it starts tDUST accruing. This guide walks the whole path. You request tNIGHT from the faucet, register it in the Lace wallet, and then do the same programmatically with the wallet SDK when you need funding to be scriptable. For why the two-token model works this way, see [Funding and transaction cost](https://docs.midnight.network/guides/networks-and-environments.md#funding-and-transaction-cost).

One term matters throughout. You **register** NIGHT for DUST generation, the on-chain operation the protocol and SDK also call registration. Lace labels the button **Generate tDUST** and displays the result as your tNIGHT designation.

## Prerequisites[​](#prerequisites "Direct link to Prerequisites")

These apply to every procedure in this guide:

* A [Lace wallet](https://chromewebstore.google.com/detail/lace/gafhhkghbfjjkeiendhlofajokpaflmk) set up on the target test network, for the faucet and Lace procedures.
* Node.js version 22 or higher, for the wallet SDK procedure. macOS, Linux, and Windows through WSL all work.
* A local [proof server](https://docs.midnight.network/guides/run-proof-server.md) on port 6300, for the wallet SDK procedure.
* A Blockfrost **Midnight Preprod** project token in the `BLOCKFROST_PROJECT_ID` environment variable, for the wallet SDK procedure. Blockfrost serves the Preprod indexer and node RPC; see [Getting a Blockfrost project token](https://docs.midnight.network/guides/networks-and-environments.md#getting-a-blockfrost-project-token).
* [Vitest](https://vitest.dev/) alongside the packages listed below, if you want to run the verification tests.

<!-- -->

## Getting tNIGHT from the faucet[​](#getting-tnight-from-the-faucet "Direct link to Getting tNIGHT from the faucet")

Request free test tokens for the network you develop on. The faucets are rate limited, and test tokens carry no real value. On the local `undeployed` network there is no faucet and none is needed; use the [local network funding menu](https://docs.midnight.network/guides/networks-and-environments.md#running-a-local-network) instead.

### Procedure[​](#procedure "Direct link to Procedure")

1. Copy your **unshielded** wallet address. In Lace, open your Midnight wallet and copy the address that starts with `mn_addr_`; the faucet rejects shielded and DUST addresses.

   Bech32m address format

   Lace shows wallet addresses in Bech32m format by default. The address encodes its network, for example `mn_addr_preprod1...` on Preprod.

2. Open the faucet for your network: the [Preprod faucet](https://midnight-tmnight-preprod.nethermind.dev/) or the [Preview faucet](https://midnight-tmnight-preview.nethermind.dev/). The [Environment reference](https://docs.midnight.network/guides/networks-and-environments.md#environment-reference) lists both.

   ![Midnight preprod faucet](/assets/images/request-tokens-aa0c9462e1c87550aa3766ef7a695a60.png)

3. Paste the address, complete the captcha, and select **Request tokens**. The faucet confirms the submission:

   ```
   Transaction submitted. You will shortly receive 5000 tNight in your wallet. This is the transaction ID: 00f15defb8d3...
   ```

### Verification[​](#verification "Direct link to Verification")

The tNIGHT balance appears in your wallet within a couple of minutes: 5,000 tNIGHT per faucet request. In Lace, the unshielded balance updates on the wallet's main view. In code, the balance watcher in [Registering NIGHT for DUST generation with the wallet SDK](#registering-night-for-dust-generation-with-the-wallet-sdk) resolves as soon as the funds land.

<!-- -->

## Registering NIGHT for DUST generation in Lace[​](#registering-night-for-dust-generation-in-lace "Direct link to Registering NIGHT for DUST generation in Lace")

Turn your tNIGHT into a source of tDUST. Holding NIGHT alone generates nothing; the registration transaction is what starts generation.

**Generate tDUST** registers tNIGHT on the test networks only. To register NIGHT held on Cardano (cNIGHT), see [Registering cNIGHT for DUST on Mainnet](https://docs.midnight.network/guides/manage-dust.md#registering-cnight-for-dust-on-mainnet).

### Prerequisites[​](#prerequisites-1 "Direct link to Prerequisites")

* tNIGHT in your wallet, from [Getting tNIGHT from the faucet](#getting-tnight-from-the-faucet).

### Procedure[​](#procedure-1 "Direct link to Procedure")

1. In Lace, open your Midnight wallet and select **Generate tDUST**.

   ![The Lace wallet tokens view with the Generate tDUST button](/assets/images/delegate-dust-cfbb546850772c93f4842fec07a43aee.png)

2. Your tDUST address populates the input field. Select **Review transaction**, then **Confirm** to submit the registration.

   ![The Generate tDUST dialog with the address filled in and the Review transaction button](/assets/images/review-transaction-143f8b80120309ee4fd00d69cf107768.png)

### Verification[​](#verification-1 "Direct link to Verification")

The tDUST tank starts filling and continues to accrue over time, up to a cap set by how much NIGHT you registered.

![The Lace tDUST tank generating tokens after registration](/assets/images/dust-tank-generation-bb9bbdc163af9bf787d5621e6588d112.png)

<!-- -->

## Setting up the wallet SDK project[​](#setting-up-the-wallet-sdk-project "Direct link to Setting up the wallet SDK project")

Prepare a TypeScript project that can talk to a Midnight network, so the wallet code in the next two procedures has somewhere to run. The three procedures that follow build up a single script, one part at a time.

The wallet SDK ships as the single barrel package `@midnightntwrk/wallet-sdk`, which re-exports every wallet sub-package. That scope has no hyphen, unlike the `@midnight-ntwrk/` packages alongside it.

### Procedure[​](#procedure-2 "Direct link to Procedure")

1. Create a project and install the version-matched dependencies. Check the [support matrix](https://docs.midnight.network/relnotes/support-matrix.md) when versions change:

   package.json

   ```
   {

     "type": "module",

     "scripts": {

       "start": "tsx src/index.ts"

     },

     "dependencies": {

       "@midnight-ntwrk/midnight-js-protocol": "5.0.1",

       "@midnightntwrk/wallet-sdk": "2.0.1",

       "rxjs": "^7.8.1",

       "ws": "^8.19.0"

     },

     "devDependencies": {

       "@types/ws": "^8.18.1",

       "tsx": "^4.19.0"

     }

   }
   ```

   Then run `npm install`.

2. Start your local [proof server](https://docs.midnight.network/guides/run-proof-server.md) and confirm it answers on port 6300:

   ```
   curl http://localhost:6300/health
   ```

3. Create `src/index.ts` and add the imports and configuration. The script assigns the `ws` package as the global WebSocket before any wallet code runs, which keeps WebSocket behavior consistent across Node versions. The endpoints come from the [Environment reference](https://docs.midnight.network/guides/networks-and-environments.md#environment-reference), and the script reads your Blockfrost token from `BLOCKFROST_PROJECT_ID` and appends it to each one:

   ```
   import { WebSocket } from 'ws';

   (globalThis as any).WebSocket = WebSocket;



   import { Buffer } from 'buffer';

   import * as Rx from 'rxjs';

   import {

     WalletSeeds,

     generateRandomSeed,

     WalletFacade,

     ShieldedWallet,

     DustWallet,

     UnshieldedWallet,

     createKeystore,

     PublicKey,

     InMemoryTransactionHistoryStorage,

     WalletEntrySchema,

     mergeWalletEntries,

     DustAddress,

     MidnightBech32m,

   } from '@midnightntwrk/wallet-sdk';

   import { unshieldedToken } from '@midnight-ntwrk/midnight-js-protocol/v9';



   const networkId = 'preprod';



   // The Preprod indexer and node RPC are served by Blockfrost and need a project token.

   const projectId = process.env.BLOCKFROST_PROJECT_ID?.trim();

   if (!projectId) throw new Error('BLOCKFROST_PROJECT_ID is not set.');

   const withBlockfrostKey = (url: string) => `${url}?project_id=${encodeURIComponent(projectId)}`;



   const CONFIG = {

     indexerHttpUrl: withBlockfrostKey('https://midnight-preprod.blockfrost.io/api/v0'),

     indexerWsUrl: withBlockfrostKey('wss://midnight-preprod.blockfrost.io/api/v0/ws'),

     node: withBlockfrostKey('https://rpc.midnight-preprod.blockfrost.io'),

     proofServer: 'http://localhost:6300',

   };
   ```

### Verification[​](#verification-2 "Direct link to Verification")

The proof server answers its health check, which is the one external dependency this project needs beyond the public endpoints:

```
curl http://localhost:6300/health
```

```
{"status":"ok","timestamp":"2026-08-07 11:29:05.352783759 +00:00:00"}
```

<!-- -->

## Building a wallet from a seed[​](#building-a-wallet-from-a-seed "Direct link to Building a wallet from a seed")

Turn a seed into a running wallet. Midnight wallets are three sub-wallets, shielded, unshielded, and DUST, derived from one seed and unified behind a `WalletFacade`, and the facade is what the registration procedure acts on.

### Prerequisites[​](#prerequisites-2 "Direct link to Prerequisites")

* The project from [Setting up the wallet SDK project](#setting-up-the-wallet-sdk-project).

### Procedure[​](#procedure-3 "Direct link to Procedure")

1. Derive the three wallets' seeds from one master seed. `WalletSeeds.fromMasterSeed` derives the shielded, unshielded, and DUST seeds by hierarchical deterministic derivation. Read the master seed from the environment so re-runs reuse the same wallet, and generate one only on the first run:

   Save the seed

   The seed is the only way to restore the wallet. A script that generates a fresh seed on every run creates a new, empty wallet each time and strands the funds in the previous one.

   ```
   const seed = process.env.WALLET_SEED ?? Buffer.from(generateRandomSeed()).toString('hex');

   if (!process.env.WALLET_SEED) {

     console.log(`New wallet seed, save this and set WALLET_SEED to reuse it: ${seed}`);

   }



   const seeds = WalletSeeds.fromMasterSeed(Buffer.from(seed, 'hex'));
   ```

2. Build the three sub-wallets from one configuration, each started from its own seed, and unify them behind the `WalletFacade`. The unshielded wallet starts from the public key of a keystore made from its seed, and the keystore signs for it. The DUST wallet requires `costParameters`: `feeBlocksMargin` sets how many blocks of finalization the fee estimate allows for, and `additionalFeeOverhead` is an optional amount that the wallet adds to every fee it declares, which defaults to `0n` if you omit it. A DUST spend has no refund, so the wallet spends the whole declared fee, overhead included:

   ```
   const unshieldedKeystore = createKeystore({ kind: 'schnorr', secret: seeds.unshielded }, networkId);



   const configuration = {

     networkId,

     indexerClientConnection: {

       indexerHttpUrl: CONFIG.indexerHttpUrl,

       indexerWsUrl: CONFIG.indexerWsUrl,

     },

     provingServerUrl: new URL(CONFIG.proofServer),

     relayURL: new URL(CONFIG.node.replace(/^http/, 'ws')),

     txHistoryStorage: new InMemoryTransactionHistoryStorage(WalletEntrySchema, mergeWalletEntries),

     costParameters: {

       // Optional amount added to every fee the wallet declares. A DUST spend does not return it. Defaults to 0n.

       additionalFeeOverhead: 300_000_000_000_000n, // 0.3 DUST

       // Blocks to allow for finalization when estimating the fee.

       feeBlocksMargin: 5,

     },

   };



   const wallet = await WalletFacade.init({

     configuration,

     shielded: (config) => ShieldedWallet(config).startWithSeed(seeds.shielded),

     unshielded: (config) => UnshieldedWallet(config).startWithPublicKey(PublicKey.fromKeyStore(unshieldedKeystore)),

     dust: (config) => DustWallet(config).startWithSeed(seeds.dust),

   });

   await wallet.start(seeds);
   ```

### Verification[​](#verification-3 "Direct link to Verification")

Key derivation is deterministic, the addresses carry the network's prefixes, and the facade connects all three sub-wallets to Preprod. The connectivity test distinguishes connected from synced on purpose: a wallet connects in seconds and finishes syncing much later.

wallet-construction.test.ts

```
import { describe, it, expect, afterAll } from 'vitest';

import { WebSocket } from 'ws';

(globalThis as any).WebSocket = WebSocket;

import { Buffer } from 'buffer';

import * as Rx from 'rxjs';

import {

  WalletSeeds,

  generateRandomSeed,

  WalletFacade,

  ShieldedWallet,

  DustWallet,

  UnshieldedWallet,

  createKeystore,

  PublicKey,

  InMemoryTransactionHistoryStorage,

  WalletEntrySchema,

  mergeWalletEntries,

  DustAddress,

  MidnightBech32m,

} from '@midnightntwrk/wallet-sdk';



const networkId = 'preprod';



// The Preprod indexer and node RPC are served by Blockfrost and need a project token.

const projectId = process.env.BLOCKFROST_PROJECT_ID?.trim();

if (!projectId) throw new Error('BLOCKFROST_PROJECT_ID is not set.');

const withBlockfrostKey = (url: string) => `${url}?project_id=${encodeURIComponent(projectId)}`;



const CONFIG = {

  indexerHttpUrl: withBlockfrostKey('https://midnight-preprod.blockfrost.io/api/v0'),

  indexerWsUrl: withBlockfrostKey('wss://midnight-preprod.blockfrost.io/api/v0/ws'),

  node: withBlockfrostKey('https://rpc.midnight-preprod.blockfrost.io'),

  proofServer: 'http://localhost:6300',

};



const seedsOf = (seed: string) => WalletSeeds.fromMasterSeed(Buffer.from(seed, 'hex'));

const newSeed = () => Buffer.from(generateRandomSeed()).toString('hex');



let wallet: WalletFacade | undefined;



afterAll(async () => {

  if (wallet) await wallet.stop();

});



describe('building a funding wallet', () => {

  it('derives the three wallet seeds deterministically from one master seed', () => {

    const seed = newSeed();

    const first = seedsOf(seed);

    const second = seedsOf(seed);

    expect(Buffer.from(first.shielded)).toEqual(Buffer.from(second.shielded));

    expect(Buffer.from(first.unshielded)).toEqual(Buffer.from(second.unshielded));

    expect(Buffer.from(first.dust)).toEqual(Buffer.from(second.dust));

  });



  it('encodes a preprod unshielded address with the mn_addr_preprod prefix', () => {

    const keystore = createKeystore({ kind: 'schnorr', secret: seedsOf(newSeed()).unshielded }, networkId);

    expect(String(keystore.getBech32Address())).toMatch(/^mn_addr_preprod1/);

  });



  it('builds the wallet facade and connects all three wallets to preprod', { timeout: 120_000 }, async () => {

    const seeds = seedsOf(newSeed());

    const unshieldedKeystore = createKeystore({ kind: 'schnorr', secret: seeds.unshielded }, networkId);



    const configuration = {

      networkId,

      indexerClientConnection: {

        indexerHttpUrl: CONFIG.indexerHttpUrl,

        indexerWsUrl: CONFIG.indexerWsUrl,

      },

      provingServerUrl: new URL(CONFIG.proofServer),

      relayURL: new URL(CONFIG.node.replace(/^http/, 'ws')),

      txHistoryStorage: new InMemoryTransactionHistoryStorage(WalletEntrySchema, mergeWalletEntries),

      costParameters: { additionalFeeOverhead: 300_000_000_000_000n, feeBlocksMargin: 5 },

    };



    wallet = await WalletFacade.init({

      configuration,

      shielded: (config) => ShieldedWallet(config).startWithSeed(seeds.shielded),

      unshielded: (config) => UnshieldedWallet(config).startWithPublicKey(PublicKey.fromKeyStore(unshieldedKeystore)),

      dust: (config) => DustWallet(config).startWithSeed(seeds.dust),

    });

    await wallet.start(seeds);



    const connected = await Rx.firstValueFrom(

      wallet.state().pipe(

        Rx.filter(

          (s) => s.shielded.progress.isConnected && s.unshielded.progress.isConnected && s.dust.progress.isConnected,

        ),

      ),

    );

    expect(connected.isSynced).toBe(false);

    expect(connected.dust.balance(new Date())).toBe(0n);



    const dustAddress = DustAddress.encodePublicKey(networkId, connected.dust.publicKey);

    expect(String(dustAddress)).toMatch(/^mn_dust_preprod1/);

    expect(MidnightBech32m.parse(String(dustAddress)).decode(DustAddress, networkId)).toBeDefined();

  });

});
```

```
 ✓ wallet-construction.test.ts > building a funding wallet > derives the three wallet seeds deterministically from one master seed

 ✓ wallet-construction.test.ts > building a funding wallet > encodes a preprod unshielded address with the mn_addr_preprod prefix

 ✓ wallet-construction.test.ts > building a funding wallet > builds the wallet facade and connects all three wallets to preprod



 Test Files  1 passed (1)

      Tests  3 passed (3)
```

<!-- -->

## Registering NIGHT for DUST generation with the wallet SDK[​](#registering-night-for-dust-generation-with-the-wallet-sdk "Direct link to Registering NIGHT for DUST generation with the wallet SDK")

Do from code what the Lace procedure does through the UI: fund the wallet, register its NIGHT UTXOs for DUST generation, and watch DUST accrue. This is the part worth scripting, because it is what CI and provisioning jobs need.

### Prerequisites[​](#prerequisites-3 "Direct link to Prerequisites")

* A running wallet from [Building a wallet from a seed](#building-a-wallet-from-a-seed).

### Procedure[​](#procedure-4 "Direct link to Procedure")

1. Print the unshielded address, fund it from the [faucet](#getting-tnight-from-the-faucet), and watch for the funds. Balances stream in while the wallet is still syncing, and a balance only ever counts UTXOs from block-confirmed transactions, so a positive balance on a newly funded wallet means the tokens have arrived even though sync is still running.

   Balances arrive as `bigint` values in the smallest denomination. NIGHT divides into 106 STAR, so the faucet's 5,000 tNIGHT reads as `5000000000`. DUST divides into 1015 SPECK. Convert before displaying:

   ```
   const formatNight = (raw: bigint) =>

     `${raw / 1_000_000n}.${(raw % 1_000_000n).toString().padStart(6, '0')}`;



   const formatDust = (raw: bigint) =>

     `${raw / 1_000_000_000_000_000n}.${(raw % 1_000_000_000_000_000n).toString().padStart(15, '0')}`;



   console.log(`Send tNIGHT to: ${unshieldedKeystore.getBech32Address()}`);



   const nightBalance = await Rx.firstValueFrom(

     wallet.state().pipe(

       Rx.throttleTime(10_000),

       Rx.map((state) => state.unshielded.balances[unshieldedToken().raw] ?? 0n),

       Rx.filter((balance) => balance > 0n),

     ),

   );

   console.log(`tNIGHT received: ${formatNight(nightBalance)}`);
   ```

2. Wait for the wallet to sync, then register the unregistered NIGHT UTXOs for DUST generation. Registration needs a fully synced wallet, so `waitForSyncedState` gates this step; keep the process running, because a restarted script syncs again from the beginning. On Preprod, a new wallet's first sync can take a few hours. A first registration pays its own fee from the DUST that the NIGHT would have generated since it arrived. `estimateRegistration` returns the amount to reach, and `waitForGeneratedDust` waits until a UTXO has generated it. Without the wait, a registration built too soon after the funds arrive throws before the wallet signs anything. [Registration rules](https://docs.midnight.network/guides/manage-dust.md#registration-rules) covers a UTXO that is too small or too new. The registration is built as a recipe, signed by the unshielded keystore, finalized, and submitted. To direct the generated DUST to a different wallet, decode that wallet's DUST address as the receiver instead:

   ```
   const state = await wallet.waitForSyncedState();



   const unregistered = state.unshielded.availableCoins.filter(

     (coin) => coin.meta?.registeredForDustGeneration !== true,

   );



   if (unregistered.length === 0) {

     console.log('All NIGHT is already registered for DUST generation.');

   } else {

     // Send the DUST elsewhere by replacing this with another wallet's address.

     const target = String(DustAddress.encodePublicKey(networkId, state.dust.publicKey));

     const dustReceiver = MidnightBech32m.parse(target).decode(DustAddress, networkId);



     // Wait until the NIGHT has generated enough DUST to pay the registration's own fee.

     const { fee } = await wallet.estimateRegistration(unregistered);

     await wallet.waitForGeneratedDust(unregistered, fee);



     const recipe = await wallet.registerNightUtxosForDustGeneration(

       unregistered,

       unshieldedKeystore.getPublicKey(),

       async (payload) => unshieldedKeystore.signData(payload),

       dustReceiver,

     );

     const finalized = await wallet.finalizeRecipe(recipe);

     await wallet.submitTransaction(finalized);

   }
   ```

   `MidnightBech32m.parse(...).decode(DustAddress, ...)` is also the validation step: it throws on anything that is not a DUST address for the current network, so a shielded or unshielded address pasted by mistake fails here rather than producing a registration that sends DUST nowhere useful.

3. Watch the DUST balance become positive. Generation begins once the registration transaction lands on-chain:

   ```
   await Rx.firstValueFrom(

     wallet.state().pipe(

       Rx.throttleTime(5_000),

       Rx.filter((s) => s.isSynced),

       Rx.filter((s) => s.dust.balance(new Date()) > 0n),

     ),

   );

   const dustBalance = (await Rx.firstValueFrom(wallet.state())).dust.balance(new Date());

   console.log(`DUST balance: ${formatDust(dustBalance)}`);

   await wallet.stop();
   ```

   DUST accrues continuously, so this balance grows between checks until it reaches the cap your registered NIGHT sets.

### Verification[​](#verification-4 "Direct link to Verification")

A saved seed restores the same wallet, the denominations convert as expected, and a mistyped receiver fails before it can be registered. The assertions below come from a second test file that shares the imports, the `networkId` constant, the `seedsOf` and `newSeed` helpers, and the two formatters shown earlier in this guide:

funding-helpers.test.ts

```
describe('restored capabilities', () => {

  it('restores the same wallet from a saved seed', () => {

    const seed = newSeed();

    const addrOf = (s: string) =>

      String(createKeystore({ kind: 'schnorr', secret: seedsOf(s).unshielded }, networkId).getBech32Address());

    expect(addrOf(seed)).toBe(addrOf(seed));

    expect(addrOf(seed)).not.toBe(addrOf(newSeed()));

  });



  it('formats the faucet amount in NIGHT and DUST denominations', () => {

    expect(formatNight(5000000000n)).toBe('5000.000000');

    expect(formatDust(405083000000n)).toBe('0.000405083000000');

  });



  it('rejects a non-DUST address when decoding a DUST receiver', () => {

    const keystore = createKeystore({ kind: 'schnorr', secret: seedsOf(newSeed()).unshielded }, networkId);

    const unshielded = String(keystore.getBech32Address());

    expect(unshielded).toMatch(/^mn_addr_preprod1/);

    expect(() => MidnightBech32m.parse(unshielded).decode(DustAddress, networkId)).toThrow();

  });

});
```

```
 ✓ funding-helpers.test.ts > restored capabilities > restores the same wallet from a saved seed

 ✓ funding-helpers.test.ts > restored capabilities > formats the faucet amount in NIGHT and DUST denominations

 ✓ funding-helpers.test.ts > restored capabilities > rejects a non-DUST address when decoding a DUST receiver



 Test Files  1 passed (1)

      Tests  3 passed (3)
```

Running the full procedure against Preprod carries this through to a submitted registration and on to a DUST balance. Re-running it against the same wallet prints the following, with the registration already in place from the first run. The wallet in this run holds 1,000 tNIGHT; a wallet funded by one faucet request shows `5000.000000`:

```
Send tNIGHT to: mn_addr_preprod1857k0p0nmd7g6788h6pr30lkdncg8zt097eq8cl57tx78gwhqlsqnr8r65

tNIGHT received: 1000.000000

All NIGHT is already registered for DUST generation.

DUST balance: 2485.035398999999999
```

DUST accrues continuously toward the cap that your registered NIGHT sets, so this balance grows between runs. Watch it with the balance check in the final step, or in Lace's tDUST tank.

<!-- -->

## Funding troubleshooting[​](#funding-troubleshooting "Direct link to Funding troubleshooting")

The failure modes readers hit most often on the funding path, and their fixes.

| Symptom                                                                                               | Fix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Faucet says `Provided address is invalid`                                                             | Use the **unshielded** address (`mn_addr_...`) with no surrounding whitespace. The faucet rejects shielded and DUST addresses.                                                                                                                                                                                                                                                                                                                                                                                               |
| Faucet says `rate_limit_error` or `Reached maximum number of requests`                                | Wait a few hours and retry. If it persists, open a ticket at the [Midnight Service Desk](https://midnightntwrk.github.io/servicedesk/) or ask in [Discord](https://discord.gg/midnightnetwork).                                                                                                                                                                                                                                                                                                                              |
| `Cannot find module` when running the script                                                          | Run `npm install` first. If it persists, delete `node_modules` and `package-lock.json`, then reinstall.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `BLOCKFROST_PROJECT_ID is not set.`, or HTTP `403` errors while the wallet syncs                      | Set `BLOCKFROST_PROJECT_ID` to the project ID of a **Midnight Preprod** project on Blockfrost. A Mainnet project's token gets `403` on Preprod. See [Migrating from the Midnight-hosted endpoints](https://docs.midnight.network/guides/networks-and-environments.md#migrating-from-the-midnight-hosted-mainnet-endpoints) for each `403` message.                                                                                                                                                                           |
| Connection refused on port 6300                                                                       | The proof server is not running; see [Run the proof server](https://docs.midnight.network/guides/run-proof-server.md).                                                                                                                                                                                                                                                                                                                                                                                                       |
| `Wallet.Sync: [object Object]` printed repeatedly to `stderr` while the script waits in step 2        | On Preprod, a new wallet's first sync replays the DUST events from before ledger 9 and can take a few hours: in testing, a new wallet took about three and a half hours from start to its first DUST balance ([servicedesk#319](https://github.com/midnightntwrk/servicedesk/issues/319)). The wallet usually retries on its own, so keep the script running. If the line keeps appearing on another network, see [Managing DUST troubleshooting](https://docs.midnight.network/guides/manage-dust.md#dust-troubleshooting). |
| Balance stays zero after the faucet confirms                                                          | Give it a couple of minutes; the wallet detects funds after its next sync. Confirm the address you pasted matches the printed one exactly.                                                                                                                                                                                                                                                                                                                                                                                   |
| DUST stays zero after registration                                                                    | Give the registration time to land on-chain, then confirm the proof server answers on `http://localhost:6300/health`.                                                                                                                                                                                                                                                                                                                                                                                                        |
| `Expected type dust, got addr` or `Expected type dust, got shield-addr` when directing DUST elsewhere | DUST addresses start with `mn_dust_` plus the network name; shielded (`mn_shield-addr_...`) and unshielded (`mn_addr_...`) addresses are different types. A DUST address for another network fails with `Expected preprod address, got preview one`.                                                                                                                                                                                                                                                                         |

## Additional resources[​](#additional-resources "Direct link to Additional resources")

* [Managing DUST for transaction fees](https://docs.midnight.network/guides/manage-dust.md): reading DUST parameters and balances, estimating fees, and sending several transactions once the wallet has DUST.
* [Funding and transaction cost](https://docs.midnight.network/guides/networks-and-environments.md#funding-and-transaction-cost): why NIGHT generates DUST and what transactions consume.
* [Environment reference](https://docs.midnight.network/guides/networks-and-environments.md#environment-reference): faucets and endpoints per network.
* [Run the proof server](https://docs.midnight.network/guides/run-proof-server.md): the local proof server the SDK path depends on.
* [Wallet developer guide](https://docs.midnight.network/sdks/official/wallet-developer-guide.md): the full wallet SDK surface behind the facade.
* [Support matrix](https://docs.midnight.network/relnotes/support-matrix.md): which wallet SDK versions pair with which network components.
* [Tokens on Midnight](https://docs.midnight.network/tokens/overview.md): the NIGHT and DUST model in depth.
