Skip to content
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

[WiP] bip324 v2 p2p protocol #2212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[WiP] bip324 v2 p2p protocol #2212

wants to merge 1 commit into from

Conversation

lnliz
Copy link

@lnliz lnliz commented Jul 13, 2024

⚠️ This is still a work in progress ⚠️

Add support for bip324 v2 p2p protocol

I worked on bip324 code for the bitcoin-bip324-proxy project and created the v2 p2p transport code so it can be used as a library for other bitcoin projects written in Go. This is POC showing that btcd can use the bip324_transport package to establish v2 connections.
Please disregard the noise in go.mod/go.sum file - I think this needs refactor of the bip324 crypto and transport package in a new package or repo so that proxy dependencies are not pulled in.

This is not a final PR, only to start a conversation and to demo functionality. There are many open questions:

  • is btcd project interested in adding bip324 v2 protocol support?
  • if yes, what's a good way forward?
  • how are external dependencies normally handled?
  • I added the v2 code in the code where I thought it would make sense but could use help in fixing the approach.
  • the bip324_transport code is not very well tested yet, some help with reviewing and improvement suggestions are welcome.
  • still missing: when trying to connect to a v1 node this will fail. bitcoin core then marks the node for reconnect with v1 - this needs something similar.

tested with:

go run . --blocksonly --noonion --maxpeers=10 --nodnsseed --debuglevel=debug --connect=aa.bb.cc.dd:8333

where "aa.bb.cc.dd:8333" is a bitcoin core node that supports v2 (-> bitcoin core v27.0 and up)
or run without "connect" parameter and btcd will try the list of peers it already has

@saubyk
Copy link

saubyk commented Jul 15, 2024

Hi @lnliz thanks for the pr. This is an important area of work for sure

Just to let you know, this project is already being worked on by @Crypt-iQ (should have the draft pr up soon)
It would be good to reconcile and also get your reviews on it as well

@Crypt-iQ can also post some initial review comments on this pr, but I would urge you to hold-off on this for a bit

@lnliz
Copy link
Author

lnliz commented Jul 17, 2024

Hey @saubyk and thank you for your comment, that is helpful to know.
I searched for bip324 in the repo but didn't find anything so I submitted the PR as I had the code ready from the work on the bip324 proxy.

I'm ok to wait with this PR until @Crypt-iQ is ready (this was more a POC anyway). And I can also help with reviews on his work and figure out the way forward on how to reconcile.

Keep me posted.

@lnliz lnliz marked this pull request as ready for review July 19, 2024 05:39
@lnliz
Copy link
Author

lnliz commented Jul 29, 2024

Hey @Crypt-iQ - just wanted to checkin, did you make any progress on your implementation or had a chance to look here?

@saubyk
Copy link

saubyk commented Jul 29, 2024

Hi @lnliz I believe #2219 is a precursor pr for BIP324

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