IPFS
Inter Planetary File System: distributed P2P file system with content-based addressing.
Addressing
IPFS address: /ipfs/<CID>/my/url/document.html
- CID: Content IDentifier (by default: sha2-256 hash).
- Content-based addressing: the hash is based on the content! If the content changes, the hash changes. => Immutability, easy data integrity check.
CIDv1 breakdown
CID has a separate specification from IPFS.
Structure d'un CIDv1:
1 | <multibase-prefix><version-prefix><multicodec-prefix><multihash> |
Multibase prefix
Version prefix:
Note: CID v0 is always base58.
Version | Hash type | Starting sequence |
---|---|---|
v0 | always base58btc |
Qm... |
v1 | base32 |
bafy... |
Multicodec prefix
- Raw
- DagProtobuf
- DagCBOR
Multihash:
type | length | value | |
---|---|---|---|
desc | hash function | expected hash size | hash value |
example | 0x12 (sha2-256) |
256b | value |
Note
La value
est le seul field à ne pas être considéré comme un prefix bien sûr