BenWestgate / yeti.Bash

A port of Yeticold.com to Shell.
https://github.com/JWWeatherman/yeticold
14 stars 2 forks source link

added change addresses to 3-of-7 CreateWallet script #4

Closed a5an0 closed 2 years ago

a5an0 commented 3 years ago

This commit changes the descriptor to add another component to the derivation path for the xpubs (was m/*, is now m/0/*) and adds a second descriptor with the same xpubs and a derivation path of m/1/*. When calling import descriptors, it passes both, marking the /1/ descriptor as internal. The effect of all of this is that the wallet now generates change addresses automatically.

I also changed the wallet descriptor to use sortedmulti instead of multi. This means that in the future if you ever had to regenerate the descriptor from the private keys, ordering wouldn't matter (sortedmulti does a lexicographic sort of the XPUBs). It also means that you can import the wallet descriptor into other software like Sparrow wallet for watching or formatting transactions.

The other scripts (coin flip wallet, custom wallet) have not been updated, nor have the docs. Planning on getting to those when I have time, but if anyone wants to play with this change, here it is!

Also note that this breaks compatibility with the yeticold restore functionality. Maybe I should copy and rename this script to keep one that works with yeti, and one that is new-and-improved. Thoughts?

BenWestgate commented 2 years ago

This breaks compatibility with yeticold.com restore but can be used by anyone who doesn't need or want that compatibility.

If you have made a wallet with both descriptors imported, can you see if restoring the xpubs with yeticold.com using the m/ derivation path shows all change and deposits? If so, I can merge this and keep descriptor.txt the yeti compatible m/ derivation path.