Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: libp2p records for ipns should be signed #1543

Merged
merged 1 commit into from
Sep 10, 2018

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Sep 5, 2018

There are two types of IPNS records. IPNS records for being stored locally and IPNS records for being used in the network.

IPNS records for being stored locally are used for understanding which is the most recent record since it is stored by the peer who published it.

IPNS records for being used in the network, are used as a common libp2p-record and are intended to be used with the DHT and Pubsub.

This way, the libp2p-record should have a signature and that signature should be validated on the resolve, in order to guarantee that the record was not changed in the network.

NOTE: The current implementation guarantees that the IPNS Record is not changed, since it has its own signature, but the libp2p-record used must be used as a generic libp2p-record, with its own signature as well.

@ghost ghost assigned vasco-santos Sep 5, 2018
@ghost ghost added the status/in-progress In progress label Sep 5, 2018
@alanshaw
Copy link
Member

alanshaw commented Sep 5, 2018

Can you please explain why this is necessary? Seems as though serializeSigned does the same as serialize, but has the side effect of setting a signature property on the record. The record is then discarded, so all that appears to be happening is just verifying that is can be signed without error.

UPDATE: I take that back the signature property is set before serialize() is called so the signature is included in the serialized record.

@vasco-santos vasco-santos force-pushed the fix/libp2p-records-for-ipns-should-be-signed branch from 0da198c to 00b1cdf Compare September 5, 2018 12:59
@vasco-santos
Copy link
Member Author

vasco-santos commented Sep 5, 2018

@alanshaw edited the initial description of the PR. Does it make sense to you now?

@alanshaw alanshaw force-pushed the fix/libp2p-records-for-ipns-should-be-signed branch from 00b1cdf to 881a312 Compare September 7, 2018 13:37
@ghost ghost assigned alanshaw Sep 7, 2018
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I have rebased for you and just waiting on CI again now.

@alanshaw alanshaw merged commit 97ba7dc into master Sep 10, 2018
@ghost ghost removed the status/in-progress In progress label Sep 10, 2018
@alanshaw alanshaw deleted the fix/libp2p-records-for-ipns-should-be-signed branch September 10, 2018 13:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants