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

ADD: P2P Feature for a more user friendly multisig creation experience #6512

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

TheCypherPhunk
Copy link

@TheCypherPhunk TheCypherPhunk commented May 4, 2024

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.

"ms_help_title5": "अग्रिम मोड",
"p2p_title": "P2P",
"creating_p2p": "सत्र बनाउँदै...",
"joining_p2p": "सत्रमा सामेल हुनुहोस्...",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aseel

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for not understanding. What does Aseel mean in this context?

@TheCypherPhunk
Copy link
Author

Hello @limpbrains @ncoelho @Overtorment!

Wanted to ask if there is any chance of passing this PR and if there are any requirements?

@silkroadnomad
Copy link

I really like this idea but saw this works only in the local network via Bonjour (zeroconf?)
So what about supporting e.g. Lib2p, Waku network or even Nostr for finding other peers?

@TheCypherPhunk
Copy link
Author

TheCypherPhunk commented May 16, 2024

I really like this idea but saw this works only in the local network via Bonjour (zeroconf?) So what about supporting e.g. Lib2p, Waku network or even Nostr for finding other peers?

Yes, this was designed to work only on local network because it fits all common use cases for multisig. Thought about developing it with Nostr as a foundation but the idea of sifting through 25 other open sessions to find the session you’re looking for felt unpleasant. Also was thinking it would be more secure to have it use local networks instead of opening things up to the non-local. What use cases do you think would benefit from having it use a non-local network, I’m curious?

@silkroadnomad
Copy link

I think, most of the time I was using multisig, the participants haven't been in the same place as me. So I thought:

  1. creating a multisig via peer-to-peer protocol (e.g. libp2p or maybe via IPFS, others could be supported)
  2. sharing only xpubs and a unique URL for all participants viia social media, email etc.
  3. after multisig creation, also spending from it should be possible via remote and signatures gathered via the same protocol. When I am signing, the signature gets published to the other participants, the last one broadcasts the tx to the network. (just a theoretical question, naturally with many question marks)

@limpbrains limpbrains removed their request for review May 27, 2024 10:13
@GladosBlueWallet
Copy link
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @ncoelho] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/ncoelho

@GladosBlueWallet
Copy link
Collaborator

Wake the fuck up samurai, we have PRs to merge

image

[all PRs for @Overtorment] https://github.com/BlueWallet/BlueWallet/pulls/review-requested/Overtorment

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.

None yet

5 participants