Skip to content
Open
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
13 changes: 7 additions & 6 deletions blip-0051.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,12 @@ The client MUST check if [option_support_large_channel](https://bitcoinops.org/e

**Errors**

| Code | Message | Data | Description |
| ---- | ------- | ----------- | ---- |
| -32602 | Invalid params | {"property": %invalid_property%, "message": %human_message% } | Invalid method parameter(s). |
| 001 | Client rejected | {"message": %human_message% } | [LSPS0.client_rejected_error][] |
| 100 | Option mismatch | {"property": %option_mismatch_property%, "message": %human_message% } | The order doesnt match the options defined in `lsps1.get_info.options`. |
| Code | Message | Data | Description |
| ------ | --------------------------- | ------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| -32602 | Invalid params | {"property": %invalid_property%, "message": %human_message% } | Invalid method parameter(s). |
| 001 | Client rejected | {"message": %human_message% } | [LSPS0.client_rejected_error][] |
| 100 | Option mismatch | {"property": %option_mismatch_property%, "message": %human_message% } | The order doesnt match the options defined in `lsps1.get_info.options`. |
| 102 | Unrecognized or stale token | {} | The provided token was unrecognized or stale. |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why not 101?



- LSP MUST validate the order against the options defined in `lsps1.get_info.options`. LSP MUST return an `100` error in case of a mismatch.
Expand All @@ -256,7 +257,7 @@ The client MUST check if [option_support_large_channel](https://bitcoinops.org/e
- `%invalid_property%` MUST be one of the fields in the request body. MUST use `.` to separate nested fields.
- Example: `{ "property": "announce_channel", "message": "Not a boolean" }`.

- LSP MUST validate the `token` field and return an error if the token is invalid.
- LSP MUST validate the `token` field and return a `102` error if the token is invalid.

> **Rationale `token` validation** The client should be informed if the token is invalid. Ignoring the invalid token and creating an order without the potentially discount or other side effect is not good UX. Ignoring the invalid token will also NOT prevent anybody bruteforcing the token because the client will still detect if the LSP has given a discount.

Expand Down