# node-eth-address

> Node module for ethereum wallet address creation and validation

Latest version **0.1.3** (published 2018-03-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-eth-address
pnpm add node-eth-address
yarn add node-eth-address
bun add node-eth-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.1.3 |
| Published | 2018-03-29 |
| First published | 2018-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.2.4 |
| Dependencies | 3 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | “Vinay |
| Maintainers | rkgitvinay |
| Keywords | ethereum, utility, blockchain, crypto, validator, nodejs, wallet |

## Links

- npm: https://www.npmjs.com/package/node-eth-address
- Repository: https://github.com/rkgitvinay/node-eth-address
- Homepage: https://github.com/rkgitvinay/node-eth-address#readme
- Issues: https://github.com/rkgitvinay/node-eth-address/issues
- npm.io page: https://npm.io/package/node-eth-address

## Dependencies (3)

- [ethers](https://npm.io/package/ethers.md) ^3.0.8
- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.9-1
- [keythereum](https://npm.io/package/keythereum.md) ^1.0.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2018-03-29
- 0.1.2 — 2018-03-29
- 0.1.1 — 2018-03-29
- 0.1.0 — 2018-03-29

## README

# Ethereum Address Generator - Node

Generate private key and its associated ethereum address

## Getting Started

These instructions will provide you a copy of the module and run in your application so that the clients can create their own private keys and ethereum compliance addresses.

### Prerequisites

```
node: ">=4.2.4"
npm
```

### Installation

```
npm install node-eth-address --save
```

## Usage

### getDefaultAddress()

```
var nodeEth = require('node-eth-address');

/** 
This password encrypts your private key. This does not act as a seed 
to generate your keys. You will need this password + your private key
to unlock your wallet
*/
var password = 'test@123'; 
var address = nodeEth.getDefaultAddress(password);
/*
{ 
	/* Your ethereum address */
	address: '0xc4d5895cdEd9477018Bcc53F524F8B17e2C3C884',

	/* Your private key */
	privateKey: '0x6371262b577bfb2b36b82e493dd89b00bae550539a890feefdb6c2012d0e89fc',

	/* Your JSON Keystore - make a Json file and store on your local computer */
	keyStore: { 
		address:"0xc4d5895cdEd9477018Bcc53F524F8B17e2C3C884",
		crypto: {
			cipher:"aes-128-ctr",
			ciphertext:"08b0de1bff09f3d4077c135ece5f3140055a66e626ff9f072f670b4840a4645a",
			cipherparams: {
				iv:"51294c8fd947c401f470c16ac9d55f0b"
			},
			mac:"34abb6c37420facd36eb4474e9c849580dc5d51e5d5c7cf453ba32980f9b7389",
			kdf:"pbkdf2",
			kdfparams: {
				c:262144,
				dklen:32,
				prf:"hmac-sha256",
				salt:"a9a18a01e2e468f85f6d003a4c20a9f3da897b2130df3a7fe7df8b40644f4d6b"
			}
		},
		id:"5e4df928-5693-4b9e-a849-2bc812b9ce16",
		version:3
 	} 
}
*/

```

### getEthereumAddress()

```
/* To generate ethereum address from private key  */

var privateKey = '0x6371262b577bfb2b36b82e493dd89b00bae550539a890feefdb6c2012d0e89fc'; 
var ethAddress = nodeEth.getEthereumAddress(privateKey);
/*
	0xc4d5895cdEd9477018Bcc53F524F8B17e2C3C884
*/

```

### validateAddress()

```
/* To Validate ethereum address */

var address = '0xc4d5895cdEd9477018Bcc53F524F8B17e2C3C884'; 
var isValid = nodeEth.validateAddress(address);
/*
	true or false
*/

```


### recoverPrivateKey()

```
/* 
To recover private key from Keystore Json file 
and password which was used to generate address 
*/

var password = 'test@123';
var keyStore: { 
	address:"0xc4d5895cdEd9477018Bcc53F524F8B17e2C3C884",
	crypto: {
		cipher:"aes-128-ctr",
		ciphertext:"08b0de1bff09f3d4077c135ece5f3140055a66e626ff9f072f670b4840a4645a",
		cipherparams: {
			iv:"51294c8fd947c401f470c16ac9d55f0b"
		},
		mac:"34abb6c37420facd36eb4474e9c849580dc5d51e5d5c7cf453ba32980f9b7389",
		kdf:"pbkdf2",
		kdfparams: {
			c:262144,
			dklen:32,
			prf:"hmac-sha256",
			salt:"a9a18a01e2e468f85f6d003a4c20a9f3da897b2130df3a7fe7df8b40644f4d6b"
		}
	},
	id:"5e4df928-5693-4b9e-a849-2bc812b9ce16",
	version:3
	} 

var privateKey = nodeEth.recoverPrivateKey(password,keyStore);
/*
	0x6371262b577bfb2b36b82e493dd89b00bae550539a890feefdb6c2012d0e89fc
*/

```

## Author

* **[Vinay Singh](https://github.com/rkgitvinay)**

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

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