bitcoinfuzz icon indicating copy to clipboard operation
bitcoinfuzz copied to clipboard

bolt11-workaround: No payment secret

Open erickcestari opened this issue 5 months ago • 0 comments

We have this workaround because currently the only implementation that doesn't require the payment secret on decoding bolt11 is LND.

They have plans to require it, so soon we won't need this workaround anymore.

https://github.com/lightningnetwork/lnd/issues/9718

  • [ ] LND
  • [x] rust-lightning
  • [x] eclair
  • [x] clightning

rust-lightning:

// Handle invoices without payment secrets by returning null
// This is needed because some Lightning implementations don't require payment secrets,
// and we need to maintain compatibility with these implementations
Err(ParseOrSemanticError::SemanticError(Bolt11SemanticError::NoPaymentSecret)) => {
    std::ptr::null_mut()
}

clightning:

// Handle invoices without payment secrets by returning null
// This is needed because LND don't require payment secrets,
// and we need to maintain compatibility with that implementation
if (strcmp(fail, "Missing required payment secret (s field)") == 0) {
    clean_tmpctx();
    return std::nullopt;
}

Eclair:

// Handle invoices without payment secrets by returning null
// This is needed because LND don't require payment secrets,
// and we need to maintain compatibility with that implementation
if(result == "payment_secret_error") {
    return std::nullopt;
}

erickcestari avatar Aug 07 '25 19:08 erickcestari