midnight-dapp:wallet-integration

Connect Lace wallet to Midnight DApps via enable() and state() APIs.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/aaronbassett/midnight-knowledgebase --skill midnight-dapp-wallet-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: midnight-dapp:wallet-integration
Source: https://github.com/aaronbassett/midnight-knowledgebase/tree/main/plugins/midnight-dapp/skills/wallet-integration
Command: npx skills add https://github.com/aaronbassett/midnight-knowledgebase --skill midnight-dapp-wallet-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Developers need a reliable way to connect the Lace wallet to Midnight DApps, manage multiple user accounts, switch between testnet and mainnet, troubleshoot wallet integration issues, and migrate patterns from MetaMask/Web3.

Core Features & Use Cases

  • Wallet connection: Establish user authentication by enabling the Lace wallet and retrieving the wallet state (address, coinPublicKey, encryptionPublicKey) via the enable() and state() APIs.
  • Network awareness: Read service URIs to determine current network (testnet vs mainnet) and adapt UI and flows.
  • Account management: Detect account changes (and future multi-account support) to reflect the active address.
  • Migration guidance: Provide a clear path for migrating from MetaMask/Web3 patterns to Lace connectors.

Quick Start

Connect Lace to your DApp by calling enable() on the Lace wallet API and then reading state() to access the wallet address and keys.

Frequently Asked Questions about midnight-dapp:wallet-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a Lace wallet to a Midnight DApp for user authentication?

To connect a Lace wallet for DApp authentication, call the enable() API on the wallet extension and retrieve the wallet state via state(), which returns the Bech32m address, coinPublicKey, and encryptionPublicKey for session validation.

How do I detect the current network when connecting a Lace wallet?

Detect the active network by calling serviceUriConfig() after enabling the wallet to obtain network URIs, allowing your DApp to determine whether it is operating on testnet or mainnet and adapt its UI flows accordingly.

How do I migrate from MetaMask Web3 patterns to a Lace wallet connector?

Migrating from MetaMask Web3 patterns to a Lace connector involves replacing Ethereum request patterns with Lace's enable() and state() APIs to fetch Bech32m addresses and manage DApp authentication natively.

Does Lace wallet integration support multi-account management and switching?

Lace wallet integration currently detects active account changes to reflect the active address, with structured migration guidance and architecture provided for handling upcoming multi-account support within DApps.

What wallet state data is available when connecting a Lace wallet to a DApp?

Connecting a Lace wallet exposes the wallet state containing the user's Bech32m address, coinPublicKey, and encryptionPublicKey, which are necessary for establishing authenticated sessions and signing operations.