{"_id":"j-bsv","_rev":"3-e18d5785157140ea3cd81927e537efde","time":{"created":"2024-02-09T05:02:03.508Z","1.0.0":"2024-01-27T22:33:18.260Z","modified":"2024-03-20T19:02:32.605Z","1.0.1":"2024-02-09T05:02:03.738Z"},"name":"j-bsv","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"j-bsv","version":"1.0.1","description":"BitcoinSV Custodial & non-Custodial Wallets","main":"index.js","types":"index.d.ts","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git+https://github.com/yfbsei/J-BSV.git"},"type":"module","author":{"name":"yfbsei"},"license":"ISC","dependencies":{"@noble/secp256k1":"^1.6.3","base58-js":"^1.0.4","bigint-conversion":"^2.2.2","bn.js":"^5.2.1"},"keywords":["secp256k1","secp","secp256","elliptic","elliptic curve","curve","signature","ecc","TTS","BSV","sig","bip0340","bip340","bitcoin","bip","ecdsa","endomorphism","cryptography","security","yfbsei","Jamallo","Threshold signature"],"bugs":{"url":"https://github.com/yfbsei/J-BSV/issues"},"homepage":"https://github.com/yfbsei/J-BSV#readme","_id":"j-bsv@1.0.1","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-U82vvDx0irJFUfekcD73hrBv4rIMg3g1fXXzK+GfTVgStPGRzJzhvGCgw1xg2lP1IdCKsgm5PNFPb3JAfhJl4w==","shasum":"d271e3515e3107464d74dd2dab35decee5cd6eac","tarball":"https://registry.npmjs.org/j-bsv/-/j-bsv-1.0.1.tgz","fileCount":15,"unpackedSize":53896,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGIe2eMYdSRNEtma3gaE+CUga60bBUtEcrj3U1tXo6QtAiBPRVdBngq3kGKZDCqLRDcF4eHPe3vOgeBuys/GvQdY6Q=="}]},"_npmUser":{"name":"yfbsei","email":"yfbsei@yandex.com"},"directories":{},"maintainers":[{"name":"yfbsei","email":"yfbsei@yandex.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/j-bsv_1.0.1_1707454923508_0.9512056405892895"},"_hasShrinkwrap":false,"deprecated":"This project has been renamed. Install using npm i j-bitcoin"}},"maintainers":[{"name":"yfbsei","email":"yfbsei@yandex.com"}],"description":"BitcoinSV Custodial & non-Custodial Wallets","homepage":"https://github.com/yfbsei/J-BSV#readme","keywords":["secp256k1","secp","secp256","elliptic","elliptic curve","curve","signature","ecc","TTS","BSV","sig","bip0340","bip340","bitcoin","bip","ecdsa","endomorphism","cryptography","security","yfbsei","Jamallo","Threshold signature"],"repository":{"type":"git","url":"git+https://github.com/yfbsei/J-BSV.git"},"author":{"name":"yfbsei"},"bugs":{"url":"https://github.com/yfbsei/J-BSV/issues"},"license":"ISC","readme":"# J-BSV\nBitcoinSV Custodial &amp; non-Custodial Wallets | Threshold signature\n\n## Getting started\n`npm i j-bsv`\n\\\n\\\n`import { Custodial_Wallet, Non_Custodial_Wallet } from 'j-bsv';`\n\n## Custodial Wallet\n\n### Generate wallet\nMaster wallet(HD)\n\\\n`const [mnemonic, wallet] = Custodial_Wallet.fromRandom('main'); // main network`\n\\\n`const [mnemonic, wallet] = Custodial_Wallet.fromRandom('test'); // test network`\n\n### Import from mnemonic\n```\nconst \n    mnemonic = \"teach scatter sample solar casino festival decrease pause random drip memory mystery\",\n    wallet = Custodial_Wallet.fromMnemonic('main', mnemonic);\n```\n\n### Import from seed\n```\nconst \n    seed = \"000102030405060708090a0b0c0d0e0f\",\n    wallet = Custodial_Wallet.fromSeed('main', seed);\n```\n\n### Password\n```\nconst [mnemonic, wallet] = Custodial_Wallet.fromRandom('main', 'password123');\n// ...\nconst wallet = Custodial_Wallet.fromMnemonic('main', mnemonic, 'password123');\n// Incorrect password returns random wallet\n```\n\n### Derive child \n`wallet.derive(\"m/0\", 'pri');`\n\\\n\\\nPublic Keys can't derive from a hardend path \\\n`wallet.derive(\"m/0'\", 'pub'); // Throws Error`\n\n### Signature\nsign\n\\\n`const {sig, serialized_sig, msgHash, recovery_id} = wallet.sign('hello world');`\n\nverfiy siganture\n\\\n`wallet.verifySig(sig, msgHash); // true`\n\n\n## Non-Custodial Wallet\n\n### Generate wallet\n`const wallet = Non_Custodial_Wallet.fromRandom(\"main\", 3, 2); // main network`\n\\\n`const wallet = Non_Custodial_Wallet.fromRandom(\"test\", 3, 2); // test network`\n\n### Import from shares\n```\nconst shares = [\n    '79479395a59a8e9d930f2b10ccd5ac3671b0ff0bf8a66aaa1d74978c5353694b',\n    '98510126c920e18b148130ac1145686cb299d21f0e010b98ede44169a7bb1c13',\n    'b75a6eb7eca7347895f3364755b524a2f382a532235bac87be53eb46fc22cedb'\n  ]\n\nconst wallet = Non_Custodial_Wallet.fromShares(\"main\", shares, 2);\n```\n\n### Shares\n`const share_for_each_participant = wallet.getShares();`\n\n### Restore private key\n`const groups_prikey = wallet.restore_pri_key();`\n\n### Signature\nsign\n\\\n`const { sig, serialized_sig, msgHash, recovery_id } = wallet.sign(\"hello world\");`\n\nverfiy siganture\n\\\n`wallet.verifySig(sig, msgHash); // true`\n\n","readmeFilename":"README.md"}