Derive public key from xpub? I woud like to obtain an extended public key of a derivation path (m/84'/0'/0').
I'm using btclib, and I have the xpub of the root account.
When I try to use bip32.derive(&quot;xpub...&quot;,&quot;m/84'/0'/0'&quot;)
I get btclib.exceptions.BTClibValueError: invalid hardened derivation from public key
What am I doing wrong ?
Review BIP32:

The fact that they are equivalent is what makes non-hardened keys
useful (one can derive child public keys of a given parent key without
knowing any private key), and also what distinguishes them from
hardened keys. The reason for not always using non-hardened keys
(which are more useful) is security; see further for more information.

That little apostrophe ' means that branch of the key derivation tree is &quot;hardened&quot; -- and THAT means that you must have the private key to derive its child keys.
So if you have the PRIVATE key for m/84'/0'/0' you can generate child keys for example m/84'/0'/0'/0 or m/84'/0'/0'/0' (these are two different keys, one is hardened the other is not).
If you were to derive the non-hardened key at m/84'/0'/0'/0 then you could use an xpub FROM THIS KEY (not any of the parent keys) to derive public child keys, without any private keys. Examples would be m/84'/0'/0'/0/0 and m/84'/0'/0'/0/1