mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-09 16:48:50 +00:00
Compare commits
2 Commits
nip71-addr
...
nip-60-rel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
baa382ca7d | ||
|
|
58cfc3189c |
15
60.md
15
60.md
@@ -28,7 +28,9 @@ This NIP doesn't deal with users' *receiving* money from someone else, it's just
|
|||||||
"content": nip44_encrypt([
|
"content": nip44_encrypt([
|
||||||
[ "privkey", "hexkey" ],
|
[ "privkey", "hexkey" ],
|
||||||
[ "mint", "https://mint1" ],
|
[ "mint", "https://mint1" ],
|
||||||
[ "mint", "https://mint2" ]
|
[ "mint", "https://mint2" ],
|
||||||
|
[ "relay", "wss://relay1.example.com" ],
|
||||||
|
[ "relay", "wss://relay2.example.com" ]
|
||||||
]),
|
]),
|
||||||
"tags": []
|
"tags": []
|
||||||
}
|
}
|
||||||
@@ -36,9 +38,10 @@ This NIP doesn't deal with users' *receiving* money from someone else, it's just
|
|||||||
|
|
||||||
The wallet event is an replaceable event `kind:17375`.
|
The wallet event is an replaceable event `kind:17375`.
|
||||||
|
|
||||||
Tags:
|
Encrypted Tags:
|
||||||
* `mint` - Mint(s) this wallet uses -- there MUST be one or more mint tags.
|
* `mint` - Mint(s) this wallet uses -- there MUST be one or more mint tags.
|
||||||
* `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.
|
* `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.
|
||||||
|
* `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.
|
||||||
|
|
||||||
### Token Event
|
### Token Event
|
||||||
Token events are used to record unspent proofs.
|
Token events are used to record unspent proofs.
|
||||||
@@ -104,10 +107,14 @@ All tags can be [NIP-44](44.md) encrypted. Clients SHOULD leave `e` tags with a
|
|||||||
Multiple `e` tags can be added, and should be encrypted, except for tags with the `redeemed` marker.
|
Multiple `e` tags can be added, and should be encrypted, except for tags with the `redeemed` marker.
|
||||||
|
|
||||||
## Flow
|
## Flow
|
||||||
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.
|
A client that wants to check for user's wallet information:
|
||||||
|
|
||||||
|
1. Fetches the user's `kind:17375` wallet event from the user's [NIP-65](65.md) relays (or any known relays)
|
||||||
|
2. Reads the `relay` tags from the wallet event to determine which relays to use for wallet operations
|
||||||
|
3. If no `relay` tags are present, falls back to using the user's [NIP-65](65.md) relay list
|
||||||
|
|
||||||
### Fetch wallet and token list
|
### Fetch wallet and token list
|
||||||
From those relays, the client should fetch wallet and token events.
|
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:
|
||||||
|
|
||||||
`"kinds": [17375, 7375], "authors": ["<my-pubkey>"]`
|
`"kinds": [17375, 7375], "authors": ["<my-pubkey>"]`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user