New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

bip69

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bip69

Lexicographical Indexing of Bitcoin Transaction Inputs and Outputs.

latest
Source
npmnpm
Version
2.1.4
Version published
Weekly downloads
267
89.36%
Maintainers
1
Weekly downloads
 
Created
Source

bip69

NPM Package Build Status

js-standard-style

Lexicographical Indexing of Transaction Inputs and Outputs.

See BIP69.

* Works only with node.js 0.11 or greater (because require Buffer.compare)

Example

var bitcoinjs = require('bitcoinjs-lib')
var bip69 = require('bip69')

var inputs = [{
	"txId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
	"vout": 0
}, ...]
var outputs = [{
	"script": new Buffer("76a9145be32612930b8323add2212a4ec03c1562084f8488ac", "hex"),
	"value": 40000000000
}, ...]

// ...

var sortedInputs = bip69.sortInputs(inputs)
var sortedOutputs = bip69.sortOutputs(outputs)

var txb = new bitcoinjs.TransactionBuilder()

sortedInputs.forEach(function (input) {
	txb.addInput(input.txId, input.vout)
})

sortedOutputs.forEach(function (output) {
	txb.addOutput(bitcoinjs.Script.fromBuffer(output.script), output.value)
})

// ... and so on

LICENSE MIT

Keywords

bip69

FAQs

Package last updated on 04 Nov 2017

Did you know?

Socket

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.

Install

Related posts