diff options
| author | Rob Woodgate <robwoodgate@users.noreply.github.com> | 2025-10-31 13:59:35 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-31 15:59:35 +0200 |
| commit | 62f0b14ae81fd062bb84791bca698b29f6b573a3 (patch) | |
| tree | 6b22c7c518d5f428ca4c0af0799db6c548470258 /60.md | |
| parent | 3ec830cd2331ba0ed3113fc05a44c87deb9785be (diff) | |
Added base "unit" tag to NutZap kind:9321 event (#1915)
Diffstat (limited to '60.md')
| -rw-r--r-- | 60.md | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -50,6 +50,7 @@ There can be multiple `kind:7375` events for the same mint, and multiple proofs | |||
| 50 | "kind": 7375, | 50 | "kind": 7375, |
| 51 | "content": nip44_encrypt({ | 51 | "content": nip44_encrypt({ |
| 52 | "mint": "https://stablenut.umint.cash", | 52 | "mint": "https://stablenut.umint.cash", |
| 53 | "unit": "sat", | ||
| 53 | "proofs": [ | 54 | "proofs": [ |
| 54 | // one or more proofs in the default cashu format | 55 | // one or more proofs in the default cashu format |
| 55 | { | 56 | { |
| @@ -69,6 +70,7 @@ There can be multiple `kind:7375` events for the same mint, and multiple proofs | |||
| 69 | * `.content` is a [NIP-44](44.md) encrypted payload: | 70 | * `.content` is a [NIP-44](44.md) encrypted payload: |
| 70 | * `mint`: The mint the proofs belong to. | 71 | * `mint`: The mint the proofs belong to. |
| 71 | * `proofs`: unencoded proofs | 72 | * `proofs`: unencoded proofs |
| 73 | * `unit` the base unit the proofs are denominated in (eg: `sat`, `usd`, `eur`). Default: `sat` if omitted. | ||
| 72 | * `del`: token-ids that were destroyed by the creation of this token. This assists with state transitions. | 74 | * `del`: token-ids that were destroyed by the creation of this token. This assists with state transitions. |
| 73 | 75 | ||
| 74 | When one or more proofs of a token are spent, the token event should be [NIP-09](09.md)-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 (the change output should include a `del` field). | 76 | When one or more proofs of a token are spent, the token event should be [NIP-09](09.md)-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 (the change output should include a `del` field). |
| @@ -84,6 +86,7 @@ Clients SHOULD publish `kind:7376` events to create a transaction history when t | |||
| 84 | "content": nip44_encrypt([ | 86 | "content": nip44_encrypt([ |
| 85 | [ "direction", "in" ], // in = received, out = sent | 87 | [ "direction", "in" ], // in = received, out = sent |
| 86 | [ "amount", "1" ], | 88 | [ "amount", "1" ], |
| 89 | [ "unit", "sat" ], | ||
| 87 | [ "e", "<event-id-of-created-token>", "", "created" ] | 90 | [ "e", "<event-id-of-created-token>", "", "created" ] |
| 88 | ]), | 91 | ]), |
| 89 | "tags": [ | 92 | "tags": [ |
| @@ -93,6 +96,7 @@ Clients SHOULD publish `kind:7376` events to create a transaction history when t | |||
| 93 | ``` | 96 | ``` |
| 94 | 97 | ||
| 95 | * `direction` - The direction of the transaction; `in` for received funds, `out` for sent funds. | 98 | * `direction` - The direction of the transaction; `in` for received funds, `out` for sent funds. |
| 99 | * `unit` the base unit of the amount (eg: `sat`, `usd`, `eur`). Default: `sat` if omitted. | ||
| 96 | 100 | ||
| 97 | Clients MUST add `e` tags to create references of destroyed and created token events along with the marker of the meaning of the tag: | 101 | Clients MUST add `e` tags to create references of destroyed and created token events along with the marker of the meaning of the tag: |
| 98 | * `created` - A new token event was created. | 102 | * `created` - A new token event was created. |
| @@ -121,6 +125,7 @@ If Alice spends 4 sats from this token event | |||
| 121 | "id": "event-id-1", | 125 | "id": "event-id-1", |
| 122 | "content": nip44_encrypt({ | 126 | "content": nip44_encrypt({ |
| 123 | "mint": "https://stablenut.umint.cash", | 127 | "mint": "https://stablenut.umint.cash", |
| 128 | "unit": "sat", | ||
| 124 | "proofs": [ | 129 | "proofs": [ |
| 125 | { "id": "1", "amount": 1 }, | 130 | { "id": "1", "amount": 1 }, |
| 126 | { "id": "2", "amount": 2 }, | 131 | { "id": "2", "amount": 2 }, |
| @@ -140,6 +145,7 @@ Her client: | |||
| 140 | "id": "event-id-2", | 145 | "id": "event-id-2", |
| 141 | "content": nip44_encrypt({ | 146 | "content": nip44_encrypt({ |
| 142 | "mint": "https://stablenut.umint.cash", | 147 | "mint": "https://stablenut.umint.cash", |
| 148 | "unit": "sat", | ||
| 143 | "proofs": [ | 149 | "proofs": [ |
| 144 | { "id": "1", "amount": 1 }, | 150 | { "id": "1", "amount": 1 }, |
| 145 | { "id": "2", "amount": 2 }, | 151 | { "id": "2", "amount": 2 }, |
| @@ -159,6 +165,7 @@ Her client: | |||
| 159 | "content": nip44_encrypt([ | 165 | "content": nip44_encrypt([ |
| 160 | [ "direction", "out" ], | 166 | [ "direction", "out" ], |
| 161 | [ "amount", "4" ], | 167 | [ "amount", "4" ], |
| 168 | [ "unit", "sat" ], | ||
| 162 | [ "e", "<event-id-1>", "", "destroyed" ], | 169 | [ "e", "<event-id-1>", "", "destroyed" ], |
| 163 | [ "e", "<event-id-2>", "", "created" ], | 170 | [ "e", "<event-id-2>", "", "created" ], |
| 164 | ]), | 171 | ]), |