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.

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.

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.