lightning icon indicating copy to clipboard operation
lightning copied to clipboard

BOLT12: invoice with a non-ISO-4217 offer_currency is accepted by decode

Open usefahmed07 opened this issue 1 month ago • 0 comments

While differential fuzzing BOLT12 invoice decoding with bitcoinfuzz, I found that CLN decodes a correctly signed invoice whose offer_currency (TLV type 6) is not a valid ISO 4217 code, while Eclair rejects the same invoice.

Reproduction

Invoice (valid signature, offer_currency = ZZZ):

PASTE_INVOICE_HERE

Decoding it with CLN's BOLT12 invoice decoder succeeds, and Eclair (Bolt12Invoice.fromString) rejects it. The bitcoinfuzz target is deserialize_bolt12_invoice (PR: https://github.com/bitcoinfuzz/bitcoinfuzz/pull/672).

Question

I am not sure which behaviour is intended. BOLT12 says:

PASTE_EXACT_SPEC_SENTENCE_HERE

Should CLN reject an offer_currency that is not a valid ISO 4217 code? If accepting it is intended, it may be worth clarifying in the spec so implementations agree.

usefahmed07 avatar Oct 15 '26 20:10 usefahmed07