{"_id":"@dmihal/ethereumjs-wallet","_rev":"1-ac66d7ed51543dcb2d47e420d3454b26","name":"@dmihal/ethereumjs-wallet","dist-tags":{"latest":"0.6.3"},"versions":{"0.6.3":{"name":"@dmihal/ethereumjs-wallet","version":"0.6.3","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","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":"https://github.com/dmihal/ethereumjs-wallet.git"},"keywords":["ethereum","wallets","keys"],"author":{"name":"Alex Beregszaszi","email":"alex@rtfs.hu"},"license":"MIT","bugs":{"url":"https://github.com/dmihal/ethereumjs-wallet/issues"},"homepage":"https://github.com/dmihal/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/lodash.zip":"^4.2.6","@types/mocha":"^5.2.7","@types/node":"^12.0.10","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"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2015 Alex Beregszaszi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@dmihal/ethereumjs-wallet@0.6.3","dist":{"shasum":"b5fb4fec578ae00d1ce1ed8d26371c9b0692c9ca","integrity":"sha512-/bVSo1c+dl39Lab+nogWIybbLt8aciN8isAixDBPqIDxhu/HGwdPFkzEHYeTyjrQ/CMzV4hPTcVQUwGp2wgyrw==","tarball":"https://registry.npmjs.org/@dmihal/ethereumjs-wallet/-/ethereumjs-wallet-0.6.3.tgz","fileCount":18,"unpackedSize":64870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefQ7eCRA9TVsSAnZWagAAF24QAJFW9JEI9rU3X1rIJymk\n2z+85CQZ04gCZIAV65mLvN9zEalasieVmsgTBazgNP7YZxWOvpPswwLNyJ5s\n3lJ3T1uRX9zcYieLfaiPCU5l5uT+19TcA+de8w9kl9QSy2eFgkMnTKrtpuam\nSCJlyO3CnDPth1BNPSYRubzlcWVHKYe4k4Z8HdaKNpmnV1Bku02G86J4z8PW\nNWi3jmnk7WisYob5WrVN3OI2e5iQRKTKUHyd7OfhsZsMZk6pgHYZT4NISC3u\njV5Cs9z0NxoXHwaicSTodEx9OhlsmmA3eE3MJjHDe6KdG+IEQbWCvDMKvKel\n4SRNfxoUfr2iun0M8u2LVj/mIE/bsVjD5HmuRSCHmOzSXtWRipIGd/cG0Jdf\ngmrwhppmotc813riFtspyLDarcvnnpgtgKhAQmUlf/Rmd56jmwlNBvWBO19h\neaK/w1KlGFgSGwEIwGgt5vZ3TeKwznmXrOLnHUCqB/mHvy6aD8VjU31bZc0u\nm5ADUjqdOe2wU5m+Gzdi5y3uOgw+rk0W7iVE/lRFQpFrUDXAFWQHuq47hZn1\nJOpxUivHVrs9iP3BEj7W7HXWOb+a1N5y/nSYCM/FymJKgvV2FSW47G8uSpVT\nZ2cS9RQ3lgu6ddYsMXIk5oG5MwmyQFPiYhoDYFxIVpzu9w0C8vS3nnke579a\nobD2\r\n=RmLs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDHJp1/tG9+v2wB0ZcDd31VyXtwpOVvo/Jj1tU6+RsIvAiEAjBBc4VCNDvmfwn14EiiZFGidYa28BWAHHzfGAtbMIwY="}]},"maintainers":[{"name":"dmihal","email":"david@dmihal.com"}],"_npmUser":{"name":"dmihal","email":"david@dmihal.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ethereumjs-wallet_0.6.3_1585254109556_0.2836676297941676"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-26T20:21:49.308Z","0.6.3":"2020-03-26T20:21:49.705Z","modified":"2022-04-05T04:58:33.097Z"},"maintainers":[{"name":"dmihal","email":"david@dmihal.com"}],"description":"Utilities for handling Ethereum keys","homepage":"https://github.com/dmihal/ethereumjs-wallet","keywords":["ethereum","wallets","keys"],"repository":{"type":"git","url":"https://github.com/dmihal/ethereumjs-wallet.git"},"author":{"name":"Alex Beregszaszi","email":"alex@rtfs.hu"},"bugs":{"url":"https://github.com/dmihal/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"}