0

Will it affect the fees in any way when one sends money to an address generated from zpub master public key compared the xpub?

What might also be part of this question is, understanding whether it is the master public key or the address type that affects the fee; and if it is the latter, then whether it is possible to generate both higher-fee and lower-fee addresses from both types of master public keys.

1 Answer 1

2

No. Fees depend on the transaction size. The transaction size is affected by the output script ("address", broadly speaking) used, but not by the encoding of the extended key used to generate key(s) used in this script.

However, as Pieter mentions in the comments, extended keys encoded with the zpub prefix usually implicitly indicate derived keys should be used for P2WPKH addresses. It is the smallest standard output type. If by the same token you implicitly associate xpubs with P2PKH addresses, then yes by using P2WPKH addresses you save 3 bytes per output (and the receiver does save a lot more when they in turn spend this coin).

4
  • 2
    I believe OP isn't just talking about the encoding of the extended public key, but also its associated meaning (zpub is used to implicitly indicate P2WPKH address derivation). Mar 23, 2023 at 11:29
  • Thanks, added a second paragraph about how P2WKH are slightly smaller than legacy ones. Mar 23, 2023 at 12:10
  • Perhaps it would be better to write “P2WPKH is the smallest output type” rather than “address type”.
    – Murch
    Mar 23, 2023 at 17:20
  • Changed for "standard output type" Mar 23, 2023 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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