function deriveEthereumAddress(publicKey) {
  if (!Buffer.isBuffer(publicKey)) {
    throw TypeError('Expected: `publicKey` to be Buffer')
  }

  // take Keccak-256 hash of public key
  const publicKeyHash = createKeccakHash('keccak256')
    .update(publicKey)
    .digest('hex')
  const publicKeyHashbuffer = Buffer.from(publicKeyHash, 'hex')

  // right-most 20 bytes is the Ethereum address
  const ethereumAddress = publicKeyHashbuffer.slice(-20).toString('hex')

  return ethereumAddress
}
/**
 * Derive Ethereum address from uncompressed Public Key
 *
 * @property {Buffer} publicKey - buffer containing the uncompressed public key (minus the prefix)
 *
 * @returns {String} - Returns a string containing the ethereum address
 */
Derive Ethereum address from uncompressed Public Key
@property {Buffer} publicKey - buffer containing the uncompressed public key (minus the prefix)

@returns {String} - Returns a string containing the ethereum address
Derive Ethereum address from uncompressed Public Key @property { Buffer } publicKey - buffer containing the uncompressed public key ( minus the prefix ) @returns { String } - Returns a string containing the ethereum address
function deriveEthereumAddress(publicKey) {
  if (!Buffer.isBuffer(publicKey)) {
    throw TypeError('Expected: `publicKey` to be Buffer')
  }
  const publicKeyHash = createKeccakHash('keccak256')
    .update(publicKey)
    .digest('hex')
  const publicKeyHashbuffer = Buffer.from(publicKeyHash, 'hex')
  const ethereumAddress = publicKeyHashbuffer.slice(-20).toString('hex')
  return ethereumAddress
}
function deriveEthereumAddress ( publicKey ) { if ( ! Buffer . isBuffer ( publicKey ) ) { throw TypeError ( 'Expected: `publicKey` to be Buffer' ) } const publicKeyHash = createKeccakHash ( 'keccak256' ) . update ( publicKey ) . digest ( 'hex' ) const publicKeyHashbuffer = Buffer . from ( publicKeyHash , 'hex' ) const ethereumAddress = publicKeyHashbuffer . slice ( - 20 ) . toString ( 'hex' ) return ethereumAddress }
Derive Ethereum address from uncompressed Public Key
 @property {Buffer} publicKey - buffer containing the uncompressed public key (minus the prefix)
Derive Ethereum address from uncompressed Public Key @property { Buffer } publicKey - buffer containing the uncompressed public key ( minus the prefix )
// take Keccak-256 hash of public key // right-most 20 bytes is the Ethereum address