# ethereum-private-key-to-public-key

> Convert an Ethereum private key to a public key

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

## Install

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

Provides the commands `ethereum-private-key-to-public-key`, `ethereum_private_key_to_public_key`.

## 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 | 2 |
| Unpacked size | 577.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Miguel Mota |
| Maintainers | miguelmota |
| Keywords | ethereum, eth, blockchain, private, key, public, address, converter, cli |

## Links

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

## Dependencies (2)

- [meow](https://npm.io/package/meow.md) ^5.0.0
- [secp256k1](https://npm.io/package/secp256k1.md) ^4.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 — 2019-10-15
- 0.0.2 — 2019-06-25
- 0.0.1 — 2019-06-25

## README

# ethereum-private-key-to-public-key

> Convert an Ethereum private key to a public key

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

## Demo

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

## Install

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

## Getting started

```javascript
const privateKeyToPublicKey = require('ethereum-private-key-to-public-key')

console.log(privateKeyToPublicKey(Buffer.from('4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d', 'hex')).toString('hex')) // '04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39'
console.log(privateKeyToPublicKey('4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d').toString('hex')) // '04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39'
console.log(privateKeyToPublicKey('0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d').toString('hex')) // '04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39'
```

## CLI

Install:

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

Convert private key to public key:

```bash
$ ethereum_private_key_to_public_key 4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d

04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39
```

Piping private key example:

```bash
$ echo 4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d | ethereum_private_key_to_public_key

04e68acfc0253a10620dff706b0a1b1f1f5833ea3beb3bde2250d5f271f3563606672ebc45e0b7ea2e816ecb70ca03137b1c9476eec63d4632e990020b7b6fba39
```

## Test

```bash
npm test
```

## License

[MIT](LICENSE)

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