Payment reference (PAY)
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.

PushBytesField
104 50 41 59 00LOKAD PAY and a zero byte
200version 0, the empty push
3a push, or 00a short text, public
408 and 8 bytes, or 00payment 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:

Text
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
Source doc/protocols/pay.md in the lotusd repository