From a1d348cfeab24c997bd908b274d8d1124241d627 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 26 May 2024 11:57:04 -0500 Subject: [PATCH] NIP-90: let "encrypted" tag have an optional value of `nip04` or `nip44` --- 90.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/90.md b/90.md index 5a15ebb6..fd5edc48 100644 --- a/90.md +++ b/90.md @@ -69,7 +69,15 @@ All tags are optional. ## Encrypted Params -If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. Add a tag `encrypted` as tags. Encryption for private tags will use [NIP-04 - Encrypted Direct Message encryption](https://github.com/nostr-protocol/nips/blob/master/04.md), using the user's private and service provider's public key for the shared secret +If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. + +Requests with encrypted content should include a tag like `["encrypted", ]`, where encryption is one of: + +- `nip04` for [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) +- `nip44` for [NIP-44](https://github.com/nostr-protocol/nips/blob/master/44.md) +- if not provided (eg `["encrypted"]`), the encryption method is assumed to be `nip04` for backwards-compatibility. + +Encryption for private tags will use the user's private and service provider's public key for the shared secret. ```json [ @@ -91,7 +99,7 @@ This param data will be encrypted and added to the `content` field and `p` tag s "content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", "tags": [ ["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"], - ["encrypted"] + ["encrypted", "nip04"] ], ... } @@ -137,7 +145,7 @@ Add a tag encrypted to mark the output content as `encrypted` ["e", "", ""], ["p", ""], ["amount", "requested-payment-amount", ""], - ["encrypted"] + ["encrypted", "nip04"] ], ... }