{"_id":"@compound-finance/ethereumjs-wallet","_rev":"5-2942ed2338fb86cdcda8c469037efea1","name":"@compound-finance/ethereumjs-wallet","dist-tags":{"latest":"0.6.3"},"versions":{"0.6.3":{"name":"@compound-finance/ethereumjs-wallet","version":"0.6.3","keywords":["ethereum","wallets","keys"],"author":{"name":"Alex Beregszaszi","email":"alex@rtfs.hu"},"license":"MIT","_id":"@compound-finance/ethereumjs-wallet@0.6.3","maintainers":[{"name":"maxwolff","email":"maxcwolff@gmail.com"},{"name":"hayesgm","email":"geoff@compound.finance"}],"homepage":"https://github.com/ethereumjs/ethereumjs-wallet","bugs":{"url":"https://github.com/ethereumjs/ethereumjs-wallet/issues"},"dist":{"shasum":"707128975a68333df615f4098b51f82d983f7416","tarball":"https://registry.npmjs.org/@compound-finance/ethereumjs-wallet/-/ethereumjs-wallet-0.6.3.tgz","fileCount":10,"integrity":"sha512-GYg2GQ69sKvVBMA/JD1GLcikd1nhQbPSqCAYlrZwN942+8s6FZZ/DYLFH2ZgdRe5jSZF2R2NDKsQ6RdqjRMiDQ==","signatures":[{"sig":"MEUCIG50Q3Nao7lnKzavjPPW3u9h2bO3tO8eDkY3voIiB1izAiEA6BwvwBCg+4urh5kqfXj1K87hPOE0BihiBlvSMmZnMEk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":54706,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7E7ACRA9TVsSAnZWagAAhsUP/iJFtdNK6RbTg7WI7RPU\ny3n7kslUfGxV9BEZ77hGN6rzfZHT69DPv6JyWy78HqLeHdZMrZskckctT3wL\nJCNs9yh6gVzSVyT0Bmn9o2CvLRaWLNIK0K9U6Ke/O67KuKdubsnFUuAeLz3B\nHkVflq7cniXk5e4cwhrVWcYPsyWiOOFh11EBEnanhp+xSMZL5KpSYNEhlz7m\nYTnKguV3IiLWBCUMRpo1fywKXOQD2eIPgJGXSxgnrPmamDQ/WN7KpBE/LaCk\nSg03NY7BmAHgKVs7sHWADH09lsGTOLoI1xCh9tR8gwHdkwsS8CEkZQBAmq49\nW/wdW+CWvaxV/Pp3PUise/t3CrFUV56YAHOGtkqccq9ebQMZr00RBI1uEMzX\nW3OFzol7RIJlcZ5oiMQ0NvfITssGRowlIqx7eq9HszoCS/w+GzeyJewCLW1Z\nhP2CkykP3nyUO9vd1jNbFm214VvwQ1HKFT7iG1Ea/9tkQPpF7SBZwLaTNo1M\nD2+429ciAWn50MQt2m0EV0jgymlAXLPurwYgGq4Bp8VY0OPsABL5bf3piT84\n/3NDh5KBgPF3Gk7KVoNjSPNhsOXze1+/zCFYYhMuof6Z52Z/9S/mBh0ZZQ0V\nuVuoDat0Z7/RFOfJ5nI1twB4aVbTxmzmAPH2I+HlF/XEmT8qTxJwNBLwQsvt\nRaeb\r\n=mJJa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-push":"npm run lint"}},"gitHead":"607799c329a7086be599d59a0fa519bba664146a","scripts":{"lint":"standard","test":"mocha ./src/test/*.js","coverage":"istanbul cover _mocha","coveralls":"npm run build:dist && npm run coverage && coveralls <coverage/lcov.info","build:dist":"babel src/ -d .","test:build":"npm run build:dist"},"_npmUser":{"name":"hayesgm","email":"geoff@compound.finance"},"standard":{"ignore":["./*.js"],"globals":["describe","it"]},"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-wallet.git","type":"git"},"_npmVersion":"6.13.1","description":"Utilities for handling Ethereum keys","directories":{},"_nodeVersion":"13.2.0","dependencies":{"utf8":"^3.0.0","uuid":"^3.3.2","hdkey":"^1.1.1","aes-js":"^3.1.1","bs58check":"^2.1.2","randombytes":"^2.0.6","safe-buffer":"^5.1.2","ethereumjs-util":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^2.1.0","mocha":"^5.2.0","istanbul":"^0.4.5","standard":"^12.0.0","babel-cli":"^6.26.0","coveralls":"^3.0.0","babel-preset-env":"^1.7.0"},"_npmOperationalInternal":{"tmp":"tmp/ethereumjs-wallet_0.6.3_1575767744127_0.034623581505263124","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-12-08T01:15:43.860Z","modified":"2024-12-12T18:14:46.826Z","0.6.3":"2019-12-08T01:15:44.319Z"},"bugs":{"url":"https://github.com/ethereumjs/ethereumjs-wallet/issues"},"author":{"name":"Alex Beregszaszi","email":"alex@rtfs.hu"},"license":"MIT","homepage":"https://github.com/ethereumjs/ethereumjs-wallet","keywords":["ethereum","wallets","keys"],"repository":{"url":"git+https://github.com/ethereumjs/ethereumjs-wallet.git","type":"git"},"description":"Utilities for handling Ethereum keys","maintainers":[{"email":"arr00comp@gmail.com","name":"arr00"},{"email":"hayesgm@gmail.com","name":"hayesgm"},{"email":"adam@compound.finance","name":"ajb413"},{"email":"bhasinaryan@gmail.com","name":"aryanbhasin"}],"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- [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- 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- 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- 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- `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` - 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- `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"}