mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-09 00:28:51 +00:00
Compare commits
1 Commits
nip60-rese
...
nh-editabl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d527dba15 |
38
37.md
Normal file
38
37.md
Normal file
@@ -0,0 +1,38 @@
|
||||
NIP-37
|
||||
======
|
||||
|
||||
Editable Short Notes
|
||||
--------------------
|
||||
|
||||
`draft` `optional`
|
||||
|
||||
This NIP describes a flow for clients that want to support editable short notes without breaking the experience of clients that don't and keeping `kind:1` a safe place.
|
||||
|
||||
The idea is that editable notes are published as `kind:31000` notes that follow all the same rules of `kind:1`, except for the fact that they can be replaceable anytime.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"kind": 31000,
|
||||
"created_at": 1730820000,
|
||||
"content": "I like dogs",
|
||||
"tags": [
|
||||
["d", "c2huy3f"],
|
||||
// other kind1 tags
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Clients that want to support edits would automatically only publish `kind:31000` notes, then immediately publish `kind:1` notes that quote the `kind:31000` note.
|
||||
|
||||
```jsonc
|
||||
{
|
||||
"kind": 1,
|
||||
"created_at": 1730820000,
|
||||
"content": "naddr1...",
|
||||
"tags": [
|
||||
["q", "31000:...:c2huy3f"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Clients that support this NIP would then fetch the `kind:31000` and display it normally in place of the `kind:1`. Other clients would display the editable event embedded inside the `kind:1`.
|
||||
18
60.md
18
60.md
@@ -12,12 +12,10 @@ 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.
|
||||
|
||||
# Event Kinds
|
||||
- `kind:37375` contains relevant info for a wallet. Clients **SHOULD** check the current info event when loading the wallet.
|
||||
- `kind:7373` wallet's reserved proofs. The proofs **MUST** be nip44-encrypted with the user's private key.
|
||||
- `kind:7374` tracks pending quotes from a mint. This event **MAY** be used to keep track of the quote ID and its expiration.
|
||||
- `kind:7375` represents the wallet's unspent proofs. The proofs **MUST** be nip44-encrypted with the user's private key.
|
||||
- `kind:7376` provides the wallet's transaction history. The history is provided only for informational purposes and is not part of the wallet state.
|
||||
# High-level flow
|
||||
1. A user has a `kind:37375` 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.
|
||||
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
|
||||
```jsonc
|
||||
@@ -59,7 +57,7 @@ Any tag, other than the `d` tag, can be [[NIP-44]] encrypted into the `.content`
|
||||
Due to PRE being hard to delete, if a user wants to delete a wallet, they should empty the event and keep just the `d` identifier and add a `deleted` tag.
|
||||
|
||||
## Token Event
|
||||
Token events are used to store proofs of a wallet.
|
||||
Token events are used to record the unspent proofs that come from the mint.
|
||||
|
||||
There can be multiple `kind:7375` events for the same mint, and multiple proofs inside each `kind:7375` event.
|
||||
|
||||
@@ -89,9 +87,6 @@ There can be multiple `kind:7375` events for the same mint, and multiple proofs
|
||||
### Spending proofs
|
||||
When one or more proofs of a token are spent, the token event should be [[NIP-09]]-deleted and, if some proofs are unspent from the same token event, a new token event should be created rolling over the unspent proofs and adding any change outputs to the new token event.
|
||||
|
||||
### Reserving proofs
|
||||
A wallet can reserve proofs by deleting them from a `kind:7375` event and creating a `kind:7373` event. `kind:7373` and `kind:7375` events have the same structure.
|
||||
|
||||
## Spending History Event
|
||||
Clients SHOULD publish `kind:7376` events to create a transaction history when their balance changes.
|
||||
|
||||
@@ -208,6 +203,3 @@ Application developers are encouraged to use local state when possible and only
|
||||
|
||||
## Appendix 1: Validating proofs
|
||||
Clients can optionally validate proofs to make sure they are not working from an old state; this logic is left up to particular implementations to decide when and why to do it, but if some proofs are checked and deemed to have been spent, the client should delete the token and roll over any unspent proof.
|
||||
|
||||
## Appendix 2: Validating relays
|
||||
Clients might want to optionally check that the relays the user chooses to store the proofs respond well to [[NIP-09]] event deletion requests and, periodically, check that the different relays are consistent with the state they report. These checks are left up to particular implementations to decide when and why to do them.
|
||||
@@ -142,8 +142,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `5000`-`5999` | Job Request | [90](90.md) |
|
||||
| `6000`-`6999` | Job Result | [90](90.md) |
|
||||
| `7000` | Job Feedback | [90](90.md) |
|
||||
| `7373` | Reserved Cashu Wallet Tokens | [60](60.md) |
|
||||
| `7374` | Pending minting quotes | [60](60.md) |
|
||||
| `7374` | Reserved Cashu Wallet Tokens | [60](60.md) |
|
||||
| `7375` | Cashu Wallet Tokens | [60](60.md) |
|
||||
| `7376` | Cashu Wallet History | [60](60.md) |
|
||||
| `9000`-`9030` | Group Control Events | [29](29.md) |
|
||||
|
||||
Reference in New Issue
Block a user