Protocol and consensus12.5.13+
Payment reference (PAY)
The reference a pay button writes with a payment.
A payment from a pay button can carry a reference, so that the page recognises it. Nothing about it is a consensus rule.
Byte layout #
One OP_RETURN output. Each element is a push.
| Push | Bytes | Field |
|---|---|---|
| 1 | 04 50 41 59 00 | LOKAD PAY and a zero byte |
| 2 | 00 | version 0, the empty push |
| 3 | a push, or 00 | a short text, public |
| 4 | 08 and 8 bytes, or 00 | payment id, random for each request |
With a payment id and no text the script is 17 bytes, inside the free data bytes of a transaction:
6a 04 50415900 00 00 08 <8 bytes>With a payment id, a reader adds up the outputs to the exact script and asks for at least the amount. Without one, the request adds 1 to 999 satoshis and the amount must match. A reference alone proves no payment.
/lib/lotus-pay.js of a node writes and reads it (payData, parsePay). The web wallet, the extension, Lotus Desktop and the phone app show it before you sign.
Source files #
share/www/lib/lotus-pay.js
