<blockquote>
<p>I need to know how to get the corresponding public key of a private key in hd-wallets, I don't need the derived ones but the public key who is related to the private I got.</p>
</blockquote>
<p>A private key derived using the BIP32 hierarchical derivation is similar to any other one and the corresponding public key is obtained by &quot;multiplying&quot; your private by <code>G</code>, as for any other private key.</p>
<p>You want to use a specific crypto library for this operation, and I believe <a href="https://github.com/ofek/coincurve" rel="nofollow noreferrer"><code>coincurve</code></a> to be a good maintained Python binding to <a href="https://github.com/bitcoin-core/secp256k1" rel="nofollow noreferrer"><code>libsecp</code></a>.</p>
<p>You can also use <a href="https://github.com/darosior/python-bip32" rel="nofollow noreferrer"><code>python-bip32</code></a> to simplify your use of BIP32 derived keys (relies on coincurve under the hood).</p>

CC BY-SA 4.0
2020-06-21T08:20:18.537Z
2020-06-21T08:20:18.537Z
Antoine Poinsot
<p>I need to know how to get the corresponding public key of a private key in hd-wallets, I don't need the derived ones but the public key who is related to the private I got. If there is an algorithm using python it will be very helpful but also the formula will be good as well.
thank you.</p>

<private-key><bip32-hd-wallets><public-key><bip>
How to get bitcoin bip32 public key from private key?
Avi El
# How to get bitcoin bip32 public key from private key?

(Asked by: username_0 on 2020-06-21)

I need to know how to get the corresponding public key of a private key in hd-wallets, I don't need the derived ones but the public key who is related to the private I got. If there is an algorithm using python it will be very helpful but also the formula will be good as well.
thank you.

**Tags:** private-key, bip32-hd-wallets, public-key, bip


---

## 1 answers

### Answer by username_1 on 2020-06-21. Score: 1 | Accepted answer

> I need to know how to get the corresponding public key of a private key in hd-wallets, I don't need the derived ones but the public key who is related to the private I got.

A private key derived using the BIP32 hierarchical derivation is similar to any other one and the corresponding public key is obtained by "multiplying" your private by `G`, as for any other private key.

You want to use a specific crypto library for this operation, and I believe [`coincurve`](https://github.com/ofek/coincurve) to be a good maintained Python binding to [`libsecp`](https://github.com/bitcoin-core/secp256k1).

You can also use [`python-bip32`](https://github.com/darosior/python-bip32) to simplify your use of BIP32 derived keys (relies on coincurve under the hood).


---

