{"id":20305696,"url":"https://github.com/bitpay/node-libbitcoinconsensus","last_synced_at":"2025-10-12T16:24:34.415Z","repository":{"id":32719445,"uuid":"36309194","full_name":"bitpay/node-libbitcoinconsensus","owner":"bitpay","description":"Node.js bindings for libbitcoinconsensus","archived":false,"fork":false,"pushed_at":"2015-06-16T15:03:28.000Z","size":183,"stargazers_count":11,"open_issues_count":3,"forks_count":5,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-06T08:03:05.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitpay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-26T16:33:43.000Z","updated_at":"2024-01-25T23:49:35.000Z","dependencies_parsed_at":"2022-09-11T10:21:01.061Z","dependency_job_id":null,"html_url":"https://github.com/bitpay/node-libbitcoinconsensus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fnode-libbitcoinconsensus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fnode-libbitcoinconsensus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fnode-libbitcoinconsensus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fnode-libbitcoinconsensus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitpay","download_url":"https://codeload.github.com/bitpay/node-libbitcoinconsensus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248424881,"owners_count":21101250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T17:09:22.732Z","updated_at":"2025-10-12T16:24:29.370Z","avatar_url":"https://github.com/bitpay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"SYNOPSIS [![Build Status](https://api.travis-ci.org/bitpay/node-libbitcoinconsensus.svg?branch=master)](https://github.com/bitpay/node-libbitcoinconsensus)\n===\n\nThis module provides native bindings to Bitcoin's [libbitcoinconsensus](https://github.com/bitcoin/bitcoin) functions.   \nThis library is experimental, so use at your own risk.\n\nINSTALL\n===\n\n##### from npm\n\n`npm install libbitcoinconsensus`   \nNote: you will need to have g++/llvm installed first   \n\n##### from git\n```bash\ngit clone git@github.com:bitpay/libbitcoinconsensus.js.git\ncd libbitcoinconsensus.js\ngit submodule init\ngit submodule update\nnpm install\n```\n\n\nNOTE: if you get multiple deprecation warnings on Mac OS X, fear not, you are using Apple's built-in libraries, all should work fine ;) \n\nUSAGE\n===\n```javascript\n\n'use strict';\n\nvar bitcoinconsensus = require('libbitcoinconsensus');\n\n// the transaction spending an output\nvar txTo = new Buffer('01000000015884e5db9de218238671572340b207ee85b628074e7e467096c267266baf77a4000000006a4730440220340f35055aceb14250e4954b23743332f671eb803263f363d1d7272f1d487209022037a0eaf7cb73897ba9069fc538e7275c5ae188e934ae47ca4a70453b64fc836401210234257444bd3aead2b851bda4288d60abe34095a2a8d49aff1d4d19773d22b32cffffffff01a0860100000000001976a9147821c0a3768aa9d1a37e16cf76002aef5373f1a888ac00000000', 'hex');\n\n// the previous unspent output script\nvar scriptPubKey = new Buffer('76a9144621d47f08fcb1e6be0b91144202de7a186deade88ac', 'hex');\n\n// the input index that is spending the scriptPubKey\nvar nIn = 0;\n\nvar valid = bitcoinconsensus.verifyScript(scriptPubKey, txTo, nIn);\n\n// valid will equal 0 (false) or 1 (true)\nconsole.log(valid);\n\n// the version of libbitcoinconsensus\nvar version = bitcoinconsensus.version();\nconsole.log(version);\n\n\n```\nAPI\n===\n\nbitconconsensus.version() \n-----------------------------\nGet the version of the libbitcoinconsensus library\n\n**Parameters**\n\nnone\n\n**Returns**: String representing the version of the library. \n\nbitcoinconsensus.verifyScript(scriptPubKey, txTo, nIn, flags)\n-----------------------------\nVerify the script according to the buffers sent in (scriptPubKey)\n\n**Parameters**\n* scriptPubKey - `Buffer`\n* txTo -  `Buffer`\n* nInt - `integer`\n* flags - `integer`\n\n**Returns**: integer representing whether the script was valid (1) or not valid (0). \n\n**Throws**: String exception when an exception is handled by the native library.  \n\nTEST\n===\nrun `npm test`\n\nLICENSE\n-----------------------------\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fnode-libbitcoinconsensus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitpay%2Fnode-libbitcoinconsensus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fnode-libbitcoinconsensus/lists"}