{"_id":"@embarklabs/ethereumjs-wallet","_rev":"4-8a5c352b23ed2ecfc2ce708bcf0aece7","name":"@embarklabs/ethereumjs-wallet","dist-tags":{"latest":"0.6.4"},"versions":{"0.6.4":{"name":"@embarklabs/ethereumjs-wallet","version":"0.6.4","description":"Utilities for handling Ethereum keys","main":"dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"ethereumjs-config-build","prepublishOnly":"npm run format && npm run tslint && npm run test","coverage":"ethereumjs-config-coverage","coveralls":"ethereumjs-config-coveralls","format":"ethereumjs-config-format","format-fix":"ethereumjs-config-format-fix","format:fix":"ethereumjs-config-format-fix","lint":"ethereumjs-config-lint","lint-fix":"ethereumjs-config-lint-fix","pretest":"npm run build","test":"nyc mocha ./test/**/*.ts","tsc":"ethereumjs-config-tsc","tslint":"ethereumjs-config-tslint","tslint:fix":"ethereumjs-config-tslint-fix"},"husky":{"hooks":{"pre-push":"npm run lint"}},"repository":{"type":"git","url":"git+https://github.com/ethereumjs/ethereumjs-wallet.git"},"keywords":["ethereum","wallets","keys"],"author":{"name":"Alex Beregszaszi","email":"alex@rtfs.hu"},"license":"MIT","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-wallet/issues"},"homepage":"https://github.com/ethereumjs/ethereumjs-wallet","dependencies":{"@web3-js/scrypt-shim":"^0.1.0","aes-js":"^3.1.1","bs58check":"^2.1.2","ethereumjs-util":"^6.0.0","hdkey":"^1.1.1","randombytes":"^2.0.6","utf8":"^3.0.0","uuid":"^3.3.2"},"devDependencies":{"@ethereumjs/config-nyc":"^1.1.1","@ethereumjs/config-prettier":"^1.1.1","@ethereumjs/config-tsc":"^1.1.1","@ethereumjs/config-tslint":"^1.1.1","@types/bn.js":"^4.11.5","@types/mocha":"^5.2.7","@types/node":"^12.0.10","@types/lodash.zip":"^4.2.6","coveralls":"^3.0.0","ethers":"^4.0.33","husky":"^2.1.0","lodash.zip":"^4.2.0","mocha":"^5.2.0","nyc":"^14.1.1","prettier":"^1.15.3","source-map-support":"^0.5.12","ts-node":"^8.3.0","tslint":"^5.12.0","typescript":"^3.2.2","typestrict":"^1.0.2"},"gitHead":"a663268f66a7d1a0a727a9639f158ab9bcb65344","_id":"@embarklabs/ethereumjs-wallet@0.6.4","_nodeVersion":"10.18.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-opx5prqlQUoWwP/SsJn2R8opq2j4WnBNmiJBiJ54U7s2eiplVtKc3pJ/De/X5Bb6dpJlYjuHpWgVljfgutYU7A==","shasum":"d2f121ec70a5bf995138219c524526c1bbca7e85","tarball":"https://registry.npmjs.org/@embarklabs/ethereumjs-wallet/-/ethereumjs-wallet-0.6.4.tgz","fileCount":17,"unpackedSize":65019,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2FniCRA9TVsSAnZWagAAQ3EQAJl6H26+I6j4iKp6MgIC\n4jg+w/N7I6ax2bV+XQu69CKRY/tUDwMPmujVsP4320RABz4c8mPdqYfme73C\nx3+9vs/o3zyfqcKhj6oKzjXg5W0z2AaEg/pMFCpA1mlu1kFPWWQ7Nl/12ujg\nD2pwwrOnfXlKa8fkOgjB6GhaLQXjZnrGSIjoI5q+j7Fk9eJhB4zju7KTq5Rr\nE+AybZqTWudZMIk1bp2DtrG9tnR7ddwhOw0VNOjOHCYUjEI1nr/Lq6UpHYkq\nV0yYfJEwg4Bgmn4NfGViqjU9sJqvcC5NpN87dgWDTkrh7wEyZcIa1cqdfYzT\nND3BMIurr4NV0+apxDjPcLzs9X0ly/1r2iGw7ESpnAz636rQWNLBFWNMkf8T\n6cYllqMztSEixxRcufoH1vM1UhsiLnSsL14u+PSZRClaqzBd2wOmaS48nh0j\nit24mIZygZu1yPajPMMHZhXhh229j0PEfECjVbzqHZrpH0v/G07UbbT8s9nk\nju/IX8gQ52owLS2yVpAFcS0a3CHU7Y6cApJjCDyFc9pmowtegCIsyqSiqMgb\nP701CxoJLyC9fxKCep0YvLgztxoj9WW0oM74uV+xrUKVHcco5Y2gU9oVJzN0\nlvWlu2kUuGtke2C6smDlPZXT+PmgVv89r0tRyO1d/Tz3CRtZxNpE1m2q19nL\nfsIW\r\n=+Q6T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG6XnmDvR0ltPZV3IyD5PNk5ppvfn75arBf73bURUinNAiEA8oeMb+fjLZvLt39Rk4eKhSYp+2nk8xQKTjAqcOewJtA="}]},"maintainers":[{"name":"jrainville","email":"rainville.jonathan@gmail.com"},{"name":"pascalprecht","email":"pascal.precht@gmail.com"},{"name":"emizzle","email":"eric.mastro@gmail.com"},{"name":"embarkbot","email":"embarkbot@status.im"},{"name":"michaelsbradleyjr","email":"michaelsbradleyjr@gmail.com"},{"name":"iurimatias","email":"iuri.matias@gmail.com"}],"_npmUser":{"name":"michaelsbradleyjr","email":"michaelsbradleyjr@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ethereumjs-wallet_0.6.4_1579048104254_0.2747662560966262"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-15T00:28:24.018Z","0.6.4":"2020-01-15T00:28:24.354Z","modified":"2022-04-05T07:28:09.485Z"},"maintainers":[{"email":"iuri.matias@gmail.com","name":"iurimatias"},{"email":"embarkbot@status.im","name":"embarkbot"},{"email":"eric.mastro@gmail.com","name":"emizzle"},{"email":"pascal.precht@gmail.com","name":"pascalprecht"},{"email":"rainville.jonathan@gmail.com","name":"jrainville"},{"email":"info@richardramos.me","name":"richard-ramos"}],"description":"Utilities for handling Ethereum keys","homepage":"https://github.com/ethereumjs/ethereumjs-wallet","keywords":["ethereum","wallets","keys"],"repository":{"type":"git","url":"git+https://github.com/ethereumjs/ethereumjs-wallet.git"},"author":{"name":"Alex Beregszaszi","email":"alex@rtfs.hu"},"bugs":{"url":"https://github.com/ethereumjs/ethereumjs-wallet/issues"},"license":"MIT","readme":"# ethereumjs-wallet\n\n[![NPM Package](https://img.shields.io/npm/v/ethereumjs-wallet.svg?style=flat-square)](https://www.npmjs.org/package/ethereumjs-wallet)\n[![Build Status](https://travis-ci.org/ethereumjs/ethereumjs-wallet.svg?branch=master)](https://travis-ci.org/ethereumjs/ethereumjs-wallet)\n[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/ethereumjs-wallet.svg?style=flat-square)](https://coveralls.io/r/ethereumjs/ethereumjs-wallet)\n[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode\n\nA lightweight wallet implementation. At the moment it supports key creation and conversion between various formats.\n\nIt is complemented by the following packages:\n\n- [ethereumjs-tx](https://github.com/ethereumjs/ethereumjs-tx) to sign transactions\n- [ethereumjs-icap](https://github.com/ethereumjs/ethereumjs-icap) to manipulate ICAP addresses\n- [store.js](https://github.com/marcuswestin/store.js) to use browser storage\n\nMotivations are:\n\n- be lightweight\n- work in a browser\n- use a single, maintained version of crypto library (and that should be in line with `ethereumjs-util` and `ethereumjs-tx`)\n- support import/export between various wallet formats\n- support BIP32 HD keys\n\nFeatures not supported:\n\n- signing transactions\n- managing storage (neither in node.js or the browser)\n\n## Wallet API\n\nConstructors:\n\n- `generate([icap])` - create an instance based on a new random key (setting `icap` to true will generate an address suitable for the `ICAP Direct mode`)\n- `generateVanityAddress(pattern)` - create an instance where the address is valid against the supplied pattern (**this will be very slow**)\n- `fromPrivateKey(input)` - create an instance based on a raw private key\n- `fromExtendedPrivateKey(input)` - create an instance based on a BIP32 extended private key (xprv)\n- `fromPublicKey(input, [nonStrict])` - create an instance based on a public key (certain methods will not be available)\n- `fromExtendedPublicKey(input)` - create an instance based on a BIP32 extended public key (xpub)\n- `fromV1(input, password)` - import a wallet (Version 1 of the Ethereum wallet format)\n- `fromV3(input, password, [nonStrict])` - import a wallet (Version 3 of the Ethereum wallet format). Set `nonStrict` true to accept files with mixed-caps.\n- `fromEthSale(input, password)` - import an Ethereum Pre Sale wallet\n\nFor the V1, V3 and EthSale formats the input is a JSON serialized string. All these formats require a password.\n\nNote: `fromPublicKey()` only accepts uncompressed Ethereum-style public keys, unless the `nonStrict` flag is set to true.\n\nInstance methods:\n\n- `getPrivateKey()` - return the private key\n- `getPublicKey()` - return the public key\n- `getAddress()` - return the address\n- `getChecksumAddressString()` - return the [address with checksum](https://github.com/ethereum/EIPs/issues/55)\n- `getV3Filename([timestamp])` - return the suggested filename for V3 keystores\n- `toV3(password, [options])` - return the wallet as a JSON string (Version 3 of the Ethereum wallet format)\n\nAll of the above instance methods return a Buffer or JSON. Use the `String` suffixed versions for a string output, such as `getPrivateKeyString()`.\n\nNote: `getPublicKey()` only returns uncompressed Ethereum-style public keys.\n\n## Thirdparty API\n\nImporting various third party wallets is possible through the `thirdparty` submodule:\n\n`var thirdparty = require('ethereumjs-wallet/thirdparty')`\n\nConstructors:\n\n- `fromEtherCamp(passphrase)` - import a brain wallet used by Ether.Camp\n- `fromEtherWallet(input, password)` - import a wallet generated by EtherWallet\n- `fromKryptoKit(seed)` - import a wallet from a KryptoKit seed\n- `fromQuorumWallet(passphrase, userid)` - import a brain wallet used by Quorum Wallet\n\n## HD Wallet API\n\nTo use BIP32 HD wallets, first include the `hdkey` submodule:\n\n`var hdkey = require('ethereumjs-wallet/hdkey')`\n\nConstructors:\n\n- `fromMasterSeed(seed)` - create an instance based on a seed\n- `fromExtendedKey(key)` - create an instance based on a BIP32 extended private or public key\n\nFor the seed we suggest to use [bip39](https://npmjs.org/package/bip39) to create one from a BIP39 mnemonic.\n\nInstance methods:\n\n- `privateExtendedKey()` - return a BIP32 extended private key (xprv)\n- `publicExtendedKey()` - return a BIP32 extended public key (xpub)\n- `derivePath(path)` - derive a node based on a path (e.g. m/44'/0'/0/1)\n- `deriveChild(index)` - derive a node based on a child index\n- `getWallet()` - return a `Wallet` instance as seen above\n\n## Provider Engine\n\nThe Wallet can be easily plugged into [provider-engine](https://github.com/metamask/provider-engine) to provide signing:\n\n```js\nconst WalletSubprovider = require('ethereumjs-wallet/provider-engine')\n\n<engine>.addProvider(new WalletSubprovider(<wallet instance>))\n```\n\nNote it only supports the basic wallet. With a HD Wallet, call `getWallet()` first.\n\n### Remarks about `toV3`\n\nThe `options` is an optional object hash, where all the serialization parameters can be fine tuned:\n\n- uuid - UUID. One is randomly generated.\n- salt - Random salt for the `kdf`. Size must match the requirements of the KDF (key derivation function). Random number generated via `crypto.getRandomBytes` if nothing is supplied.\n- iv - Initialization vector for the `cipher`. Size must match the requirements of the cipher. Random number generated via `crypto.getRandomBytes` if nothing is supplied.\n- kdf - The key derivation function, see below.\n- dklen - Derived key length. For certain `cipher` settings, this must match the block sizes of those.\n- cipher - The cipher to use. Names must match those of supported by `OpenSSL`, e.g. `aes-128-ctr` or `aes-128-cbc`.\n\nDepending on the `kdf` selected, the following options are available too.\n\nFor `pbkdf2`:\n\n- `c` - Number of iterations. Defaults to 262144.\n- `prf` - The only supported (and default) value is `hmac-sha256`. So no point changing it.\n\nFor `scrypt`:\n\n- `n` - Iteration count. Defaults to 262144.\n- `r` - Block size for the underlying hash. Defaults to 8.\n- `p` - Parallelization factor. Defaults to 1.\n\nThe following settings are favoured by the Go Ethereum implementation and we default to the same:\n\n- `kdf`: `scrypt`\n- `dklen`: `32`\n- `n`: `262144`\n- `r`: `8`\n- `p`: `1`\n- `cipher`: `aes-128-ctr`\n\n# EthereumJS\n\nSee our organizational [documentation](https://ethereumjs.readthedocs.io) for an introduction to `EthereumJS` as well as information on current standards and best practices.\n\nIf you want to join for work or do improvements on the libraries have a look at our [contribution guidelines](https://ethereumjs.readthedocs.io/en/latest/contributing.html).\n\n## License\n\nMIT License\n\nCopyright (C) 2016 Alex Beregszaszi\n","readmeFilename":"README.md"}