{"id":20642430,"url":"https://github.com/ipld/js-bitcoin","last_synced_at":"2025-07-18T08:04:31.265Z","repository":{"id":38269712,"uuid":"267232210","full_name":"ipld/js-bitcoin","owner":"ipld","description":"JavaScript Bitcoin data multiformats codecs and utilities for IPLD","archived":false,"fork":false,"pushed_at":"2025-05-09T19:58:37.000Z","size":15969,"stargazers_count":6,"open_issues_count":5,"forks_count":4,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-07-11T05:04:55.582Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipld.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-27T05:49:03.000Z","updated_at":"2025-05-09T19:58:41.000Z","dependencies_parsed_at":"2024-11-16T16:09:11.552Z","dependency_job_id":"6c97498c-fa0e-45ba-8cfd-182457b87ab0","html_url":"https://github.com/ipld/js-bitcoin","commit_stats":{"total_commits":133,"total_committers":11,"mean_commits":"12.090909090909092","dds":0.6240601503759399,"last_synced_commit":"1b26c6c5ec31837dafe8356a8521bdaeb0365271"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ipld/js-bitcoin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fjs-bitcoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fjs-bitcoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fjs-bitcoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fjs-bitcoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipld","download_url":"https://codeload.github.com/ipld/js-bitcoin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipld%2Fjs-bitcoin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265724564,"owners_count":23817825,"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-16T16:09:07.315Z","updated_at":"2025-07-18T08:04:31.247Z","avatar_url":"https://github.com/ipld.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IPLD for Bitcoin\n\n**JavaScript Bitcoin data multiformats codecs and utilities for IPLD**\n\n## About\n\nThis codec is intended to be used with **[multiformats](https://github.com/multiformats/js-multiformats)**. It provides decode and encode functionality for the Bitcoin native format to and from IPLD.\n\nThe following IPLD codecs are available; they each support `encode()` and `decode()` functionality compatible with the multiformats `BlockCodec` type.\n\n## Codecs\n\n### `bitcoin-block`\n\n`bitcoin-block` / `0xb0` is the Bitcoin block **header**, commonly identified by \"Bitcoin block identifiers\" (hashes with leading zeros).\n\n```js\nimport * as bitcoinBlock from '@ipld/bitcoin/block'\n```\n\n### `bitcoin-tx`\n\n`bitcoin-tx` / `0xb1` are Bitcoin transactions _and_ nodes in a binary merkle tree, the tip of which is referenced by the Bitcoin block header.\n\n```js\nimport * as bitcoinTx from '@ipld/bitcoin/tx'\n```\n\n###  `bitcoin-witness-commitment`\n\n`bitcoin-witness-commitment` / `0xb2` is the Bitcoin witness commitment that is used to reference transactions with intact witness data (a complication introduced by [SegWit](https://en.wikipedia.org/wiki/SegWit)).\n\n```js\nimport * as bitcoinWitnessCommitment from '@ipld/bitcoin/witness-commitment'\n```\n\n## Hasher\n\nThe following multihash is available, compatible with the multiformats `MultihashHasher` type.\n\n###  `dbl-sha2-256`\n\n`dbl-sha2-256` / `0x56` is a double SHA2-256 hash: `SHA2-256(SHA2-256(bytes))`, used natively across all Bitcoin blocks, forming block identifiers, transaction identifiers and hashes and binary merkle tree nodes.\n\n```js\nimport * as dblSha2256 from '@ipld/bitcoin/dbl-sha2-256'\n```\n\n## Utilities\n\nIn addition to the multiformats codecs and hasher, utilities are also provided to convert between Bitcoin hash identifiers and CIDs and to convert to and from full Bitcoin raw block data to a full collection of IPLD blocks. Additional conversion functionality for bitcoin raw data and the `bitcoin-cli` JSON format is provided by the **[bitcoin-block](https://github.com/rvagg/js-bitcoin-block)** library.\n\nSee the **API** section below for details on the additional utility functions.\n\n## Example\n\nThis example reads Bitcoin IPLD blocks from a CAR file; assuming that CAR contains a complete (enough) graph representing a Bitcoin block (whose identifier is supplied as the second argument) and its transactions, it navigates to the first transaction (the Coinbase) and prints the `scriptSig` as UTF-8. This is often used to store arbitrary messages and other \"graffiti\".\n\nRunning this example on the Genesis block (CAR provided in this project: example-genesis.car) produces the following output:\n\n```\n$ node example.js ./example-genesis.car 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\n��EThe Times 03/Jan/2009 Chancellor on brink of second bailout for banks\n```\n\n```js\nimport fs from 'fs'\nimport * as bitcoinBlock from '@ipld/bitcoin/block'\nimport * as bitcoinTx from '@ipld/bitcoin/tx'\nimport { CarReader } from '@ipld/car'\n\n// Assumes a CAR with at least one full Bitcoin block represented as IPLD blocks\n// and a \"blockId\" which is the commonly used Bitcoin block identifier (32-byte\n// digest in hexadecimal, with leading zeros).\nasync function run (pathToCar, blockId) {\n  const reader = await CarReader.fromIterable(fs.createReadStream(pathToCar))\n  const headerCid = bitcoinBlock.blockHashToCID(blockId)\n  const header = bitcoinBlock.decode((await reader.get(headerCid)).bytes)\n\n  // navigate the transaction binary merkle tree to the first transaction, the coinbase,\n  // which will be at the leftmost side of the tree.\n  let txCid = header.tx\n  let tx\n  while (true) {\n    tx = bitcoinTx.decode((await reader.get(txCid)).bytes)\n    if (!Array.isArray(tx)) { // is not an inner merkle tree node\n      break\n    }\n    txCid = tx[0] // leftmost side of the tx binary merkle\n  }\n\n  // convert the scriptSig to UTF-8 and cross our fingers that there's something\n  // interesting in there\n  console.log(Buffer.from(tx.vin[0].coinbase, 'hex').toString('utf8'))\n}\n\nrun(process.argv[2], process.argv[3]).catch((err) =\u003e {\n  console.error(err.stack)\n  process.exit(1)\n})\n```\n\n## Usage\n\nIn the API docs below, the names denote the export locations, such that they may be obtained by the following:\n\n```js\n// The whole bundle (note this object also includes additional properties that\n// can be used to access all the others)\nimport * as Bitcoin from '@ipld/bitcoin'\n// the `bitcoin-block` / `0xb0` codec\nimport * as BitcoinBlock from '@ipld/bitcoin/block'\n// the `bitcoin-tx` / `0xb1` codec\nimport * as BitcoinTransaction from '@ipld/bitcoin/tx'\n// the `bitcoin-witness-commitment` / `0xb2` codec\nimport * as BitcoinWitnessCommitment from '@ipld/bitcoin/witness-commitment'\n// the `dbl-sha2-256` / `0x56` multihasher\nimport * as DblSha2256 from '@ipld/bitcoin/dbl-sha2-256'\n```\n\n## API\n\n### Contents\n\n * [`Bitcoin.deserializeFullBitcoinBytes()(bytes)`](#Bitcoin__deserializeFullBitcoinBytes____)\n * [`Bitcoin.serializeFullBitcoinBytes()(obj)`](#Bitcoin__serializeFullBitcoinBytes____)\n * [`Bitcoin.cidToHash()(cid)`](#Bitcoin__cidToHash____)\n * [`Bitcoin.encodeAll()`](#Bitcoin__encodeAll____)\n * [`Bitcoin.assemble()`](#Bitcoin__assemble____)\n * [`BitcoinBlock.encode()`](#BitcoinBlock__encode____)\n * [`BitcoinBlock.decode()`](#BitcoinBlock__decode____)\n * [`BitcoinBlock.name`](#BitcoinBlock__name)\n * [`BitcoinBlock.code`](#BitcoinBlock__code)\n * [`BitcoinBlock.blockHashToCID()`](#BitcoinBlock__blockHashToCID____)\n * [`BitcoinTransaction.encode()`](#BitcoinTransaction__encode____)\n * [`BitcoinTransaction.encodeNoWitness()`](#BitcoinTransaction__encodeNoWitness____)\n * [`BitcoinTransaction.encodeAll()`](#BitcoinTransaction__encodeAll____)\n * [`BitcoinTransaction.encodeAllNoWitness()`](#BitcoinTransaction__encodeAllNoWitness____)\n * [`BitcoinTransaction.decode()`](#BitcoinTransaction__decode____)\n * [`BitcoinTransaction.name`](#BitcoinTransaction__name)\n * [`BitcoinTransaction.name`](#BitcoinTransaction__name)\n * [`BitcoinTransaction.txHashToCID()`](#BitcoinTransaction__txHashToCID____)\n * [`BitcoinWitnessCommitment.encode()`](#BitcoinWitnessCommitment__encode____)\n * [`BitcoinWitnessCommitment.decode()`](#BitcoinWitnessCommitment__decode____)\n * [`BitcoinWitnessCommitment.name`](#BitcoinWitnessCommitment__name)\n * [`BitcoinWitnessCommitment.code`](#BitcoinWitnessCommitment__code)\n * [`DblSha2256.name`](#DblSha2256__name)\n * [`DblSha2256.code`](#DblSha2256__code)\n * [`DblSha2256.encode()`](#DblSha2256__encode____)\n * [`DblSha2256.digest()`](#DblSha2256__digest____)\n\n\u003ca name=\"Bitcoin__deserializeFullBitcoinBytes____\"\u003e\u003c/a\u003e\n### `Bitcoin.deserializeFullBitcoinBytes()(bytes)`\n\n* `bytes` `(Uint8Array)`: a binary form of a Bitcoin block graph\n\n* Returns:  `BlockPorcelain`: an object representation of the full Bitcoin block graph\n\nInstantiate a full object form from a full Bitcoin block graph binary representation. This binary form is typically extracted from a Bitcoin network node, such as with the Bitcoin Core `bitcoin-cli` `getblock \u003cidentifier\u003e 0` command (which outputs hexadecimal form and therefore needs to be decoded prior to handing to this function). This full binary form can also be obtained from the utility [`assemble`](#assemble) function which can construct the full graph form of a Bitcoin block from the full IPLD block graph.\n\nThe object returned, if passed through `JSON.stringify()` should be identical to the JSON form provided by the Bitcoin Core `bitcoin-cli` `getblock \u003cidentifier\u003e 2` command (minus some chain-context elements that are not possible to derive without the full blockchain).\n\n\u003ca name=\"Bitcoin__serializeFullBitcoinBytes____\"\u003e\u003c/a\u003e\n### `Bitcoin.serializeFullBitcoinBytes()(obj)`\n\n* `obj` `(BlockPorcelain)`: a full JavaScript object form of a Bitcoin block graph\n\n* Returns:  `Uint8Array`: a binary form of the Bitcoin block graph\n\nEncode a full object form of a Bitcoin block graph into its binary\nequivalent. This is the inverse of\n[`Bitcoin.deserializeFullBitcoinBytes()`](#Bitcoin__deserializeFullBitcoinBytes____) and should produce the exact\nbinary representation of a Bitcoin block graph given the complete input.\n\nThe object form must include both the header and full transaction (including\nwitness data) data for it to be properly serialized.\n\nAs of writing, the witness merkle nonce is not currently present in the JSON\noutput from Bitcoin Core's `bitcoin-cli`. See\nhttps://github.com/bitcoin/bitcoin/pull/18826 for more information. Without\nthis nonce, the exact binary form cannot be fully generated.\n\n\u003ca name=\"Bitcoin__cidToHash____\"\u003e\u003c/a\u003e\n### `Bitcoin.cidToHash()(cid)`\n\n* `cid` `(CID|string)`: a CID\n\n* Returns:  `string`: a hexadecimal big-endian representation of the identifier.\n\nConvert a CID to a Bitcoin block or transaction identifier. This process is\nthe reverse of `blockHashToCID()` and `txHashToCID()` and involves extracting\nand decoding the multihash from the CID, reversing the bytes and presenting\nit as a big-endian hexadecimal string.\n\nWorks for both block identifiers and transaction identifiers.\n\n\u003ca name=\"Bitcoin__encodeAll____\"\u003e\u003c/a\u003e\n### `Bitcoin.encodeAll()`\n\n* `block` `(BlockPorcelain)`\n\n* Returns:  `IterableIterator\u003c{cid: CID, bytes: Uint8Array}\u003e`\n\nEncodes a full Bitcoin block, as presented in `BlockPorcelain` form (which is\navailable as JSON output from the `bitcoin-cli` tool—see the `bitcoin-block`\nnpm package for more information) into its constituent IPLD blocks. This\nincludes the header, the transaction merkle intermediate nodes, the\ntransactions and SegWit forms of the transaction merkle and nodes if present\nalong with the witness commitment block if required.\n\n\u003ca name=\"Bitcoin__assemble____\"\u003e\u003c/a\u003e\n### `Bitcoin.assemble()`\n\n* `loader` `(IPLDLoader)`: an IPLD block loader function that takes a CID argument and returns a `Uint8Array` containing the binary block data for that CID\n* `blockCid` `(CID)`: a CID of type `bitcoin-block` pointing to the Bitcoin block header for the block to be assembled\n\n* Returns:  `Promise\u003c{deserialized:BlockPorcelain, bytes:Uint8Array}\u003e`: an object containing two properties, `deserialized` and `bytes` where `deserialized` contains a full JavaScript instantiation of the Bitcoin block graph and `bytes` contains a `Uint8Array` with the binary representation of the graph.\n\nGiven a CID for a `bitcoin-block` Bitcoin block header and an IPLD block\nloader that can retrieve Bitcoin IPLD blocks by CID, re-assemble a full\nBitcoin block graph into both object and binary forms. This is the inverse\nof the [`Bitcoin.encodeAll()`](#Bitcoin__encodeAll____) function in that it puts the\n`BitcoinPorcelain` back together. A JSON form of this output should match\nthe output provided by `bitcoin-cli` (with some possible minor differences).\n\nThe loader should be able to return the binary form for `bitcoin-block`,\n`bitcoin-tx` and `bitcoin-witness-commitment` CIDs.\n\n\u003ca name=\"BitcoinBlock__encode____\"\u003e\u003c/a\u003e\n### `BitcoinBlock.encode()`\n\n* `node` `(BitcoinHeader)`\n\n* Returns:  `ByteView\u003cBitcoinHeader\u003e`\n\n**`bitcoin-block` / `0xb0` codec**: Encodes an IPLD node representing a\nBitcoin header object into byte form.\n\n\u003ca name=\"BitcoinBlock__decode____\"\u003e\u003c/a\u003e\n### `BitcoinBlock.decode()`\n\n* `data` `(ByteView\u003cBitcoinHeader\u003e)`\n\n* Returns:  `BitcoinHeader`\n\n**`bitcoin-block` / `0xb0` codec**: Decodes a bytes form of a Bitcoin header\ninto an IPLD node representation.\n\n\u003ca name=\"BitcoinBlock__name\"\u003e\u003c/a\u003e\n### `BitcoinBlock.name`\n\n**`bitcoin-block` / `0xb0` codec**: the codec name\n\n\u003ca name=\"BitcoinBlock__code\"\u003e\u003c/a\u003e\n### `BitcoinBlock.code`\n\n**`bitcoin-block` / `0xb0` codec**: the codec code\n\n\u003ca name=\"BitcoinBlock__blockHashToCID____\"\u003e\u003c/a\u003e\n### `BitcoinBlock.blockHashToCID()`\n\n* `blockHash` `(string)`: a string form of a block hash\n\n* Returns:  `CID`: a CID object representing this block identifier.\n\nConvert a Bitcoin block identifier (hash) to a CID. The identifier should be in big-endian form, i.e. with leading zeros.\n\nThe process of converting to a CID involves reversing the hash (to little-endian form), encoding as a `dbl-sha2-256` multihash and encoding as a `bitcoin-block` multicodec. This process is reversable, see [`cidToHash`](#cidToHash).\n\n\u003ca name=\"BitcoinTransaction__encode____\"\u003e\u003c/a\u003e\n### `BitcoinTransaction.encode()`\n\n* `node` `(BitcoinTransaction|BitcoinTransactionMerkleNode)`\n\n* Returns:  `ByteView\u003c(BitcoinTransaction|BitcoinTransactionMerkleNode)\u003e`\n\n**`bitcoin-tx` / `0xb1` codec**: Encodes an IPLD node representing a\nBitcoin transaction object into byte form.\n\nNote that a `bitcoin-tx` IPLD node can either be a full transaction with or\nwithout SegWit data, or an intermediate transaction Merkle tree node; in\nwhich case it is simply an array of two CIDs.\n\n\u003ca name=\"BitcoinTransaction__encodeNoWitness____\"\u003e\u003c/a\u003e\n### `BitcoinTransaction.encodeNoWitness()`\n\n* `node` `(BitcoinTransaction)`\n\n* Returns:  `ByteView\u003cBitcoinTransaction\u003e`\n\nSame as [`BitcoinTransaction.encode()`](#BitcoinTransaction__encode____) but will explictly exclude any\nwitness (SegWit) data from the output. This is necessary for encoding SegWit\nblocks since transactions must be stored both with and without witness data\nto correctly represent the full content addressed structure.\n\n\u003ca name=\"BitcoinTransaction__encodeAll____\"\u003e\u003c/a\u003e\n### `BitcoinTransaction.encodeAll()`\n\n* `obj` `(BlockPorcelain)`\n\n* Returns: \n\nEncodes all transactions in a complete `BlockPorcelain` (see the\n`bitcoin-block` npm package for details on this type) representation of an\nentire Bitcoin transaction; including intermediate Merkle tree nodes.\n\nIntermediate Merkle tree nodes won't have the `transaction` property on the\noutput as they aren't full transactions and their `bytes` will have a length\nof 64.\n\n\u003ca name=\"BitcoinTransaction__encodeAllNoWitness____\"\u003e\u003c/a\u003e\n### `BitcoinTransaction.encodeAllNoWitness()`\n\n* `obj` `(BlockPorcelain)`\n\n* Returns: \n\nSame as [`BitcoinTransaction.encodeAll()`](#BitcoinTransaction__encodeAll____) but only encodes non-SegWit\ntransaction data, that is, transactions without witness data and no secondary\nSegWit transactions Merkle tree.\n\n\u003ca name=\"BitcoinTransaction__decode____\"\u003e\u003c/a\u003e\n### `BitcoinTransaction.decode()`\n\n* `data` `(ByteView\u003c(BitcoinTransaction|BitcoinTransactionMerkleNode)\u003e)`\n\n* Returns:  `BitcoinTransaction|BitcoinTransactionMerkleNode`\n\n**`bitcoin-block` / `0xb0` codec**: Decodes a bytes form of a Bitcoin\ntransaction into an IPLD node representation.\n\nNote that a `bitcoin-tx` IPLD node can either be a full transaction with or\nwithout SegWit data, or an intermediate transaction Merkle tree node; in\nwhich case it is simply an array of two CIDs. As byte form, an intermediate\nMerkle tree node is a fixed 64-bytes.\n\n\u003ca name=\"BitcoinTransaction__name\"\u003e\u003c/a\u003e\n### `BitcoinTransaction.name`\n\n**`bitcoin-tx` / `0xb1` codec**: the codec name\n\n\u003ca name=\"BitcoinTransaction__name\"\u003e\u003c/a\u003e\n### `BitcoinTransaction.name`\n\n**`bitcoin-tx` / `0xb1` codec**: the codec name\n\n\u003ca name=\"BitcoinTransaction__txHashToCID____\"\u003e\u003c/a\u003e\n### `BitcoinTransaction.txHashToCID()`\n\n* `txHash` `(string)`: a string form of a transaction hash\n\n* Returns:  `CID`: A CID (`multiformats.CID`) object representing this transaction identifier.\n\nConvert a Bitcoin transaction identifier (hash) to a CID. The identifier should be in big-endian form as typically understood by Bitcoin applications.\n\nThe process of converting to a CID involves reversing the hash (to little-endian form), encoding as a `dbl-sha2-256` multihash and encoding as a `bitcoin-tx` multicodec. This process is reversable, see [`cidToHash`](#cidToHash).\n\n\u003ca name=\"BitcoinWitnessCommitment__encode____\"\u003e\u003c/a\u003e\n### `BitcoinWitnessCommitment.encode()`\n\n* `node` `(BitcoinWitnessCommitment)`\n\n* Returns:  `ByteView\u003cBitcoinWitnessCommitment\u003e`\n\n**`bitcoin-witness-commitment` / `0xb2` codec**: Encodes an IPLD node\nrepresenting a Bitcoin witness commitment object into byte form.\n\nThe object is expected to be in the form\n`{witnessMerkleRoot:CID, nonce:Uint8Array}` where the `witnessMerkleRoot`\nmay be null.\n\n\u003ca name=\"BitcoinWitnessCommitment__decode____\"\u003e\u003c/a\u003e\n### `BitcoinWitnessCommitment.decode()`\n\n* `data` `(ByteView\u003cBitcoinWitnessCommitment\u003e)`\n\n* Returns:  `BitcoinWitnessCommitment`\n\n**`bitcoin-witness-commitment` / `0xb2` codec**: Decodes a bytes form of a\nBitcoin witness commitment into an IPLD node representation.\n.\n\nThe returned object will be in the form\n`{witnessMerkleRoot:CID, nonce:Uint8Array}` where the `witnessMerkleRoot`\nmay be null.\n\n\u003ca name=\"BitcoinWitnessCommitment__name\"\u003e\u003c/a\u003e\n### `BitcoinWitnessCommitment.name`\n\n**`bitcoin-witness-commitment` / `0xb2` codec**: the codec name\n\n\u003ca name=\"BitcoinWitnessCommitment__code\"\u003e\u003c/a\u003e\n### `BitcoinWitnessCommitment.code`\n\n**`bitcoin-witness-commitment` / `0xb2` codec**: the codec code\n\n\u003ca name=\"DblSha2256__name\"\u003e\u003c/a\u003e\n### `DblSha2256.name`\n\n**`dbl-sha2-256` / `0x56` multihash**: the multihash name\n\n\u003ca name=\"DblSha2256__code\"\u003e\u003c/a\u003e\n### `DblSha2256.code`\n\n**`dbl-sha2-256` / `0x56` multihash**: the multihash code\n\n\u003ca name=\"DblSha2256__encode____\"\u003e\u003c/a\u003e\n### `DblSha2256.encode()`\n\n* `bytes` `(Uint8Array)`: a Uint8Array\n\n* Returns:  `Uint8Array`: a 32-byte digest\n\n**`dbl-sha2-256` / `0x56` multihash**: Encode bytes using the multihash\nalgorithm, creating raw 32-byte digest _without_ multihash prefix.\n\n\u003ca name=\"DblSha2256__digest____\"\u003e\u003c/a\u003e\n### `DblSha2256.digest()`\n\n* `input` `(Uint8Array)`\n\n* Returns: \n\n**`dbl-sha2-256` / `0x56` multihash**: Encode bytes using the multihash\nalgorithm, creating multihash `Digest` (i.e. with multihash prefix).\n\n## License\n\nLicensed under either of\n\n * Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)\n * MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipld%2Fjs-bitcoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipld%2Fjs-bitcoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipld%2Fjs-bitcoin/lists"}