-
Notifications
You must be signed in to change notification settings - Fork 957
cln-bip353: add plugin that fetches payment instructions from human readable addresses #8362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added a basic test with the same address the library uses in it's tests. Let me know if you have more addresses you'd like to see tested. Also updated the bitcoin_payment_instructions library to an unreleased version that supports proxying and implemented proxying incase For documentation i've added a json schema file. I have reworked the reponse structure a bit to also support onchain instructions. |
69c9ef7
to
d669e6f
Compare
Great! The always-use-proxy was my only question on this PR. Ack d669e6f |
d8ae7d9
to
14ea45f
Compare
rebased after merge of wss-proxy which created some conflicts. |
I had the dependency lock wrong: the keyword is |
let proof = payment_instructions | ||
.bip_353_dnssec_proof() | ||
.as_ref() | ||
.ok_or_else(|| anyhow!("bip353 dnssec proof not found"))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're using the HTTPResolver
you may get an LNURL instruction instead. It might be worth trying to do onion message resolution instead of HTTP resolution to a global DNS service. What does the plugin architecture look like on the CLN side for sending an onion message? After rust-bitcoin/bitcoin-payment-instructions#7 (and maybe one other PR to take a DNS-resolving node by node-id instead of doing a scan of the LDK network graph structure) you should be able to do a resolve, then poll release_pending_messages
, get back a DNSSECQuery
bLIP-32 message and a "context" (for your purposes some bytes that need to be shoved in the reply path that is included when the onion message is sent). From there, when we get back a bLIP-32 DNSSECProof
message (and the context that was included in the blinded path) you can call handle_dnssec_proof
and the original async resolution should complete.
If you're interested in giving this a go I'm happy to add the ability to provide a resolver node rather than relying on the LDK network graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rustyrussell can we do that with injectonionmessage? If so do you want me to change it to use the onion-based resolver? I'm a bit concerned about latency/reliability. In my gossip store there are currently 11 nodes which have the dns_resolver
flag set. 2 of those were offline, 8 tor only and 1 clearnet/tor hybrid.
If you're using the HTTPResolver you may get an LNURL instruction instead
The fact that we can get LNURL instructions via the HTTP resolver should not be important since we just skip them.
and maybe one other PR to take a DNS-resolving node by node-id instead of doing a scan of the LDK network graph structure
I've skimmed over the tests for that new resolver and i saw that currently you are loading the whole graph in there, that would be quite slow here and so yes we would need such a PR
you should be able to do a resolve, then poll release_pending_messages, get back a DNSSECQuery bLIP-32 message and a "context" (for your purposes some bytes that need to be shoved in the reply path that is included when the onion message is sent). From there, when we get back a bLIP-32 DNSSECProof message (and the context that was included in the blinded path) you can call handle_dnssec_proof and the original async resolution should complete
I understood about 10% of that (yet). I'm not that familiar with onion messaging.
If you're interested in giving this a go I'm happy to add the ability to provide a resolver node rather than relying on the LDK network graph.
Can you elaborate? You want me to hard-code in your node for resolving DNS queries instead of searching the graph for the dns_resolver
flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my gossip store there are currently 11 nodes which have the dns_resolver flag set. 2 of those were offline, 8 tor only and 1 clearnet/tor hybrid.
If you filter them properly I think it's only my personal node :( https://github.com/rust-bitcoin/bitcoin-payment-instructions/blob/main/src/onion_message_resolver.rs#L149
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate? You want me to hard-code in your node for resolving DNS queries instead of searching the graph for the dns_resolver flag?
No, you'd scan CLN's graph db and provide the nodes you want to use to resolve to the resolver logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing an onion based resolver is a whole other plugin, TBH. Maybe next release...
…eadable addresses Changelog-Add: new plugin cln-bip353 that can fetch BIP-353 payment instructions from human readable addresses
45588b8
to
6dd12ea
Compare
e3e4116
into
ElementsProject:master
Changelog-Add: new plugin cln-bip353 that can fetch payment instructions from human readable addresses
Important
25.09 FREEZE July 28TH: Non-bugfix PRs not ready by this date will wait for 25.12.
RC1 is scheduled on August 11th
The final release is scheduled for September 1st.
Adds a new rpc command
fetchbip353 [address]
that fetches payment instructions from a bip-353 address and returns an object containing:proof
: lowercase hex encoded proofinstructions
: An array of bip353 payment instruction objectsThese objects either contain an onchain instruction:
onchain
: a bitcoin addressonchain_amount_sat
: an optional amount for fixed amount paymentsdescription
: an optional description provided by the recipientor an offchain instruction:
offer
: a bolt12 offer stringoffchain_amount_msat
: an optional amount for fixed amount paymentsdescription
: an optional description provided by the recipientFixes: #8361
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked: