function derivePublicKey(privateKey, compressed = false) {
  // check private key is valid
  if (!secp256k1.privateKeyVerify(privateKey)) {
    throw Error('Invalid private key')
  }

  return secp256k1.publicKeyCreate(privateKey, compressed).toString('hex')
}
/**
 * Derive Public Key from Private Key
 *
 * @property {Buffer} privateKey - buffer containing private key
 * @property {Boolean} [compressed=false] - flag for type of public key to return (compressed / uncompressed)
 *
 * @returns {String} - Returns a string containing the public key
 */
Derive Public Key from Private Key
@property {Buffer} privateKey - buffer containing private key
@property {Boolean} [compressed=false] - flag for type of public key to return (compressed / uncompressed)

@returns {String} - Returns a string containing the public key
Derive Public Key from Private Key @property { Buffer } privateKey - buffer containing private key @property { Boolean } [ compressed = false ] - flag for type of public key to return ( compressed / uncompressed ) @returns { String } - Returns a string containing the public key
function derivePublicKey(privateKey, compressed = false) {
  if (!secp256k1.privateKeyVerify(privateKey)) {
    throw Error('Invalid private key')
  }
  return secp256k1.publicKeyCreate(privateKey, compressed).toString('hex')
}
function derivePublicKey ( privateKey , compressed = false ) { if ( ! secp256k1 . privateKeyVerify ( privateKey ) ) { throw Error ( 'Invalid private key' ) } return secp256k1 . publicKeyCreate ( privateKey , compressed ) . toString ( 'hex' ) }
Derive Public Key from Private Key
 @property {Buffer} privateKey - buffer containing private key
 @property {Boolean} [compressed=false] - flag for type of public key to return (compressed / uncompressed)
Derive Public Key from Private Key @property { Buffer } privateKey - buffer containing private key @property { Boolean } [ compressed = false ] - flag for type of public key to return ( compressed / uncompressed )
// check private key is valid