From 004f94ea056789dd542de4930d76a00e26ca4362 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 28 Dec 2022 16:24:19 +0100 Subject: [PATCH 01/12] refactor --- cashu/wallet/cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cashu/wallet/cli.py b/cashu/wallet/cli.py index a500921..3b7138e 100644 --- a/cashu/wallet/cli.py +++ b/cashu/wallet/cli.py @@ -504,11 +504,10 @@ async def burn(ctx, token: str, all: bool, force: bool): @coro async def pending(ctx): wallet: Wallet = ctx.obj["WALLET"] - await wallet.load_mint() reserved_proofs = await get_reserved_proofs(wallet.db) if len(reserved_proofs): print(f"--------------------------\n") - sorted_proofs = sorted(reserved_proofs, key=itemgetter("send_id")) + sorted_proofs = sorted(reserved_proofs, key=itemgetter("send_id")) # type: ignore for i, (key, value) in enumerate( groupby(sorted_proofs, key=itemgetter("send_id")) ): From 065bcf83a544f9627270c93ee115da66f0b523e2 Mon Sep 17 00:00:00 2001 From: rlack Date: Thu, 29 Dec 2022 07:33:27 +0100 Subject: [PATCH 02/12] Update b_dhke.py I was a little bit confused by this comment, I think the mint and client got mixed up --- cashu/core/b_dhke.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cashu/core/b_dhke.py b/cashu/core/b_dhke.py index 8d0d6db..ce511fb 100644 --- a/cashu/core/b_dhke.py +++ b/cashu/core/b_dhke.py @@ -3,28 +3,28 @@ """ Implementation of https://gist.github.com/RubenSomsen/be7a4760dd4596d06963d67baf140406 -Alice (Client): +Bob (Mint): A = a*G return A -Bob (Mint): +Alice (Client): Y = hash_to_curve(secret_message) r = random blinding factor B'= Y + r*G return B' -Alice: +Bob: C' = a*B' (= a*Y + a*r*G) return C' -Bob: +Alice: C = C' - r*A (= C' - a*r*G) (= a*Y) return C, secret_message -Alice: +Bob: Y = hash_to_curve(secret_message) C == a*Y If true, C must have originated from Alice From 6d0ac86608bb60d2c3074b45164ec36dd3790a38 Mon Sep 17 00:00:00 2001 From: rlack Date: Fri, 30 Dec 2022 13:07:17 +0700 Subject: [PATCH 03/12] Update b_dhke.py --- cashu/core/b_dhke.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cashu/core/b_dhke.py b/cashu/core/b_dhke.py index ce511fb..80735ef 100644 --- a/cashu/core/b_dhke.py +++ b/cashu/core/b_dhke.py @@ -27,7 +27,7 @@ return C, secret_message Bob: Y = hash_to_curve(secret_message) C == a*Y -If true, C must have originated from Alice +If true, C must have originated from Bob """ import hashlib From 338f2c1d9e9c78166da283b2262da3f4634e9ed7 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sat, 7 Jan 2023 19:51:47 +0100 Subject: [PATCH 04/12] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 455bb1b..2f40cc3 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ pip install cashu To update Cashu, use `pip install cashu -U`. -If you have problems running the command above on Ubuntu, run `sudo apt install -y pip pkg-config`. On macOS, you might have to run `pip install wheel` and `brew install pkg-config`. +If you have problems running the command above on Ubuntu, run `sudo apt install -y pip pkg-config` and `pip install wheel`. On macOS, you might have to run `pip install wheel` and `brew install pkg-config`. You can skip the entire next section about Poetry and jump right to [Using Cashu](#using-cashu). @@ -51,8 +51,7 @@ These steps help you install Python via pyenv and Poetry. If you already have Po ```bash # on ubuntu: -sudo apt install -y build-essential pkg-config libffi-dev libpq-dev zlib1g-dev libssl-dev python3-dev libsqlite3-dev -# on mac: brew install postgres +sudo apt install -y build-essential pkg-config libffi-dev libpq-dev zlib1g-dev libssl-dev python3-dev libsqlite3-dev ncurses-dev libbz2-dev libreadline-dev lzma-dev # install python using pyenv curl https://pyenv.run | bash @@ -71,7 +70,7 @@ source ~/.bashrc #### Poetry: Install Cashu ```bash # install cashu -git clone https://github.com/callebtc/cashu.git +git clone https://github.com/callebtc/cashu.git --recurse-submodules cd cashu pyenv local 3.9.13 poetry install From e70c393ec95ccb85110758225a2059e8a42198f2 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Jan 2023 13:39:59 +0100 Subject: [PATCH 05/12] update specs --- docs/specs/{wip => }/0 - Notation.md | 2 + .../1 - Request public keys from mint.md | 39 +++++++++++++++++++ .../{wip => }/2 - Keysets and keyset IDs.md | 21 +++++----- docs/specs/{wip => }/3 - Request minting.md | 2 + docs/specs/{wip => }/4 - Minting tokens.md | 2 + docs/specs/{wip => }/5 - Melting tokens.md | 2 + docs/specs/{wip => }/6 - Split.md | 2 + .../wip/1 - Request public keys from mint.md | 32 --------------- 8 files changed, 61 insertions(+), 41 deletions(-) rename docs/specs/{wip => }/0 - Notation.md (98%) create mode 100644 docs/specs/1 - Request public keys from mint.md rename docs/specs/{wip => }/2 - Keysets and keyset IDs.md (60%) rename docs/specs/{wip => }/3 - Request minting.md (98%) rename docs/specs/{wip => }/4 - Minting tokens.md (99%) rename docs/specs/{wip => }/5 - Melting tokens.md (98%) rename docs/specs/{wip => }/6 - Split.md (99%) delete mode 100644 docs/specs/wip/1 - Request public keys from mint.md diff --git a/docs/specs/wip/0 - Notation.md b/docs/specs/0 - Notation.md similarity index 98% rename from docs/specs/wip/0 - Notation.md rename to docs/specs/0 - Notation.md index dbd014e..7957895 100644 --- a/docs/specs/wip/0 - Notation.md +++ b/docs/specs/0 - Notation.md @@ -1,3 +1,5 @@ +# NUT-0 - Notation and Models + Sending user: `Alice` Receiving user: `Carol` Mint: `Bob` diff --git a/docs/specs/1 - Request public keys from mint.md b/docs/specs/1 - Request public keys from mint.md new file mode 100644 index 0000000..21e8554 --- /dev/null +++ b/docs/specs/1 - Request public keys from mint.md @@ -0,0 +1,39 @@ +# NUT-1 - Mint public key exchange + +This describes the basic exchange of the public mint keys that the wallet user `Alice` uses to unblind `Bob`'s signature. + +## Description + +Wallet user `Alice` receives public keys from mint `Bob` via `GET /keys` and stores them in a key-value store like a dictionary. The set of all public keys for each supported amount is called a *keyset*. + +Mint `Bob` responds with his *active* keyset [TODO: Link #2]. The active keyset is the keyset a mint currently uses to sign promises with. The active keyset can change over time, for example due to key rotation. A mint MAY support older keysets indefinetely. Note that a mint can support multiple keysets at the same time but will only respond with the active keyset on the endpoint `GET /keys`. A wallet can ask for the keys of a specific (non-active) keyset by using the endpint `GET /keys/{keyset_id}` (see #2 [TODO: Link #2]). + +See [TODO: Link #2] for how a wallet deals with multiple keysets. + +Keysets are received as a JSON of the form `{ : , : ...}` for each `` of the amounts the mint `Bob` supports and the corresponding public key ``, that is `K_i` (see #0 [TODO: Link #0]). + +## Example + +Request of `Alice`: + +```http +GET https://mint.host:3338/keys +``` + +With curl: + +```bash +curl -X GET https://mint.host:3338/keys +``` + +Response of `Bob`: + +```json +{ + "1": "03a40f20667ed53513075dc51e715ff2046cad64eb68960632269ba7f0210e38bc", + "2": "03fd4ce5a16b65576145949e6f99f445f8249fee17c606b688b504a849cdc452de", + "4": "02648eccfa4c026960966276fa5a4cae46ce0fd432211a4f449bf84f13aa5f8303", + "8": "02fdfd6796bfeac490cbee12f778f867f0a2c68f6508d17c649759ea0dc3547528", + ... +} +``` \ No newline at end of file diff --git a/docs/specs/wip/2 - Keysets and keyset IDs.md b/docs/specs/2 - Keysets and keyset IDs.md similarity index 60% rename from docs/specs/wip/2 - Keysets and keyset IDs.md rename to docs/specs/2 - Keysets and keyset IDs.md index 389a08f..57dbbf2 100644 --- a/docs/specs/wip/2 - Keysets and keyset IDs.md +++ b/docs/specs/2 - Keysets and keyset IDs.md @@ -1,8 +1,10 @@ +# NUT-2 - Keysets and keyset ID + A keyset is a set of public keys that the mint `Bob` generates and shares with its users. It refers to the set of public keys that each correspond to the amount values that the mint supports (e.g. 1, 2, 4, 8, ...) respectively. ## Requesting mint keyset IDs -A mint can have multiple active keysets at the same time but **MUST** have only one active keyset. A wallet can ask the mint for all active keyset IDs via the `GET /keysets` endpoint. A wallet **CAN** request the list of active keysets from the mint upon startup and, if it does so, **MUST** choose only tokens from its database that have a keyset ID supported by the mint to interact with it. +A mint can have multiple keysets at the same time but **MUST** have only one *active* keyset (see #1 [TODO: Link #1]). A wallet can ask the mint for all active keyset IDs via the `GET /keysets` endpoint. A wallet **CAN** request the list of active keyset IDs from the mint upon startup and, if it does so, **MUST** choose only tokens from its database that have a keyset ID supported by the mint to interact with it. This is useful in the case a wallet interacts with multiple mints. That way, a wallet always knows which tokens it can use with the mint it is currently interacting with. @@ -40,17 +42,21 @@ for i in range(MAX_ORDER): k_i = HASH_SHA256(s + D + i)[:32] ``` -Here, `MAX_ORDER` refers to the order of the maximum token value that the mint supports, i.e., `2^MAX_ORDER`. Typically, `MAX_ORDER = 64`. `D` refers to a derivation path that is chosen by the mint to rotate keys. `i` is the string representation of the index of the amount value. +Here, `MAX_ORDER` refers to the order of the maximum token value that the mint supports, i.e., `2^MAX_ORDER`. Typically, `MAX_ORDER = 64`. `D` refers to a derivation path that is chosen by the mint. The derivation path can be used to rotate keys over time or to service multiple parallel mints with a single instance. `i` is the string representation of the index of the amount value, i.e., `0`, `1`, and so on. ## 2.2 - Keyset ID -A keyset ID is an identifier for a specific keyset. It can be derived by anyone who knows the set of public keys of a mint. The keyset ID **CAN** be stored in a Cashu token [TODO: Link to definition of token] if it was generated by a mint corresponding to the keyset. +A keyset ID is an identifier for a specific keyset. It can be derived by anyone who knows the set of public keys of a mint. The keyset ID **CAN** be stored in a Cashu token [TODO: Link to definition of token] such that the token can be used to identify which mint or keyset it was generated from. -A wallet can use the keyset ID in a token to recognize a mint it was issued by. For example, a wallet might store the `MINT_URL` together with the `keyset_id` in its database the first time it receives a keyset from that mint. That way, a wallet can know which mint to contact when it receives a token with a `keyset_id` of a mint that it has interacted with before. +### 2.2.1 - Storing the keyset ID in a token -### 2.2.1 - Deriving the keyset ID +A wallet can use the keyset ID in a token to recognize a mint it was issued by. For example, a wallet might store the `MINT_URL` together with the `keyset_id` in its database the first time it receives a keyset from that mint. That way, a wallet can know which mint to contact when it receives a token with a `keyset_id` of a mint that it has interacted with before. -The mint and its users can derive a keyset ID from the keyset of the mint. To derive the keyset ID of a mint, execute the following steps: +[TODO: V2 tokens include the `MINT_URL` to enable the first contact when a wallet recieves a token from a mint it has never met before.] + +### 2.2.2 - Deriving the keyset ID + +The mint and the wallets of its users can derive a keyset ID from the keyset of the mint. To derive the keyset ID of a keyset, execute the following steps: ``` 1 - sort keyset by amount @@ -71,6 +77,3 @@ def derive_keyset_id(keys: Dict[int, PublicKey]): ).decode()[:12] ``` -### 2.2.2 - Storing the keyset ID in a token - -A mint **CAN** add the keyset ID to a `BlindedSignature` during the minting process [TODO: link to blinded signature. TODO: link to /mint]. If a wallet receives a `BlindedSignature` with a keyset ID, \ No newline at end of file diff --git a/docs/specs/wip/3 - Request minting.md b/docs/specs/3 - Request minting.md similarity index 98% rename from docs/specs/wip/3 - Request minting.md rename to docs/specs/3 - Request minting.md index f884d5a..f39b4c3 100644 --- a/docs/specs/wip/3 - Request minting.md +++ b/docs/specs/3 - Request minting.md @@ -1,3 +1,5 @@ +# NUT-3 - Request mint + Minting tokens is a two-step process: requesting a mint and minting the tokens. Here, we describe the first step. A wallet requests the minting of tokens in exchange for paying a bolt11 Lightning invoice (typically generated by the mint to add funds to its reserves, and typically paid with another Lightning wallet). To request the minting of tokens, a wallet `Alice` sends a `GET /mint&amount=` request with the requested amount `` in satoshis. The mint `Bob` then responds with a Lightning invoice. diff --git a/docs/specs/wip/4 - Minting tokens.md b/docs/specs/4 - Minting tokens.md similarity index 99% rename from docs/specs/wip/4 - Minting tokens.md rename to docs/specs/4 - Minting tokens.md index 0a7dc15..6f088f3 100644 --- a/docs/specs/wip/4 - Minting tokens.md +++ b/docs/specs/4 - Minting tokens.md @@ -1,3 +1,5 @@ +# NUT-4 - Mint tokens + After requesting a mint (see #3 [TODO: Link]) and paying the invoice that was returned by the mint, a wallet proceeds with requesting tokens from the mint in return for paying the invoice. For that, a wallet sends a `POST /mint&payment_hash=` request with a JSON body to the mint. The body **MUST** include `BlindedMessages` that are worth a maximum of `` [TODO: Refer to BlindedMessages]. If successful (i.e. the invoice has been previously paid and the `BlindedMessages` are valid), the mint responds with `Promises` [TODO: Link Promises]. diff --git a/docs/specs/wip/5 - Melting tokens.md b/docs/specs/5 - Melting tokens.md similarity index 98% rename from docs/specs/wip/5 - Melting tokens.md rename to docs/specs/5 - Melting tokens.md index 5141337..1cfb716 100644 --- a/docs/specs/wip/5 - Melting tokens.md +++ b/docs/specs/5 - Melting tokens.md @@ -1,3 +1,5 @@ +# NUT-5 - Melting tokens + Melting tokens is the opposite of minting them (see #4): the wallet `Alice` sends `Proofs` to the mint `Bob` together with a bolt11 Lightning invoice that `Alice` wants to be paid. To melt tokens, `Alice` sends a `POST /melt` request with a JSON body to the mint. The `Proofs` included in the request will be burned by the mint and the mint will pay the invoice in exchange. `Alice`'s request **MUST** include a `MeltRequest` ([TODO: Link MeltRequest]) JSON body with `Proofs` that have at least the amount of the invoice to be paid. diff --git a/docs/specs/wip/6 - Split.md b/docs/specs/6 - Split.md similarity index 99% rename from docs/specs/wip/6 - Split.md rename to docs/specs/6 - Split.md index e6b735f..6106e98 100644 --- a/docs/specs/wip/6 - Split.md +++ b/docs/specs/6 - Split.md @@ -1,3 +1,5 @@ +# NUT-6 - Split tokens + The split operation is the most important component of the Cashu system. The wallet `Alice` can use it to redeem tokens (i.e. receive new ones in return) that she received from `Carol`, or she can split her own tokens to a target amount she needs to send to `Carol`, if she does not have the necessary amounts to compose the target amount in her wallet already. The basic idea is that `Alice` sends `Bob` a set of `Proof`'s and a set of `BlindedMessage`'s with an equal amount. Additionally, she specifies the `amount` at which she would like to have the split. diff --git a/docs/specs/wip/1 - Request public keys from mint.md b/docs/specs/wip/1 - Request public keys from mint.md deleted file mode 100644 index 936150c..0000000 --- a/docs/specs/wip/1 - Request public keys from mint.md +++ /dev/null @@ -1,32 +0,0 @@ - -`Alice` receives public keys from mint `Bob` via `GET /keys` and stores them in a key-value store like a dictionary. - -`Bob` responds with his **active** keyset [TODO: Link #2]. Note that a mint can support multiple keysets at the same time but will only respond with the active keyset. See [TODO: Link #2] for how a wallet deals with multiple keysets. - -Keysets are received as a JSON of the form `{ : , : ...}` for each `` of the amounts the mint `Bob` supports and the corresponding public key ``, that is `K_i` (see #0). - -## Example - -Request of `Alice`: - -```http -GET https://mint.host:3338/keys -``` - -With curl: - -```bash -curl -X GET https://mint.host:3338/keys -``` - -Response of `Bob`: - -```json -{ - "1": "03a40f20667ed53513075dc51e715ff2046cad64eb68960632269ba7f0210e38bc", - "2": "03fd4ce5a16b65576145949e6f99f445f8249fee17c606b688b504a849cdc452de", - "4": "02648eccfa4c026960966276fa5a4cae46ce0fd432211a4f449bf84f13aa5f8303", - "8": "02fdfd6796bfeac490cbee12f778f867f0a2c68f6508d17c649759ea0dc3547528", - ... -} -``` \ No newline at end of file From 73b9596aab3abdcf49f2ff45c562dc7b7ec970c2 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Jan 2023 13:44:06 +0100 Subject: [PATCH 06/12] update link --- docs/specs/1 - Request public keys from mint.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/1 - Request public keys from mint.md b/docs/specs/1 - Request public keys from mint.md index 21e8554..ae8f70e 100644 --- a/docs/specs/1 - Request public keys from mint.md +++ b/docs/specs/1 - Request public keys from mint.md @@ -6,7 +6,7 @@ This describes the basic exchange of the public mint keys that the wallet user ` Wallet user `Alice` receives public keys from mint `Bob` via `GET /keys` and stores them in a key-value store like a dictionary. The set of all public keys for each supported amount is called a *keyset*. -Mint `Bob` responds with his *active* keyset [TODO: Link #2]. The active keyset is the keyset a mint currently uses to sign promises with. The active keyset can change over time, for example due to key rotation. A mint MAY support older keysets indefinetely. Note that a mint can support multiple keysets at the same time but will only respond with the active keyset on the endpoint `GET /keys`. A wallet can ask for the keys of a specific (non-active) keyset by using the endpint `GET /keys/{keyset_id}` (see #2 [TODO: Link #2]). +Mint `Bob` responds with his *active* keyset [2 - Keysets and keyset IDs]. The active keyset is the keyset a mint currently uses to sign promises with. The active keyset can change over time, for example due to key rotation. A mint MAY support older keysets indefinetely. Note that a mint can support multiple keysets at the same time but will only respond with the active keyset on the endpoint `GET /keys`. A wallet can ask for the keys of a specific (non-active) keyset by using the endpint `GET /keys/{keyset_id}` (see #2 [TODO: Link #2]). See [TODO: Link #2] for how a wallet deals with multiple keysets. From 299d3bf8088fb39d0a3931a5301d16034b863e20 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Jan 2023 13:47:53 +0100 Subject: [PATCH 07/12] rename files --- docs/specs/{0 - Notation.md => 00.md} | 0 ...Request public keys from mint.md => 01.md} | 23 ++++++++++++++++++- .../{2 - Keysets and keyset IDs.md => 02.md} | 0 docs/specs/{3 - Request minting.md => 03.md} | 0 docs/specs/{4 - Minting tokens.md => 04.md} | 0 docs/specs/{5 - Melting tokens.md => 05.md} | 0 docs/specs/{6 - Split.md => 06.md} | 0 7 files changed, 22 insertions(+), 1 deletion(-) rename docs/specs/{0 - Notation.md => 00.md} (100%) rename docs/specs/{1 - Request public keys from mint.md => 01.md} (87%) rename docs/specs/{2 - Keysets and keyset IDs.md => 02.md} (100%) rename docs/specs/{3 - Request minting.md => 03.md} (100%) rename docs/specs/{4 - Minting tokens.md => 04.md} (100%) rename docs/specs/{5 - Melting tokens.md => 05.md} (100%) rename docs/specs/{6 - Split.md => 06.md} (100%) diff --git a/docs/specs/0 - Notation.md b/docs/specs/00.md similarity index 100% rename from docs/specs/0 - Notation.md rename to docs/specs/00.md diff --git a/docs/specs/1 - Request public keys from mint.md b/docs/specs/01.md similarity index 87% rename from docs/specs/1 - Request public keys from mint.md rename to docs/specs/01.md index ae8f70e..64f82b6 100644 --- a/docs/specs/1 - Request public keys from mint.md +++ b/docs/specs/01.md @@ -36,4 +36,25 @@ Response of `Bob`: "8": "02fdfd6796bfeac490cbee12f778f867f0a2c68f6508d17c649759ea0dc3547528", ... } -``` \ No newline at end of file +``` + +[00]: 00.md +[01]: 02.md +[03]: 03.md +[04]: 04.md +[05]: 05.md +[06]: 06.md +[07]: 07.md +[08]: 08.md +[09]: 09.md +[10]: 10.md +[11]: 11.md +[12]: 12.md +[13]: 13.md +[14]: 14.md +[15]: 15.md +[16]: 16.md +[17]: 17.md +[18]: 18.md +[19]: 19.md +[20]: 20.md \ No newline at end of file diff --git a/docs/specs/2 - Keysets and keyset IDs.md b/docs/specs/02.md similarity index 100% rename from docs/specs/2 - Keysets and keyset IDs.md rename to docs/specs/02.md diff --git a/docs/specs/3 - Request minting.md b/docs/specs/03.md similarity index 100% rename from docs/specs/3 - Request minting.md rename to docs/specs/03.md diff --git a/docs/specs/4 - Minting tokens.md b/docs/specs/04.md similarity index 100% rename from docs/specs/4 - Minting tokens.md rename to docs/specs/04.md diff --git a/docs/specs/5 - Melting tokens.md b/docs/specs/05.md similarity index 100% rename from docs/specs/5 - Melting tokens.md rename to docs/specs/05.md diff --git a/docs/specs/6 - Split.md b/docs/specs/06.md similarity index 100% rename from docs/specs/6 - Split.md rename to docs/specs/06.md From cdb09e79b3acfaca308b4096b64db059cabed62c Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Jan 2023 13:50:52 +0100 Subject: [PATCH 08/12] fix link --- docs/specs/01.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/specs/01.md b/docs/specs/01.md index 64f82b6..ea58e95 100644 --- a/docs/specs/01.md +++ b/docs/specs/01.md @@ -6,7 +6,7 @@ This describes the basic exchange of the public mint keys that the wallet user ` Wallet user `Alice` receives public keys from mint `Bob` via `GET /keys` and stores them in a key-value store like a dictionary. The set of all public keys for each supported amount is called a *keyset*. -Mint `Bob` responds with his *active* keyset [2 - Keysets and keyset IDs]. The active keyset is the keyset a mint currently uses to sign promises with. The active keyset can change over time, for example due to key rotation. A mint MAY support older keysets indefinetely. Note that a mint can support multiple keysets at the same time but will only respond with the active keyset on the endpoint `GET /keys`. A wallet can ask for the keys of a specific (non-active) keyset by using the endpint `GET /keys/{keyset_id}` (see #2 [TODO: Link #2]). +Mint `Bob` responds with his *active* keyset [02]. The active keyset is the keyset a mint currently uses to sign promises with. The active keyset can change over time, for example due to key rotation. A mint MAY support older keysets indefinetely. Note that a mint can support multiple keysets at the same time but will only respond with the active keyset on the endpoint `GET /keys`. A wallet can ask for the keys of a specific (non-active) keyset by using the endpint `GET /keys/{keyset_id}` (see #2 [TODO: Link #2]). See [TODO: Link #2] for how a wallet deals with multiple keysets. From 356975f28088a1936a9fca5dd7254c9e7a1103be Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Jan 2023 13:56:44 +0100 Subject: [PATCH 09/12] add table --- docs/specs/01.md | 2 +- docs/specs/README.md | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 docs/specs/README.md diff --git a/docs/specs/01.md b/docs/specs/01.md index ea58e95..d495da7 100644 --- a/docs/specs/01.md +++ b/docs/specs/01.md @@ -6,7 +6,7 @@ This describes the basic exchange of the public mint keys that the wallet user ` Wallet user `Alice` receives public keys from mint `Bob` via `GET /keys` and stores them in a key-value store like a dictionary. The set of all public keys for each supported amount is called a *keyset*. -Mint `Bob` responds with his *active* keyset [02]. The active keyset is the keyset a mint currently uses to sign promises with. The active keyset can change over time, for example due to key rotation. A mint MAY support older keysets indefinetely. Note that a mint can support multiple keysets at the same time but will only respond with the active keyset on the endpoint `GET /keys`. A wallet can ask for the keys of a specific (non-active) keyset by using the endpint `GET /keys/{keyset_id}` (see #2 [TODO: Link #2]). +Mint `Bob` responds with his *active* [keyset][02]. The active keyset is the keyset a mint currently uses to sign promises with. The active keyset can change over time, for example due to key rotation. A mint MAY support older keysets indefinetely. Note that a mint can support multiple keysets at the same time but will only respond with the active keyset on the endpoint `GET /keys`. A wallet can ask for the keys of a specific (non-active) keyset by using the endpint `GET /keys/{keyset_id}` (see #2 [TODO: Link #2]). See [TODO: Link #2] for how a wallet deals with multiple keysets. diff --git a/docs/specs/README.md b/docs/specs/README.md new file mode 100644 index 0000000..0c11c30 --- /dev/null +++ b/docs/specs/README.md @@ -0,0 +1,27 @@ +Cashu NUTs (Notation, Usage, and Terminology) + + +| Number | Description | Wallets (in alphabetical order) | +|----------|-------------------------------------------------------------|---------| +| [00][00] | Notation | , Feni, LNbits + +[00]: 00.md +[01]: 02.md +[03]: 03.md +[04]: 04.md +[05]: 05.md +[06]: 06.md +[07]: 07.md +[08]: 08.md +[09]: 09.md +[10]: 10.md +[11]: 11.md +[12]: 12.md +[13]: 13.md +[14]: 14.md +[15]: 15.md +[16]: 16.md +[17]: 17.md +[18]: 18.md +[19]: 19.md +[20]: 20.md \ No newline at end of file From a478ddb5c8b23e009860de0f8459045a4a1def60 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Jan 2023 13:59:37 +0100 Subject: [PATCH 10/12] list --- docs/specs/README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/specs/README.md b/docs/specs/README.md index 0c11c30..07400e9 100644 --- a/docs/specs/README.md +++ b/docs/specs/README.md @@ -1,9 +1,17 @@ Cashu NUTs (Notation, Usage, and Terminology) -| Number | Description | Wallets (in alphabetical order) | +| Number | Description | Wallets | |----------|-------------------------------------------------------------|---------| -| [00][00] | Notation | , Feni, LNbits +| [00][00] | Notation | Python-CLI, Feni, LNbits +| [01][01] | Mint keys | Python-CLI, Feni, LNbits +| [02][02] | Keysets and keyset IDs | Python-CLI, Feni, LNbits +| [03][03] | Requesting a mint | Python-CLI, Feni, LNbits +| [04][04] | Mint tokens | Python-CLI, Feni, LNbits +| [05][05] | Melt tokens | Python-CLI, Feni, LNbits +| [06][06] | Split tokens | Python-CLI, Feni, LNbits + + [00]: 00.md [01]: 02.md From f715c322ba9a3a1492a17c742f5168d609ba9c61 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Jan 2023 14:00:51 +0100 Subject: [PATCH 11/12] clean --- docs/specs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/specs/README.md b/docs/specs/README.md index 07400e9..93f1df6 100644 --- a/docs/specs/README.md +++ b/docs/specs/README.md @@ -3,8 +3,8 @@ Cashu NUTs (Notation, Usage, and Terminology) | Number | Description | Wallets | |----------|-------------------------------------------------------------|---------| -| [00][00] | Notation | Python-CLI, Feni, LNbits -| [01][01] | Mint keys | Python-CLI, Feni, LNbits +| [00][00] | Notation and Models | Python-CLI, Feni, LNbits +| [01][01] | Mint public keys | Python-CLI, Feni, LNbits | [02][02] | Keysets and keyset IDs | Python-CLI, Feni, LNbits | [03][03] | Requesting a mint | Python-CLI, Feni, LNbits | [04][04] | Mint tokens | Python-CLI, Feni, LNbits From f8a75a51cd673f789b1ab59563cb4fe160562586 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Jan 2023 14:05:22 +0100 Subject: [PATCH 12/12] clean readme --- docs/specs/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/specs/README.md b/docs/specs/README.md index 93f1df6..e7b364a 100644 --- a/docs/specs/README.md +++ b/docs/specs/README.md @@ -1,4 +1,4 @@ -Cashu NUTs (Notation, Usage, and Terminology) +# Cashu NUTs (Notation, Usage, and Terminology) | Number | Description | Wallets | @@ -14,7 +14,8 @@ Cashu NUTs (Notation, Usage, and Terminology) [00]: 00.md -[01]: 02.md +[01]: 01.md +[02]: 02.md [03]: 03.md [04]: 04.md [05]: 05.md