From c45340aefa8a802608e22c5786d79ab87e7d58bb Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Fri, 12 Dec 2025 15:08:17 +0100 Subject: [PATCH] bLIP-51: Specify invalid token error code Previously the spec said that the LSP should return 'an error' in case of an invalid or unrecogized token. To keep the approach similar to what we do in bLIP-52 (where we specify a particular error code for this case), we now here specify an error code to be used in this case. --- blip-0051.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/blip-0051.md b/blip-0051.md index c0dd5c0..ccb6a8c 100644 --- a/blip-0051.md +++ b/blip-0051.md @@ -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. | - 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. @@ -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.