<p>In mastering the lightning network, the <a href="https://github.com/lnbook/lnbook/blob/54453c7b1cf82186614ab929b80876ba18bdc65d/12_path_finding.asciidoc#keeping-it-simple" rel="nofollow noreferrer">following paragraph</a> describes a facet of pathfinding</p>
<blockquote>
<p>The pathfinding mechanism implemented in Lightning nodes is to first create a list of candidate paths, filtered and sorted by some function. Then, the node or wallet will probe paths (by attempting to deliver a payment) in a trial-and-error loop until a path is found that successfully delivers the payment.</p>
</blockquote>
<p>Can we describe this version of probing in the context of LND and a classic mpp (base amp) payment?</p>
<p>For a classic mpp (no adulterations) are we using a real preimage hash (real described as one that has a preimage to be released upon successful htlc route established) for each of these trial-and-error attempts, or is the preimage used during the loop total junk (as one might expect during typical <a href="https://bitcoinops.org/en/topics/payment-probes/" rel="nofollow noreferrer">probing</a> methods.</p>
<p>In the case that <em>real</em> attempts are made in a trial and loop fashion, how is the error to be returned determined in LND?</p>

CC BY-SA 4.0
2023-08-25T09:03:48.943Z
LND uses real preimages for each trial-and-error payment attempt in the context of pathfinding.
Mani T
CC BY-SA 4.0
2023-08-25T09:04:47.583Z
If a payment attempt fails, the real preimage is not revealed, and the funds are not claimed.
Mani T
<lightning-network-daemon><error><preimage>
Do payment trial and error attempts in LND use valid preimages?
arshbot
# Do payment trial and error attempts in LND use valid preimages?

(Asked by: username_0 on 2023-08-24)

In mastering the lightning network, the [following paragraph](https://github.com/lnbook/lnbook/blob/54453c7b1cf82186614ab929b80876ba18bdc65d/12_path_finding.asciidoc#keeping-it-simple) describes a facet of pathfinding

> The pathfinding mechanism implemented in Lightning nodes is to first create a list of candidate paths, filtered and sorted by some function. Then, the node or wallet will probe paths (by attempting to deliver a payment) in a trial-and-error loop until a path is found that successfully delivers the payment.

Can we describe this version of probing in the context of LND and a classic mpp (base amp) payment?

For a classic mpp (no adulterations) are we using a real preimage hash (real described as one that has a preimage to be released upon successful htlc route established) for each of these trial-and-error attempts, or is the preimage used during the loop total junk (as one might expect during typical [probing](https://bitcoinops.org/en/topics/payment-probes/) methods.

In the case that *real* attempts are made in a trial and loop fashion, how is the error to be returned determined in LND?

**Tags:** lightning-network-daemon, error, preimage

> **Comments:**
> **username_1**: LND uses real preimages for each trial-and-error payment attempt in the context of pathfinding.  
> **username_1**: If a payment attempt fails, the real preimage is not revealed, and the funds are not claimed.  

---

## 0 answers

