DEV Community


Posted on

How to send file securely on the blockchain [The easy way]


As we keep hearing about data breach news of big companies like Dropbox or WhatsApp, it is harder for us to keep trusting them with our file and personal data, and it made us think about finding a better way. We think the best way to keep data secure is not having them in the first place. That’s why we choose the server-less solution, in other word, blockchain.
Anyone who has had their identity stolen or lost money because of a data breach understands that centralized applications come with personal risk.


The most challenging part for us was designing a blockchain app that doesn't look like a blockchain app! We wanted to make the transition from centralized to decentralized solution as smoothly as possible. That is where Blockstack comes in to help us with a secure and decentralized authentication service, working on Bitcoin blockchain.

Your shared file split into parts, encrypt, and then upload to a random hub of your choice. It gives you a private share link that plays the role of a key. No one can access the file without this link. Unlike traditional centralized services, BlackHole doesn't know about who, whom, what, and where the file shared! That’s the reason we name it BlackHole 🕳

Technical stuff

For a start, we need an open protocol so that anyone can review and check it. For that, we made the protocol simple but didn't let anything slow it down, as we wanted a fast experience. As I said, it will split the file into parts and but what I didn't say that it has a layer of smart compression. Why smart? Because it will look at the content and estimate how good it is for compression. After the compression, it will encrypt every part with the random 256 bits key and upload them in a multi-thread fashion (4 connection is the default).
After Protocol was done, we made it compatible with Blockstack with adding a layer of secure authentication and a Gaia provider.

Gaia’s approach to decentralization focuses on user control of data and its storage. If a user can choose which Gaia hub provider to use, then that choice is all the decentralization required to enable user-controlled applications.

We made it with Lazarus and FPC compiler and it was a very fun experience. You could use industry-standard AES CBC with 256 bits key with AES-NI assembly support and compile it easily for Mac and Windows.


BlackHole is a fully native app; as a result, it has so much less system usage (10MB of ram) and great user experience. Being native also provides multiple layers of encryption with excellent performance. BlackHole lives in your menu bar and lets you send files with only one click.


The project is available for Windows and Mac, and Linux version is on the way. You can take a look at the source on Github.

Take a look at it and let me know if you want to know more about BlackHole, BlockStack, FPC or encryption.

Top comments (0)