> ## Documentation Index
> Fetch the complete documentation index at: https://lnurl.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# LUD-12: Comments in `payRequest`.

> Display inline code and code blocks

`author: andreneves` `discussion: https://github.com/fiatjaf/lnurl-rfc/pull/50`

***

## Support for LNURL-pay comment

This allows for a `WALLET` to pass a custom comment property to a `SERVICE` that accepts it. This can have multiple use-cases. Better donation flow is an easy one to visualize. The entity donating gets to send a message, whether their name/contact/random text and the issuer gets paid to read/voice/receive that message, for example, streamers.

This is completely additional/ad-hoc, so current implementations are not affected by this. Any services and wallets that wish to support it do need to add some more business logic.

### Service-side

`SERVICE` must alter its JSON response to the first callback to include a `commentAllowed` field, as follows:

```diff theme={null}
 {
   "callback": string,
   "maxSendable": number,
   "minSendable": number,
   "metadata": string,
+  "commentAllowed": number,
   "tag": "payRequest"
 }
```

The value of `commentAllowed` should be the number of characters accepted for the `comment` query parameter on subsequent callback. (Should be interpreted as 0 if not provided).

### Wallet-side

Upon seeing a positive `commentAllowed` attribute on the response from the `SERVICE`, a `WALLET` must display a text input where user can enter a `comment` string (max character count is equal or less than `commentAllowed` value) along with the other LNURL-pay metadata (text and image).

After gathering input from the user, `WALLET` must include the comment in its second callback to `SERVICE`:

```diff theme={null}
- <callback><?|&>amount=<milliSatoshi>
+ <callback><?|&>amount=<milliSatoshi>&comment=<String>
```

### Note on comment length

[GET URL's accept around \~2000 characters for the entire request string](https://stackoverflow.com/a/417184). Therefore `comment` can only be as large as to fit in the URL alongside any/all of the properties outlined above.
