From deb58fd21e1177549a4fc772a807ca18d0834d3a Mon Sep 17 00:00:00 2001 From: blacktemplar Date: Mon, 14 Sep 2020 10:09:48 +0200 Subject: [PATCH] only use first 8 bytes of hash as message id --- specs/phase0/p2p-interface.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/phase0/p2p-interface.md b/specs/phase0/p2p-interface.md index c28deb2ee..2ad95f54b 100644 --- a/specs/phase0/p2p-interface.md +++ b/specs/phase0/p2p-interface.md @@ -243,10 +243,10 @@ Each gossipsub [message](https://github.com/libp2p/go-libp2p-pubsub/blob/master/ Clients MUST reject (fail validation) messages that are over this size limit. Likewise, clients MUST NOT emit or propagate messages larger than this limit. -The `message-id` of a gossipsub message MUST be: +The `message-id` of a gossipsub message MUST be the first 8 bytes of the SHA-256 hash of the message data, i.e.: ```python - message-id: SHA256(message.data) + message-id: (SHA256(message.data))[0..8] ``` The payload is carried in the `data` field of a gossipsub message, and varies depending on the topic: