<blockquote>
<p>From what I understand, the preimage is publicly revealed when the lightning payment request is paid as a part of the transaction.</p>
</blockquote>
<p>The preimage is revealed across the route from the destination back to the source but isn't announced publicly to say all nodes on the network.</p>
<blockquote>
<p>Is there any way to find that transaction and therefore the preimage fro the details included in the decoded payment request?</p>
</blockquote>
<p>If you are running a Lightning node then you can query the past transactions of your node but the payment request doesn't include the preimage. The preimage is only revealed once the payment is completed.</p>
<blockquote>
<p>The reason for this question is that I am using an app to pay lightning payment requests that does not show me the preimage in the UI, so I’m wondering if there’s any other way to retrieve it through some kind of RPC call for example.</p>
</blockquote>
<p>If you are running a Lightning node then the preimage should be returned on payment completion. With Core Lightning the <code>pay</code> <a href="https://lightning.readthedocs.io/lightning-pay.7.html" rel="nofollow noreferrer">RPC</a> and <code>keysend</code> <a href="https://lightning.readthedocs.io/lightning-keysend.7.html" rel="nofollow noreferrer">RPC</a> both return the preimage on a completed payment. If you aren't running a Lightning node then it depends on the app you are using and whether you even have a Lightning node running (it may be that the app doesn't allocate you a specific Lightning channel).</p>

CC BY-SA 4.0
2023-05-16T12:31:07.853Z
Thank you for your answer. You said that "the preimage is revealed across the route from the destination back to the source"--how exactly does this work? How is the preimage is communicated from the node that received the payment back to the node that sent it?
cool171
CC BY-SA 4.0
2023-05-16T12:43:42.337Z
@cool171: The same way all messages are communicated between Lightning nodes. The Lightning protocol relies on many messages being sent back and forth between Lightning nodes. They are typically communicated via TCP. Messaging is covered in BOLT 1: https://github.com/lightning/bolts/blob/master/01-messaging.md. Transport is covered in BOLT 8: https://github.com/lightning/bolts/blob/master/08-transport.md
Michael Folkson
CC BY-SA 4.0
2023-05-16T10:16:26.007Z
2023-05-16T10:16:26.007Z
Michael Folkson
<p>From what I understand, the preimage is publicly revealed when the lightning payment request is paid as a part of the transaction. Is there any way to find that transaction and therefore the preimage fro the details included in the decoded payment request? The reason for this question is that I am using an app to pay lightning payment requests that does not show me the preimage in the UI, so I’m wondering if there’s any other way to retrieve it through some kind of RPC call for example. Thanks in advance.</p>

<lightning-network><core-lightning><hash-time-locked-contract><invoices>
Is there anyway to find a lighting payment request preimage after it is paid if you aren’t the sending or receiving node?
cool171
# Is there anyway to find a lighting payment request preimage after it is paid if you aren’t the sending or receiving node?

(Asked by: username_0 on 2023-05-15)

From what I understand, the preimage is publicly revealed when the lightning payment request is paid as a part of the transaction. Is there any way to find that transaction and therefore the preimage fro the details included in the decoded payment request? The reason for this question is that I am using an app to pay lightning payment requests that does not show me the preimage in the UI, so I’m wondering if there’s any other way to retrieve it through some kind of RPC call for example. Thanks in advance.

**Tags:** lightning-network, core-lightning, hash-time-locked-contract, invoices


---

## 1 answers

### Answer by username_1 on 2023-05-16. Score: 2

> From what I understand, the preimage is publicly revealed when the lightning payment request is paid as a part of the transaction.

The preimage is revealed across the route from the destination back to the source but isn't announced publicly to say all nodes on the network.

> Is there any way to find that transaction and therefore the preimage fro the details included in the decoded payment request?

If you are running a Lightning node then you can query the past transactions of your node but the payment request doesn't include the preimage. The preimage is only revealed once the payment is completed.

> The reason for this question is that I am using an app to pay lightning payment requests that does not show me the preimage in the UI, so I’m wondering if there’s any other way to retrieve it through some kind of RPC call for example.

If you are running a Lightning node then the preimage should be returned on payment completion. With Core Lightning the `pay` [RPC](https://lightning.readthedocs.io/lightning-pay.7.html) and `keysend` [RPC](https://lightning.readthedocs.io/lightning-keysend.7.html) both return the preimage on a completed payment. If you aren't running a Lightning node then it depends on the app you are using and whether you even have a Lightning node running (it may be that the app doesn't allocate you a specific Lightning channel).

> **Comments:**
> **username_0**: Thank you for your answer. You said that "the preimage is revealed across the route from the destination back to the source"--how exactly does this work? How is the preimage is communicated from the node that received the payment back to the node that sent it?  
> **username_1**: @username_0: The same way all messages are communicated between Lightning nodes. The Lightning protocol relies on many messages being sent back and forth between Lightning nodes. They are typically communicated via TCP. Messaging is covered in BOLT 1: https://github.com/lightning/bolts/blob/master/01-messaging.md. Transport is covered in BOLT 8: https://github.com/lightning/bolts/blob/master/08-transport.md  

---

