diff options
| author | pablof7z <pfer@me.com> | 2025-10-08 14:29:40 +0300 |
|---|---|---|
| committer | pablof7z <pfer@me.com> | 2025-10-08 14:29:40 +0300 |
| commit | 58cfc3189c700d1f0fb53cebc6819af12fa3b4ef (patch) | |
| tree | 82a8e66cffcd03b20cdd06bde44ea82539d66e04 | |
| parent | b516adbf423a120045e07adf5358ae69f190f3c8 (diff) | |
relay tags in nip-60 on 17375 instead of 10019
| -rw-r--r-- | 51.md | 1 | ||||
| -rw-r--r-- | 60.md | 14 |
2 files changed, 12 insertions, 3 deletions
| @@ -32,6 +32,7 @@ For example, _mute list_ can contain the public keys of spammers and bad actors | |||
| 32 | | Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | | 32 | | Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | |
| 33 | | Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | | 33 | | Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | |
| 34 | | Simple groups | 10009 | [NIP-29](29.md) groups the user is in | `"group"` ([NIP-29](29.md) group id + relay URL + optional group name), `"r"` for each relay in use | | 34 | | Simple groups | 10009 | [NIP-29](29.md) groups the user is in | `"group"` ([NIP-29](29.md) group id + relay URL + optional group name), `"r"` for each relay in use | |
| 35 | | Wallet relays | 17375 | relays for [NIP-60](60.md) wallet operations | `"relay"` (relay URLs) - stored in the wallet event itself, see [NIP-60](60.md) | | ||
| 35 | | Relay feeds | 10012 | user favorite browsable relays (and relay sets) | `"relay"` (relay URLs) and `"a"` (kind:30002 relay set) | | 36 | | Relay feeds | 10012 | user favorite browsable relays (and relay sets) | `"relay"` (relay URLs) and `"a"` (kind:30002 relay set) | |
| 36 | | Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a"` (kind:30015 interest set) | | 37 | | Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a"` (kind:30015 interest set) | |
| 37 | | Media follows | 10020 | multimedia (photos, short video) follow list | `"p"` (pubkeys -- with optional relay hint and petname) | | 38 | | Media follows | 10020 | multimedia (photos, short video) follow list | `"p"` (pubkeys -- with optional relay hint and petname) | |
| @@ -30,7 +30,10 @@ This NIP doesn't deal with users' *receiving* money from someone else, it's just | |||
| 30 | [ "mint", "https://mint1" ], | 30 | [ "mint", "https://mint1" ], |
| 31 | [ "mint", "https://mint2" ] | 31 | [ "mint", "https://mint2" ] |
| 32 | ]), | 32 | ]), |
| 33 | "tags": [] | 33 | "tags": [ |
| 34 | [ "relay", "wss://relay1.example.com" ], | ||
| 35 | [ "relay", "wss://relay2.example.com" ] | ||
| 36 | ] | ||
| 34 | } | 37 | } |
| 35 | ``` | 38 | ``` |
| 36 | 39 | ||
| @@ -39,6 +42,7 @@ The wallet event is an replaceable event `kind:17375`. | |||
| 39 | Tags: | 42 | Tags: |
| 40 | * `mint` - Mint(s) this wallet uses -- there MUST be one or more mint tags. | 43 | * `mint` - Mint(s) this wallet uses -- there MUST be one or more mint tags. |
| 41 | * `privkey` - Private key used to unlock P2PK ecash. MUST be stored encrypted in the `.content` field. **This is a different private key exclusively used for the wallet, not associated in any way to the user's Nostr private key** -- This is only used for receiving [NIP-61](61.md) nutzaps. | 44 | * `privkey` - Private key used to unlock P2PK ecash. MUST be stored encrypted in the `.content` field. **This is a different private key exclusively used for the wallet, not associated in any way to the user's Nostr private key** -- This is only used for receiving [NIP-61](61.md) nutzaps. |
| 45 | * `relay` - Relay(s) where the wallet's events (`kind:7374`, `kind:7375`, `kind:7376`) are published to and queried from. Clients MUST use these relays for all wallet operations. If no `relay` tags are present, clients SHOULD fall back to the user's [NIP-65](65.md) relay list. | ||
| 42 | 46 | ||
| 43 | ### Token Event | 47 | ### Token Event |
| 44 | Token events are used to record unspent proofs. | 48 | Token events are used to record unspent proofs. |
| @@ -104,10 +108,14 @@ All tags can be [NIP-44](44.md) encrypted. Clients SHOULD leave `e` tags with a | |||
| 104 | Multiple `e` tags can be added, and should be encrypted, except for tags with the `redeemed` marker. | 108 | Multiple `e` tags can be added, and should be encrypted, except for tags with the `redeemed` marker. |
| 105 | 109 | ||
| 106 | ## Flow | 110 | ## Flow |
| 107 | A client that wants to check for user's wallets information starts by fetching `kind:10019` events from the user's relays, if no event is found, it should fall back to using the user's [NIP-65](65.md) relays. | 111 | A client that wants to check for user's wallet information: |
| 112 | |||
| 113 | 1. Fetches the user's `kind:17375` wallet event from the user's [NIP-65](65.md) relays (or any known relays) | ||
| 114 | 2. Reads the `relay` tags from the wallet event to determine which relays to use for wallet operations | ||
| 115 | 3. If no `relay` tags are present, falls back to using the user's [NIP-65](65.md) relay list | ||
| 108 | 116 | ||
| 109 | ### Fetch wallet and token list | 117 | ### Fetch wallet and token list |
| 110 | From those relays, the client should fetch wallet and token events. | 118 | Using the relays from the wallet event's `relay` tags (or NIP-65 relays if not specified), the client should fetch wallet and token events: |
| 111 | 119 | ||
| 112 | `"kinds": [17375, 7375], "authors": ["<my-pubkey>"]` | 120 | `"kinds": [17375, 7375], "authors": ["<my-pubkey>"]` |
| 113 | 121 | ||