function privkey2pubkey($ECDSA, $secp256k1_G) { // this is function that needs the phpecc stuff - rewrite when binary module available $privKey = gmp_Utils::gmp_hexdec($ECDSA); $pubKey = new PublicKey($secp256k1_G, Point::mul($privKey, $secp256k1_G)); $xcoord = strtoupper(gmp_Utils::gmp_dechex($pubKey->getPoint()->getX())); $xcoord = str_pad($xcoord, 64, '0', STR_PAD_LEFT); $ycoord = strtoupper(gmp_Utils::gmp_dechex($pubKey->getPoint()->getY())); $ycoord = str_pad($ycoord, 64, '0', STR_PAD_LEFT); return '04' . $xcoord . $ycoord; }