{"_id":"interface-ipld-format","_rev":"4576283","name":"interface-ipld-format","description":"IPLD format","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"rvagg","email":""},{"name":"vmx","email":""}],"time":{"modified":"2026-04-10T15:43:39.000Z","created":"2021-03-10T14:40:56.842Z","1.0.1":"2021-08-11T15:56:51.728Z","1.0.0":"2021-03-11T12:32:03.294Z","0.0.2":"2021-03-10T15:08:55.850Z","0.0.1":"2021-03-10T14:57:57.586Z","0.0.0":"2021-03-10T14:40:56.842Z"},"users":{},"author":"","repository":{"type":"git","url":"git+https://github.com/ipld/interface-ipld-format.git"},"versions":{"1.0.1":{"name":"interface-ipld-format","version":"1.0.1","description":"IPLD format","main":"index.js","types":"./types.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/ipld/interface-ipld-format.git"},"author":"","license":"(Apache-2.0 AND MIT)","bugs":{"url":"https://github.com/ipld/interface-ipld-format/issues"},"homepage":"https://github.com/ipld/interface-ipld-format#readme","dependencies":{"cids":"^1.1.6","multicodec":"^3.0.1","multihashes":"^4.0.2"},"gitHead":"3add6e1189bbf40d89a256375bc23d0870e1b0d8","_id":"interface-ipld-format@1.0.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"shasum":"bee39c70c584a033e186ff057a2be89f215963e3","size":9389,"noattachment":false,"key":"/interface-ipld-format/-/interface-ipld-format-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-ipld-format/download/interface-ipld-format-1.0.1.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"rvagg","email":""},{"name":"vmx","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interface-ipld-format_1.0.1_1628697411620_0.07908654528115444"},"_hasShrinkwrap":false,"publish_time":1628697411728,"deprecated":"This module has been superseded by the multiformats module","_cnpm_publish_time":1628697411728,"_cnpmcore_publish_time":"2021-12-16T20:08:36.493Z"},"1.0.0":{"name":"interface-ipld-format","version":"1.0.0","description":"IPLD format","main":"index.js","types":"./types.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/ipld/interface-ipld-format.git"},"author":"","license":"(Apache-2.0 AND MIT)","bugs":{"url":"https://github.com/ipld/interface-ipld-format/issues"},"homepage":"https://github.com/ipld/interface-ipld-format#readme","dependencies":{"cids":"^1.1.6","multicodec":"^3.0.1","multihashes":"^4.0.2"},"gitHead":"a163883c4931d40a5e50e85bfe5e99cf73db13b8","_id":"interface-ipld-format@1.0.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"8cd9b37363a3b7aee0b109f4fa55e89af31e20f8","size":9331,"noattachment":false,"key":"/interface-ipld-format/-/interface-ipld-format-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-ipld-format/download/interface-ipld-format-1.0.0.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"rvagg","email":""},{"name":"vmx","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interface-ipld-format_1.0.0_1615465923130_0.38514848305513194"},"_hasShrinkwrap":false,"publish_time":1615465923294,"deprecated":"This module has been superseded by the multiformats module","_cnpm_publish_time":1615465923294,"_cnpmcore_publish_time":"2021-12-16T20:08:36.769Z"},"0.0.2":{"name":"interface-ipld-format","version":"0.0.2","description":"IPLD format","main":"index.js","types":"./types.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/ipld/interface-ipld-format.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/ipld/interface-ipld-format/issues"},"homepage":"https://github.com/ipld/interface-ipld-format#readme","dependencies":{"cids":"^1.1.6","multicodec":"^3.0.1","multihashes":"^4.0.2"},"gitHead":"29a319eddbfae9a225bf069be73082ad1eb6e526","_id":"interface-ipld-format@0.0.2","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"fd27e2c4b8bf7250e52b7da14c93425d1fccf71f","size":9315,"noattachment":false,"key":"/interface-ipld-format/-/interface-ipld-format-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-ipld-format/download/interface-ipld-format-0.0.2.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"rvagg","email":""},{"name":"vmx","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interface-ipld-format_0.0.2_1615388935654_0.06070294922983166"},"_hasShrinkwrap":false,"publish_time":1615388935850,"deprecated":"This module has been superseded by the multiformats module","_cnpm_publish_time":1615388935850,"_cnpmcore_publish_time":"2021-12-16T20:08:36.973Z"},"0.0.1":{"name":"interface-ipld-format","version":"0.0.1","description":"IPLD format","main":"index.js","types":"./types.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/ipld/interface-ipld-format.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/ipld/interface-ipld-format/issues"},"homepage":"https://github.com/ipld/interface-ipld-format#readme","dependencies":{"cids":"^1.1.6","multicodec":"^3.0.1","multihashes":"^4.0.2"},"gitHead":"4066c6eacbe16d037b2f9f830d98941f224002c5","_id":"interface-ipld-format@0.0.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"dfb33f214231c9a8dd06ff9e5468aee7f50e3afc","size":9317,"noattachment":false,"key":"/interface-ipld-format/-/interface-ipld-format-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-ipld-format/download/interface-ipld-format-0.0.1.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"rvagg","email":""},{"name":"vmx","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interface-ipld-format_0.0.1_1615388277291_0.6090812551733089"},"_hasShrinkwrap":false,"publish_time":1615388277586,"deprecated":"This module has been superseded by the multiformats module","_cnpm_publish_time":1615388277586,"_cnpmcore_publish_time":"2021-12-16T20:08:37.191Z"},"0.0.0":{"name":"interface-ipld-format","version":"0.0.0","description":"IPLD format","main":"index.js","types":"./types.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/ipld/interface-ipld-format.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/ipld/interface-ipld-format/issues"},"homepage":"https://github.com/ipld/interface-ipld-format#readme","dependencies":{"cids":"^1.1.6","multicodec":"^3.0.1","multihashes":"^4.0.2"},"gitHead":"9b0256c621d3dcdfbb51b803d6ffb0c25c1d94cb","_id":"interface-ipld-format@0.0.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"2a2d20831e2c65c71a3358f6c1e232bff39cfce1","size":39083,"noattachment":false,"key":"/interface-ipld-format/-/interface-ipld-format-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/interface-ipld-format/download/interface-ipld-format-0.0.0.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"rvagg","email":""},{"name":"vmx","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/interface-ipld-format_0.0.0_1615387256390_0.3635069819655834"},"_hasShrinkwrap":false,"publish_time":1615387256842,"deprecated":"This module has been superseded by the multiformats module","_cnpm_publish_time":1615387256842,"_cnpmcore_publish_time":"2021-12-16T20:08:37.499Z"}},"readme":"⛔️ DEPRECATED: This module has been superseded by the [multiformats](https://github.com/multiformats/js-multiformats) module <!-- omit in toc -->\n\n# interface-ipld-format <!-- omit in toc -->\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![](https://img.shields.io/badge/project-IPLD-blue.svg?style=flat-square)](http://github.com/ipld/ipld)\n[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)\n\n> A interface you can follow to implement a valid IPLD format, resolvable through the IPLD Resolver (available in IPFS)\n\n## Table of Contents <!-- omit in toc -->\n\n- [Background](#background)\n  - [Modules that implement the interface](#modules-that-implement-the-interface)\n  - [Badge](#badge)\n- [Definitions](#definitions)\n- [API](#api)\n  - [IPLD format utils](#ipld-format-utils)\n    - [`util.serialize(IpldNode)`](#utilserializeipldnode)\n    - [`util.deserialize(binaryBlob)`](#utildeserializebinaryblob)\n    - [`util.cid(binaryBlob[, options])`](#utilcidbinaryblob-options)\n  - [Local resolver methods](#local-resolver-methods)\n    - [`resolver.resolve(binaryBlob, path)`](#resolverresolvebinaryblob-path)\n    - [`resolver.tree(binaryBlob)`](#resolvertreebinaryblob)\n  - [Properties](#properties)\n    - [`defaultHashAlg`](#defaulthashalg)\n    - [`codec`](#codec)\n- [Maintainers](#maintainers)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Background\n\nThe primary goal of this module is to define an interface that IPLD formats can implement and attach to any IPLD Resolver. The API is presented with both Node.js and Go primitives. However, there are no actual limitations keeping it from being extended for any other language, pushing forward cross compatibility and interoperability through different stacks.\n\n### Modules that implement the interface\n\n- [JavaScript ipld-dag-pb](https://github.com/ipld/js-ipld-dag-pb)\n- [JavaScript ipld-dag-cbor](https://github.com/ipld/js-ipld-dag-cbor)\n- [JavaScript ipld-ethereum](https://github.com/ipld/js-ipld-ethereum)\n- [JavaScript ipld-bitcoin](https://github.com/ipld/js-ipld-bitcoin)\n- [JavaScript ipld-zcash](https://github.com/ipld/js-ipld-zcash)\n- [JavaScript ipld-git](https://github.com/ipld/js-ipld-git)\n- [JavaScript ipld-raw](https://github.com/ipld/js-ipld-raw)\n\nSend in a PR if you find or write one!\n\n### Badge\n\nInclude this badge in your readme if you make a new module that implements interface-ipld-format API.\n\n![](/img/badge.png)\n\n## Definitions\n\n- **IPLD Node**: A JavaScript object where all values conform to the [IPLD Data Model](https://github.com/ipld/specs/blob/master/IPLD-Data-Model-v1.md).\n\n## API\n\nA valid (read: that follows this interface) IPLD format implementation the following API.\n\nIPLD Format APIs are restricted to a single IPLD Node, they never access any linked IPLD Nodes.\n\n### IPLD format utils\n\n#### `util.serialize(IpldNode)`\n\n> Serialize an IPLD Node into a binary blob.\n\n`IpldNode` is a previously deserialized binary blob.\n\nReturns a [Uint8Array] with the serialized version of the given IPLD Node.\n\n#### `util.deserialize(binaryBlob)`\n\n> Deserialize a binary blob into an IPLD Node.\n\nThe result is a JavaScript object. Its fields are the public API that can be resolved through. It’s up to the format to add convenient methods for manipulating the data.\n\nAll enumerable properties (the ones that are returned by a `Object.keys()` call) of the deserialized object are considered for resolving IPLD Paths. They must only return values whose type is one of the [IPLD Data Model](https://github.com/ipld/specs/blob/master/IPLD-Data-Model-v1.md).\n\nThe result must be able to be serialized with a `serialize()` call. Deserializing and serializing a `binaryBlob` (`await serialize(await deserialize(binaryBlob))`) needs to result in data that is byte-identical to the input `binaryBlob`.\n\n#### `util.cid(binaryBlob[, options])`\n\n> Calculate the CID of the binary blob.\n\nPossible `options` are:\n  - `cidVersion` (`number`, default: 1): the CID version to be used\n  - `hashAlg` (`Multicodec`, default: the one the format specifies): the hash algorithm to be used\n\nThis can be used to verify that some data actually has a certain CID.\n\nReturns a Promise containing the calculated CID of the given binary blob.\n\n### Local resolver methods\n\n#### `resolver.resolve(binaryBlob, path)`\n\n> Resolves a path within the blob, returns the value and the partial missing path. This way the `js-ipld` can continue to resolve in case the value is a link.\n\nReturns a `ResolverResult`, which is an Object with the following keys:\n\n  - `value` (`IPLD Data`): the value resolved, whose type is one of the [IPLD Data model](https://github.com/ipld/specs/blob/master/IPLD-Data-Model-v1.md)\n  - remainderPath (`string`): the remaining path that was not resolved under block scope\n\nIf `path` is the root `/`, the result is a nested object that contains all paths that `tree()` returns. The values are the same as accessing them directly with the full path. Example:\n\n`tree()` returns in iterator with those values:\n\n```JSON\n[\"author/name\", \"author/email\"]\n```\n\n`await resolve(binaryblob, \"/\")` would then have as a result:\n\n```JSON\n{\n  \"value\": {\n    \"author\": {\n      \"name\": \"vmx\",\n      \"email\": \"vmx@example.com\"\n    }\n  },\n  \"remainderPath\": \"\"\n}\n```\n\nIf `resolve()` is called with the root path (`/`), then the `value` of the `ResolverResult` will equal the return value of a `deserialize()` call.\n\nNumbers within a path are interpreted as an array.\n\n#### `resolver.tree(binaryBlob)`\n\n> Returns all the paths available in this blob\n\nReturns an Iterable where each item is a path that can be resolved, e.g. `[\"/foo\", \"/bar\", \"/author/name\", ...]`.\n\n### Properties\n\n#### `defaultHashAlg`\n\n> Default hash algorithm of the format.\n\nMost formats have one specific hash algorithm, e.g. Bitcoin’s is `dbl-sha2-256`. CBOR can be used with any hash algorithm, though the default in the IPFS world is `sha256`. `defaultHashAlg` is used in the `util.cid()` call if no hash algorithm is given. The value of `defaultHashAlg` is of type `Multicodec` should be one code defined in the [Multihash Table](https://github.com/multiformats/multihash#table-for-multihash).\n\n#### `codec`\n\n> Identifier for the format implementation.\n\nThe `codec` property of type `Multicodec` is used to register a format implementation in IPLD. It should be one of the codes specified in the [Multicodec Table](https://github.com/multiformats/multicodec#multicodec-table).\n\n\n## Maintainers\n\nCaptain: [@diasdavid](https://github.com/diasdavid).\n\n## Contribute\n\nFeel free to join in. All welcome. Open an [issue](https://github.com/ipld/interface-ipld-format/issues)!\n\nCheck out our [contributing document](https://github.com/ipld/ipld/blob/master/contributing.md) for more information on how we work, and about contributing in general. Please be aware that all interactions related to IPLD are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nThis repository is only for documents. These are licensed under a [CC-BY 3.0 Unported](LICENSE) License © 2016 Protocol Labs Inc. Any code is licensed under a [MIT](MIT-LICENSE) © 2016 Protocol Labs Inc.\n\n[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs\n[Uint8Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\n","_attachments":{},"homepage":"https://github.com/ipld/interface-ipld-format#readme","bugs":{"url":"https://github.com/ipld/interface-ipld-format/issues"},"license":"(Apache-2.0 AND MIT)"}