ethereum-payments
Library to assist in payment processing on ethereum. It first allows for generation of address according to the BIP44 standard.
Bitcore is used for deterministic public and private keys. Please see the BIP32 standard for more information (BIP32).
Some work is inspired off of the prior work done by ethereum-bip44
Coming soon: tools to sign transactions passed down from the server connected to web3.
Getting Started
npm install --save ethereum-payments
Create a new wallet (DON'T DO THIS ON PRODUCTION):
let ethereumPayments = let keys = ethereumPaymentsconsoleconsole
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):
let depositAddress = ethereumPayments // for path m/44'/60'/0'/0/1234console
Get the private key for an address on a specific path:
let privateKey = ethereumPayments // for path m/44'/60'/0'/0/1234
Get the public key from a private key:
let address = ethereumPayments // for path m/44'/60'/0'/0/1234ifaddress === depositAddress console else console
Get the derived xpub key from a hardened private key:
let xpub = ethereumPayments // 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