From 25885cd218e122ff9f8b57fc3b729d8e3c13c891 Mon Sep 17 00:00:00 2001 From: Leonardo Escuer <47948594+lescuer97@users.noreply.github.com> Date: Tue, 15 Oct 2024 20:25:31 +0200 Subject: [PATCH 1/6] README: nutmix update (#177) --------- Co-authored-by: Pavol Rusnak --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index dcf9898..e0ca519 100644 --- a/README.md +++ b/README.md @@ -20,19 +20,19 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio ### Optional -| # | Description | Wallets | Mints | -| -------- | --------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------- | -| [07][07] | Token state check | [Nutshell][py], [Moksha][moksha], [Nutstash][ns], [cashu-ts][ts], [cdk-cli] | [Nutshell][py], [Moksha][moksha], [cdk-mintd] | -| [08][08] | Overpaid Lightning fees | [Nutshell][py], [Moksha][moksha], [Nutstash][ns], [cashu-ts][ts], [cdk-cli] | [Nutshell][py], [Moksha][moksha], [cdk-mintd] | -| [09][09] | Signature restore | [Nutshell][py], [cdk-cli], [cashu-ts][ts], [gonuts] | [Nutshell][py], [cdk-mintd] | -| [10][10] | Spending conditions | [Nutshell][py], [cdk-cli], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd], [nutmix] | -| [11][11] | Pay-To-Pubkey (P2PK) | [Nutshell][py], [cdk-cli], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd], [nutmix] | -| [12][12] | DLEQ proofs | [Nutshell][py], [cdk-cli] | [Nutshell][py], [cdk-mintd] | -| [13][13] | Deterministic secrets | [Nutshell][py], [Moksha][moksha], [cashu-ts][ts], [cdk-cli], [gonuts] | - | -| [14][14] | Hashed Timelock Contracts (HTLCs) | [Nutshell][py], [cdk-cli] | [Nutshell][py], [cdk-mintd] | -| [15][15] | Partial multi-path payments (MPP) | [Nutshell][py] | [Nutshell][py] | -| [16][16] | Animated QR codes | [Cashu.me][cashume] | - | -| [17][17] | WebSocket subscriptions | [Nutshell][py] | [Nutshell][py] | +| # | Description | Wallets | Mints | +| -------- | --------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------- | +| [07][07] | Token state check | [Nutshell][py], [Moksha][moksha], [Nutstash][ns], [cashu-ts][ts], [cdk-cli] | [Nutshell][py], [Moksha][moksha], [cdk-mintd], [nutmix] | +| [08][08] | Overpaid Lightning fees | [Nutshell][py], [Moksha][moksha], [Nutstash][ns], [cashu-ts][ts], [cdk-cli] | [Nutshell][py], [Moksha][moksha], [cdk-mintd], [nutmix] | +| [09][09] | Signature restore | [Nutshell][py], [cdk-cli], [cashu-ts][ts], [gonuts] | [Nutshell][py], [cdk-mintd], [nutmix] | +| [10][10] | Spending conditions | [Nutshell][py], [cdk-cli], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd], [nutmix] | +| [11][11] | Pay-To-Pubkey (P2PK) | [Nutshell][py], [cdk-cli], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd], [nutmix] | +| [12][12] | DLEQ proofs | [Nutshell][py], [cdk-cli] | [Nutshell][py], [cdk-mintd], [nutmix] | +| [13][13] | Deterministic secrets | [Nutshell][py], [Moksha][moksha], [cashu-ts][ts], [cdk-cli], [gonuts] | - | +| [14][14] | Hashed Timelock Contracts (HTLCs) | [Nutshell][py], [cdk-cli] | [Nutshell][py], [cdk-mintd], [nutmix] | +| [15][15] | Partial multi-path payments (MPP) | [Nutshell][py] | [Nutshell][py], [nutmix] | +| [16][16] | Animated QR codes | [Cashu.me][cashume] | - | +| [17][17] | WebSocket subscriptions | [Nutshell][py] | [Nutshell][py] | #### Wallets: From 28e6f9f89a20b2b4f53d870f63870a38e741742b Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:29:08 +0200 Subject: [PATCH 2/6] remove TokenV4 JSON, instead use mint unit proofs --- xx.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/xx.md b/xx.md index 6274ed2..e3ee60e 100644 --- a/xx.md +++ b/xx.md @@ -22,7 +22,8 @@ A Payment Request is defined as follows "i": str , "a": int , "u": str , - "r": Array[str] , + "r": bool , + "m": Array[str] , "d": str , "t": Transport } @@ -30,12 +31,13 @@ A Payment Request is defined as follows while Transport is defined as -- i: Payment id to be included in the payment payload -- a: The amount of the requested payment -- u: The unit of the requested payment (MUST be set if `a` is set) -- r: A set of mints from which the payment is requested -- d: A human readable description that the sending wallet will display after scanning the request -- t: The method of transport chosen to transmit the payment (can be multiple, sorted by preference) +- `i`: Payment id to be included in the payment payload +- `a`: The amount of the requested payment +- `u`: The unit of the requested payment (MUST be set if `a` is set) +- `s`: Whether the payment request is for single use +- `m`: A set of mints from which the payment is requested +- `d`: A human readable description that the sending wallet will display after scanning the request +- `t`: The method of transport chosen to transmit the payment (can be multiple, sorted by preference) ## Transport @@ -63,17 +65,21 @@ There are different transport layers: - type: `post` - target: `` +## Payment payload + Regardless of the transport layer, the payload sent to the receiver is a JSON serialized object as follows: ```json { "id": str , "memo": str , - "token": TokenV4_JSON + "mint": str, + "unit": , + "proofs": Array } ``` -Here, `id` is the payment id (corresponding to `i` in request), `memo` is an optional memo to be sent to the receiver with the payment, and `token` is a TokenV4 JSON object as specified in [NUT-00][00]. +Here, `id` is the payment id (corresponding to `i` in request), `memo` is an optional memo to be sent to the receiver with the payment, `mint` is the mint URL from which the ecash is from, `unit` is the unit of the payment, and `proofs` is an array of proofs (see [NUT-00][00], can also include DLEQ proofs). ## Encoded Request From 459d66f6b076cd32e729580c2e2721b4883a13a2 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 16 Oct 2024 20:10:04 +0200 Subject: [PATCH 3/6] add to readme --- xx.md => 18.md | 29 ++++++++++++++++++++--------- README.md | 30 ++++++++++++++++-------------- 2 files changed, 36 insertions(+), 23 deletions(-) rename xx.md => 18.md (73%) diff --git a/xx.md b/18.md similarity index 73% rename from xx.md rename to 18.md index e3ee60e..ab476d1 100644 --- a/xx.md +++ b/18.md @@ -55,19 +55,30 @@ Transport specifies methods for sending the ecash to the receiver. A transport c - a: target of Transport - g: optional tags for the Transport -There are different transport layers: +### Transport types -- nostr - - type: `nostr` - - target: `` - - tags: `[["1", "NIP-04"], ["2", "NIP-17"], ["3", "NIP-61"]]` -- post - - type: `post` - - target: `` +The supported transport types are: + +#### Nostr + +- type: `nostr` +- target: `` +- tags: `[["NIP-04", "true"], ["NIP-17", "true"]]` + +The payment request MUST specify which type of Nostr message they support in the `tags`. For [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) and [NIP-17](https://github.com/nostr-protocol/nips/blob/master/17.md) direct messages, the sender sends a `PaymentRequestPayload` as the message content. + +Note that the use of NIP-04 direct messages is strongly discouraged, since it reveals metadata about sender and receiver public keys. + +#### HTTP POST + +- type: `post` +- target: `` + +The execute the payment, the sender makes a `POST` request to the specified endpoint URL with the `PaymentRequestPayload` as the body. ## Payment payload -Regardless of the transport layer, the payload sent to the receiver is a JSON serialized object as follows: +If not specified otherwise, the payload sent to the receiver is a `PaymentRequestPayload` JSON serialized object as follows: ```json { diff --git a/README.md b/README.md index e0ca519..8bbb4fe 100644 --- a/README.md +++ b/README.md @@ -20,19 +20,20 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio ### Optional -| # | Description | Wallets | Mints | -| -------- | --------------------------------- | --------------------------------------------------------------------------- | ------------------------------------------------------- | -| [07][07] | Token state check | [Nutshell][py], [Moksha][moksha], [Nutstash][ns], [cashu-ts][ts], [cdk-cli] | [Nutshell][py], [Moksha][moksha], [cdk-mintd], [nutmix] | -| [08][08] | Overpaid Lightning fees | [Nutshell][py], [Moksha][moksha], [Nutstash][ns], [cashu-ts][ts], [cdk-cli] | [Nutshell][py], [Moksha][moksha], [cdk-mintd], [nutmix] | -| [09][09] | Signature restore | [Nutshell][py], [cdk-cli], [cashu-ts][ts], [gonuts] | [Nutshell][py], [cdk-mintd], [nutmix] | -| [10][10] | Spending conditions | [Nutshell][py], [cdk-cli], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd], [nutmix] | -| [11][11] | Pay-To-Pubkey (P2PK) | [Nutshell][py], [cdk-cli], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd], [nutmix] | -| [12][12] | DLEQ proofs | [Nutshell][py], [cdk-cli] | [Nutshell][py], [cdk-mintd], [nutmix] | -| [13][13] | Deterministic secrets | [Nutshell][py], [Moksha][moksha], [cashu-ts][ts], [cdk-cli], [gonuts] | - | -| [14][14] | Hashed Timelock Contracts (HTLCs) | [Nutshell][py], [cdk-cli] | [Nutshell][py], [cdk-mintd], [nutmix] | -| [15][15] | Partial multi-path payments (MPP) | [Nutshell][py] | [Nutshell][py], [nutmix] | -| [16][16] | Animated QR codes | [Cashu.me][cashume] | - | -| [17][17] | WebSocket subscriptions | [Nutshell][py] | [Nutshell][py] | +| # | Description | Wallets | Mints | +| -------- | --------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------- | +| [07][07] | Token state check | [Nutshell][py], [Moksha][moksha], [Nutstash][ns], [cashu-ts][ts], [cdk-cli] | [Nutshell][py], [Moksha][moksha], [cdk-mintd] | +| [08][08] | Overpaid Lightning fees | [Nutshell][py], [Moksha][moksha], [Nutstash][ns], [cashu-ts][ts], [cdk-cli] | [Nutshell][py], [Moksha][moksha], [cdk-mintd] | +| [09][09] | Signature restore | [Nutshell][py], [cdk-cli], [cashu-ts][ts], [gonuts] | [Nutshell][py], [cdk-mintd] | +| [10][10] | Spending conditions | [Nutshell][py], [cdk-cli], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd], [nutmix] | +| [11][11] | Pay-To-Pubkey (P2PK) | [Nutshell][py], [cdk-cli], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd], [nutmix] | +| [12][12] | DLEQ proofs | [Nutshell][py], [cdk-cli] | [Nutshell][py], [cdk-mintd] | +| [13][13] | Deterministic secrets | [Nutshell][py], [Moksha][moksha], [cashu-ts][ts], [cdk-cli], [gonuts] | - | +| [14][14] | Hashed Timelock Contracts (HTLCs) | [Nutshell][py], [cdk-cli] | [Nutshell][py], [cdk-mintd] | +| [15][15] | Partial multi-path payments (MPP) | [Nutshell][py] | [Nutshell][py] | +| [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] | - #### Wallets: @@ -45,7 +46,7 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio - [Nutstash][ns] - [Cashu.me][cashume] - [Gonuts][gonuts] -- [Boardwalk Cash][bwc] +- [Boardwalk][bwc] #### Mints: @@ -87,3 +88,4 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio [15]: 15.md [16]: 16.md [17]: 17.md +[18]: 18.md From 4989f52c27cc20ca91b3b8830a85ecac65940106 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Thu, 17 Oct 2024 00:27:11 +0200 Subject: [PATCH 4/6] fix transport and change tag --- 18.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/18.md b/18.md index ab476d1..5cb7eff 100644 --- a/18.md +++ b/18.md @@ -25,7 +25,7 @@ A Payment Request is defined as follows "r": bool , "m": Array[str] , "d": str , - "t": Transport + "t": Array[Transport] } ``` @@ -63,9 +63,9 @@ The supported transport types are: - type: `nostr` - target: `` -- tags: `[["NIP-04", "true"], ["NIP-17", "true"]]` +- tags: `[["m", "NIP-04"],["m", "NIP-17"]]` -The payment request MUST specify which type of Nostr message they support in the `tags`. For [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) and [NIP-17](https://github.com/nostr-protocol/nips/blob/master/17.md) direct messages, the sender sends a `PaymentRequestPayload` as the message content. +The `m` tag MUST specify at least one type of Nostr direct message type the receiver supports. For [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) and [NIP-17](https://github.com/nostr-protocol/nips/blob/master/17.md) direct messages, the sender sends a `PaymentRequestPayload` as the message content. Note that the use of NIP-04 direct messages is strongly discouraged, since it reveals metadata about sender and receiver public keys. From ec3bfa32275525b8fc61c3c40b2d91913155115e Mon Sep 17 00:00:00 2001 From: gudnuf Date: Thu, 17 Oct 2024 11:46:28 -0700 Subject: [PATCH 5/6] change tags to support multiple values --- 18.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/18.md b/18.md index 5cb7eff..a6d7491 100644 --- a/18.md +++ b/18.md @@ -53,19 +53,23 @@ Transport specifies methods for sending the ecash to the receiver. A transport c - t: type of Transport - a: target of Transport -- g: optional tags for the Transport +- g: optional tags for the Transport ### Transport types The supported transport types are: +### Tags + +Tags are an optional array of `[tag, value, value, ...]` tuples that can be used to specify additional features about the transport. A single tag can have multiple values. + #### Nostr - type: `nostr` - target: `` -- tags: `[["m", "NIP-04"],["m", "NIP-17"]]` +- tags: `[["n","04", "17"]]` -The `m` tag MUST specify at least one type of Nostr direct message type the receiver supports. For [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) and [NIP-17](https://github.com/nostr-protocol/nips/blob/master/17.md) direct messages, the sender sends a `PaymentRequestPayload` as the message content. +The `n` tag specifies the NIPs the receiver supports. At lease one type of Nostr direct message MUST be specified. For [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) and [NIP-17](https://github.com/nostr-protocol/nips/blob/master/17.md) direct messages, the sender sends a `PaymentRequestPayload` as the message content. Note that the use of NIP-04 direct messages is strongly discouraged, since it reveals metadata about sender and receiver public keys. @@ -104,4 +108,4 @@ _Example_ creqAaVhQRVhVWNzYXRhTXgiaHR0cHM6Ly9taW50Lm1pbmliaXRzLmNhc2gvQml0Y29pbmFEeCNQbGVzYXNlIHBheSB0aGUgdmVyeSBmaXJzdCBjYXNodSBwcmFUgaJhVGVub3N0cmJUYXhGbnByb2ZpbGUxcXFzZG11cDZlMno2bWNwZXVlNno2a2wwOGhlNDloY2VuNXhucmMzdG5wdncwbWRndGplbWgwc3V4YTBrag ``` -[00]: 00.md \ No newline at end of file +[00]: 00.md From 0663344be253f38e0fd7491073b40bb839b51514 Mon Sep 17 00:00:00 2001 From: gudnuf Date: Thu, 17 Oct 2024 12:45:00 -0700 Subject: [PATCH 6/6] remove NIP-04 --- 18.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/18.md b/18.md index a6d7491..d16cdec 100644 --- a/18.md +++ b/18.md @@ -67,11 +67,11 @@ Tags are an optional array of `[tag, value, value, ...]` tuples that can be used - type: `nostr` - target: `` -- tags: `[["n","04", "17"]]` +- tags: `[["n", "17"]]` -The `n` tag specifies the NIPs the receiver supports. At lease one type of Nostr direct message MUST be specified. For [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) and [NIP-17](https://github.com/nostr-protocol/nips/blob/master/17.md) direct messages, the sender sends a `PaymentRequestPayload` as the message content. +The `n` tag specifies the NIPs the receiver supports. At least one tag value MUST be specified. For [NIP-17](https://github.com/nostr-protocol/nips/blob/master/17.md) direct messages, the sender sends a `PaymentRequestPayload` as the message content. -Note that the use of NIP-04 direct messages is strongly discouraged, since it reveals metadata about sender and receiver public keys. +[NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) SHOULDNT be used because it is deprecated and reveals metadata about sender and receiver public keys. #### HTTP POST