Proposal: Extended serialization format for BIP-32 wallets



Summary:

In a Bitcoin-dev discussion, Pavol Rusnak suggested adding an additional byte field OutputType for wallets that do not follow BIP43. This field would have 0x00 for P2PKH output type, 0x01 for P2WPKH-in-P2SH output type, and 0x02 for native Segwit output type. Thomas Voegtlin agreed that this solution would work, but raised the question of whether the field should be present only if depth==0x00 or at all times. In response, Pavol Rusnak stated that even though the depth is not null in Bitcoin Wallet (m/0'/[0,1]), the field should always be present if a chain is limited to a certain script type. However, there are cases where on one chain, script types are mixed, and in this case, the field should be omitted and the wallet needs to scan for all known types. It was noted that Bitcoin Core is taking this approach.


Updated on: 2023-06-12T18:17:06.361584+00:00