upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/61.md
diff options
context:
space:
mode:
Diffstat (limited to '61.md')
-rw-r--r--61.md18
1 files changed, 10 insertions, 8 deletions
diff --git a/61.md b/61.md
index 2cf27d5..4b4020a 100644
--- a/61.md
+++ b/61.md
@@ -22,8 +22,8 @@ Alice wants to nutzap 1 sat to Bob because of an event `event-id-1` she liked.
22 "tags": [ 22 "tags": [
23 [ "relay", "wss://relay1" ], 23 [ "relay", "wss://relay1" ],
24 [ "relay", "wss://relay2" ], 24 [ "relay", "wss://relay2" ],
25 [ "mint", "https://mint1" ], 25 [ "mint", "https://mint1", "usd", "sat" ],
26 [ "mint", "https://mint2" ], 26 [ "mint", "https://mint2", "sat" ],
27 [ "pubkey", "<p2pk-pubkey>" ] 27 [ "pubkey", "<p2pk-pubkey>" ]
28 ] 28 ]
29} 29}
@@ -32,13 +32,13 @@ Alice wants to nutzap 1 sat to Bob because of an event `event-id-1` she liked.
32`kind:10019` is an event that is useful for others to know how to send money to the user. 32`kind:10019` is an event that is useful for others to know how to send money to the user.
33 33
34* `relay` - Relays where the user will be reading token events from. If a user wants to send money to the user, they should write to these relays. 34* `relay` - Relays where the user will be reading token events from. If a user wants to send money to the user, they should write to these relays.
35* `mint` - Mints the user is explicitly agreeing to use to receive funds on. Clients SHOULD not send money on mints not listed here or risk burning their money. 35* `mint` - Mints the user is explicitly agreeing to use to receive funds on. Clients SHOULD not send money on mints not listed here or risk burning their money. Additional markers can be used to list the supported base units of the mint.
36* `pubkey` - Pubkey that SHOULD be used to P2PK-lock receiving nutzaps. If not present, clients SHOULD use the pubkey of the recipient. 36* `pubkey` - Pubkey that SHOULD be used to P2PK-lock receiving nutzaps. If not present, clients SHOULD use the pubkey of the recipient. This is explained in Appendix 1.
37 37
38## Nutzap event 38## Nutzap event
39Event `kind:7337` is a nutzap event published by the sender, p-tagging the recipient. The outputs are P2PK-locked to the pubkey the recipient indicated in their `kind:10019` event or to the recipient pubkey if the `kind:10019` event doesn't have a explicit pubkey. 39Event `kind:7337` is a nutzap event published by the sender, p-tagging the recipient. The outputs are P2PK-locked to the pubkey the recipient indicated in their `kind:10019` event or to the recipient pubkey if the `kind:10019` event doesn't have a explicit pubkey.
40 40
41Clients MUST prefix the recipient pubkey with `"02"` (for nostr<>cashu pubkey compatibility). 41Clients MUST prefix the pubkey they p2pk-lock with `"02"` (for nostr<>cashu pubkey compatibility).
42 42
43```jsonc 43```jsonc
44{ 44{
@@ -46,7 +46,7 @@ Clients MUST prefix the recipient pubkey with `"02"` (for nostr<>cashu pubkey co
46 content: "[{\"amount\":1,\"C\":\"02277c66191736eb72fce9d975d08e3191f8f96afb73ab1eec37e4465683066d3f\",\"id\":\"000a93d6f8a1d2c4\",\"secret\":\"[\\\"P2PK\\\",{\\\"nonce\\\":\\\"b00bdd0467b0090a25bdf2d2f0d45ac4e355c482c1418350f273a04fedaaee83\\\",\\\"data\\\":\\\"02eaee8939e3565e48cc62967e2fde9d8e2a4b3ec0081f29eceff5c64ef10ac1ed\\\"}]\"}]", 46 content: "[{\"amount\":1,\"C\":\"02277c66191736eb72fce9d975d08e3191f8f96afb73ab1eec37e4465683066d3f\",\"id\":\"000a93d6f8a1d2c4\",\"secret\":\"[\\\"P2PK\\\",{\\\"nonce\\\":\\\"b00bdd0467b0090a25bdf2d2f0d45ac4e355c482c1418350f273a04fedaaee83\\\",\\\"data\\\":\\\"02eaee8939e3565e48cc62967e2fde9d8e2a4b3ec0081f29eceff5c64ef10ac1ed\\\"}]\"}]",
47 pubkey: "sender-pubkey", 47 pubkey: "sender-pubkey",
48 tags: [ 48 tags: [
49 [ "amount", "1", "sats" ], 49 [ "amount", "1", "sat" ],
50 [ "comment", "Great point" ], 50 [ "comment", "Great point" ],
51 [ "u", "https://stablenut.umint.cash", ], 51 [ "u", "https://stablenut.umint.cash", ],
52 [ "e", "<zapped-event-id>", "<relay-hint>" ], 52 [ "e", "<zapped-event-id>", "<relay-hint>" ],
@@ -61,6 +61,8 @@ Clients MUST prefix the recipient pubkey with `"02"` (for nostr<>cashu pubkey co
61* `e` zero or one event that is being nutzapped. 61* `e` zero or one event that is being nutzapped.
62* `p` exactly one pubkey, specifying the recipient of the nutzap. 62* `p` exactly one pubkey, specifying the recipient of the nutzap.
63 63
64WIP: Clients SHOULD embed a DLEQ proof in the nutzap event to make it possible to verify nutzaps without talking to the mint.
65
64# Sending a nutzap 66# Sending a nutzap
65 67
66* The sender fetches the recipient's `kind:10019`. 68* The sender fetches the recipient's `kind:10019`.
@@ -91,7 +93,7 @@ Multiple `kind:7337` events can be tagged in the same `kind:7376` event.
91 "kind": 7376, 93 "kind": 7376,
92 "content": nip44_encrypt([ 94 "content": nip44_encrypt([
93 [ "direction", "in" ], // in = received, out = sent 95 [ "direction", "in" ], // in = received, out = sent
94 [ "amount", "1", "sats" ], 96 [ "amount", "1", "sat" ],
95 [ "e", "<7375-event-id>", "relay-hint", "created" ] // new token event that was created 97 [ "e", "<7375-event-id>", "relay-hint", "created" ] // new token event that was created
96 ]), 98 ]),
97 "tags": [ 99 "tags": [
@@ -117,7 +119,7 @@ Events that redeem a nutzap SHOULD be published to the sender's [[NIP-65]] relay
1173. A nut zap MUST be sent to a mint the recipient has listed in their `kind:10019` event or to the NIP-65 relays of the recipient, failure to do so may result in the recipient donating the tokens to the mint since the recipient might never see the event. 1193. A nut zap MUST be sent to a mint the recipient has listed in their `kind:10019` event or to the NIP-65 relays of the recipient, failure to do so may result in the recipient donating the tokens to the mint since the recipient might never see the event.
118 120
119## Appendix 1: Alternative P2PK pubkey 121## Appendix 1: Alternative P2PK pubkey
120Sometimes clients might not have access to the user's private key (i.e. NIP-07, NIP-46 signing) and, as such, the private key to sign cashu spends might not be available, which would make spending the P2PK incoming nutzaps impossible. 122Clients might not have access to the user's private key (i.e. NIP-07, NIP-46 signing) and, as such, the private key to sign cashu spends might not be available, which would make spending the P2PK incoming nutzaps impossible.
121 123
122For this scenarios clients can: 124For this scenarios clients can:
123 125