### ipld-bitcoin

`0.3.2`
Need help reading this?

### resolve

src/resolver.js

Resolves a path within a Bitcoin block.

Returns the value or a link and the partial mising path. This way the IPLD Resolver can fetch the link and continue to resolve.

resolve(binaryBlob: Buffer, path: string): Object
Parameters
binaryBlob `(Buffer)` Binary representation of a Bitcoin block
path `(string = `'/'`)` Path that should be resolved
Returns
`Object`: result - Result of the path it it was resolved successfully
Returns
`any`: result.value - Value the path resolves to
Returns
`string`: result.remainderPath - If the path resolves half-way to a link, then the `remainderPath` is the part after the link that can be used for further resolving

### tree

src/resolver.js

Return all available paths of a block.

tree(binaryBlob: Buffer)
Parameters
binaryBlob `(Buffer)` Binary representation of a Bitcoin block

### serialize

src/util.js

Serialize internal representation into a binary Bitcoin block.

serialize
Parameters
dagNode `(BitcoinBlock)` Internal representation of a Bitcoin block
Returns
`Buffer`:

### deserialize

src/util.js

Deserialize Bitcoin block into the internal representation.

deserialize
Parameters
binaryBlob `(Buffer)` Binary representation of a Bitcoin block
Returns
`BitcoinBlock`:

### cid

src/util.js

Calculate the CID of the binary blob.

cid
Parameters
binaryBlob `(Object)` Encoded IPLD Node
userOptions `(Object?)` Options to create the CID

Name | Description
--- | ---
userOptions.cidVersion `number` (default `1`) | CID version number

Returns
`Promise<CID>`: