comit-network / xmr-btc-swap

Bitcoin–Monero Cross-chain Atomic Swap
GNU General Public License v3.0
658 stars 85 forks source link

Allow ASB to move money to a zpub instead of the internal wallet #489

Open thomaseizinger opened 3 years ago

thomaseizinger commented 3 years ago

This can easily be achieved by having a separate bdk wallet instance that is initialized from the zpub and keeps track of the funds and used addresses.

SamouraiDev commented 3 years ago

If a zpub is provided it is assumed to belong to a wallet controlled by the asb user. The zpub is used for deriving bitcoin receive addresses and pubkeys required during key generation.

thomaseizinger commented 3 years ago

If a zpub is provided it is assumed to belong to a wallet controlled by the asb user. The zpub is used for deriving bitcoin receive addresses and pubkeys required during key generation.

I've added some information in this regard to the original issue description.

A minor correction: only receive addresses will be derived from this zpub. Keys used in the protocol like S_a_bitcoin need to be generated by our software because it needs to be in control of the private key associated with it in order to generate the correct signatures.

da-kami commented 3 years ago

If someone ever picks this up read this: https://github.com/comit-network/xmr-btc-swap/pull/507#discussion_r633953991