shopstr-eng / shopstr

A global, decentralized Nostr marketplace to buy and sell anything, anywhere, anytime, anonymously with Bitcoin.
https://shopstr.store
GNU General Public License v3.0
45 stars 8 forks source link

NIP60 Wallet Transaction Events #85

Open lnbc1QWFyb24 opened 1 month ago

lnbc1QWFyb24 commented 1 month ago

I was playing around with the Shopstr NIP-60 wallet and noticed that when ecash is sent from the wallet, two kind 7376 events are published to the relay. One event has direction out which is correct, but there is another in event published with the same amount which cancels out the first event meaning that the correct balance of the wallet cannot be derived.

calvadev commented 1 month ago

Thanks for the find. Does this happen when sending ecash and paying out to a Lightning address? And with any amount or when sending half the wallet balance?

calvadev commented 1 month ago

Ahh, this is coming from when change is left over on a spend. The change amount is published as coming in, but since the proofs that are coming in are technically already set in the wallet state there probably isn't a need to re-publish them unless entirely new proofs were created.