diff --git a/17.md b/17.md index 73e61f72..276e1ee3 100644 --- a/17.md +++ b/17.md @@ -154,11 +154,11 @@ class BloomFilter(size: Int, rounds: Int, buffer: ByteArray, salt: ByteArray) { } ``` -Example event: +Example event for direct chats: -```json +```js { - "pubkey" : "badbdda507572b397852048ea74f2ef3ad92b1aac07c3d4e1dec174e8cdc962a", + "pubkey" : sha256(hkdf(private_key, salt: 'nip17') || ""), "kind": 30010, "created_at": 1738964056, "tags": [ @@ -173,6 +173,25 @@ Example event: In this example the pubkey `badbdda507572b397852048ea74f2ef3ad92b1aac07c3d4e1dec174e8cdc962a`, has confirmed that they saw the messages with ids of `ca29c211f1c72d5b6622268ff43d2288ea2b2cb5b9aa196ff9f1704fc914b71b` and `460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c` from pubkey `bd4ae3e67e29964d494172261dc45395c89f6bd2e774642e366127171dfb81f5`. +> d tag uses the hkdf defined in [NIP-44](44.md). + +Example event for group messages: + +```js +{ + "pubkey" : sha256(hkdf(private_key, salt: 'nip17') || ""), + "kind": 30010, + "created_at": 1738964056, + "tags": [ + [ + "d", + "bd4ae3e67e29964d494172261dc45395c89f6bd2e774642e366127171dfb81f5" + ] + ], + "content": "100:10:AAAkAQANcYQFCQoB:hZkZYqqdxcE", +} +``` + A client MAY encrypt the `.content` based on [NIP-44](44.md) for more privacy. ## Relays