peer-ids.md: be explicit about supporting CID v0&v1

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
This commit is contained in:
Marcin Rataj
2019-09-30 15:32:41 +02:00
parent 4e2c796bc7
commit b621ac506a

View File

@@ -133,14 +133,17 @@ behavior.
Peer Ids are [multihashes][multihash] canonically represented with [CIDs](https://github.com/ipld/cid) when encoded into strings.
CID is a multihash with a prefix that specifies things like base encoding, cid version and the type of data behind it:
Encoding and decoding of string representation MUST follow [CID specification][cid-decoding].
Implementations parsing IDs from text MUST support both base58 CIDv0 and CIDv1 in base32, and they MUST generate base32-encoded CIDv1 by default. Generating CIDv0 is allowed as an opt-in (behind a flag).
CIDv0 is a multihash encoded in Base58.
CIDv1 is a multihash with a prefix that specifies things like base encoding, cid version and the type of data behind it:
```
<cidv1> ::= <multibase><cid-version><multicodec><multihash>
```
Encoding and decoding of string representation must follow [CID spec][cid-decoding].
#### libp2p-key CID
The canonical string representation of a Peer Id is a CID v1