# ethereum-public-key-to-address

> Convert an Ethereum public key to an address

Latest version **0.0.5** (published 2020-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install ethereum-public-key-to-address
pnpm add ethereum-public-key-to-address
yarn add ethereum-public-key-to-address
bun add ethereum-public-key-to-address
```

Provides the commands `ethereum-public-key-to-address`, `ethereum_public_key_to_address`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2020-10-19 |
| First published | 2019-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 596.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Miguel Mota |
| Maintainers | miguelmota |
| Keywords | ethereum, eth, blockchain, private, key, public, address, converter, checksum, cli |

## Links

- npm: https://www.npmjs.com/package/ethereum-public-key-to-address
- Repository: https://github.com/miguelmota/ethereum-public-key-to-address
- Issues: https://github.com/miguelmota/ethereum-public-key-to-address/issues
- npm.io page: https://npm.io/package/ethereum-public-key-to-address

## Dependencies (4)

- [meow](https://npm.io/package/meow.md) ^5.0.0
- [keccak](https://npm.io/package/keccak.md) ^3.0.1
- [secp256k1](https://npm.io/package/secp256k1.md) ^4.0.2
- [ethereum-checksum-address](https://npm.io/package/ethereum-checksum-address.md) 0.0.2

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2020-10-19
- 0.0.4 — 2020-07-23
- 0.0.3 — 2020-07-23
- 0.0.2 — 2019-10-15
- 0.0.1 — 2019-06-25

## README

# ethereum-public-key-to-address

> Convert an Ethereum public key to an address

[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/miguelmota/ethereum-public-key-to-address/master/LICENSE)
[![NPM version](https://badge.fury.io/js/ethereum-public-key-to-address.svg)](http://badge.fury.io/js/ethereum-public-key-to-address)

## Demo

[https://lab.miguelmota.com/ethereum-public-key-to-address](https://lab.miguelmota.com/ethereum-public-key-to-address)

## Install

```bash
npm install ethereum-public-key-to-address
```

## Getting started

```javascript
const publicKeyToAddress = require('ethereum-public-key-to-address')

console.log(publicKeyToAddress(Buffer.from('04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39', 'hex'))) // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
console.log(publicKeyToAddress('04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39')) // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
console.log(publicKeyToAddress('0x04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39')) // '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
```

## CLI

Install:

```bash
npm install -g ethereum-public-key-to-address
```

Convert public key to address:

```bash
$ ethereum_public_key_to_address 04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39

0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
```

Piping public key example:

```bash
$ echo 04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39 | ethereum_public_key_to_address

0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
```

## Test

```bash
npm test
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/ethereum-public-key-to-address · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
