Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion 18.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ A Payment Request is defined as follows
"u": str <optional>,
"s": bool <optional>,
"m": Array[str] <optional>,
"pm": Array[str] <optional>,
"d": str <optional>,
"t": Array[Transport] <optional>,
"nut10": NUT10Option <optional>,
Expand All @@ -36,7 +37,8 @@ Here, the fields are
- `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
- `m`: A set of mints from which the payment is requested. If this field is defined, the sender SHOULD only send proofs from these mints. The fields `m` and `pm` are mutually exclusive; a payment request MUST NOT contain both fields.
- `pm`: A set of preferred mints the receiver supports. If this field is defined, the receiver will accept proofs from any mint but prefers these mints for faster and cheaper transactions. The fields `m` and `pm` are mutually exclusive; a payment request MUST NOT contain both fields.
- `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)
- `nut10`: The required [NUT-10][10] locking condition
Expand Down
21 changes: 11 additions & 10 deletions 26.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@ The payment request is encoded as a sequence of TLV fields. Each TLV entry consi

### Top-Level TLV Tags

| Tag | Field | Type | Description |
| ---- | ----------- | --------- | -------------------------------------------------------------------- |
| 0x01 | id | string | Payment identifier (corresponds to `i` in JSON) |
| 0x02 | amount | u64 | Amount in base units (corresponds to `a` in JSON) |
| 0x03 | unit | u8/string | Currency unit (corresponds to `u` in JSON) |
| 0x04 | single_use | u8 | Single-use flag: 0=false, 1=true (corresponds to `s` in JSON) |
| 0x05 | mint | string | Mint URL (repeatable for multiple mints, corresponds to `m` in JSON) |
| 0x06 | description | string | Human-readable description (corresponds to `d` in JSON) |
| 0x07 | transport | sub-TLV | Transport configuration (repeatable, corresponds to `t` in JSON) |
| 0x08 | nut10 | sub-TLV | NUT-10 spending conditions (corresponds to `nut10` in JSON) |
| Tag | Field | Type | Description |
| ---- | --------------- | --------- | ------------------------------------------------------------------------------- |
| 0x01 | id | string | Payment identifier (corresponds to `i` in JSON) |
| 0x02 | amount | u64 | Amount in base units (corresponds to `a` in JSON) |
| 0x03 | unit | u8/string | Currency unit (corresponds to `u` in JSON) |
| 0x04 | single_use | u8 | Single-use flag: 0=false, 1=true (corresponds to `s` in JSON) |
| 0x05 | mint | string | Mint URL (repeatable for multiple mints, corresponds to `m` in JSON) |
| 0x06 | description | string | Human-readable description (corresponds to `d` in JSON) |
| 0x07 | transport | sub-TLV | Transport configuration (repeatable, corresponds to `t` in JSON) |
| 0x08 | nut10 | sub-TLV | NUT-10 spending conditions (corresponds to `nut10` in JSON) |
| 0x09 | preferred_mints | string | Preferred mint URL (repeatable for multiple mints, corresponds to `pm` in JSON) |

All fields are optional. Unknown tags MUST be ignored to maintain forward compatibility.

Expand Down
19 changes: 19 additions & 0 deletions tests/18-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,22 @@ Encoded:
```
creqApWFpaGM5ZTQ1ZDJhYWEZAfRhdWNzYXRhbYF4GGh0dHBzOi8vbWludC5leGFtcGxlLmNvbWVudXQxMKNha2RQMlBLYWR4QjAyYzNiNWJiMjdlMzYxNDU3YzkyZDkzZDc4ZGQ3M2QzZDUzNzMyMTEwYjJjZmU4YjUwZmJjMGFiYzYxNWU5YzMzMWF0gYJndGltZW91dGQzNjAw
```

### Preferred Mints Field

A payment request specifying preferred mints using the `pm` field.

```json
{
"i": "pm_test",
"a": 100,
"u": "sat",
"pm": ["https://mint.example.com"]
}
```

Encoded:

```
creqApGFpZ3BtX3Rlc3RhYRhkYXVjc2F0YnBtgXgYaHR0cHM6Ly9taW50LmV4YW1wbGUuY29t
```
21 changes: 21 additions & 0 deletions tests/26-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,3 +413,24 @@ Encoded:
```
CREQB1QYQQKCM4WD6X7M2LW4HXJAQZQQYQQQQQQQQQQQRYQVQQXCN5VVZSQXRGW368QUE69UHK66TWWSHX27RPD4CXCEFWVDHK6PZHCW8
```

---

### Preferred Mints Field

A payment request specifying preferred mints using the `pm` field (tag 0x09).

```json
{
"i": "pm_test",
"a": 100,
"u": "sat",
"pm": ["https://mint.example.com"]
}
```

Encoded:

```
CREQB1QYQQWURDTA6X2UM5QGQQSQQQQQQQQQQQVSPSQQGQPYQPS6R5W3C8XW309AKKJMN59EJHSCTDWPKX2TNRDAKSYWN0VM
```
Loading