External dApp cannot connect to Miden Wallet extension — no public API documented
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 1
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
## External dApp cannot connect to Miden Wallet extension — no public API documented
**Context**
I am building a game dApp on Miden testnet called MidenGrid — a privacy-first game that uses Miden's client-side ZK proving and private notes as core mechanics. While integrating wallet connection, I discovered there is no working public API for external dApps to connect to the Miden Chrome wallet extension.
**What I tried**
1. `@miden-sdk/miden-wallet-adapter` — errors out with a `publicKey vs accountId` mismatch (see issue #9 in that repo)
2. Calling `window.midenWallet.connect()` directly — throws `Cannot read properties of undefined (reading 'rpcBaseURL')`
3. Inspecting `window.midenWallet` in the console:
```js
Object.keys(window.midenWallet)
// ['_events', '_eventsCount', 'address', 'publicKey', 'permission', 'appName', 'network', 'clearAccountChangeInterval']
JSON.stringify({ address: window.midenWallet.address, publicKey: window.midenWallet.publicKey, permission: window.midenWallet.permission })
// '{}'
window.midenWallet.permission
// undefined
window.midenWallet._events
// Events {} — no properties
```
The extension is injected on the page but all fields are empty and there is no active event system or permission flow. The wallet appears to be in a dormant state with no documented way to wake it up from an external dApp.
**What I need**
Clear documentation or a working example showing how an external dApp (not the official playground) should:
1. Request connection / permission from the wallet extension
2. Read the user's account address after approval
3. Read the user's MDN balance
4. Submit a transaction request and have the wallet sign it
The playground at `playground.miden.xyz` does this successfully — but it appears to use an internal integration not available to external developers.
**Why this matters**
Miden's privacy and ZK proving features are genuinely powerful and unique. There are developers who want to build real dApps on this chain. Without a working wallet connection API, the ecosystem cannot grow beyond the official playground. I am happy to test any proposed solution and contribute documentation once it works.
**Environment**
- Chrome with Miden Wallet extension installed
- Miden testnet
- React + Vite app running on localhost:5173
- Extension successfully injected (`Adding midenWallet to window` confirmed in console)
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Esamina il codice sorgente dell'estensione Miden Wallet per comprenderne l'API iniettata (`window.midenWallet`). Osserva come il playground ufficiale su playground.miden.xyz avvia la connessione e legge i dati dell'account. Documenta i metodi corretti per richiedere l'autorizzazione, recuperare l'indirizzo/il saldo e firmare le transazioni. Testa l'API documentata con una semplice dApp esterna.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, nodejs, react, typescript
- Ambito
- api, backend-api-design, documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100