Skip to content

Commit 0f7a3cb

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 e43873b commit 0f7a3cb

File tree

7 files changed

+430
-8
lines changed

7 files changed

+430
-8
lines changed

.gitignore

+1
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

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ members = [
1212
"lightning-rapid-gossip-sync",
1313
"lightning-custom-message",
1414
"lightning-transaction-sync",
15+
"lightning-dns-resolver",
1516
"possiblyrandom",
1617
]
1718

ci/ci-tests.sh

-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ echo -e "\n\nBuilding and testing all workspace crates..."
3131
cargo test --verbose --color always
3232
cargo check --verbose --color always
3333

34-
echo -e "\n\nBuilding and testing lightning crate with dnssec feature"
35-
pushd lightning
36-
cargo test -p lightning --verbose --color always --features dnssec
37-
cargo check -p lightning --verbose --color always --features dnssec
38-
popd
39-
4034
echo -e "\n\nBuilding and testing Block Sync Clients with features"
4135

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

lightning-dns-resolver/Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "lightning-resolver"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
lightning = { version = "0.0.124-rc1", path = "../lightning", default-features = false }
8+
dnssec-prover = { version = "0.6", default-features = false, features = [ "std", "tokio" ] }
9+
tokio = { version = "1.0", default-features = false, features = ["rt"] }
10+
11+
[dev-dependencies]
12+
bitcoin = { version = "0.32" }
13+
tokio = { version = "1.0", default-features = false, features = ["macros", "time"] }
14+
lightning = { version = "0.0.124-rc1", path = "../lightning", features = ["dnssec", "_test_utils"] }

0 commit comments

Comments
 (0)