<p>No. Fees depend on the transaction size. The transaction size is affected by the output script (&quot;address&quot;, broadly speaking) used, but not by the encoding of the extended key used to generate key(s) used in this script.</p>
<p>However, as Pieter mentions in the comments, extended keys encoded with the <code>zpub</code> prefix usually implicitly indicate derived keys should be used for <a href="https://bitcoin.stackexchange.com/a/64852/101498"><code>P2WPKH</code> addresses</a>. It <a href="https://bitcoin.stackexchange.com/a/84006/101498">is the smallest standard output type</a>. If by the same token you implicitly associate <code>xpub</code>s with <code>P2PKH</code> addresses, then yes by using <a href="https://bitcoin.stackexchange.com/a/64852/101498"><code>P2WPKH</code> addresses</a> <a href="https://bitcoin.stackexchange.com/a/84006/101498">you save 3 bytes per output</a> (and the receiver does save a lot more when they in turn spend this coin).</p>

CC BY-SA 4.0
2023-03-23T11:29:34.637Z
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).
Pieter Wuille
CC BY-SA 4.0
2023-03-23T12:10:25.983Z
Thanks, added a second paragraph about how P2WKH are slightly smaller than legacy ones.
Antoine Poinsot
CC BY-SA 4.0
2023-03-23T17:20:42.607Z
Perhaps it would be better to write “P2WPKH is the smallest _output_ type” rather than “address type”.
Murch
CC BY-SA 4.0
2023-03-23T17:22:02.727Z
Changed for "standard output type"
Antoine Poinsot
CC BY-SA 4.0
2023-03-23T09:38:02.713Z
2023-03-23T17:21:55.467Z
2023-03-23T17:21:55.467Z
Antoine Poinsot
<p>Will it affect the fees in any way when one sends money to an address generated from <code>zpub</code> master public key compared the <code>xpub</code>?</p>
<p>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.</p>

<transaction-fees><public-key><address-generation><xpub><derivatives>
Are fees smaller to transact to addresses generated from a zpub master public keys compared to xpub?
Meglio
# Are fees smaller to transact to addresses generated from a zpub master public keys compared to xpub?

(Asked by: username_0 on 2023-03-23)

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.

**Tags:** transaction-fees, public-key, address-generation, xpub, derivatives


---

## 1 answers

### Answer by username_1 on 2023-03-23. Score: 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 username_2 mentions in the comments, extended keys encoded with the `zpub` prefix usually implicitly indicate derived keys should be used for [`P2WPKH` addresses](https://bitcoin.stackexchange.com/a/64852/101498). It [is the smallest standard output type](https://bitcoin.stackexchange.com/a/84006/101498). If by the same token you implicitly associate `xpub`s with `P2PKH` addresses, then yes by using [`P2WPKH` addresses](https://bitcoin.stackexchange.com/a/64852/101498) [you save 3 bytes per output](https://bitcoin.stackexchange.com/a/84006/101498) (and the receiver does save a lot more when they in turn spend this coin).

> **Comments:**
> **username_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).  
> **username_1**: Thanks, added a second paragraph about how P2WKH are slightly smaller than legacy ones.  
> **username_3**: Perhaps it would be better to write “P2WPKH is the smallest _output_ type” rather than “address type”.  
> **username_1**: Changed for "standard output type"  

---

