{"id":13772924,"url":"https://github.com/ethers/bitcoin-proof","last_synced_at":"2025-04-30T17:11:58.899Z","repository":{"id":24641057,"uuid":"28050447","full_name":"ethers/bitcoin-proof","owner":"ethers","description":"Merkle proof for a Bitcoin transaction","archived":false,"fork":false,"pushed_at":"2023-06-19T07:06:00.000Z","size":29,"stargazers_count":33,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T17:11:46.000Z","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/ethers.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-12-15T18:37:49.000Z","updated_at":"2025-04-30T00:21:36.000Z","dependencies_parsed_at":"2024-01-15T03:41:29.311Z","dependency_job_id":null,"html_url":"https://github.com/ethers/bitcoin-proof","commit_stats":{"total_commits":50,"total_committers":2,"mean_commits":25.0,"dds":0.09999999999999998,"last_synced_commit":"7f0df40bf1323ad9aad018028e15d9b190eee402"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethers%2Fbitcoin-proof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethers%2Fbitcoin-proof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethers%2Fbitcoin-proof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethers%2Fbitcoin-proof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethers","download_url":"https://codeload.github.com/ethers/bitcoin-proof/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748951,"owners_count":21637418,"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-08-03T17:01:09.213Z","updated_at":"2025-04-30T17:11:58.843Z","avatar_url":"https://github.com/ethers.png","language":"JavaScript","readme":"# bitcoin-proof\n\n[![NPM Package](https://img.shields.io/npm/v/bitcoin-proof.svg?style=flat-square)](https://www.npmjs.org/package/bitcoin-proof)\n[![Build Status](https://img.shields.io/travis/ethers/bitcoin-proof.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/ethers/bitcoin-proof)\n[![js-standard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)\n[![Dependency status](https://img.shields.io/david/ethers/bitcoin-proof.svg?style=flat-square)](https://david-dm.org/ethers/bitcoin-proof#info=dependencies)\n\nMerkle proof for a Bitcoin transaction.\n\n## Install\n\n```\nnpm install bitcoin-proof\n```\n\n## API\n\n  - [`getProof(String[] txIds, Number txIndex)`](#getproofstring-txids-number-txindex---txid-string-txindex-number-sibling-string)\n  - [`getTxMerkle({txId: String, txIndex: Number, sibling: String[]})`](#gettxmerkletxid-string-txindex-number-sibling-string---string)\n  - [`getMerkleRoot(String[] txIds)`](#getmerklerootstring-txids---string)\n\n----\n\n#####`getProof(String[] txIds, Number txIndex)` -\u003e `{txId: String, txIndex: Number, sibling: String[]}`\n\nComputes the Merkle proof of a given transaction.\n\n  * `txIds` - array of transaction hashes (as hex string)\n  * `txIndex` - index of which transaction to compute a Merkle proof for\n\nReturns an object with the following keys:\n  * `txId` - transaction hash that the Merkle proof is computed for\n  * `txIndex` - index of `txId` among `txIds`\n  * `sibling` - sibling hashes of `txId` which comprise the Merkle proof\n\n----\n\n#####`getTxMerkle({txId: String, txIndex: Number, sibling: String[]})` -\u003e `String`\n\nComputes the Merkle root of a given proof.\n\n  * `proof` - an object of the form returned by `getProof`\n\nReturns the Merkle root as a hex string.\n\n----\n\n#####`getMerkleRoot(String[] txIds)` -\u003e `String`\n\nComputes the Merkle root of a set of transactions.\n\n  * `txIds` - array of transaction hashes (as hex string)\n\nReturns the Merkle root as a hex string.\n\n## Usage\n\n```javascript\nvar btcProof = require('bitcoin-proof');\n\nvar BLOCK_100K_TRANSACTIONS = [\n  '8c14f0db3df150123e6f3dbbf30f8b955a8249b62ac1d1ff16284aefa3d06d87',\n  'fff2525b8931402dd09222c50775608f75787bd2b87e56995a7bdd30f79702c4',\n  '6359f0868171b1d194cbee1af2f16ea598ae8fad666d9b012c8ed2b79a236ec4',\n  'e9a66845e05d5abc0ad04ec80f774a7e585c6e8db975962d069a522137b80c1d'\n];\n\nvar proofOfFirstTx = btcProof.getProof(BLOCK_100K_TRANSACTIONS, 0);\n// {\n//   txId: '8c14f0db3df150123e6f3dbbf30f8b955a8249b62ac1d1ff16284aefa3d06d87',\n//   txIndex: 0,\n//   sibling: [\n//     'fff2525b8931402dd09222c50775608f75787bd2b87e56995a7bdd30f79702c4',\n//     '8e30899078ca1813be036a073bbf80b86cdddde1c96e9e9c99e9e3782df4ae49'\n//   ]\n// }\n\nvar proofOfLastTx = btcProof.getProof(BLOCK_100K_TRANSACTIONS, 3);\n// {\n//   txId: 'e9a66845e05d5abc0ad04ec80f774a7e585c6e8db975962d069a522137b80c1d',\n//   txIndex: 0,\n//   sibling: [\n//     '6359f0868171b1d194cbee1af2f16ea598ae8fad666d9b012c8ed2b79a236ec4',\n//     'ccdafb73d8dcd0173d5d5c3c9a0770d0b3953db889dab99ef05b1907518cb815'\n//   ]\n// }\n```\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":["List of content"],"sub_categories":["Utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethers%2Fbitcoin-proof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethers%2Fbitcoin-proof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethers%2Fbitcoin-proof/lists"}