Skip to content

Commit

Permalink
link to NUT-3/4/5
Browse files Browse the repository at this point in the history
  • Loading branch information
lollerfirst committed Nov 26, 2024
1 parent 85d390e commit 8b4aa14
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio
| [16][16] | Animated QR codes | [Cashu.me][cashume] | - |
| [17][17] | WebSocket subscriptions | [Nutshell][py] | [Nutshell][py] |
| [18][18] | Payment requests | [Cashu.me][cashume], [Boardwalk][bwc], [cdk-cli] | - |
| [XX][xx] | Cached Responses | - | [Nutshell][py], [cdk-mintd] |
| [XX][xx] | Cached Responses | - | [Nutshell][py], [cdk-mintd] |


#### Wallets:
Expand Down
11 changes: 8 additions & 3 deletions XX.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Any Mint implementation should elect a data structure `D` that maps request obje

### Derive & Repeat

Upon the reception of a mint (`POST /v1/mint/{method}`), swap (`POST v1/swap`) or melt (`POST /v1/melt/{method}`) `request`, the mint derives a key `k` for it. `k` should depend on the path of `request` as well as the contents of `request`'s payload.
Upon the reception of a mint ([NUT-4](04)), swap ([NUT-3](03)) or melt ([NUT-5](05)) `request`, the mint derives a key `k` for it. `k` should depend on the path of `request` as well as the contents of `request`'s payload.

The mint uses `k` to look up a `response = D[k]` and discriminates execution based on the following checks:
* If no cached `response` is found: `request` has no matching `response`. The mint processes `request` as per usual.
Expand Down Expand Up @@ -53,8 +53,10 @@ The entry is structured as follows:
}
```

Where `ttl` is the number of seconds the responses are cached for and `cached_endpoints` is a list of the methods and paths for which caching is enabled.
`path` and `method` describe respectively the cached route and its method.
Where:
* `ttl` is the number of seconds the responses are cached for
* `cached_endpoints` is a list of the methods and paths for which caching is enabled.
* `path` and `method` describe the cached route and its method respectively.

If `ttl` is `null`, the responses are expected to be cached *indefinitely*.

Expand Down Expand Up @@ -116,4 +118,7 @@ If the first request is successful, `Bob` will respond with 5 identical `PostSwa
}
```

[03]: 03.md
[04]: 04.md
[05]: 05.md
[06]: 06.md

0 comments on commit 8b4aa14

Please sign in to comment.