Flowee/P2PNet

3 327

For the last couple of weeks I've worked on a new library for Flowee. The library is called 'P2PNet' and has been pushed to the project git yesterday.

The purpose of this library is to provide programmers with a very simple way for their programs to become part of the network of Bitcoin Cash, speaking the peer-to-peer (P2P) protocol. It allows applications to be written in a way that with about 10 lines of code they will be able to discover peers, connect to them and validate, and sync the Blockchain, SPV style. The library should work on all desktop and mobile platforms.

About Flowee

In Flowee we believe that the best way to benefit humanity is to get more people to use Bitcoin Cash. Use it in their normal daily lives. From getting wages in Bitcoin Cash to paying rent, water and groceries with it. All those people and companies need good bitcoin-cash infrastructure. Libraries and services. This is what Flowee is all about. We add more services and libraries on a regular basis.

P2PNet library for a wallet

The ability for an application to access the Bitcoin Cash P2P network is the basis for many useful applications and tools because it is the full nodes who provide the backbone of Bitcoin Cash. One application to benefit from this library that I want to highlight today is a Bitcoin Cash wallet.

Building a wallet can be easy, just trust something like a block-explorer or online API-service and you are halfway there. But this requires trust. It gets harder if you want to avoid trusting any company or random 3rd party. Bitcoin Cash gives us the promise of being our own bank, which is a fancy way of saying that people can set up a wallet which nobody can confiscate, censor or block. You, and you alone, can decide how your money is moved.

To build a wallet that avoids this privacy problem is to create one which will automatically also become immune to confiscation of funds, blocking of participation or censorship of payments. Because there is no 3rd party to block you. No government that can lean on them. You own your own money.

The most popular wallets we have today all have major privacy issues where a very small number of central servers are fully aware of exactly the bitcoin you have in your wallet. This is because those wallets ask what funds are stored on your address. This avoids searching through the Blockchain, and thus is faster, but it does have a huge down-side that the 3rd party now knows all your addresses.

To improve on this, in 2012 the 'bloom filter' infrastructure was designed and support for it is available in most full nodes. This technology allows a fuzzy request where the server thus doesn't actually know exactly which addresses the user owns. While it is a big privacy improvement over the model where all addresses are sent to a central server, research has shown it is not an absolute improvement. This research showed that a full node receiving a bloom filter can do heuristics and after a long time of usage it can make some reasonably good guesses on which addresses belong together to the one wallet, and thus one person.

In P2PNet Flowee builds on top of this and adds the next level privacy feature: complete separation of wallets into Privacy-Segments. A user that uses cash-fusion to anonymize their funds would create a new Privacy-Segment for those funds to completely separate them from her previous wallet.

If we look at the most uses of Bitcoin Cash wallets we observe that they use the worst-case solution when it comes to privacy: a request is sent to a server to find out usages of a certain bitcoin-address. This means that one of a very small number of servers knows exactly which addresses a user has. Bloom is better since there now are 1000 servers available. The chance of them being bugged by evil people is much lower, on top of the already significant privacy advantages of bloom.

The solution that the P2PNet library adds to this is based on distributed nature of the coin. Since we have a lot of servers, we can associate a server with a privacy-segment of our wallet. Flowee connects to a unique set of full-nodes for each privacy-segment. This effectively means that one full node will never get a request for Blockchain-data for more than one privacy-segment. This total separation will have a huge increase of privacy as an effect.

When a user runs an anonymizing feature like 'cash-fusion' we will also switch to a different set of full nodes in order to get information about the new bitcoin-addresses the funds have been transferred to. Ensuring maximum privacy.

This means we provide a scalable way to ensure privacy on a simplified payment validation (SPV) based wallet, now let's build a wallet on top of this.

14
$ 2.21
$ 0.50 from @emergent_reasons
$ 0.50 from @ErdoganTalk
$ 0.25 from @Read.Cash
+ 7

Comments

The solution that the P2PNet library adds to this is based on distributed nature of the coin. Since we have a lot of servers, we can associate a server with a privacy-segment of our wallet. Flowee connects to a unique set of full-nodes for each privacy-segment. This effectively means that one full node will never get a request for Blockchain-data for more than one privacy-segment. This total separation will have a huge increase of privacy as an effect.

sounds brilliant! 🤩

Bloom is better since there now are 1000 servers available.

@TomZ are you saying that PSPNet will work with ANY BCH node, not just SPV; which I doubt there are 1000??

$ 0.00
4 years ago

Thanks for your question.

@TomZ are you saying that PSPNet will work with ANY BCH node, not just SPV; which I doubt there are 1000??

yes, it will work with the full nodes of BCH.

According to https://cash.coin.dance/nodes there are currently 1414 nodes.

The fact that the crawler of coin.dance found each of those means that that node is a potential node for P2PNet.

$ 0.25
4 years ago

yes, it will work with the full nodes of BCH.

that's amazing! i just opened an issue on my project to see this implemented asap https://gitlab.com/bchplease/nito.cash/-/issues/23

i see your library is written in C, which support TCP; unfortunately JS does not, which is why my implementation would probably have to rely on SPV servers (not full nodes); but the concept of segregating coins to specific servers is still BRILLIANT! 👏👍

$ 0.00
4 years ago