bitcoinjs/bip69

Name: bip69

Owner: BitcoinJS

Description: Lexicographical Indexing of Transaction Inputs and Outputs

Created: 2015-08-07 02:55:40.0

Updated: 2018-01-17 04:35:45.0

Pushed: 2017-11-04 03:57:16.0

Homepage: null

Size: 26

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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
bitcoinjs = require('bitcoinjs-lib')
bip69 = require('bip69')

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

..

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

txb = new bitcoinjs.TransactionBuilder()

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


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


.. and so on
LICENSE MIT

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.