Skip to content

Conversation

@GJaubert
Copy link

@GJaubert GJaubert commented Mar 2, 2025

[DISCLAIMER]
This proposal needs bitcoin version 0.32.5 to work. That is why I have created this PR: #160 containing all the needed changes.

My proposal is primarily located in the reactor component. This approach maintains a clear separation between the Bitcoin protocol and encryption functionality, placing the encryption responsibility entirely within the transport layer.
Encrypted communication between Nakamoto nodes can now be enabled using the --p2p-v2 flag:

$ cargo run --release -p nakamoto-node -- --testnet --p2p-v2

As recommended in BIP324, I've implemented a fallback mechanism that reverts to V1 protocol when the V2 handshake fails.
I've added a test case (test_full_sync_v2) to verify successful V2 communication. However, I cannot currently test the fallback functionality in the test environment due to a limitation in Nakamoto's current state (please correct me if I'm wrong) - V1 Responder nodes hang when receiving unrecognized messages (in this case, the 64-byte ElligatorSwift-encoded public key). Despite this testing limitation, the fallback mechanism works successfully in the testnet environment, allowing connections to V1 nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants