{"_id":"@bitcoinerlab/descriptors-scure","_rev":"9-fd5c83f454327ffe825d0f5c049eeca7","name":"@bitcoinerlab/descriptors-scure","dist-tags":{"latest":"3.2.0"},"versions":{"3.1.0":{"name":"@bitcoinerlab/descriptors-scure","version":"3.1.0","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"license":"MIT","_id":"@bitcoinerlab/descriptors-scure@3.1.0","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"homepage":"https://github.com/bitcoinerlab/descriptors","bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"dist":{"shasum":"ec5de63af0826948694e071adc886c625b5ab28d","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.1.0.tgz","fileCount":4,"integrity":"sha512-iKf1DscbtELpiu0XnVGQO3o/3aVhuSoXTXFVnFz1evoLVrfKOSfZ1wgilQULR6Av4/SSOE2QQC5w5+JZ75hWKQ==","signatures":[{"sig":"MEQCIBQwRutdJFmDYIEfvemZg+V5GiO392AcIJdY6JlBR0a4AiBBFjvgJSsjwtigFc34y3mNTU7U2ek0e4JyoziJO6TYDg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2846},"main":"./index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"gitHead":"d564c79d41b5c1248a73b8aff9982347651c1574","_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"repository":{"url":"git+https://github.com/bitcoinerlab/descriptors.git","type":"git"},"_npmVersion":"10.8.2","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@scure/base":"^2.0.0","@scure/bip32":"^2.0.1","@noble/curves":"^2.0.1","@scure/btc-signer":"^2.0.1","@bitcoinerlab/descriptors-core":"^3.1.0"},"_hasShrinkwrap":false,"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.0"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/descriptors-scure_3.1.0_1774432589913_0.39816736209697057","host":"s3://npm-registry-packages-npm-production"}},"3.1.1":{"name":"@bitcoinerlab/descriptors-scure","version":"3.1.1","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"author":{"name":"Jose-Luis Landabaso"},"license":"MIT","_id":"@bitcoinerlab/descriptors-scure@3.1.1","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"homepage":"https://github.com/bitcoinerlab/descriptors","bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"dist":{"shasum":"a1798afca210b0baa6c9ecb664252c91c469a654","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.1.1.tgz","fileCount":4,"integrity":"sha512-7DgwZwoNDCzQXNZlUIL3os3Mpb42xOtAoWiLPpc+FQFB0q2aS6jUG1RAvmmghBUVZXQrDEDfxfdQoSFGlmzzoQ==","signatures":[{"sig":"MEYCIQC+Drq4z1/7tzJMTLFv+WqZPx7V4mSMKvJHwiZFZ+JDEAIhAL84JEe+aAN+kUjvTcUGeI6BcxtBWzNSLc53V6OLhUfv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3487},"main":"./index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"gitHead":"d564c79d41b5c1248a73b8aff9982347651c1574","_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"repository":{"url":"git+https://github.com/bitcoinerlab/descriptors.git","type":"git"},"_npmVersion":"10.8.2","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@scure/base":"^2.0.0","@scure/bip32":"^2.0.1","@noble/curves":"^2.0.1","@scure/btc-signer":"^2.0.1","@bitcoinerlab/descriptors-core":"^3.1.0"},"_hasShrinkwrap":false,"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.0"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/descriptors-scure_3.1.1_1774434167829_0.5479130583927625","host":"s3://npm-registry-packages-npm-production"}},"3.1.2":{"name":"@bitcoinerlab/descriptors-scure","version":"3.1.2","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"author":{"name":"Jose-Luis Landabaso"},"license":"MIT","_id":"@bitcoinerlab/descriptors-scure@3.1.2","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"homepage":"https://github.com/bitcoinerlab/descriptors","bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"dist":{"shasum":"acefa7371d9600ca77d97585886251127e25b09b","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.1.2.tgz","fileCount":4,"integrity":"sha512-BrOA/1IstZpzlrAqSX5VbpJaHZBjR2cqqV7hwu6BVR+aQzNmhy5bvjH0OcsWpG0j/GDy0d19DevCBFdEbBT5PQ==","signatures":[{"sig":"MEUCIHj5aqkJifX2vzw8VK4j/zGx3jsdJahL6EM5mKe0xZ18AiEAgIbRz3G30zAcwq7nvDQtB8FqT4ly40CYnG+JhIWNtpk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3530},"main":"./index.js","types":"./index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"gitHead":"d564c79d41b5c1248a73b8aff9982347651c1574","_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"repository":{"url":"git+https://github.com/bitcoinerlab/descriptors.git","type":"git"},"_npmVersion":"10.8.2","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@scure/base":"^2.0.0","@scure/bip32":"^2.0.1","@noble/curves":"^2.0.1","@scure/btc-signer":"^2.0.1","@bitcoinerlab/descriptors-core":"3.1.2"},"_hasShrinkwrap":false,"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.0"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/descriptors-scure_3.1.2_1774445622469_0.5421069089105941","host":"s3://npm-registry-packages-npm-production"}},"3.1.3":{"name":"@bitcoinerlab/descriptors-scure","version":"3.1.3","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"author":{"name":"Jose-Luis Landabaso"},"license":"MIT","_id":"@bitcoinerlab/descriptors-scure@3.1.3","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"homepage":"https://github.com/bitcoinerlab/descriptors","bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"dist":{"shasum":"365f37578b3539dd9b4bc681662b06aaa6e29fcd","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.1.3.tgz","fileCount":4,"integrity":"sha512-ZMXUz5ESa4gisXtA8KdqiYmkrYolD3z8yGdVj3JjeFoRsw2xO0SG3aIX3rq7bbqouY7mFFXNwr4osPzh3CaM/Q==","signatures":[{"sig":"MEUCIQDYzKkCNYN40p70Iu2fbHvCKSZ//SLrSThPLsvR0h8RtgIgFgU9dYkaJk7rqITTeOc/qbxzuQj0GD2Btn3y3sG2cpE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3530},"main":"./index.js","types":"./index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"gitHead":"dbe537a45c1ee185e3ad9e1387284007db8b5fbc","_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"repository":{"url":"git+https://github.com/bitcoinerlab/descriptors.git","type":"git"},"_npmVersion":"10.8.2","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@scure/base":"^2.0.0","@scure/bip32":"^2.0.1","@noble/curves":"^2.0.1","@scure/btc-signer":"^2.0.1","@bitcoinerlab/descriptors-core":"3.1.3"},"_hasShrinkwrap":false,"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.1"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/descriptors-scure_3.1.3_1774452203032_0.657551274898418","host":"s3://npm-registry-packages-npm-production"}},"3.1.4":{"name":"@bitcoinerlab/descriptors-scure","version":"3.1.4","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"author":{"name":"Jose-Luis Landabaso"},"license":"MIT","_id":"@bitcoinerlab/descriptors-scure@3.1.4","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"homepage":"https://github.com/bitcoinerlab/descriptors","bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"dist":{"shasum":"75357391a9fca9d393dd34df65aac435d35d1243","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.1.4.tgz","fileCount":4,"integrity":"sha512-r2m1vLh4k5OhDgfh8TnBLeUWaVc9GXiXCR24gf0zJp1LhDA/i+KYO1WaYplibJK44mKWi1uIkBdw499dqymTLw==","signatures":[{"sig":"MEYCIQDJcyxJIltjMLvnMtV/yZ1FxswUa4EJyWMBc89LGSTj+wIhAM9ePdX+yuwDWfDuNAoFvqDJkWWMHMH+lAayL7vR72CZ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3561},"main":"./index.js","types":"./index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"gitHead":"7d70765569ba39eeeb20995c06ae24a64daeae82","_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"repository":{"url":"git+https://github.com/bitcoinerlab/descriptors.git","type":"git"},"_npmVersion":"10.8.2","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@scure/base":"^2.0.0","@scure/bip32":"^2.0.1","@noble/curves":"^2.0.1","@noble/hashes":"^2.0.1","@scure/btc-signer":"^2.0.1","@bitcoinerlab/descriptors-core":"3.1.4"},"_hasShrinkwrap":false,"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.1"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/descriptors-scure_3.1.4_1774531003101_0.421598623258141","host":"s3://npm-registry-packages-npm-production"}},"3.1.5":{"name":"@bitcoinerlab/descriptors-scure","version":"3.1.5","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"author":{"name":"Jose-Luis Landabaso"},"license":"MIT","_id":"@bitcoinerlab/descriptors-scure@3.1.5","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"homepage":"https://github.com/bitcoinerlab/descriptors","bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"dist":{"shasum":"ad618b1169b4ea7a207aadc8a25d1135ae9a3b9e","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.1.5.tgz","fileCount":6,"integrity":"sha512-GJPQuTHbN58a479RIkjvsFvo9IRqf22gvcOHsu2drouIZV14XW2gYgDBVuHgyP73r/F4kSt0Jq3jkbhhYOkVEA==","signatures":[{"sig":"MEUCIHcFwmo5kbqz/MV3ULmpXC7OOMdcpoOrY8/mLq3Doa0rAiEAi40f96npbmjOh7baBJlKOj3nwiTRfuF/ftA+GKWNr74=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11262},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./ledger":{"types":"./dist/ledger.d.ts","default":"./dist/ledger.js"}},"gitHead":"096c3631c45f6c14a321bba8492a8203294776ab","scripts":{"build":"npm --prefix ../.. run build:src && tsc --project ./tsconfig.json","prepack":"npm run build"},"_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"repository":{"url":"git+https://github.com/bitcoinerlab/descriptors.git","type":"git"},"_npmVersion":"10.8.2","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@scure/base":"^2.0.0","@scure/bip32":"^2.0.1","@noble/curves":"^2.0.1","@noble/hashes":"^2.0.1","@scure/btc-signer":"^2.0.1","@bitcoinerlab/descriptors-core":"3.1.5"},"_hasShrinkwrap":false,"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.1"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/descriptors-scure_3.1.5_1774894019161_0.8551365520623999","host":"s3://npm-registry-packages-npm-production"}},"3.1.6":{"name":"@bitcoinerlab/descriptors-scure","version":"3.1.6","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"author":{"name":"Jose-Luis Landabaso"},"license":"MIT","_id":"@bitcoinerlab/descriptors-scure@3.1.6","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"homepage":"https://github.com/bitcoinerlab/descriptors","bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"dist":{"shasum":"aad4bd14c1410111c05ac5335c2ebed29b9e1906","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.1.6.tgz","fileCount":6,"integrity":"sha512-yv2DB4ZlgQswsZH5QVRPoViC/6f85x9GQRwvnC2VOp9e/a9Kb4U2RSnTu11w94wPIcO1zEninbRhc1ciMokRJQ==","signatures":[{"sig":"MEQCICiiAzr0CxyHQgq5BrJ2RkxfunDtqef2x1aCQ4q3GoiCAiAGcSzWqHOF9RDDfHqZ1B4VOHIND39bAsHukCSrs3S6sA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11285},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./ledger":{"types":"./dist/ledger.d.ts","default":"./dist/ledger.js"}},"gitHead":"97ca743eeab0b6ecf488a3977d18e05b71c839af","scripts":{"build":"npm --prefix ../.. run build:src && tsc --project ./tsconfig.json","prepublishOnly":"rm -rf dist/ && npm run build"},"_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"repository":{"url":"git+https://github.com/bitcoinerlab/descriptors.git","type":"git"},"_npmVersion":"10.8.2","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@scure/base":"^2.0.0","@scure/bip32":"^2.0.1","@noble/curves":"^2.0.1","@noble/hashes":"^2.0.1","@scure/btc-signer":"^2.0.1","@bitcoinerlab/descriptors-core":"3.1.6"},"_hasShrinkwrap":false,"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.1"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/descriptors-scure_3.1.6_1774898519154_0.7154375574042107","host":"s3://npm-registry-packages-npm-production"}},"3.1.7":{"name":"@bitcoinerlab/descriptors-scure","version":"3.1.7","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"author":{"name":"Jose-Luis Landabaso"},"license":"MIT","_id":"@bitcoinerlab/descriptors-scure@3.1.7","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"homepage":"https://github.com/bitcoinerlab/descriptors","bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"dist":{"shasum":"12d57ac92d4e4f5ecf7d2692a4c1da3a46b96b02","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.1.7.tgz","fileCount":6,"integrity":"sha512-jeyi8L3hzOquJn3t5w+NY3G93B/amZw83xeF8hrpwe7w4FMt2SH2o9rithEydQ2tP3Tlqfog+LnJOOChmfFPWw==","signatures":[{"sig":"MEYCIQDR8XZ6C3NwdoI+btNP/BezVO+UmZkcZKfOL/sKXPjHpgIhAOwetmN1U2MMHI78cCBoQOxs6fKfmDUWFqOnGao87kq/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43995},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./ledger":{"types":"./dist/ledger.d.ts","default":"./dist/ledger.js"}},"gitHead":"97ca743eeab0b6ecf488a3977d18e05b71c839af","scripts":{"build":"npm --prefix ../.. run build:src && tsc --project ./tsconfig.json","prepublishOnly":"cp ../../README.md README.md && rm -rf dist/ && npm run build"},"_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"repository":{"url":"git+https://github.com/bitcoinerlab/descriptors.git","type":"git"},"_npmVersion":"10.8.2","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@scure/base":"^2.0.0","@scure/bip32":"^2.0.1","@noble/curves":"^2.0.1","@noble/hashes":"^2.0.1","@scure/btc-signer":"^2.0.1","@bitcoinerlab/descriptors-core":"3.1.7"},"_hasShrinkwrap":false,"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.1"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/descriptors-scure_3.1.7_1774938028904_0.877343864564512","host":"s3://npm-registry-packages-npm-production"}},"3.2.0":{"name":"@bitcoinerlab/descriptors-scure","version":"3.2.0","description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","author":{"name":"Jose-Luis Landabaso"},"license":"MIT","homepage":"https://github.com/bitcoinerlab/descriptors","repository":{"type":"git","url":"git+https://github.com/bitcoinerlab/descriptors.git"},"bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"engines":{"node":">=20.19.0"},"keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"peerDependencies":{"@ledgerhq/ledger-bitcoin":"^0.3.1"},"peerDependenciesMeta":{"@ledgerhq/ledger-bitcoin":{"optional":true}},"scripts":{"build":"npm --prefix ../.. run build:src && tsc --project ./tsconfig.json","prepublishOnly":"cp ../../README.md README.md && cp ../../HARDWARE_WALLETS.md HARDWARE_WALLETS.md && rm -rf dist/ && npm run build"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./ledger":{"types":"./dist/ledger.d.ts","default":"./dist/ledger.js"},"./bitbox":{"types":"./dist/bitbox.d.ts","default":"./dist/bitbox.js"}},"dependencies":{"@bitcoinerlab/descriptors-core":"3.2.0","@noble/hashes":"^2.4.0","@noble/curves":"^2.4.0","@scure/base":"^2.3.0","@scure/bip32":"^2.3.0","@scure/btc-signer":"^2.3.0"},"_id":"@bitcoinerlab/descriptors-scure@3.2.0","gitHead":"53cfdaaa1a4d603272ee53069ebbe7736a482c00","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-cswB+6OmIoyAiQEDtv+eGkotmfIZbC+K4WiNIYlZTepLsIAJtWFkeTUCFfjBSZ630vUsUwwk9I4ZSHvPqIN5hA==","shasum":"b7b122133ad03bda7cf0921d20a89c0615f9631f","tarball":"https://registry.npmjs.org/@bitcoinerlab/descriptors-scure/-/descriptors-scure-3.2.0.tgz","fileCount":11,"unpackedSize":78109,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDjhNPc7T+HW2c0pb1ev+WDtSn0nIAi9MYZw944AxKJYQIgQQ8nrfhxgU+RXQc4Xn8W8qwDTINhlG7JXXD09IufN7k="}]},"_npmUser":{"name":"jl.landabaso","email":"landabaso@gmail.com"},"directories":{},"maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/descriptors-scure_3.2.0_1788116453563_0.7933996104016938"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-25T09:56:29.801Z","modified":"2026-08-30T19:00:53.878Z","3.1.0":"2026-03-25T09:56:30.067Z","3.1.1":"2026-03-25T10:22:47.953Z","3.1.2":"2026-03-25T13:33:42.633Z","3.1.3":"2026-03-25T15:23:23.173Z","3.1.4":"2026-03-26T13:16:43.251Z","3.1.5":"2026-03-30T18:06:59.323Z","3.1.6":"2026-03-30T19:21:59.306Z","3.1.7":"2026-03-31T06:20:29.109Z","3.2.0":"2026-08-30T19:00:53.706Z"},"bugs":{"url":"https://github.com/bitcoinerlab/descriptors/issues"},"author":{"name":"Jose-Luis Landabaso"},"license":"MIT","homepage":"https://github.com/bitcoinerlab/descriptors","keywords":["bitcoin","descriptors","miniscript","psbt","scure","noble","btc-signer","bip32"],"repository":{"type":"git","url":"git+https://github.com/bitcoinerlab/descriptors.git"},"description":"This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets, bundled for the scure/noble family of lib","maintainers":[{"name":"jl.landabaso","email":"landabaso@gmail.com"}],"readme":"# Bitcoin Descriptors Library\n\nThis library is designed to parse and create Bitcoin Descriptors, including Miniscript and Taproot script trees and generate Partially Signed Bitcoin Transactions (PSBTs). It also provides PSBT signers and finalizers for single-key, BIP32 and hardware-wallet flows.\n\nThis library uses an underlying Bitcoin library for creating, signing & decoding transactions. Users can pick:\n\n- `@bitcoinerlab/descriptors` for the [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) and [bitcoinjs](https://github.com/bitcoinjs) family of libraries: battle-tested and broadly used.\n- `@bitcoinerlab/descriptors-scure` for [@scure/btc-signer](https://github.com/paulmillr/scure-btc-signer) and the [noble](https://github.com/paulmillr/noble-curves)/[scure](https://github.com/paulmillr/scure-btc-signer) family of libraries: audited, fast and minimal.\n- `@bitcoinerlab/descriptors-core` as the low-level package used under the preset packages. Most users should treat it as internal, but advanced users can use it directly when they need explicit control over backend setup.\n\n## TL;DR (quick start)\n\n_Using `@bitcoinerlab/descriptors-scure`? See the scure variant right below._\n\n```bash\nnpm install @bitcoinerlab/descriptors @bitcoinerlab/miniscript-policies\n```\n\nThis quick example compiles a timelocked Miniscript policy, creates a descriptor address to fund, then builds, signs, and finalizes a PSBT that spends that funded UTXO and prints the final transaction hex.\n\n```javascript\nimport { ECPair, Output, Psbt, signers } from '@bitcoinerlab/descriptors'; // bitcoinjs-ready package\n\nconst ecpair = ECPair.makeRandom(); // Creates a signer for a single-key wallet\n\n// Timelocked policy: signature + relative timelock (older)\nconst { miniscript } = compilePolicy('and(pk(@bob),older(10))');\n\nconst descriptor = `wsh(${miniscript.replace('@bob', toHex(ecpair.publicKey))})`;\n\n// 1) Build the output description\nconst fundedOutput = new Output({ descriptor });\nconst address = fundedOutput.getAddress(); // Fund this address\n\n// 2) Prepare PSBT input/output\nconst psbt = new Psbt();\n\nconst txHex = 'FUNDING_TX_HEX'; // hex of the tx that funded the address above\nconst vout = 0; // Output index (vout) of that UTXO within FUNDING_TX_HEX\nconst finalizeInput = fundedOutput.updatePsbtAsInput({ psbt, txHex, vout });\n\nconst recipient = new Output({\n  descriptor: 'addr(bc1qgw6xanldsz959z45y4dszehx4xkuzf7nfhya8x)'\n}); // Final address where we'll send the funds after timelock\nrecipient.updatePsbtAsOutput({ psbt, value: 10000n }); // input covers this+fees\n\n// 3) Sign and finalize\nsigners.signECPair({ psbt, ecpair });\nfinalizeInput({ psbt });\n\nconsole.log('Push this: ' + psbt.extractTransaction().toHex());\n```\n\n<details>\n  <summary>Click to see the scure variant</summary>\n\n```bash\nnpm install @bitcoinerlab/descriptors-scure @bitcoinerlab/miniscript-policies\n```\n\n```typescript\nimport { Output, btc, secp256k1, signers } from '@bitcoinerlab/descriptors-scure';\n\nconst privKey = btc.utils.randomPrivateKeyBytes();\nconst pubkey = secp256k1.getPublicKey(privKey, true);\n\n// Timelocked policy: signature + relative timelock (older)\nconst { miniscript } = compilePolicy('and(pk(@bob),older(10))');\n\nconst descriptor = `wsh(${miniscript.replace('@bob', toHex(pubkey))})`;\n\n// 1) Build the output description\nconst fundedOutput = new Output({ descriptor });\nconst address = fundedOutput.getAddress(); // Fund this address\n\n// 2) Prepare transaction input/output\nconst psbt = new btc.Transaction();\n\nconst txHex = 'FUNDING_TX_HEX'; // hex of the tx that funded the address above\nconst vout = 0; // Output index (vout) of that UTXO within FUNDING_TX_HEX\nconst finalizeInput = fundedOutput.updatePsbtAsInput({ psbt, txHex, vout });\n\nconst recipient = new Output({\n  descriptor: 'addr(bc1qgw6xanldsz959z45y4dszehx4xkuzf7nfhya8x)'\n});\nrecipient.updatePsbtAsOutput({ psbt, value: 10000n }); // input covers this+fees\n\n// 3) Sign and finalize\nsigners.signPrivKey({ psbt, privKey });\nfinalizeInput({ psbt });\n\nconsole.log('Push this: ' + psbt.hex);\n```\n\n</details>\n\n## Features\n\n- Parses and creates [Bitcoin Descriptors](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md) (including those based on the [Miniscript language](https://bitcoinerlab.com/modules/miniscript)).\n- Supports Taproot descriptors with trees: `tr(KEY,TREE)` (tapscript).\n- Generates Partially Signed Bitcoin Transactions (PSBTs).\n- Provides PSBT finalizers and signers for single-signature, BIP32 and hardware-wallet flows.\n- Provides optional Ledger and BitBox integrations for both bitcoinjs and Scure.\n\n### Version Compatibility\n\nStarting in `3.x`, `@bitcoinerlab/descriptors` is aligned with the modern bitcoinjs stack (`bitcoinjs-lib 7.x`).\n\nIn practical terms, this means:\n\n- byte arrays are represented as `Uint8Array`;\n- satoshi values are represented as `bigint`.\n\nIf you need older bitcoinjs versions, keep using `@bitcoinerlab/descriptors 2.x`.\nIf you want Taproot trees (`tr(KEY,TREE)`), use `3.x+`.\n\nStarting in `3.1.x`, scure users can install\n`@bitcoinerlab/descriptors-scure`.\n\nVersion `3.2.0` requires Node.js `>=20.19.0`.\n\n## Concepts\n\nThis library has two main capabilities related to Bitcoin descriptors. Firstly, it can generate `addresses` and `scriptPubKeys` from descriptors. These `addresses` and `scriptPubKeys` can be used to receive funds from other parties. Secondly, the library is able to sign transactions and spend unspent outputs described by those same descriptors. In order to do this, the descriptors must first be set into a PSBT.\n\nIf you are not familiar with _Bitcoin descriptors_ and _partially signed Bitcoin transactions (PSBTs)_, click on the section below to expand and read more about these concepts.\n\n<details>\n  <summary>Concepts</summary>\n\n### Descriptors\n\nIn Bitcoin, a transaction consists of a set of inputs that are spent into a different set of outputs. Each input spends an output in a previous transaction. A Bitcoin descriptor is a string of text that describes the rules and conditions required to spend an output in a transaction.\n\nFor example, `wpkh(02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9)` is a descriptor that describes a pay-to-witness-public-key-hash (P2WPKH) type of output with the specified public key. If you know the corresponding private key for the transaction for which this descriptor is an output, you can spend it.\n\nDescriptors can express much more complex conditions, such as multi-party cooperation, time-locked outputs and more. These conditions can be expressed using the Bitcoin Miniscript language, which is a way of writing Bitcoin Scripts in a structured and more easily understandable way.\n\n### Partially Signed Bitcoin Transactions (PSBTs)\n\nA PSBT (Partially Signed Bitcoin Transaction) is a format for sharing Bitcoin transactions between different parties.\n\nPSBTs come in handy when working with descriptors, especially when using scripts, because they allow multiple parties to collaborate in the signing process. This is especially useful when using hardware wallets or other devices that require separate signatures or authorizations.\n\n</details>\n\n## Usage\n\nBefore we dive in, it's worth mentioning that we have several comprehensive guides available covering different aspects of the library. These guides provide explanations and code examples in interactive playgrounds, allowing you to see the changes in the output as you modify the code. This hands-on learning experience, combined with clear explanations, helps you better understand how to use the library effectively. [Check out the available guides here](https://bitcoinerlab.com/guides).\n\nFurthermore, we've meticulously documented our API. For an in-depth look into Classes, functions and types, head over [here](https://bitcoinerlab.com/modules/descriptors/api).\n\nFor most users, install the package that matches your preferred Bitcoin library.\n\nBitcoinjs backend:\n\n```bash\nnpm install @bitcoinerlab/descriptors\n```\n\nScure/noble backend:\n\n```bash\nnpm install @bitcoinerlab/descriptors-scure\n```\n\nChoose one backend for an application. Loading both preset packages together is\nnot supported because existing Outputs and PSBTs must keep using the backend\nthat created them. If you need both, isolate them in separate processes or\nworkers.\n\nIf you plan to compile policy strings into Miniscript in your app, also install:\n\n```bash\nnpm install @bitcoinerlab/miniscript-policies\n```\n\nThe examples below keep the bitcoinjs stack visible by default. When\nbackend-specific code differs, a collapsible scure variant is shown right\nbelow.\n\n<details>\n  <summary>Compatibility note for existing @bitcoinerlab/descriptors users</summary>\n\nThe root `@bitcoinerlab/descriptors` package still keeps a few 3.x compatibility shims, but they are deprecated and planned for removal in the next major release:\n\n- `DescriptorsFactory()` and `DescriptorsFactory(ecc)` on the root package\n\nFor new code, prefer the preset top-level exports directly. `DescriptorsFactory(...)` on `@bitcoinerlab/descriptors` is kept only for 3.x backwards compatibility and is planned to stop being a public preset-package API in the next major release, including the custom `ecc` initialization path.\n\n</details>\n\nFor a minimal end-to-end scure example, see [`test/integration/scure.ts`](https://github.com/bitcoinerlab/descriptors/blob/main/test/integration/scure.ts).\n\nThe library can be split into four main parts:\n\n- The `Output` class is the central component for managing descriptors. It facilitates the creation of outputs to receive funds and enables the signing and finalization of PSBTs (Partially Signed Bitcoin Transactions) for spending UTXOs (Unspent Transaction Outputs).\n- PSBT signers and finalizers, which are used to manage the signing and finalization of PSBTs.\n- `keyExpressions` and `scriptExpressions`, which provide functions to create key and standard descriptor expressions (strings) from structured data.\n- Hardware wallet integration, covered in its own section below.\n\n### Output class\n\nFor normal usage, import `Output` directly from the preset package you chose.\n\n```javascript\nimport { Output } from '@bitcoinerlab/descriptors'; // bitcoinjs-ready package\n```\n\n```javascript\nimport { Output } from '@bitcoinerlab/descriptors-scure'; // scure-ready package\n```\n\n<details>\n  <summary>Advanced: custom bitcoinjs-compatible ecc implementation</summary>\n\nMost users do not need `DescriptorsFactory(...)` directly. It remains useful if\nyou want to swap the default `@bitcoinerlab/secp256k1` binding for another\ntiny-secp256k1-compatible implementation.\n\n```javascript\nimport * as ecc from '@bitcoinerlab/secp256k1'; // or another tiny-secp256k1-compatible implementation\nimport {\n  DescriptorsFactory,\n  createBitcoinjsLib\n} from '@bitcoinerlab/descriptors';\n\nconst { Output } = DescriptorsFactory(createBitcoinjsLib(ecc));\n```\n\n</details>\n\nOnce set up, you can obtain an instance for an output, described by a descriptor such as a `wpkh`, as follows:\n\n```javascript\nconst wpkhOutput = new Output({\n  descriptor:\n    'wpkh(02f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9)'\n});\n```\n\nFor advanced spend-path control (for example `signersPubKeys`, `taprootSpendPath`, and `tapLeaf`), see [Spending-path selection: from WSH Miniscript to Taproot](#spending-path-selection-from-wsh-miniscript-to-taproot).\n\nDetailed information about constructor parameters can be found in [the API documentation](https://bitcoinerlab.com/modules/descriptors/api/classes/Output.html#constructor) and in [this Stack Exchange answer](https://bitcoin.stackexchange.com/a/118036/89665).\n\nSome commonly used constructor parameters are:\n\n- `index`: for ranged descriptors ending in `*`.\n- `change`: for multipath key expressions such as `/**` or `/<0;1>/*`. For example, in `/<0;1>/*`, use `change: 0` or `change: 1`.\n\nThe `Output` class [offers various helpful methods](https://bitcoinerlab.com/modules/descriptors/api/classes/Output.html), including `getAddress()`, which returns the address associated with the descriptor, `getScriptPubKey()`, which returns the `scriptPubKey` for the descriptor, `expand()`, which decomposes a descriptor into its elemental parts, `updatePsbtAsInput()` and `updatePsbtAsOutput()`.\n\nThe library supports a wide range of descriptor types, including:\n\n- Pay-to-Public-Key-Hash (P2PKH): `pkh(KEY)`\n- Pay-to-Witness-Public-Key-Hash (P2WPKH): `wpkh(KEY)`\n- Pay-to-Script-Hash (P2SH): `sh(SCRIPT)`\n- Pay-to-Witness-Script-Hash (P2WSH): `wsh(SCRIPT)`\n- Pay-to-Taproot (P2TR) with key-only or script tree: `tr(KEY)` and `tr(KEY,TREE)`\n- Address-based descriptors: `addr(ADDRESS)`\n\nThese descriptors can be used with various key expressions, including raw public keys, BIP32 derivation paths and more.\n\nFor example, a Taproot descriptor with script leaves can look like:\n\n```\ntr(INTERNAL_KEY,{pk(KEY_A),{pk(KEY_B),and_v(v:pk(KEY_C),older(144))}})\n```\n\nThis means the output has an internal-key spend path and additional script-path options inside the tree.\n\nThe `updatePsbtAsInput()` method is an essential part of the library, responsible for adding an input to the PSBT corresponding to the UTXO described by the descriptor. Additionally, when the descriptor expresses an absolute time-spending condition, such as \"This UTXO can only be spent after block N\", `updatePsbtAsInput()` adds timelock information to the PSBT.\n\nTo call `updatePsbtAsInput()`, use the following syntax:\n\n```javascript\nimport { Psbt } from '@bitcoinerlab/descriptors';\nconst psbt = new Psbt();\nconst inputFinalizer = output.updatePsbtAsInput({ psbt, txHex, vout, rbf });\n```\n\n<details>\n  <summary>Click to see the scure variant</summary>\n\n```javascript\nimport { btc } from '@bitcoinerlab/descriptors-scure';\n\nconst psbt = new btc.Transaction();\nconst inputFinalizer = output.updatePsbtAsInput({ psbt, txHex, vout, rbf });\n```\n\n</details>\n\nHere, `psbt` refers to either a [bitcoinjs-lib `Psbt` class](https://github.com/bitcoinjs/bitcoinjs-lib) instance or an `@scure/btc-signer` `Transaction`, depending on the backend you chose. The parameter `txHex` denotes a hex string that serializes the previous transaction containing this output. Meanwhile, `vout` is an integer that marks the position of the output within that transaction. Finally, `rbf` is an optional parameter (defaulting to `true`) used to indicate whether the transaction uses Replace-By-Fee (RBF). When RBF is enabled, transactions can be replaced while they are in the mempool with others that have higher fees. Note that RBF is enabled for the entire transaction if at least one input signals it. Also, note that transactions using relative time locks inherently opt into RBF due to the `nSequence` range used.\n\nThe method returns the `inputFinalizer()` function. This finalizer function completes a PSBT input by adding the unlocking script (`scriptWitness` or `scriptSig`) that satisfies the previous output's spending conditions. Bear in mind that both `scriptSig` and `scriptWitness` incorporate signatures. As such, you should complete all necessary signing operations before calling `inputFinalizer()`. Detailed [explanations on the `inputFinalizer` method](#signers-and-finalizers-finalize-psbt-input) can be found in the Signers and Finalizers section.\n\nSimilarly, `updatePsbtAsOutput` allows you to add an output to a PSBT. For instance, to configure a `psbt` that sends `10,000` sats to the SegWit address `bc1qgw6xanldsz959z45y4dszehx4xkuzf7nfhya8x`:\n\n```javascript\nconst recipientOutput = new Output({\n  descriptor: `addr(bc1qgw6xanldsz959z45y4dszehx4xkuzf7nfhya8x)`\n});\nrecipientOutput.updatePsbtAsOutput({ psbt, value: 10000n });\n```\n\nFor further information on using the `Output` class, refer to the [comprehensive guides](https://bitcoinerlab.com/guides) that offer explanations and playgrounds to help learn the module. For specific details on the methods, refer directly to [the API](https://bitcoinerlab.com/modules/descriptors/api/classes/Output.html).\n\n#### Parsing Descriptors with `expand()`\n\nMost applications do not need `expand()` for normal receive/spend flows. It is mainly useful for debugging and introspection (for example, checking expanded expressions, key mappings, scripts, and parsed metadata).\n\n```javascript\nimport { expand } from '@bitcoinerlab/descriptors'; // or '@bitcoinerlab/descriptors-scure' for scure\n\nconst info = expand({ descriptor });\n```\n\nFor full details on returned fields, refer to [the API](https://bitcoinerlab.com/modules/descriptors/api/types/Expansion.html).\n\n#### Spending-path selection: from WSH Miniscript to Taproot\n\nWhen a descriptor has more than one valid way to spend, the library needs to know which path you intend to use.\n\nFor `wsh(miniscript)` and `sh(wsh(miniscript))`, this is usually done with `signersPubKeys`: you pass the public keys expected to sign and the library selects the most optimal satisfiable branch.\n\n`signersPubKeys` is passed as an array of public keys (`Uint8Array[]`).\nIf omitted, the library assumes all descriptor keys may sign.\n\nExample with two BIP32-derived keys and one preferred signer:\n\n```javascript\nimport { randomBytes } from 'crypto';\nimport { BIP32, Output, keyExpressionBIP32 } from '@bitcoinerlab/descriptors';\n\nconst masterNode = BIP32.fromSeed(randomBytes(32));\n\nconst originPath = \"/84'/0'/0'\";\n\nconst keyPathA = '/0/0';\nconst keyPathB = '/0/1';\n\nconst keyExprA = keyExpressionBIP32({ masterNode, originPath, keyPath: keyPathA });\nconst keyExprB = keyExpressionBIP32({ masterNode, originPath, keyPath: keyPathB });\n\nconst signerPubKeyA = masterNode.derivePath(`m${originPath}${keyPathA}`).publicKey;\n\n// Two possible branches:\n// - branch 1: signature by keyA + older(10)\n// - branch 2: signature by keyB (no timelock)\nconst output = new Output({\n  descriptor: `wsh(andor(pk(${keyExprA}),older(10),pk(${keyExprB})))`,\n  signersPubKeys: [signerPubKeyA] // choose the keyA (timelock branch)\n});\n```\n\n<details>\n  <summary>Click to see the scure variant</summary>\n\n```javascript\nimport { randomBytes } from '@noble/hashes/utils.js';\nimport { HDKey, Output, keyExpressionBIP32 } from '@bitcoinerlab/descriptors-scure';\n\nconst masterNode = HDKey.fromMasterSeed(randomBytes(32));\n\nconst originPath = \"/84'/0'/0'\";\n\nconst keyPathA = '/0/0';\nconst keyPathB = '/0/1';\n\nconst keyExprA = keyExpressionBIP32({ masterNode, originPath, keyPath: keyPathA });\nconst keyExprB = keyExpressionBIP32({ masterNode, originPath, keyPath: keyPathB });\n\nconst signerPubKeyA = masterNode.derive(`m${originPath}${keyPathA}`).publicKey;\n\nconst output = new Output({\n  descriptor: `wsh(andor(pk(${keyExprA}),older(10),pk(${keyExprB})))`,\n  signersPubKeys: [signerPubKeyA]\n});\n```\n\n</details>\n\nTaproot uses the same idea. For `tr(KEY,TREE)`, `signersPubKeys` helps determine which leaves are satisfiable and which satisfiable path is more optimal. In addition, Taproot provides two optional controls:\n\n- `taprootSpendPath` (`'key' | 'script'`) to force key-path or script-path spending.\n- `tapLeaf` to force a specific script leaf when using script path.\n\n  If `taprootSpendPath` is omitted for `tr(KEY,TREE)`, the library uses script path and auto-selects the most optimal satisfiable leaf from available spending data (including `signersPubKeys` and preimages when relevant).\n\nIf you specifically plan to spend from the internal key, set:\n\n```javascript\nnew Output({\n  descriptor: 'tr(INTERNAL_KEY,{pk(KEY_A),pk(KEY_B)})',\n  taprootSpendPath: 'key'\n});\n```\n\nIf you want to force a specific script leaf:\n\n```javascript\nnew Output({\n  descriptor: 'tr(INTERNAL_KEY,{pk(KEY_A),pk(KEY_B)})',\n  taprootSpendPath: 'script',\n  tapLeaf: 'pk(KEY_A)'\n});\n```\n\nThese spending-path parameters (`signersPubKeys`, `taprootSpendPath`, `tapLeaf`) are only needed when spending/finalizing UTXOs with multiple candidate paths. They are not needed just to derive addresses or `scriptPubKeys`.\n\nFor a focused walkthrough of constructor choices (including `signersPubKeys`) and practical usage of `updatePsbtAsInput`, `getAddress` and `getScriptPubKey`, see this [Stack Exchange answer](https://bitcoin.stackexchange.com/a/118036/89665).\n\n### Signers and Finalizers\n\nThis library encompasses a PSBT finalizer as well as signer helpers for single-key and BIP32 flows. Device-backed signing uses the same PSBT model, but the device setup is separate.\n\nTo incorporate these functionalities, use the following import statement:\n\n```javascript\nimport { signers } from '@bitcoinerlab/descriptors'; // or '@bitcoinerlab/descriptors-scure' for scure\n```\n\nFor signing operations, utilize the methods provided by the [`signers`](https://bitcoinerlab.com/modules/descriptors/api/modules/signers.html):\n\n```javascript\n// `psbt` here is a bitcoinjs-lib `Psbt` (for example: `const psbt = new Psbt()`)\n\n// For BIP32 - https://github.com/bitcoinjs/bip32\nsigners.signBIP32({ psbt, masterNode }); // Here, `masterNode` is a bitcoinjs `BIP32Interface` (see examples above)\n\n// For ECPair - https://github.com/bitcoinjs/ecpair\nsigners.signECPair({ psbt, ecpair }); // Here, `ecpair` is a bitcoinjs `ECPairInterface`\n```\n\n<details>\n  <summary>Click to see the scure variant</summary>\n\n```javascript\n// `psbt` here is an `@scure/btc-signer` `Transaction`\n// (for example: `const psbt = new btc.Transaction()`)\n\n// For BIP32 with @scure/bip32\nsigners.signBIP32({ psbt, masterNode }); // Here, `masterNode` is an `HDKey` (see examples above)\n\n// For raw private keys\nsigners.signPrivKey({ psbt, privKey }); // Here, `privKey` is a 32-byte `Uint8Array`\nsigners.signInputPrivKey({ psbt, index: 0, privKey }); // Same `privKey` type as above\n```\n\n</details>\n\nHardware-wallet signers follow the same pattern after the device session has been created.\n\n<a name=\"signers-and-finalizers-finalize-psbt-input\"></a>\n\n#### Finalizing the `psbt`\n\nWhen finalizing the `psbt`, the [`updatePsbtAsInput` method](https://bitcoinerlab.com/modules/descriptors/api/classes/Output.html#updatePsbtAsInput) plays a key role. When invoked, the `output.updatePsbtAsInput()` sets up the `psbt` by designating the output as an input and, if required, adjusts the transaction locktime. In addition, it returns a `inputFinalizer` function tailored for this specific `psbt` input.\n\n##### Procedure\n\n1. For each unspent output from a previous transaction that you're referencing in a `psbt` as an input to be spent, call the `updatePsbtAsInput` method:\n\n   ```javascript\n   const inputFinalizer = output.updatePsbtAsInput({ psbt, txHex, vout });\n   ```\n\n2. Once you've completed the necessary signing operations on the `psbt`, use the returned finalizer function on each input:\n\n   ```javascript\n   inputFinalizer({ psbt });\n   ```\n\n##### Important Notes\n\n- The finalizer function returned from `updatePsbtAsInput` adds the necessary unlocking script (`scriptWitness` or `scriptSig`) that satisfies the `Output`'s spending conditions. Remember, both `scriptSig` and `scriptWitness` contain signatures. Ensure that all necessary signing operations are completed before finalizing.\n\n- `txHex` is required for non-Segwit inputs. For Segwit inputs, the API also\n  accepts `txId` and `value`, but using the full `txHex` is strongly recommended\n  for security because it lets the library verify more of the previous\n  transaction and helps protect against fee attacks. See [Trezor's explanation\n  of why hardware wallets need the previous transaction](https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-3-1-1eba8f60f2dd).\n  For supported hardware-wallet signing, always pass the full `txHex`, including\n  for Segwit inputs.\n\n### Key Expressions and Script Expressions\n\nThis library also provides a series of function helpers designed to streamline the generation of `descriptor` strings. These strings can serve as input parameters in the `Output` class constructor. These helpers are nested within the `scriptExpressions` module. You can import them as illustrated below:\n\n```javascript\nimport { scriptExpressions } from '@bitcoinerlab/descriptors'; // or '@bitcoinerlab/descriptors-scure' for scure\n```\n\nWithin the root `scriptExpressions` module, there are functions designed to generate descriptors for commonly used BIP32-based scripts, such as `pkhBIP32()`, `shWpkhBIP32()` and `wpkhBIP32()`. Refer to [the API](https://bitcoinerlab.com/modules/descriptors/api/modules/scriptExpressions.html) for a detailed list and further information.\n\nWhen using BIP32-based descriptors, the following parameters are required for the `scriptExpressions` functions:\n\n```javascript\npkhBIP32(params: {\n  masterNode: BIP32Interface; //bitcoinjs-lib BIP32 - https://github.com/bitcoinjs/bip32\n  network?: Network; //A bitcoinjs-lib network\n  account: number;\n  change?: number | undefined; //0 -> external (receive), 1 -> internal (change)\n  index?: number | undefined | '*';\n  keyPath?: string; //You can use change & index or a keyPath such as \"/0/0\"\n  isPublic?: boolean; //Whether to use xpub or xprv\n})\n```\n\n<details>\n  <summary>Click to see the scure variant</summary>\n\n```javascript\npkhBIP32(params: {\n  masterNode: HDKey; // @scure/bip32 - https://github.com/paulmillr/scure-bip32\n  network?: Network;\n  account: number;\n  change?: number | undefined;\n  index?: number | undefined | '*';\n  keyPath?: string;\n  isPublic?: boolean;\n})\n```\n\n</details>\n\nThe `keyExpressions` category includes functions that generate string representations of key expressions for public keys.\n\nThis library includes [`keyExpressionBIP32`](https://bitcoinerlab.com/modules/descriptors/api/functions/keyExpressionBIP32.html) for BIP32 key expressions. It can be imported as follows:\n\n```javascript\nimport { keyExpressionBIP32 } from '@bitcoinerlab/descriptors'; // or '@bitcoinerlab/descriptors-scure' for scure\n```\n\nThe parameters required for these functions are:\n\n```javascript\nfunction keyExpressionBIP32({\n  masterNode: BIP32Interface; //bitcoinjs-lib BIP32 - https://github.com/bitcoinjs/bip32\n  originPath: string;\n  change?: number | undefined; //0 -> external (receive), 1 -> internal (change)\n  index?: number | undefined | '*';\n  keyPath?: string | undefined;\n  isPublic?: boolean;\n});\n```\n\n<details>\n  <summary>Click to see the scure variant</summary>\n\n```javascript\nfunction keyExpressionBIP32({\n  masterNode: HDKey; // @scure/bip32 - https://github.com/paulmillr/scure-bip32\n  originPath: string;\n  change?: number | undefined;\n  index?: number | undefined | '*';\n  keyPath?: string | undefined;\n  isPublic?: boolean;\n});\n```\n\n</details>\n\nThis function generates strings that fully define BIP32 keys. For example:\n\n```text\n[d34db33f/44'/0'/0']xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL/1/*\n```\n\nRead [Bitcoin Core descriptors documentation](https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md) to learn more about Key Expressions.\n\n### Hardware Wallet Integration\n\nLedger and BitBox support is available through separate entrypoints:\n\n| Backend | Ledger | BitBox |\n| --- | --- | --- |\n| bitcoinjs | `@bitcoinerlab/descriptors/ledger` | `@bitcoinerlab/descriptors/bitbox` |\n| Scure | `@bitcoinerlab/descriptors-scure/ledger` | `@bitcoinerlab/descriptors-scure/bitbox` |\n\nApplications import only the device support they use, so unused hardware-wallet\ncode and vendor packages are not loaded with the main package.\n\n`connect(...)` returns a `Session` that owns the device connection. Pass that\nsession to hardware-wallet operations and close it when finished. Persist the\nJSON-safe `Store`, not the live session, so cached keys and policy information\ncan be reused after reconnecting.\n\nSee the [Hardware Wallets](./HARDWARE_WALLETS.md) guide for setup, policy\nregistration, signing, React Native support, device limitations and real-device\ntests.\n\n<a name=\"documentation\"></a>\n\n## Additional Resources\n\nFor more information, refer to the following resources:\n\n- **[Guides](https://bitcoinerlab.com/guides)**: Comprehensive explanations and playgrounds to help you learn how to use the module.\n- **[API](https://bitcoinerlab.com/modules/descriptors/api)**: Dive into the details of the Classes, functions and types.\n- **[Stack Exchange answer](https://bitcoin.stackexchange.com/a/118036/89665)**: Focused explanation on the constructor, specifically the `signersPubKeys` parameter and the usage of `updatePsbtAsInput`, `getAddress` and `getScriptPubKey`.\n- **[Integration tests](https://github.com/bitcoinerlab/descriptors/tree/main/test/integration)**: End-to-end examples for representative software and hardware-wallet flows.\n- **Local Documentation**: Generate comprehensive API documentation from the source code:\n\n  ```bash\n  git clone https://github.com/bitcoinerlab/descriptors\n  cd descriptors/\n  npm install\n  npm run docs\n  ```\n\n  The generated documentation will be available in the `docs/` directory. Open the `index.html` file to view the documentation.\n\n## Authors and Contributors\n\nThe project was initially developed and is currently maintained by [Jose-Luis Landabaso](https://github.com/landabaso). Contributions and help from other developers are welcome.\n\nHere are some resources to help you get started with contributing:\n\n### Building from source\n\nTo download the source code and build the project, follow these steps:\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/bitcoinerlab/descriptors.git\n```\n\n2. Install the dependencies:\n\n```bash\nnpm install\n```\n\n3. Build the project:\n\n```bash\nnpm run build\n```\n\nThis will build the project and generate the necessary files in the `dist` directory.\n\n### Testing\n\nBefore committing any code, make sure it passes all tests.\n\nRun unit tests:\n\n```bash\nnpm run test:unit\n```\n\nRun the full test pipeline (lint + build + unit + integration):\n\n```bash\nnpm run test\n```\n\nIntegration tests require Docker. Make sure the `docker` command is installed and available in your PATH. When integration tests run, they automatically start or reuse a local container with the regtest services needed by this repository.\n\nHardware-wallet tests require real devices and are not part of the normal test\npipeline. Run `npm run test:ledger` or `npm run test:bitbox` for manual device\nchecks. Both commands run lint and build first, then test the bitcoinjs and\nScure backends.\n\n### License\n\nThis project is licensed under the MIT License.\n","readmeFilename":"README.md"}