<p>Yeah, you do "need some code which multiplies some coordinates on the elliptic curve" :). If you don't have extensive cryptography experience I would recommend you use library rather than trying to implement details yourself.</p>

<p>Googling I've found <a href="https://github.com/Bit-Wasp/bitcoin-lib-php" rel="nofollow noreferrer">Bitcoin-lib-php</a>. Looking at  <a href="https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/BitcoinLib.php#L506" rel="nofollow noreferrer">the code it seems it seems this function</a> does exactly what you are looking for.</p>

CC BY-SA 3.0
2017-12-04T18:45:56.437Z
Thanks! Unfortunately, I am not able to get this code running. I dont have classes in my php but the code you suggested does need classes and a lot of other stuff (composer ...). Is there a solution which is a bit easier? I am not able to implement this due to lack of programming skills .... :/
A.c
CC BY-SA 3.0
2017-12-04T07:02:00.743Z
2017-12-04T07:02:00.743Z
nikib3ro
<p>I created a small PHP library. You can do that using <a href="https://github.com/ItayRosen/cryptophp/blob/master/src/secp256k1.php" rel="nofollow noreferrer">this class</a></p>

<p>You can use it like this:</p>

<pre><code>require('secp256k1.php');
$Secp256k1 = new Secp256k1();

$public_key = $Secp256k1 -&gt; private2public($private_key);
</code></pre>

CC BY-SA 3.0
2018-01-07T13:09:19.967Z
2018-01-07T13:09:19.967Z
user2298995
<p>As described here (<a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses</a>) I am trying to convert a private ECDSA key to its corresponding public key. (See step1 and step2).</p>

<p>I think I need some code which multiplies some coordinates on the elliptic curve. But I dont know how. Can someone help me, please?</p>

<p>// Unfortunately, this answer doesn't help me enough since I don't understand how to use the code. Can someone clearify that or give alternative solutions? Thanks</p>

<php>
PHP: is there a way to convert a private ECDSA key to its corresponding public key?
A.c
# PHP: is there a way to convert a private ECDSA key to its corresponding public key?

(Asked by: username_0 on 2017-12-04)

As described here (<https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses>) I am trying to convert a private ECDSA key to its corresponding public key. (See step1 and step2).

I think I need some code which multiplies some coordinates on the elliptic curve. But I dont know how. Can someone help me, please?

// Unfortunately, this answer doesn't help me enough since I don't understand how to use the code. Can someone clearify that or give alternative solutions? Thanks

**Tags:** php


---

## 2 answers

### Answer by username_1 on 2017-12-04. Score: 1 | Accepted answer

Yeah, you do "need some code which multiplies some coordinates on the elliptic curve" :). If you don't have extensive cryptography experience I would recommend you use library rather than trying to implement details yourself.

Googling I've found [Bitcoin-lib-php](https://github.com/Bit-Wasp/bitcoin-lib-php). Looking at [the code it seems it seems this function](https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/BitcoinLib.php#L506) does exactly what you are looking for.

> **Comments:**
> **username_0**: Thanks! Unfortunately, I am not able to get this code running. I dont have classes in my php but the code you suggested does need classes and a lot of other stuff (composer ...). Is there a solution which is a bit easier? I am not able to implement this due to lack of programming skills .... :/  

---

### Answer by username_2 on 2018-01-07. Score: 0

I created a small PHP library. You can do that using this class
You can use it like this:
require('secp256k1.php');
$Secp256k1 = new Secp256k1();

$public_key = $Secp256k1 -> private2public($private_key);


---

