NIP-60: Fix heading levels (#2029)
This commit is contained in:
parent
68e5d0ada4
commit
c222f71102
18
60.md
18
60.md
|
@ -16,12 +16,12 @@ The purpose of this NIP is:
|
||||||
|
|
||||||
This NIP doesn't deal with users' *receiving* money from someone else, it's just to keep state of the user's wallet.
|
This NIP doesn't deal with users' *receiving* money from someone else, it's just to keep state of the user's wallet.
|
||||||
|
|
||||||
# High-level flow
|
## High-level flow
|
||||||
1. A user has a `kind:17375` event that represents a wallet.
|
1. A user has a `kind:17375` event that represents a wallet.
|
||||||
2. A user has `kind:7375` events that represent the unspent proofs of the wallet. -- The proofs are encrypted with the user's private key.
|
2. A user has `kind:7375` events that represent the unspent proofs of the wallet. -- The proofs are encrypted with the user's private key.
|
||||||
3. A user has `kind:7376` events that represent the spending history of the wallet -- This history is for informational purposes only and is completely optional.
|
3. A user has `kind:7376` events that represent the spending history of the wallet -- This history is for informational purposes only and is completely optional.
|
||||||
|
|
||||||
## Wallet Event
|
### Wallet Event
|
||||||
```jsonc
|
```jsonc
|
||||||
{
|
{
|
||||||
"kind": 17375,
|
"kind": 17375,
|
||||||
|
@ -40,7 +40,7 @@ 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.
|
||||||
|
|
||||||
## Token Event
|
### Token Event
|
||||||
Token events are used to record unspent proofs.
|
Token events are used to record unspent proofs.
|
||||||
|
|
||||||
There can be multiple `kind:7375` events for the same mint, and multiple proofs inside each `kind:7375` event.
|
There can be multiple `kind:7375` events for the same mint, and multiple proofs inside each `kind:7375` event.
|
||||||
|
@ -75,7 +75,7 @@ When one or more proofs of a token are spent, the token event should be [NIP-09]
|
||||||
|
|
||||||
The `kind:5` _delete event_ created in the [NIP-09](09.md) process MUST have a tag `["k", "7375"]` to allow easy filtering by clients interested in state transitions.
|
The `kind:5` _delete event_ created in the [NIP-09](09.md) process MUST have a tag `["k", "7375"]` to allow easy filtering by clients interested in state transitions.
|
||||||
|
|
||||||
## Spending History Event
|
### Spending History Event
|
||||||
Clients SHOULD publish `kind:7376` events to create a transaction history when their balance changes.
|
Clients SHOULD publish `kind:7376` events to create a transaction history when their balance changes.
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
|
@ -103,17 +103,17 @@ 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 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.
|
||||||
|
|
||||||
## Fetch wallet and token list
|
### Fetch wallet and token list
|
||||||
From those relays, the client should fetch wallet and token events.
|
From those relays, the client should fetch wallet and token events.
|
||||||
|
|
||||||
`"kinds": [17375, 7375], "authors": ["<my-pubkey>"]`
|
`"kinds": [17375, 7375], "authors": ["<my-pubkey>"]`
|
||||||
|
|
||||||
## Fetch proofs
|
### Fetch proofs
|
||||||
|
|
||||||
## Spending token
|
### Spending token
|
||||||
If Alice spends 4 sats from this token event
|
If Alice spends 4 sats from this token event
|
||||||
```jsonc
|
```jsonc
|
||||||
{
|
{
|
||||||
|
@ -166,7 +166,7 @@ Her client:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Redeeming a quote (optional)
|
### Redeeming a quote (optional)
|
||||||
When creating a quote at a mint, an event can be used to keep the state of the quote ID, which will be used to check when the quote has been paid. These events should be created with an expiration tag [NIP-40](40.md) of 2 weeks (which is around the maximum amount of time a Lightning payment may be in-flight).
|
When creating a quote at a mint, an event can be used to keep the state of the quote ID, which will be used to check when the quote has been paid. These events should be created with an expiration tag [NIP-40](40.md) of 2 weeks (which is around the maximum amount of time a Lightning payment may be in-flight).
|
||||||
|
|
||||||
However, application developers SHOULD use local state when possible and only publish this event when it makes sense in the context of their application.
|
However, application developers SHOULD use local state when possible and only publish this event when it makes sense in the context of their application.
|
||||||
|
|
Loading…
Reference in New Issue