Skip to content

Commit

Permalink
Add a lightning-dns-resolver crate which answers bLIP 32 queries
Browse files Browse the repository at this point in the history
When a lightning node wishes to send payments to a BIP 353 human
readable name (using BOLT 12), it first has to resolve that name to
a DNS TXT record. bLIP 32 defines a way to do so over onion
messages, and this completes our implementation thereof by adding
the server side.

It operates by simply accepting new messages and spawning tokio
tasks to do DNS lookups using the `dnsse_prover` crate. It also
contains full end-to-end tests of the BIP 353 -> BOLT 12 -> payment
logic using the new server code to do the resolution.

Note that because we now have a workspace crate which sets the
"lightning/dnssec" feature in its `dev-dependencies`, a naive
`cargo test` will test the "dnssec" feature.
  • Loading branch information
TheBlueMatt committed Oct 1, 2024
1 parent aa45eaf commit 93efbec
Show file tree
Hide file tree
Showing 7 changed files with 431 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ lightning/net_graph-*.bin
lightning-rapid-gossip-sync/res/full_graph.lngossip
lightning-custom-message/target
lightning-transaction-sync/target
lightning-dns-resolver/target
no-std-check/target
msrv-no-dev-deps-check/target
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"lightning-rapid-gossip-sync",
"lightning-custom-message",
"lightning-transaction-sync",
"lightning-dns-resolver",
"possiblyrandom",
]

Expand Down
5 changes: 1 addition & 4 deletions ci/ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ WORKSPACE_MEMBERS=(
lightning-rapid-gossip-sync
lightning-custom-message
lightning-transaction-sync
lightning-dns-resolver
possiblyrandom
)

Expand All @@ -56,10 +57,6 @@ for DIR in "${WORKSPACE_MEMBERS[@]}"; do
cargo doc -p "$DIR" --document-private-items
done

echo -e "\n\nChecking and testing lightning crate with dnssec feature"
cargo test -p lightning --verbose --color always --features dnssec
cargo check -p lightning --verbose --color always --features dnssec

echo -e "\n\nChecking and testing Block Sync Clients with features"

cargo test -p lightning-block-sync --verbose --color always --features rest-client
Expand Down
14 changes: 14 additions & 0 deletions lightning-dns-resolver/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "lightning-resolver"
version = "0.1.0"
edition = "2021"

[dependencies]
lightning = { version = "0.0.124-rc1", path = "../lightning", default-features = false }
dnssec-prover = { version = "0.6", default-features = false, features = [ "std", "tokio" ] }
tokio = { version = "1.0", default-features = false, features = ["rt"] }

[dev-dependencies]
bitcoin = { version = "0.32" }
tokio = { version = "1.0", default-features = false, features = ["macros", "time"] }
lightning = { version = "0.0.124-rc1", path = "../lightning", features = ["dnssec", "_test_utils"] }
Loading

0 comments on commit 93efbec

Please sign in to comment.