Skip to content

Bip324 implementation #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

GJaubert
Copy link

@GJaubert GJaubert commented Mar 2, 2025

[DISCLAIMER]
This implementation requires bitcoin 0.32.5 for the Bip324 crate. I've updated the entire project to use this bitcoin version, which explains the size of this PR. To focus specifically on the BIP324 implementation, please refer to commit "351465d - BIP324 implementation".

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.

@GJaubert GJaubert closed this Mar 2, 2025
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.

1 participant