Skip to content

Commit 8264cc1

Browse files
committed
Add an onion message-based DNSSEC HRN Resolver
Doing HRN resolution natively over the normal internet tends to be horrendous for privacy. One of the main motivations for BIP 353 was to limit the impacts of this by allowing for easier proxying of DNS requests. Here we add one such proxied request, specifically using lightning onion messages to do the DNS requests.
1 parent 2e7646f commit 8264cc1

File tree

4 files changed

+396
-3
lines changed

4 files changed

+396
-3
lines changed

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ rustdoc-args = ["--cfg", "docsrs"]
1515

1616
[features]
1717
http = ["reqwest", "std", "serde", "serde_json"]
18-
std = ["dnssec-prover"]
18+
std = ["dnssec-prover", "getrandom"]
1919
default = ["std"]
2020

2121
[dependencies]
2222
lightning-invoice = { version = "0.33", default-features = false }
2323
lightning = { version = "0.1", default-features = false, features = ["dnssec"] }
2424
bitcoin = { version = "0.32", default-features = false }
25-
getrandom = { version = "0.3", default-features = false }
25+
getrandom = { version = "0.3", default-features = false, optional = true }
2626
dnssec-prover = { version = "0.6", default-features = false, optional = true, features = ["validation", "std", "tokio"] }
2727
reqwest = { version = "0.11", default-features = false, optional = true, features = ["rustls-tls-webpki-roots", "json"] }
2828
serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] }
2929
serde_json = { version = "1.0", default-features = false, optional = true, features = ["alloc"] }
3030

3131
[dev-dependencies]
3232
tokio = { version = "1.0", default-features = false, features = ["rt", "macros"] }
33+
lightning = { version = "0.1", features = ["std"] }
34+
lightning-net-tokio = { version = "0.1", default-features = false }

ci/ci-tests.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ cargo check --verbose --color always
1313
cargo check --release --verbose --color always
1414
cargo test --no-default-features
1515
[ "$RUSTC_MINOR_VERSION" -gt 81 ] && cargo test --features http
16-
cargo test --features std
16+
# One std test syncs much of the lightning network graph, so --release is a must
17+
# At least until https://github.com/lightningdevkit/rust-lightning/pull/3687 gets backported
18+
export RUSTFLAGS="-C debug-assertions=on"
19+
cargo test --features std --release
1720
[ "$RUSTC_MINOR_VERSION" -gt 81 ] && cargo doc --document-private-items --no-default-features
1821
[ "$RUSTC_MINOR_VERSION" -gt 81 ] && cargo doc --document-private-items --features http,std
1922
exit 0

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ pub mod dns_resolver;
5757
#[cfg(feature = "http")]
5858
pub mod http_resolver;
5959

60+
#[cfg(feature = "std")] // TODO: Drop once we upgrade to LDK 0.2
61+
pub mod onion_message_resolver;
62+
6063
pub mod amount;
6164

6265
pub mod receive;

0 commit comments

Comments
 (0)