From 7ff162591abe715b0c464c68ba1350d1cd328c32 Mon Sep 17 00:00:00 2001 From: decanus Date: Thu, 27 Feb 2020 18:43:10 +0100 Subject: [PATCH] pushing rough --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++-- multiprotocol.csv | 5 ++++ 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 multiprotocol.csv diff --git a/README.md b/README.md index 6e96e54..4c2fd06 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,64 @@ -# multiprotocol -Self-describing protocol identifiers +# multiprotocol: Domain Specific Protocol Extensions for Multiaddr + +**:warning: THIS IS STILL AN EARLY DRAFT :warning:** + +> Multiformat inspired self-describing protocol identifiers + +In this specification we describe a simple method for nodes to advertise their capabilities. +The protocol is heavily inspired by [multiformats](https://multiformats.io/) and provides both a human and machine readable representation. + +The goal is to provide node identification beyond the [multiaddr](https://github.com/multiformats/multiaddr) +connection info which can be appended to the end of the address. + +This repository contains the [multiprotocol definition](./multiprotocol.csv) used by [vac](https://vac.dev), +the [go implementation](https://github.com/vacp2p/go-multiprotocol) however is generic and therefore anyone can implement their own table. + +The table is represented using the following CSV format: + +```csv +code, size, name, comment +1, 0, vac, namespace +2, V, waku, +``` + +| field | description | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------- | +| **code** | This field contains the code identifying the key. | +| **size** | This field identifies the expected keys size, it can be any number or `V`, indicating that the value itself is length prefixed. | +| **name** | The human readable name of the field. | +| **comment** | Any developer related comments for the field. | + +**Namespaces should be generic to not cause overlap, vac uses `42`** + +Human-readable: + +``` +///(//|)+ +``` + +Examples: + +``` +/vac/waku/2 +/vac/waku/2/relay/2 +/vac/waku/2/store/1 +``` + +Machine-readable: + +``` +()+ +``` + +Examples: + +``` +0x42 0x2 0x2 0x0 0x2 +``` + + +With multiaddr: + +``` +/ip4/127.0.0.1/tcp/9000/vac/waku/0.2/relay/0.2 +``` \ No newline at end of file diff --git a/multiprotocol.csv b/multiprotocol.csv new file mode 100644 index 0000000..1bc24d3 --- /dev/null +++ b/multiprotocol.csv @@ -0,0 +1,5 @@ +code, size, name, comment +42, 0, vac, namespace +2, V, waku, +3, V, store, a node will store messages. +4, V, relay, a node will relay messages.