Skip to content

Commit 8e94142

Browse files
committed
Add a lightning-dns-resolver crate which answers bLIP 32 queries
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.
1 parent 2bbb3b7 commit 8e94142

File tree

7 files changed

+500
-6
lines changed

7 files changed

+500
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ lightning/net_graph-*.bin
1212
lightning-rapid-gossip-sync/res/full_graph.lngossip
1313
lightning-custom-message/target
1414
lightning-transaction-sync/target
15+
lightning-dns-resolver/target
1516
no-std-check/target
1617
msrv-no-dev-deps-check/target

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ members = [
1515
"lightning-custom-message",
1616
"lightning-transaction-sync",
1717
"lightning-macros",
18+
"lightning-dns-resolver",
1819
"possiblyrandom",
1920
]
2021

ci/ci-tests.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ WORKSPACE_MEMBERS=(
5454
lightning-custom-message
5555
lightning-transaction-sync
5656
lightning-macros
57+
lightning-dns-resolver
5758
possiblyrandom
5859
)
5960

@@ -64,10 +65,6 @@ for DIR in "${WORKSPACE_MEMBERS[@]}"; do
6465
cargo doc -p "$DIR" --document-private-items
6566
done
6667

67-
echo -e "\n\nChecking and testing lightning crate with dnssec feature"
68-
cargo test -p lightning --verbose --color always --features dnssec
69-
cargo check -p lightning --verbose --color always --features dnssec
70-
7168
echo -e "\n\nChecking and testing Block Sync Clients with features"
7269

7370
cargo test -p lightning-block-sync --verbose --color always --features rest-client

lightning-dns-resolver/Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[package]
2+
name = "lightning-dns-resolver"
3+
version = "0.1.0"
4+
authors = ["Matt Corallo"]
5+
license = "MIT OR Apache-2.0"
6+
repository = "https://github.com/lightningdevkit/rust-lightning/"
7+
description = "A crate which implements DNSSEC resolution for lightning clients over bLIP 32 using `tokio` and the `dnssec-prover` crate."
8+
edition = "2021"
9+
10+
[dependencies]
11+
lightning = { version = "0.0.124", path = "../lightning", default-features = false }
12+
dnssec-prover = { version = "0.6", default-features = false, features = [ "std", "tokio" ] }
13+
tokio = { version = "1.0", default-features = false, features = ["rt"] }
14+
15+
[dev-dependencies]
16+
bitcoin = { version = "0.32" }
17+
tokio = { version = "1.0", default-features = false, features = ["macros", "time"] }
18+
lightning = { version = "0.0.124", path = "../lightning", features = ["dnssec", "_test_utils"] }

0 commit comments

Comments
 (0)