[Lightning] 0-amount HODL invoices have null preimage. Is that normal?

What follows was observed using the Lighting Labs LND , but i think it happens with the LTC fork of it as well.

I am creating 0-amount HODL invoices via REST API https://localhost:8080/v2/invoices/hodl, like this one:

{

"value":0,

"expiry":31536000,

"r_preimage":"cFJMaBpeey0wu+tnbWD\/Wy0fbnQ4XXJvOnpfNDtDSDs=",

"hash":"FtMaCDxhyM4d7X4CbfilDQi+gcOH+usZ3Bpbn4fIqx4=",

"description_hash":"HOv7xHJJStMY\/cDIcX04UjTOju81t5BV3rD9+v2Hqe0="

}

This is the output payment request:

lntb1p0456rypp5zmf35zpuv8yvu80d0cpxm799p5ytaqwrslawkxwurfdelp7g4v0qhp5rn4lh3rjf99dxx8acry8zlfc2g6varh0xkmeq4w7kr7l4lv848kscqzpgxq97zvuqsp54y3ttl7gnu8a5j0dn572zxs5yve2zhvd7g03pqpk8kd03nwt4qyq9qy9qsqeuqef37m2w065rfuxxymcwukkzx8dhu40ezjrwsrpqku7jdl22e98v8skqvmvngsjjawawk672q2kceakqymhpwvea4pmtcym4vka0cq64a8nm

lncli listinvoices shows r_preimage = null for invoices like that.

Is that ok?
Did i do everything correctly while creating the invoice?

p.s.
I know i should not be using these type of invoices which are vulnerable according to https://suredbits.com/zero-amount-invoices/, but in my case there is nothing to worry about, because i know in advance what amount the user is about to send me ( the user will pay via a LNURL-pay link, so the wallet will tell me the amount entered by the user via HTTP just before paying the invoice, thus i will know if i have to settle or cancel the HODL invoice based on the amount received).

I have paid it from another node and it is ACCEPTED now, so i guess it’s ok

1 Like

I think it’s best to ask on the lightning slack: http://lightningcommunity.slack.com/