vulpemventures / neutrino-elements

MIT License
3 stars 4 forks source link

descriptor-based wallet watcher #7

Closed tiero closed 2 years ago

tiero commented 2 years ago

NOTICE: This can become a standalone pkg in go-elements or separated repository, to keep this only about neutrino instance.

A wallet tracker is basically able to:

  1. Load a descriptor defintion (that contains an xpub)
  2. We know how to create the script with a pubkey derived from the xpub
  3. We derive a very large number of those ie. first 100 pubkeys
  4. We load them in the node/neutrino so he can scan the blockchain
  5. We index/store the txs found in blockchain for that client/user!
  6. We reduce the txs that have unspent tx outputs
tiero commented 2 years ago

Re: descriptor

Would start supporting the fragment Marina (and other clients such as tdexd) will likely track down:

wpkh(xpub)

So realistically, the fragment wpkh tells us that given an xpub we need to derive childs pubkeys and create WitnessPubKeyHash kind of script with them

tiero commented 2 years ago

This should have been closed?

sekulicd commented 2 years ago

@tiero i would say that 5 and 6 are not completed. I added web socket daemon(neuutrinod) more as POC, where client established WS connection uploads wpkh descriptor and neutrinod sends unspents events.

tiero commented 2 years ago

Ok we can say that without indexing, we can eventually rescan on the fly for each descriptor wallet if asked again from clients?

sekulicd commented 2 years ago

Ok we can say that without indexing, we can eventually rescan on the fly for each descriptor wallet if asked again from clients?

@tiero if client reconnect he should get utxos for wallet desc.