{"id":22200314,"url":"https://github.com/vacp2p/multiprotocol","last_synced_at":"2026-02-03T10:01:35.688Z","repository":{"id":107129788,"uuid":"243301261","full_name":"vacp2p/multiprotocol","owner":"vacp2p","description":"Self-describing protocol identifiers","archived":false,"fork":false,"pushed_at":"2020-03-02T16:23:08.000Z","size":32,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-19T08:46:07.979Z","etag":null,"topics":["protocol","varint"],"latest_commit_sha":null,"homepage":"","language":null,"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/vacp2p.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-26T15:48:54.000Z","updated_at":"2020-03-23T15:58:58.000Z","dependencies_parsed_at":"2024-06-19T18:02:22.122Z","dependency_job_id":null,"html_url":"https://github.com/vacp2p/multiprotocol","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vacp2p/multiprotocol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vacp2p%2Fmultiprotocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vacp2p%2Fmultiprotocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vacp2p%2Fmultiprotocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vacp2p%2Fmultiprotocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vacp2p","download_url":"https://codeload.github.com/vacp2p/multiprotocol/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vacp2p%2Fmultiprotocol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29040726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T09:57:37.951Z","status":"ssl_error","status_checked_at":"2026-02-03T09:55:14.920Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["protocol","varint"],"created_at":"2024-12-02T15:22:23.681Z","updated_at":"2026-02-03T10:01:35.664Z","avatar_url":"https://github.com/vacp2p.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# multiprotocol: multiformat inspired self-describing protocol identifiers\n\n@TODO MOVE TABLE TO VAC SPECIFIC REPO\n\nThis specification describes a simple method for nodes to describe the set of their capabilities.\nThe protocol is inspired by other [multiformats](https://multiformats.io/), it provides both human and machine-readable\nrepresentations.\n\nThe goal is to provide more granular identification for nodes beyond their connection information as provided by\n[multiaddr](https://github.com/multiformats/multiaddr). \n\nMultiprotocol is generic in that any protocol can adapt the `code`s used for their own protocol.\n**A namespace is used to differentiate between protocols, this number should be arbitrary enough to not cause overlap**.\n\n\u003c!--\nThis repository contains the [multiprotocol definition](./multiprotocol.csv) used by [vac](https://vac.dev), \nthe [go implementation](https://github.com/vacp2p/go-multiprotocol) however is generic and therefore anyone can implement their own table.\n--\u003e\n\n## Motivation\n\nThe reason for creating this, is to provide more granular node information than that provided by [multiaddr](https://github.com/multiformats/multiaddr).\nMultiaddr only provides us with connectivity information however it does not tell us what protocol level services\na node may provide. For example in the case of [waku](https://specs.vac.dev/specs/waku/waku.html), we would like to \nknow if a node is a mailserver or if a node relays messages. This allows clients to make more informed decisions on\nwhich nodes to connect to.\n\n## Protocol Definitions\n\nProtocol values are defined using a csv table, current implementations support this standard. \nThe CSV file MUST contain a header of the fields defined, these are `code`, `size`, `name` and `comment`.\nTheir values MUST be as follows:\n\n| field       | description                                                                                                                     |\n| :---------: | :------------------------------------------------------------------------------------------------------------------------------ |\n| **code**    | This field contains the code identifying the key.                                                                               |\n| **size**    | This field identifies the expected keys size, it can be any number or `V`, indicating that the value itself is length prefixed. |\n| **name**    | The human readable name of the field.                                                                                           |\n| **comment** | Any developer related comments for the field.                                                                                   |\n\nThe valid `size` values are:\n - `0` - there is no value.\n - `V` - meaning the value is length prefixed.\n - `\u003e0` - any number above 0 is the explicit length of the field.\n\nBelow is an example valid csv table, the values in it will be used further in the examples within this document.\n\n```csv\ncode, size, name, comment\n42,   0,    vac,  namespace\n2,    V,    waku,\n3,    V,    store,\n4,    V,    relay, \n```\n\n## Specification\n\nA multiprotocol, like a multiaddr is a recursive (TLV)+ (type-length-value repeating) encoding, \nexcept we add the addition of prefixes such as the `namespace`, `protocol` and `version`. It has two forms:\n  - a human-readable version to be used when printing to the user (UTF-8)\n  - a binary-packed version to be used in storage, transmissions on the wire, and as a primitive in other formats.\n  \n### Human-readable\n\nBelow is a psuedo regex of the encoding itself.\n\n```regexp\n/\u003cnamespace\u003e/\u003cprotocol\u003e/\u003cversion\u003e(/\u003ccapability\u003e/\u003cversion\u003e|\u003ccapability\u003e)+\n```\n\n - `namespace` - the namespace represents the protocol namespace. In our case this would be `vac`.\n - `protocol` - the protocol represents the specific protocol we are identifying, in our case `waku`.\n - `version` - the version represents the global protocol version, this can be any integer.\n\nNext we have our repeating fields:\n\n - `capability` - this represents a specific supported capability, for example `store` or `relay`.\n - `version` - this field is not required, if the `size` for a specific capability is `0`, it represents the supported version,\n this can either be latest or earliest, we leave this to implementers to decide.\n\nNow, let's look at some human-readable examples:\n\n```\n/vac/waku/2\n/vac/waku/2/relay/2\n/vac/waku/2/store/1\n```\n\n### Machine-readable\n\nBelow is a psuedo regex of the binary-packed encoding itself.\n\n```regexp\n\u003cnamespace uvarint\u003e\u003cprotocol uvarint\u003e\u003cversion uvarint\u003e(\u003cprotoCode uvarint\u003e\u003cversion uvarint\u003e|\u003cprotoCode uvarint\u003e)+\n```\n\nThe binary encoding looks similar to the human-readable one, the only difference here is that we use variable integers.\nThese are configured like the strings using the protocol definitions table.\n\nExamples:\n\n```python\n0x2a 0x2 0x1 0x32 # /vac/waku/2\n0x2a 0x2 0x1 0x32 0x4 0x1 0x32 # /vac/waku/2/relay/2\n0x2a 0x2 0x1 0x32 0x3 0x1 0x32 # /vac/waku/2/store/1\n```\n\n### Interaction with Multiaddr\n\n@TODO\n\n```\n/ip4/127.0.0.1/tcp/9000/vac/waku/0.2/relay/0.2\n```\n\n## Implementations\n\n - [go-multiprotocol](https://github.com/vacp2p/go-multiprotocol)\n \n## Credits\n\nThis protocol was inspired by [@oskarth](https://github.com/oskarth) and based on the work of [multiformats](https://github.com/multiformats).\nIts current form was conceived by [decanus](https://github.com/decanus).\n\n## License\n\nThis repository is only for documents. All of these are licensed under the [CC-BY-SA 3.0](https://ipfs.io/ipfs/QmVreNvKsQmQZ83T86cWSjPu2vR3yZHGPm5jnxFuunEB9u) license, © 2020 vacp2p. Any code is under a [MIT](LICENSE) © 2020 vacp2p.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvacp2p%2Fmultiprotocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvacp2p%2Fmultiprotocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvacp2p%2Fmultiprotocol/lists"}