[RFC] offers: add bLIP 42 (Bolt 12 Contacts) PoC#8994
Draft
vincenzopalazzo wants to merge 3 commits intoElementsProject:masterfrom
Draft
[RFC] offers: add bLIP 42 (Bolt 12 Contacts) PoC#8994vincenzopalazzo wants to merge 3 commits intoElementsProject:masterfrom
vincenzopalazzo wants to merge 3 commits intoElementsProject:masterfrom
Conversation
Add support for the bLIP 42 contact protocol which allows payers to optionally reveal their identity and offer when paying a contact. Wire format: - invreq_contact_secret (type 2000001729): 32-byte contact identifier derived via ECDH between the two offers' node keys - invreq_payer_offer (type 2000001731): TLV-encoded payer offer for pay-back capability Both fields are added to invoice_request and invoice TLV definitions. Payer side (fetchinvoice): - New optional `contact_secret` and `contact_offer` params - When provided, includes bLIP 42 fields in the invoice_request Recipient side (offers_invreq_hook): - Logs incoming contact fields at LOG_INFORM level Contact secret derivation (common/bolt12_contact.c): - EC point multiplication + SHA256 tagged hash matching the spec - Unit test with both bLIP 42 test vectors from the LDK reference Changelog-Added: offers: PoC implementation of bLIP 42 (Bolt 12 Contacts)
The header is already included via bolt12_contact.h, so the .c file doesn't need to include it again. Fixes check-includes CI failure.
Remove wire/onion_wiregen.o dependency and provide stubs for blinded_path and sciddir_or_pubkey wire functions instead. This avoids pulling in transitive deps that cause linker failures on macOS (missing siphash_seed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PoC implementation of bLIP 42 (Bolt 12 Contacts) for Core Lightning, following the LDK reference implementation.
invreq_contact_secret(type 2000001729) andinvreq_payer_offer(type 2000001731) TLV fields toinvoice_requestandinvoicebolt12_contact_secret()derivation matching the spec: EC point multiplication + SHA256 tagged hashfetchinvoicegains optionalcontact_secretandcontact_offerparametersoffers_invreq_hooklogs incoming contact fieldsWhat this PoC does NOT implement yet
invreq_payer_bip_353_name/invreq_payer_bip_353_signaturefieldsTest plan
run-bolt12_contactpasses both bLIP 42 test vectors