1

To receive funds, I was thinking of giving a user the option of displaying two QR codes:

  1. Legacy - p2phk e.g. 1AKDDsfTh8uY4X3ppy1m7jw1fVMBSMkzjP
  2. Compatibility - p2sh(p2wpkh) e.g. 34nSkinWC9rDDJiUY438qQN1JHmGqBHGW7

Is it safe to only give them the option of receiving to a "compatibility" address?

5

Displaying two would be justified if you were asking about a BC1 p2wpkh vs a 3xxx p2sh(p2wpkh) because not everything supports BC1 but its pretty good to use when supported.

Displaying two isn't useful between p2pkh/p2sh as you've asked about because p2sh is supported everywhere and many wallets and services have used p2sh exclusively for a long time.

Supporting plain p2pkh is not something I'd recommend a new wallet bother doing. That development and testing effort would better be spent on newer functionality.

2

Is it safe to only give them the option of receiving to a "compatibility" address?

Yes. All modern wallet software understand P2SH and can create transactions that send to such addresses.

  • What's the implication of displaying both? i.e. for a single compressed public key, you'll have utxo associated with multiple addresses (if people send to both.) – Malone Feb 28 at 19:41
  • A UTXO is only associated with a single encumberment (script) - The fact that one private key controls multiple outputs is irrelevant. However, you should be using HD wallets to derive keys for BIP44/49/84 following standard paths, in which case they private key will not be common. – Raghav Sood Feb 28 at 20:00
  • @RaghavSood So even if the address to be generated is p2sh(p2wpkh), I should derive from the HD wallet at say, m / 84' / 0' / 0' / 0 / 0? – Malone Feb 28 at 20:07
  • 1
    Actually I just noticed bip49 refers to this particular example. – Malone Feb 28 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.