ADD: P2P Feature for a more user friendly multisig creation experience #6512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Short Description
This feature allows
n
users to create a Multisig wallet collaboratively each with their own BlueWallet app. There are two modes for P2P, hosting a session and joining a session. Session hosts advertise their presence and in parallel the rest of the peers search for a session to join. All peers join the host session and the host coordinates the process until peers share their key with all other nodes in the network. All communications are performed using encrypted TLS sockets on the local network (Wi-Fi and Hotspot are supported). react-native-p2p-secure, a new library was created to enable multi-platform P2P communication for this purpose.Through this sharing process, only the XPUBs are shared. The
onBarScanned
method is reused when an XPUB is received from a peer to increase logic sharing and minimize logic error risks.Below is a screen recording of a 2-of-3 multisig wallet creation using the P2P feature:
Screen.Recording.2024-05-05.at.12.45.48.AM.mp4
Motivation
This feature allows for a more intuitive approach for multisig wallet adoption. This approach might be a step towards simplifying multisig for the masses and increasing adoption by adopting a more familiar sharing mechanism to the average user while the rest of the sharing process is black-boxed. This work (as well as the react-native-p2p-secure library) was in an effort to complete the HRF bounty
#8 Easy Mobile Multisig
. The current bounty is for 1 BTC (before taxes), given that this is a relatively big PR, some effort from people other than myself will most probably be required to bake this into the app. Given this fact, I am willing to commit a 7.5% bounty share (of the net amount) to additional contributors and BlueWallet maintainers wishing to add some effort to the passing of this PR.I have spent quite a while working on this, feedback is appreciated, however, I will be working minimally on this moving forward, I have other things to prioritize, so I hope the bounty share is enough to encourage contributors to join in on this and get this going before the end of year deadline.
Note: Translations have been performed using GPT-4. It has been proven to perform quite well for translation tasks. Hope this is ok. Tried to make this PR as complete as possible.