Skip to content

Add throw/check against storing CID-encoded libp2p key as DagCid link #43

@Arlodotexe

Description

@Arlodotexe

Background

IPLD links aren't designed to support IPNS CIDs, and must be immutable.

When we talk about linking in IPLD, we always mean this -- linking in IPLD is always immutable, and uses hashes, and therefore when we talk about linking, we always mean CIDs.

From ipld docs at ipfs://bafybeigz7xdtojjcpufxkibctnslx5x3yhqffye5fc3hs4ftmk4p37drei/glossary/#link
See also https://discuss.ipfs.tech/t/why-doesnt-ipld-allow-ipns-links/12236/1

Problem

We have a DagCid type in net-ipfs-core, we could add a throw/check for this.

Solution

Add a throw/check in the DagCid Value setter that makes sure you aren't trying to store a CID-encoded libp2p key as a DagCid link.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions