{"name":"hdkey","version":"2.0.0","description":"Bitcoin BIP32 hierarchical deterministic keys","main":"lib/hdkey.js","repository":{"type":"git","url":"git://github.com/cryptocoinjs/hdkey.git"},"license":"MIT","keywords":["bitcoin","bip32","bip","key","hierarchical","deterministic","crypto"],"bugs":{"url":"https://github.com/cryptocoinjs/hdkey/issues"},"homepage":"https://github.com/cryptocoinjs/hdkey","devDependencies":{"bigi":"^1.1.0","coveralls":"^3.0.4","ecurve":"^1.0.0","istanbul":"^0.4.5","mocha":"^6.1.4","mocha-lcov-reporter":"0.0.1","mochify":"^6.3.0","secure-random":"^1.0.0","standard":"^7.1.1"},"dependencies":{"bs58check":"^2.1.2","safe-buffer":"^5.1.1","secp256k1":"^4.0.0"},"scripts":{"lint":"standard","browser-test":"mochify --wd -R spec","test":"standard && mocha","unit":"mocha","coverage":"istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js","coveralls":"npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info"},"gitHead":"4cfb3b789a06f1fdbec12b790dcadc7aad2f395d","_id":"hdkey@2.0.0","_nodeVersion":"14.0.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-GO+TSEDFMdqz46TLkQM6dGR+y+RaN2p8E/GD7zxsr7trFVPEpoNukYL8INQ+1H2scgGvcFVDRcwOrEzkZxSVdw==","shasum":"4d5c146727bd23daaa3ec8c66366d1385f634a65","tarball":"http://registry-npm.ywwl.com/hdkey/download/hdkey-2.0.0.tgz","fileCount":5,"unpackedSize":18504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0RUqCRA9TVsSAnZWagAAGRwP/RgSslcXyldY06pLWhVi\nMtfaCwooubfzPzqcndNIrSfioxve2rA0pPdUQs108qIGqAgdKMFX7KaF1nn5\nv2ym45rY7Qs5RqVQ/pspb25oHHOqXBbTjsIa1+Q4edj1sDGZ4ONUTU8Zco8u\nrLQGf/Z0qleqqJ6+sx1nGJLuAY8SYe/7ZvskoiuqzZz+o3lVBndN0Ii0018k\nDyge2QQnVD9btu0c7Mr3eKa+9ZotJ/YE8IqgCboNcPZRnWJMW9gVryZsrpsV\nnGv+ZJ1I1+iegGukwGldh30b1OycDAXgiNGIv0yWxi172u+NjjtOU5vePGmP\nw73PMQXgJimZlKZP4AV7aeGrEttq07hzo06efMDXEg007vMku00HEl0KKXYI\nYmtkVO+Rb1QhKQTIbxpMLe1lt922iZ01NJknTh1PnQcl91Lpnpeh8HBJtQxN\ny3iLkqEycGs9wsxepuPkThL9KcCeQeEZg5+QXilxbxWlk97zNoGqcPJM9DBg\nMwIRzHoitkewZTqFo1HRHwXpYSggLaHSVD4WaOCZA9ARlHCH6SMceezkdhMW\nYPh3HRNHcQLdVv5SIs90rYIoRGbOcLRfoNPpsu/CkcRoZjkOXg+drUdfcXci\nu32s+Rdpbjq2gCkS1RXJT2lB04sO0VMkkqJGPAQSHRRfPRBqdtjlpTSqc86u\n8bs+\r\n=iEEj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcfoL5k99EsNwIBFlv4wUrcGuV5cWZuiw8lhh+YeTe7gIhAJSTl4cyy+aF0ln6BmNuMyv83xV8DWbi5WE0FdQsWfR0"}],"size":6888,"noattachment":false,"key":"/hdkey/-/hdkey-2.0.0.tgz"},"maintainers":[{"email":"jprichardson@gmail.com","name":"jprichardson"},{"email":"opensrc@ryanzim.com","name":"ryanzim"}],"_npmUser":{"name":"ryanzim","email":"opensrc@ryanzim.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hdkey_2.0.0_1590760745550_0.15771764189748638"},"_hasShrinkwrap":false,"deprecated":"Serious bug in hdkey v2.0.0; please use v2.0.1 or later. See https://github.com/cryptocoinjs/hdkey/pull/39 for details","readme":"hdkey\n=====\n\n[![NPM Package](https://img.shields.io/npm/v/hdkey.svg?style=flat-square)](https://www.npmjs.org/package/hdkey)\n[![build status](https://secure.travis-ci.org/cryptocoinjs/hdkey.svg)](http://travis-ci.org/cryptocoinjs/hdkey)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\nA JavaScript component for [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)(hierarchical deterministic keys).\n\n\nInstallation\n------------\n\n```bash\nnpm i --save hdkey\n```\n\n\nUsage\n-----\n\n**example:**\n\n```js\nvar HDKey = require('hdkey')\nvar seed = 'a0c42a9c3ac6abf2ba6a9946ae83af18f51bf1c9fa7dacc4c92513cc4dd015834341c775dcd4c0fac73547c5662d81a9e9361a0aac604a73a321bd9103bce8af'\nvar hdkey = HDKey.fromMasterSeed(Buffer.from(seed, 'hex'))\nconsole.log(hdkey.privateExtendedKey)\n// => 'xprv9s21ZrQH143K2SKJK9EYRW3Vsg8tWVHRS54hAJasj1eGsQXeWDHLeuu5hpLHRbeKedDJM4Wj9wHHMmuhPF8dQ3bzyup6R7qmMQ1i1FtzNEW'\nconsole.log(hdkey.publicExtendedKey)\n// => 'xpub661MyMwAqRbcEvPmRAmYndzERhyNux1GoHzHxgzVHMBFkCro3kbbCiDZZ5XabZDyXPj5mH3hktvkjhhUdCQxie5e1g4t2GuAWNbPmsSfDp2'\n```\n\n\n### `HDKey.fromMasterSeed(seedBuffer[, versions])`\n\nCreates an `hdkey` object from a master seed buffer. Accepts an optional `versions` object.\n\n```js\nvar seed = 'a0c42a9c3ac6abf2ba6a9946ae83af18f51bf1c9fa7dacc4c92513cc4dd015834341c775dcd4c0fac73547c5662d81a9e9361a0aac604a73a321bd9103bce8af'\nvar hdkey = HDKey.fromMasterSeed(Buffer.from(seed, 'hex'))\n```\n\n### `HDKey.fromExtendedKey(extendedKey[, versions, skipVerification])`\n\nCreates an `hdkey` object from a `xprv` or `xpub` extended key string. Accepts an optional `versions` object & an optional `skipVerification` boolean. If `skipVerification` is set to true, then the provided public key's x (and y if uncompressed) coordinate will not will be verified to be on the curve.\n\n```js\nvar key = 'xprvA2nrNbFZABcdryreWet9Ea4LvTJcGsqrMzxHx98MMrotbir7yrKCEXw7nadnHM8Dq38EGfSh6dqA9QWTyefMLEcBYJUuekgW4BYPJcr9E7j'\nvar hdkey = HDKey.fromExtendedKey(key)\n```\n\n**or**\n\n```js\nvar key = 'xpub6FnCn6nSzZAw5Tw7cgR9bi15UV96gLZhjDstkXXxvCLsUXBGXPdSnLFbdpq8p9HmGsApME5hQTZ3emM2rnY5agb9rXpVGyy3bdW6EEgAtqt'\nvar hdkey = HDKey.fromExtendedKey(key)\n```\n\n### `HDKey.fromJSON(obj)`\n\nCreates an `hdkey` object from an object created via `hdkey.toJSON()`.\n\n---\n\n### `hdkey.derive(path)`\n\nDerives the `hdkey` at `path` from the current `hdkey`.\n\n```js\nvar seed = 'fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542'\nvar hdkey = HDKey.fromMasterSeed(Buffer.from(seed, 'hex'))\nvar childkey = hdkey.derive(\"m/0/2147483647'/1\")\n\nconsole.log(childkey.privateExtendedKey)\n// -> \"xprv9zFnWC6h2cLgpmSA46vutJzBcfJ8yaJGg8cX1e5StJh45BBciYTRXSd25UEPVuesF9yog62tGAQtHjXajPPdbRCHuWS6T8XA2ECKADdw4Ef\"\nconsole.log(childkey.publicExtendedKey)\n// -> \"xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon\"\n```\n\nNewer, \"hardened\" derivation paths look like this:\n\n```js\n// as defined by BIP-44\nvar childkey = hdkey.derive(\"m/44'/0'/0'/0/0\");\n```\n\n### `hdkey.sign(hash)`\n\nSigns the buffer `hash` with the private key using `secp256k1` and returns the signature as a buffer.\n\n### `hdkey.verify(hash, signature)`\n\nVerifies that the `signature` is valid for `hash` and the `hdkey`'s public key using `secp256k1`. Returns `true` for valid, `false` for invalid. Throws if the `hash` or `signature` is the wrong length.\n\n### `hdkey.wipePrivateData()`\n\nWipes all record of the private key from the `hdkey` instance. After calling this method, the instance will behave as if it was created via `HDKey.fromExtendedKey(xpub)`.\n\n### `hdkey.toJSON()`\n\nSerializes the `hdkey` to an object that can be `JSON.stringify()`ed.\n\n```js\nvar seed = 'fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542'\nvar hdkey = HDKey.fromMasterSeed(Buffer.from(seed, 'hex'))\n\nconsole.log(hdkey.toJSON())\n// -> {\n//      xpriv: 'xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U',\n//      xpub: 'xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB'\n//    }\n```\n\n### `hdkey.privateKey`\n\nGetter/Setter of the `hdkey`'s private key, stored as a buffer.\n\n### `hdkey.publicKey`\n\nGetter/Setter of the `hdkey`'s public key, stored as a buffer.\n\n### `hdkey.privateExtendedKey`\n\nGetter/Setter of the `hdkey`'s `xprv`, stored as a string.\n\n### `hdkey.publicExtendedKey`\n\nGetter/Setter of the `hdkey`'s `xpub`, stored as a string.\n\nReferences\n----------\n- https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/src/hdnode.js\n- http://bip32.org/\n- http://blog.richardkiss.com/?p=313\n- https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki\n- http://bitcoinmagazine.com/8396/deterministic-wallets-advantages-flaw/\n\n\nLicense\n-------\n\nMIT\n","publish_time":1590760745643,"_cnpm_publish_time":1590760745643,"dist-tags":{"latest":"2.1.0"}}