specter-desktop icon indicating copy to clipboard operation
specter-desktop copied to clipboard

Any plans for non-deterministic watch-only wallet?

Open ghost opened this issue 4 years ago • 13 comments

Guys first, Specter is great piece of software, thank you a lot 👍 Do you have any plans for supporting non-deterministic watch-only wallet? There are still a lot of non-BIP32 paper wallets out there.

ghost avatar Feb 16 '21 23:02 ghost

We've been thinking on adding that for a while, but didn't get the time yet... Can't promise anything, but I'll try in the coming weeks to find some time for that

ben-kaufman avatar Feb 17 '21 07:02 ben-kaufman

This would be a perfect usecase for our new extension-framework. Here is roughly how to get started:

  • https://www.youtube.com/watch?v=MHiAH1YffFE
  • https://www.youtube.com/watch?v=s41RFyRn1I8

k9ert avatar May 25 '22 19:05 k9ert

Hi, I would like to work on this

Aditi-Singh16 avatar Feb 07 '23 13:02 Aditi-Singh16

See also the extension-documentation which is probably not that important for this task but worth a mention: https://docs.specter.solutions/desktop/extensions/intro/ Also, i'd suggest to use the bdk instead of dealing with the internal API of specter in order to do the Transaction generation stuff. bdk has nice python-bindings and it's as easy as pip3 install bdkpython. The documentation, especially for the python-bindings are not that great.

I looked through the examples and python ones are a bit rare. Here are some nuggest i found. Especially the Spotbit stuff might be interesting:

  • https://github.com/BlockchainCommons/spotbit/blob/072b1cdff471681e5f6727541b9cb0d0ec8cbc2c/beancounter.py
  • https://github.com/thunderbiscuit/bitcoindevkit-scripts/tree/aa601c93dfbe92f1812179f4441c002e091f2953/python (consider also to look at the examples on other languages in order to get an idea how to implement it in python)
  • https://github.com/k9ert/spectrum/blob/feature/sync_progress/tests/test_bdk.py
  • https://github.com/stepansnigirev/bdk_playground

Let me know if you need any help. We'd be happy to join you in the Development chat: https://t.me/+yS4VO2JqBHkzYTI6

k9ert avatar Feb 08 '23 08:02 k9ert

Okay, thanks for the resources

Aditi-Singh16 avatar Feb 08 '23 14:02 Aditi-Singh16

Hi @k9ert, I went through the videos and code samples.

I do have some silly doubts😅 I would like to know to which files or in what folder I should work. also, In the frontend part, should there be an option in the wallets dropdown to create non-deterministic watch-only wallets or some other way?

Aditi-Singh16 avatar Feb 11 '23 18:02 Aditi-Singh16

I'd suggest to create an extension which has a scope to simply sweep a paperwallet. You type or scan a secret key from something like e.g. https://www.bitaddress.org/ and the extension creates a transaction which sweeps the complete amount to one of your existing wallets. If we have that, we can think about anything else but i think this extension would solve a lot of problems for a lot of people. We could improve that solution but having that, would already be a big deal.

k9ert avatar Feb 11 '23 19:02 k9ert

I would like to know to which files or in what folder I should work. I propose those steps:

  • Create a new extension
  • Create a silly test within the extension which is using the bdk library. Start with a copy of what you can find in specterext-taxtheft.
  • Get familiar with that library. Figure out how to create a transaction with that library based on some secret key created with bitaddress.org
  • If you have that working in a test, you can try to incorporate that in a frontend. But having the test will probably need some time. Especially if you have some learning to dos on the bitcoin side.

k9ert avatar Feb 12 '23 11:02 k9ert

ooh okay

Aditi-Singh16 avatar Feb 12 '23 11:02 Aditi-Singh16

Hi @k9ert , I think I found an issue with the extension_gen.py file so when I was creating an extension I got this error image

However, when I changed line 206 from with open(fq_fname, "w") as file: to with open(fq_fname, "w", encoding='utf-8') as file: it worked So if this is a problem with everyone, should I create a PR for it?

Aditi-Singh16 avatar Feb 12 '23 18:02 Aditi-Singh16

Oh, yes, please! I'm also happy if you would spend a bit more time on the extension generation, please have a look here: https://github.com/cryptoadvance/specter-desktop/issues/1957

k9ert avatar Feb 13 '23 08:02 k9ert

Okay sure! I will then work on that issue first

Aditi-Singh16 avatar Feb 13 '23 09:02 Aditi-Singh16

Great! I had a discussion with @moneymanolis on how to cut this one in smaller pieces and i think we have some more concrete ideas on how to get this done with a bit more guidance. Stay tuned (or rather work on the ext-gen code for now).

k9ert avatar Feb 13 '23 11:02 k9ert