From f0fe3e59f75f9b35243d54892eafcde07e6c7a0c Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 9 Apr 2024 15:59:49 -0400 Subject: [PATCH] Generic way to represent a relational database --- 41.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 41.md diff --git a/41.md b/41.md new file mode 100644 index 00000000..1c5ba005 --- /dev/null +++ b/41.md @@ -0,0 +1,37 @@ +NIP-41 +====== + +Relational Database +------------------- + +`draft` `optional` + +This NIP offers a plug-and-play method to export/sync information from existing systems using relational databases into Nostr. + +Event kind `31200` represents a row in a database. Each value of the row is added as a tag whose name is the column's name. + +Values can be public or encrypted to the user. + +```js +{ + "kind": 31200, + "tags": [ + ["d", ""] + ["n", ""] + ["u", ""] + ["", ""] + // other public columns + ], + "content": nip44Encrypt(JSON.stringify(( + [ + ["", ""] + // other private columns + ] + )), + // .. other fields +} +``` + +Inserts and updates are supported via Nostr's regular signing operations and deletions via [NIP-09](09.md). + +The pubkey MAY be own by the system and represent several users from that system. \ No newline at end of file