Skip to content

Commit 0f5077a

Browse files
committed
fix: split off proxy into its own repository
1 parent eceb074 commit 0f5077a

35 files changed

+45
-6791
lines changed
File renamed without changes.

Cargo.toml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
1-
[workspace]
2-
members = ["protocol", "proxy", "protocol/fuzz", "traffic"]
3-
default-members = ["protocol", "proxy", "traffic"]
1+
[package]
2+
name = "bip324-proxy"
3+
version = "0.4.0"
4+
edition = "2021"
5+
license = "CC0-1.0"
46
resolver = "2"
7+
description = "BIP-324 proxy enabling v1-only clients to use the v2 bitcoin p2p protocol"
8+
repository = "https://github.com/nyonson/bip324-proxy"
9+
readme = "README.md"
10+
11+
[package.metadata.configure_me]
12+
spec = "config_spec.toml"
13+
14+
[dependencies]
15+
bitcoin = { version = "0.32.4" }
16+
tokio = { version = "1", features = ["full"] }
17+
hex = { package = "hex-conservative", version = "0.2.0" }
18+
bip324 = { version = "0.10.0", features = ["tokio"] }
19+
configure_me = "0.4.0"
20+
log = "0.4.8"
21+
env_logger = "0.10"
22+
23+
[build-dependencies]
24+
configure_me_codegen = { version = "0.4.8", default-features = false }

README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
# BIP-324 Encrypted Transport Protocol
1+
# BIP-324 V2 Proxy
22

3-
[BIP-324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki) describes the V2 encrypted communication protocol for the bitcoin P2P network.
3+
A proxy sidecar process which allows V1-only clients to communicate over the V2 protocol. The process listens on port `1324` for V1 connections and requires the V1 client to send along the remote peer's IP address in the `addr_recv` field.
44

5-
## Motivation
5+
## Running the Proxy
66

7-
Bitcoin's original P2P protocol, "V1", was designed without any encryption. Even though the data exchanged over the bitcoin P2P network is public to some degree, encrypted communications offers a number of benefits over plaintext communication.
7+
`cargo run --bin proxy`
88

9-
* Internet Service Providers (ISPs) can easily detect and censor plaintext bitcoin communication.
10-
* Plaintext message tampering, without detection, is trivial for a man in the middle (MitM) attacker.
11-
* Nefarious actors may associate metadata, such as IP addresses and transaction origins, without explicitly having to connect directly to peers.
9+
The `--v1-fallback=true` flag can be used to fallback to the V1 protocol if the remote client does not support V2.
1210

13-
BIP-324 - "V2" - encrypted communication protects against the above issues increasing the privacy and censorship-resistance of the bitcoin ecosystem. Any applications communicating with bitcoin nodes, including light clients, should make use of the V2 protocol.
11+
## Testing with Nakamoto
1412

15-
## Crates
13+
[Nakamoto](https://github.com/cloudhead/nakamoto) is a BIP-157/BIP-158 Light Client that communicates over the Bitcoin P2P network. With a single change, Nakamoto may be modified to use the proxy. This patch hardcodes Nakamoto to connect to the localhost on port 1324 where the proxy should be running.
1614

17-
* [`protocol`](./protocol) - Exports the `bip324` client library.
18-
* [`proxy`](./proxy) - A small side-car application to enable V2 communication for V1-only applications.
19-
* [`traffic`](./traffic) - Traffic shape hiding layer over the base client.
15+
```diff
16+
diff --git a/net/poll/src/reactor.rs b/net/poll/src/reactor.rs
17+
18+
--- a/net/poll/src/reactor.rs
19+
+++ b/net/poll/src/reactor.rs
20+
@@ -468,7 +468,7 @@ fn dial(addr: &net::SocketAddr) -> Result<net::TcpStream, io::Error> {
21+
sock.set_write_timeout(Some(WRITE_TIMEOUT))?;
22+
sock.set_nonblocking(true)?;
23+
24+
- match sock.connect(&(*addr).into()) {
25+
+ match sock.connect(&net::SocketAddr::from(([127, 0, 0, 1], 1324)).into()) {
26+
Ok(()) => {}
27+
Err(e) if e.raw_os_error() == Some(libc::EINPROGRESS) => {}
28+
Err(e) if e.raw_os_error() == Some(libc::EALREADY) => {
29+
```
File renamed without changes.
File renamed without changes.

protocol/CHANGELOG.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

protocol/Cargo.toml

Lines changed: 0 additions & 33 deletions
This file was deleted.

protocol/README.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

protocol/benches/cipher_session.rs

Lines changed: 0 additions & 177 deletions
This file was deleted.

protocol/doc/DESIGN.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)