code: public function privateKeyToPublicKey(string $privateKey)
      {
          if ($this->isHex($privateKey) === false) {
              throw new InvalidArgumentException('Invalid private key format.');
          }
          $privateKey = $this->stripZero($privateKey);
  
          if (strlen($privateKey) !== 64) {
              throw new InvalidArgumentException('Invalid private key length.');
          }
          $privateKey = $this->secp256k1->keyFromPrivate($privateKey, 'hex');
          $publicKey = $privateKey->getPublic(false, 'hex');
  
          return '0x' . $publicKey;
      }
docs: privateKeyToPublicKey
  
  @param string $privateKey
  @return string