# ethereum-payments

> Utilities for ethereum payments, such as bip44 addresses, and sweeping funds

Latest version **1.0.2** (published 2018-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install ethereum-payments
pnpm add ethereum-payments
yarn add ethereum-payments
bun add ethereum-payments
```

## 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.2 |
| Published | 2018-07-20 |
| First published | 2018-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Moe Adham |
| Maintainers | moeadham |
| Keywords | ethereum, bitcoin, bip44, payments, eth, faast, bitaccess |

## Links

- npm: https://www.npmjs.com/package/ethereum-payments
- Repository: https://github.com/go-faast/ethereum-payments
- Homepage: https://github.com/go-faast/ethereum-payments#readme
- Issues: https://github.com/go-faast/ethereum-payments/issues
- npm.io page: https://npm.io/package/ethereum-payments

## Dependencies (4)

- [elliptic](https://npm.io/package/elliptic.md) ^6.4.0
- [bitcore-lib](https://npm.io/package/bitcore-lib.md) ^0.14.0
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^5.1.2
- [ethereum-address](https://npm.io/package/ethereum-address.md) 0.0.4

## Recent versions

- 1.0.2 (latest) — 2018-07-20

## README

ethereum-payments
=================

Library to assist in payment processing on ethereum. It first allows for generation
of address according to the [BIP44 standard](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki).

[Bitcore](https://bitcore.io/) is used for  deterministic public and private keys.
Please see the BIP32 standard for more information ([BIP32](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki)).

Some work is inspired off of the prior work done by [ethereum-bip44](https://github.com/trapp/ethereum-bip44)

Coming soon: tools to sign transactions passed down from the server connected to web3.

## Getting Started

```bash
npm install --save ethereum-payments
```

Create a new wallet (DON'T DO THIS ON PRODUCTION):
```js
let ethereumPayments = require('@faast/ethereum-payments')()
let keys = ethereumPayments.generateNewKeys()
console.log(keys.xpub)
console.log(keys.xprv)
```

Generate an ethereum deposit address from a public seed (xpub).
This is useful if you are a hot wallet and don't store the private key. You will need
to keep track of which path node you are on (increasing INT):
```js
let depositAddress = ethereumPayments.bip44(keys.xpub, 1234) // for path m/44'/60'/0'/0/1234
console.log(depositAddress)
```

Get the private key for an address on a specific path:
```js
let privateKey = ethereumPayments.getPrivateKey(keys.xprv, 1234) // for path m/44'/60'/0'/0/1234
```

Get the public key from a private key:
```js
let address = ethereumPayments.privateToPublic(privateKey) // for path m/44'/60'/0'/0/1234
if(address === depositAddress){
  console.log('this library works')
} else {
  console.log('better not use this library')
}
```

Get the derived xpub key from a hardened private key:
```js
let xpub = ethereumPayments.getXpubFromXprv(xprv) // for path m/44'/60'/0'/0/1234
```





**Note:** It is suggested to generate your Private key offline with FAR more entropy than the default function, then use getXpubFromXprv.
You have been warned!

## License

MIT

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