# mnemonic-to-key-pair

> Obtain a key pair from a BIP 39 mnemonic phrase

Latest version **1.0.0** (published 2020-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install mnemonic-to-key-pair
pnpm add mnemonic-to-key-pair
yarn add mnemonic-to-key-pair
bun add mnemonic-to-key-pair
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-10-02 |
| First published | 2020-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gabriel Montes |
| Maintainers | gabmontes |
| Keywords | bip39, bip44, key, mnemonic, pair, private, public |

## Links

- npm: https://www.npmjs.com/package/mnemonic-to-key-pair
- Repository: https://github.com/bloq/mnemonic-to-key-pair
- Homepage: http://github.com/bloq/mnemonic-to-key-pair#readme
- Issues: http://github.com/bloq/mnemonic-to-key-pair/issues
- npm.io page: https://npm.io/package/mnemonic-to-key-pair

## Dependencies (2)

- [bip39](https://npm.io/package/bip39.md) ^3.0.2
- [hdkey](https://npm.io/package/hdkey.md) ^2.0.1

## Recent versions

- 1.0.0 (latest) — 2020-10-02

## README

# mnemonic-to-key-pair

[![Build Status](https://travis-ci.com/bloq/mnemonic-to-key-pair.svg?branch=master)](https://travis-ci.com/bloq/mnemonic-to-key-pair)
[![Code Style](https://img.shields.io/badge/code%20style-bloq-0063a6.svg)](https://github.com/bloq/eslint-config-bloq)

Obtain a key pair from a BIP 39 mnemonic phrase.

## Installation

```shell
npm install mnemonic-to-key-pair
```

## Usage

```js
const mnemonicToKeyPair = require('mnemonic-to-key-pair')

const { publicKey } = mnemonicToKeyPair(
  'maze birth captain runway client pulp vast universe era panda discover access',
  "m/44'/0'/0'/0/0",
  "1234"
)
console.log(publicKey.toString()) // 0238e831638a96248d1a8ee6b6ee16170667b0e0529cdc838d825b135c927aa95d
```

## API

<a name="mnemonicToKeyPair"></a>

### mnemonicToKeyPair(mnemonic, derivationPath, [password]) ⇒ [<code>keyPair</code>](#keyPair)
Obtian a key pair from a BIP39 mnemonic phrase and following the supplied
derivation path. Optinally supply a password.

**Returns**: [<code>keyPair</code>](#keyPair) - The key pair.  

| Param | Type | Description |
| --- | --- | --- |
| mnemonic | <code>string</code> | The 12-words mnemonic phrase. |
| derivationPath | <code>string</code> | The derivation path to use. I.e. "m/44'...". |
| [password] | <code>string</code> | The mnemonic password. |

<a name="keyPair"></a>

### keyPair
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| privateKey | <code>Buffer</code> | The private key. |
| publicKey | <code>Buffer</code> | The public key. |

## License

MIT

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