LIGHTNING-HOOK-O...SAGE_RECV_SECRET(7)
π NAME π
Okay bestie, welcome to the LIGHTNING-HOOK-O...SAGE_RECV_SECRET(7) manual page β¨ β this is all about onion_message_recv_secret, the hook for receiving onion messages via blinded paths π§
π¦.
β¨ DESCRIPTION β¨
So the onion_message_recv_secret hook gets called when an onion message arrives via a blinded path that this node literally provided before. No cap.
The presence of pathsecret lets the plugin authenticate that the message used the intended return path. That's the whole vibe check right there π
Replies MUST only be sent when the pathsecret matches expectations. Periodt β do not be out here replying when it doesn't line up.
Returning anything other than {"result": "continue"} prevents further hook processing. So yeah, that exact thing is the green light π.
π HOOK PAYLOAD π
onion_message(object):pathsecret(secret): shared secret identifying the blinded path. It's used to verify that the sender used a path previously provided by this node. This prevents probing attacks and unauthorized replies. πreply_blindedpath(object, optional): a blinded return path provided by the sender. This allows replying without revealing the recipient's identity or network position. If present, plugins must use this path if they construct a reply onion message. π«Άfirst_node_id(pubkey, optional): the introduction node of the blinded path. This is the first hop to which the reply should be sent. Only one offirst_node_idor the pairfirst_scidandfirst_scid_diris present.first_scid(short_channel_id, optional): alternative tofirst_node_id: identifies the introduction point via a channel. Only one offirst_node_idor the pairfirst_scidandfirst_scid_diris present.first_scid_dir(u32, optional): direction of theshort_channel_id(0or1). Only one offirst_node_idor the pairfirst_scidandfirst_scid_diris present.first_path_key(pubkey, optional): initial public key used to derive shared secrets with the first hop. This key allows each hop to derive per-hop encryption keys and blinding factors. (added v24.11) ποΈhops(array of objects, optional): sequence of blinded hops forming the path. Each hop contains a blinded node identifier and encrypted routing instructions:blinded_node_id(pubkey): blinded public key representing the hop. The actual node identity is hidden using a blinding factor. π΅οΈββοΈencrypted_recipient_data(hex): encrypted TLV payload for this hop. Contains instructions (e.g., next hop) encrypted with a shared secret derived from the path key. π
invoice_request(hex, optional): BOLT #12invoice_requestpayload. π§Ύinvoice(hex, optional): BOLT #12invoicepayload. πinvoice_error(hex, optional): BOLT #12invoice_errorpayload. πunknown_fields(array of objects, optional): unknown or unparsed TLV fields from the onion message. Plugins may inspect these for experimental or custom extensions. πnumber(u64): TLV type number.value(hex): raw TLV value.
π HOOK RETURN π
result(string): return"continue"to pass the message to the next plugin. Returning any other value stops further hook processing. That's it, bestie β"continue"is the only slay here for keeping things moving β¨
Cute lil' sign-off: this iconic page is from Core Lightning v26.06.9 β LIGHTNING-HOOK-O...SAGE_RECV_SECRET(7) β mwah π, go forth and verify those pathsecrets π§π
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms