Martti Malmi on Nostr: It's very simple. Private block: { kind: 16462, content: nip04.encrypt(myPriv, myPub, ...
It's very simple. Private block:
{
kind: 16462,
content: nip04.encrypt(myPriv, myPub, JSON.stringify(privateBlockedUsersArray))
}
Public block:
{
kind: 16463,
content: JSON.stringify(publicBlockedUsersArray)
}
I picked the kind by random from the replaceable events range.
Any improvements are welcome. One thing that comes to mind is recording the reason or expiry date for block. If such additional attributes are needed, object might be better than array.
Published at
2023-01-14 21:06:05Event JSON
{
"id": "a67bfb43ed3a9c1a64aec2f06e4dbe4b62eea07bfb049ff85fc4b812bbd2f279",
"pubkey": "4523be58d395b1b196a9b8c82b038b6895cb02b683d0c253a955068dba1facd0",
"created_at": 1673730365,
"kind": 1,
"tags": [
[
"e",
"2c5261786cb170ec77826ecc7105ef07f89dc205f0d41e773a29175eddcaa39d",
"wss://nostr.ono.re",
"reply"
],
[
"p",
"8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"
],
[
"p",
"4523be58d395b1b196a9b8c82b038b6895cb02b683d0c253a955068dba1facd0",
"wss://nostr-pub.wellorder.net"
],
[
"p",
"4523be58d395b1b196a9b8c82b038b6895cb02b683d0c253a955068dba1facd0",
"wss://nostr-pub.semisol.dev"
],
[
"p",
"32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245",
"wss://nostr.bitcoiner.social"
]
],
"content": "It's very simple. Private block:\n{\n kind: 16462,\n content: nip04.encrypt(myPriv, myPub, JSON.stringify(privateBlockedUsersArray))\n}\n\nPublic block:\n{\n kind: 16463,\n content: JSON.stringify(publicBlockedUsersArray)\n}\n\nI picked the kind by random from the replaceable events range.\n\nAny improvements are welcome. One thing that comes to mind is recording the reason or expiry date for block. If such additional attributes are needed, object might be better than array.",
"sig": "33218875069b1eddfc12550118c137c2983215b276903171b536ff6a27d8dd21e28b1182d5aef8fc92f8275d54bb8af6d769e088ca9bcd0476b364c2b9f3ce6a"
}