Inspiration

Blockchain is an emerging and interesting technology whose full potential has not been realized. Cryptocurrencies have already heavily leveraged the features of blockchain, but many other software frameworks could benefit from integrating blockchain. Email is one software stack that is difficult to secure, but I believe that locally hosted mail servers supported by a blockchain database can remedy this.

What it does

In its current form, I have Postfix as my mail transfer agent running on my mail server, Dovecot as my mail delivery agent also running on my mail server, and two Thunderbird mail clients running on 2 DragonBoards. I registered my mail server on the domain "mail.blockchainmail.org", which I registered as part of Domain.com's MLH free domain promotion. This alone is a fully local email system, but I also backed up the mailbox onto IPFS, an existing blockchain filesystem framework. Email is routed like any locally hosted mail service, but the mailbox is decentralized over many nodes in the IPFS network.

How I built it

I followed existing guides to install and configure Postfix and Dovecot on my laptop, and Thunderbird on each of the 2 DragonBoards I borrowed. I forked the IPFS repository and made a few changes to begin to integrate it with my email system (the IPFS fork is the only thing on my GitHub repo for now). I setup an IPFS node on my laptop adjacent to my Dovecot instance, and now it automatically propagates my mailbox across the blockchain network.

Challenges I ran into

By and large the biggest challenges I ran into were setup/debugging problems. All of the individual components I used were well designed, but my main challenge was finding a way to glue them all together so they maintained some sort of consistency. I came into this hackathon with very little understanding of the email software stack, and that proved to be a roadblock time and time again as I tried to make any small change in my system. With that said, I am extremely grateful for all the software maintainers on the individual components I used. Given my little background knowledge before I started, I could not have nearly setup this entire system in a weekend if it wasn't for all the clean code and documentation I encountered.

Accomplishments that I'm proud of

Getting this entire system running was definitely the most rewarding part of this entire project. Again, each component was already developed, but gluing them together was by far the hardest and most unpredictable part. The fact that the prototype works quite well still amazes me.

What I learned

I learned that integrating components with well maintained developers is not as easy as it might seem. While things would definitely be worse if each component was a mess, the task of setting up blockchain email was by no means an easy task. From picking my way through all the source code and documentation, to recalling the bits and pieces of email stack architecture from various classes, I was barely able to scrape by and develop a working prototype. After this experience I've learned firsthand the importance of clean code and documentation because it might really help out someone who is coming into your codebase completely new with no formal training. I also learned that a solid understanding of the fundamentals of the space you're trying to work in (email in my case) goes a long way in troubleshooting errors, especially those that are related to your software environment and not an actual bug.

What's next for Chainmail

Develop a seamless API on top of the blockchain database infrastructure that can accurately interpret all the commands and tasks the mail server sends to the mail database. This would allow a system administrator to seamlessly swap out a regular mail database for a blockchain-backed database, and really spur mass adoption of blockchain in email. My final step would be packaging this blockchain database with the rest of the open source locally hosted email stack into a one-step deployment of blockchain email. With this all-in-one solution, I envision Chainmail as a viable alternative to traditional third-party email services for system administrators.

Built With

  • dovecot
  • ipfs
  • mariadb
  • postfix
  • thunderbird
Share this project:

Updates