rfc
rfc copied to clipboard
16/WAKU2-RPC: Inconsistencies and inaccuracies in RFC spec
Problem
There are some inconsistencies between the RFC and the main implementation in nwaku.
- The KeyPair fields are called in
privateKey
andpublicKey
in the RFC, butseckey
andpubkey
in the implementation. -
WakuMessage payload is defined as a hex-encoded data string in the RFC, but returned as an array of
uint8
in the implementation. - The Private API get methods (e.g. this one) must explicitly indicate that messages that can't be decrypted with the provided key will be discarded.
- The Private API must define encrypt/decrypt methods to allow applications to use multiple keys to encrypt or attempt decryption of received, encrypted messages.
Suggested solution:
- Change the implementation to reflect
privateKey
andpublicKey
as the field names forKeyPair
. - Change the specification to indicate that
WakuMessage
payload is an array ofuint8
rather than a hex-encoded data string. This is currently a limitation of the implementation. Note thatWakuMessage
is only received in responses, whileWakuRelayMessage
, used in requests, do indeed contain a hex-encoded payload.
cc @richard-ramos
For the specs for both get_waku_v2_private_v1_asymmetric_messages
and get_waku_v2_private_v1_symmetric_messages
, it should be clarified that messages that can't be decrypted with the provided keys will be ignored and discarded.
Issue has been moved to here