Skip to main content
Midnight is a privacy-focused chain. Unlike most chains, a functional Midnight wallet is not a single address — it exposes three distinct surfaces: NIGHT exists as both a shielded and an unshielded asset — they are different token types in different pools, not the same balance shown twice.
This page covers Midnight wallets connected through an injected browser extension (the 1am wallet). For embedded Midnight wallets created via social or email login, see Using Midnight embedded wallets.

Enabling Midnight

1

Enable Midnight in the dashboard

Enable Midnight under Chains & Networks.
2

Install the connector

3

Add the connector to DynamicContextProvider

React

Checking if a Wallet is a Midnight Wallet

React

Retrieving the Address Surfaces

The unshielded address is the wallet’s main address. The shielded and DUST addresses are exposed through additionalAddresses, keyed by WalletAddressType.
React
Deposits go to either the unshielded or shielded address depending on which pool the sender is paying into — surface both in your deposit UI. DUST is generated, not deposited to.
If you need the cryptographic public keys for the shielded surface (coin and encryption keys required by some dApps), read them from the connector:
React

Reading Balances

getFormattedBalances() returns display-ready strings for all three surfaces in one call:
React
Individual getters are also available:
React
For raw, per-token amounts (a pool can hold more than just NIGHT), use getBalances(), which returns { shielded, unshielded, dust } keyed by token type:
React

Sending

sendBalance routes to the correct pool automatically based on the recipient address prefix (mn_shield... = shielded, otherwise unshielded). Cross-pool transfers are not supported — sender and recipient must be in the same pool.
React

Ownership Boundaries

When integrating, it helps to know who owns what:
  • Dynamic — connection lifecycle, the MidnightWalletConnectors, the MidnightWallet object, address/balance accessors, and send routing.
  • 1am wallet (extension) — key custody, address derivation, proving, message signing, and transaction submission. Dynamic talks to it through the official @midnight-ntwrk/dapp-connector-api.
  • Your app — the deposit/receive UX (surface unshielded and shielded), which pool to display, and how you present DUST generation.

Resources

Last modified on June 29, 2026