0
I need to understand the correct Bitcoin address workflow for transactions. I created an address a while back with a common wallet and sent some coin there. The address is at segwit m/49'/0'/0'/0/0. I then spent some coin from that. When I looked up the address on the blockchain, I noticed that the balance was 0. The transaction that occurred had two output addresses. The funds were sent to two addresses. The second is the non-segwit address of the person of who I sent the funds to. The first was segwit m/49'/0'/0'/1/0 (address from my wallet). It appears that the wallet moved my funds to a new address in my wallet. I.e. m/49'/0'/0'/0/0 -> m/49'/0'/0'/1/0.
Should a wallet always move the left over from m/49'/0'/0'/0/x to m/49'/0'/0'/x/0? Is this logic standard practice? Or is this specific to the wallet I used? Is there a recommended practice? I need to know because I am developing a wallet, and I need to follow standard practice.
What should happen when I transfer the funds from m/49'/0'/0'/x/0 to another address, and there are leftovers? Where should the new address for the leftovers be moved to? m/49'/0'/x'/0/0?
Thanks. I'll have a read through this and check to see if it answers my questions completely. – Melbourne Developer – 2018-01-08T00:03:36.860
It seems that the spec covers a lot of the cases, but not necessarily all cases. It seems that there are some cases that the spec does not dictate best practice. And, aside from that, a wallet app is able to do whatever it wants really. It could transact funds in to wherever it wants. This seems like a general problem, but it's hard to say whether this will cause issues down the line or not. I can only try to follow the spec the best I can. – Melbourne Developer – 2018-01-08T00:12:39.197
I think this is mostly correct, but the wallet implements BIP0044, and BIP0049 so BIP0032 doesn't seem to be enough to answer the full question at this point. – Melbourne Developer – 2018-01-08T02:32:25.073
Ah, yes, that's a better reference in this case. Thanks. – Nate Eldredge – 2018-01-08T02:38:36.427
, if you modify your answer, I will mark it as the answer. – Melbourne Developer – 2018-01-08T03:02:36.740
Particularly this point: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account-discovery
– Melbourne Developer – 2018-01-08T03:03:57.860@MelbourneDeveloper: See what you think now. – Nate Eldredge – 2018-01-08T03:38:24.970
Awesome. Good work. I think it's settled my issue and I can move forward with the functionality. – Melbourne Developer – 2018-01-08T03:42:09.623