
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
btc-script-helpers
Advanced tools
Some functions to help compose bitcoin scripts.
npm i btc-script-helper
const scripter = require('btc-script-helper')
// keys must be passed as buffers
const keys = []
keys.push(Buffer.from('0252a536c77bb9a0e46abb21633f2382a3c68de9b48c7933142d70d759cddb35c2', 'hex'))
keys.push(Buffer.from('03e5f2f74b8277f7b69d80987bff932de1009d82f366a920bfa60359620e5f5858', 'hex'))
keys.push(Buffer.from('034f355bdcb7cc0af728ef3cceb9615d90684bb5b2ca5f859ab0f0b704075871aa', 'hex'))
// construct a 2-of-3 multisig script
const script = scripter.fromMultisig(2, 3, keys)
// create a nested P2SH-P2WSH address from the script
const address = scripter.computeNestedAddress(script)
console.log('please pay to:', address)
// please pay to: 3KruSwZhXtDaHJpcqr5cMiuMbWCWQVS343
scripter.fromMultisig(m, n, keys)Compute an m-of-n multisig script. keys should be an array of buffers, n should be < 16.
scriptet.p2shAddress(script, [network = bitcoin])Compute a P2SH address from a script hash. Defaults to mainnet address.
scriptet.p2pkhAddress(pubKey, [network = bitcoin])Compute a P2PKH address from a pubKey. Defaults to mainnet address.
scripter.p2wshNestedAddress(script, [network = bitcoin])Compute the nested P2SH-P2WSH address for the given script. Script should be passed as a buffer. Defaults to mainnet address.
scripter.p2wpkhNestedAddress(address, [network = bitcoin])Compute the nested P2SH-P2WPKH address for the given segwit address. Defaults to mainnet address.
scripter.payToAddress(address, [network])Compute the scriptPubKey corresponding to P2PKH|P2WPKH address. network may be passed to check for bech32 prefixes.
scripter.p2wpkh(address)Compute the scriptPubKey corresponding to a P2WPKH address.
scripter.p2wsh(address)Compute the scriptPubKey corresponding to a P2WSH address.
scripter.p2pkh(address)Compute the scriptPubKey corresponding to a P2PKH address.
scripter.p2pkh(address)Compute the scriptPubKey corresponding to a P2PKH address.
scripter.scriptToBytecode(script)Compute the bytecode for a given asm script.
scripter.getScriptHash(script)Compute the Bitcoin internal scripthash format for a given script.
FAQs
Helpers for composing bitcoin scripts
The npm package btc-script-helpers receives a total of 1 weekly downloads. As such, btc-script-helpers popularity was classified as not popular.
We found that btc-script-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.