0xMiden / 0xMiden/wallet-adapter
Auto-consumed private note cannot be verified by organizer via nullifier RPC
- Langage dominant
- TypeScript
- Étoiles
- 2
- Forks
- 9
- Merge moyen
- 25 min
- PR mergées (30 j)
- 1
Description
### Packages versions
@miden-sdk/miden-sdk: 0.15.4
@miden-sdk/react: 0.15.4
@miden-sdk/vite-plugin: 0.15.4
@miden-sdk/miden-wallet-adapter-base: 0.15.1
@miden-sdk/miden-wallet-adapter-react: 0.15.1
Network: testnet
Wallet: Miden Wallet browser extension
App: React + Vite dApp
### Bug description
Recipient wallet showing confirmed/received:
Organizer dashboard still pending:
Diagnostics table:
I am building a dApp and one is the things it does is that it sends private reward notes from an organizer wallet to a recipient wallet.
The private note is received by the recipient wallet and auto-consumed successfully, but the organizer dApp cannot verify consumption from the original note data.
The organizer app stores the output note returned by waitForTransaction(), verifies that the stored note ID matches the note ID computed from the stored note bytes, computes the note nullifier, and calls:
rpcClient.getNullifierCommitHeight(note.nullifier(), latestBlockNumber)
Even after the recipient wallet shows the reward as received/auto-consumed successfully, the nullifier commit height remains undefined.
I expected the organizer dApp to have a reliable way to verify that the private reward note was consumed, ideally by checking that the note nullifier was committed.
### How can this be reproduced?
1. Connect an organizer wallet on testnet.
2. Send a private reward note using requestSend() with:
- noteType: "private"
- recipient wallet address
- faucet ID
- amount
3. Wait for the send transaction using waitForTransaction().
4. Store the output note whose asset faucet ID and raw amount match the reward.
5. Confirm the stored note ID matches the computed note ID from the stored note bytes.
6. Let the recipient wallet receive and auto-consume the private note.
7. In the organizer dApp, deserialize the stored note and compute note.nullifier().
8. Call getNullifierCommitHeight(note.nullifier(), latestBlockNumber).
9. Also call getNetworkNoteStatus(note.id()).
### Relevant log output
```shell
Stored note ID matches computed note ID:
0x4454b6...2c5c73
Stored asset:
1000000 raw units from faucet 0x2458e5446128e6b150b75b8ebd9ce1
Computed nullifier:
0xeb9976...9add36
getNullifierCommitHeight(note.nullifier(), latestBlockNumber):
undefined / not visible
getNetworkNoteStatus(note.id()):
failed to get network note status: grpc request failed for get_network_note_status: resource not found: code: 'Some requested entity was not found', message: "note not found in ntx-builder database"
```
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Le problème concerne le cycle de vie des notes et l'engagement du nullifier dans le Miden SDK. Commencez par examiner le flux de création et de consommation des notes dans le code de l'adaptateur de portefeuille, en particulier les méthodes `requestSend` et `waitForTransaction`. Passez en revue les implémentations de `getNullifierCommitHeight` et `getNetworkNoteStatus` dans le client RPC pour comprendre comment elles interrogent le réseau. Vérifiez la sérialisation/désérialisation des notes et le calcul du nullifier pour garantir leur exactitude. L'objectif est de déterminer pourquoi le nullifier n'est pas engagé sur la chaîne après la consommation automatique, ce qui peut nécessiter de comprendre les transitions d'état des notes et la synchronisation réseau dans la Miden VM.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- blockchain, react
- Domaine
- backend-api-design, blockchain
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100