Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
blockchainjs
Advanced tools
A pure JavaScript library for node.js and browsers for easy data exchange between wallets and bitcoin network.
blockchainjs have two abstraction level: Connector and Blockchain
Connector implements a common interface for remote service. For now available only one provider: chromanode.
Blockchain implements a common interface between connector and your wallet. You can use Naive (trust all data from remove service) or Verified (SPV implementation).
In addition to Verified blockchainjs has Storage interface for store headers. Memory and LocalStorage available for now.
var blockchainjs = require('blockchainjs')
var connector = new blockchainjs.connector.Chromanode({networkName: 'testnet'})
var address = 'mp8XoMWnJzQwovninMdChQutPuhyHokJNc'
function showUTXO(address) {
connector.addressesQuery([address], {status: 'unspent'})
.then(function (result) {
console.log('UTXO for ' + address + ':')
result.transactions.forEach(function (unspent) {
// var txOut = unspent.txid + ':' + unspent.outIndex
// console.log(txOut + ' has ' + unspent.value + ' satoshi')
// sorry, only txid and height available now
console.log('Unspent in txid: ' + unspent.txid)
})
if (result.transactions.length === 0) {
console.log('nothing...')
}
console.log('')
})
}
connector.on(address, showUTXO)
connector.connect()
connector.subscribe({event: 'touchAddress', address: address})
showUTXO(address)
var blockchainjs = require('blockchainjs')
var connector = new blockchainjs.connector.Chromanode({networkName: 'testnet'})
connector.connect()
var storage = new blockchainjs.storage.Memory({
networkName: 'testnet',
compactMode: true
})
var blockchain = new blockchainjs.blockchain.Verified(connector, {
storage: storage,
networkName: 'testnet',
testnet: true,
compactMode: true,
chunkHashes: blockchainjs.chunkHashes.testnet
})
blockchain.on('syncStop', blockchainjs.util.makeSerial(function () {
return blockchain.getHeader(blockchain.latest.hash)
.then(function (header) {
console.log('Current header: ', header)
})
}))
Code released under the MIT license.
Copyright 2015 Chromaway AB
FAQs
Bitcoin blockchain for wallets.
We found that blockchainjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.