Welcome to blank space!

What is blank space?

blank space brings decentralised, real-time document collaboration for the very first time to the IC Blockchain! While planning this project, Hassan and I were using Google Docs, an application which is actively used by approximately 2 billion users worldwide. This lead us to the belief that this application would have wide applicability, making use of the unique characteristics of the IC blockchain, such as its speed and security, making it a perfect candidate for real-time collaboration as well as decentralised document data storage so no company completely owns your data and documents.

How we built it?

The build process was completed by me and Hassan, making use of our primary tools: VS code for the development process, the Motoko docs for research and understanding of the IC blockchain, and finally Google Docs and Discord for collaborating and planning.

The architecture involves 3 main canisters.

  • blankspace_assets
  • blankspace
  • signalling

blankspace_assets is our front end canister maintaining the primary react source code, which handles the connected peers on a document, the document itself (including the sending of deltas which are the changes on the document), and our front end features which can be interacted with.

blankspace is canister is used for the management and maintenance of the Users to Documents relationship, as well as the current active peers on a set document.

And finally the signalling canister for the signalling between users as they send their WebRTC offers and answers from one user to the other.

This multi-canister implementation allows the signalling functionality to be separated from the blank space project and be utilised by anyone who wishes to use the signalling canister to also send offers and answers between multiple peers in the future, regardless of what application they are using a WebRTC offers answers based approach for.

Challenges we ran into

The primary and most noteworthy challenge we faced was connecting users for the collaborative process. For this process, we decided to utilize WebRTC, to be able to quickly send messages (in our case, deltas which represent changes on the document) to each of the separate peers so that they have the most up to date documents.

On web2.0, we would simply have used node.js as our server-side tool and utilized sockets to instantly connect users and exchange direct offers and answers for peers in WebRTC. Without Sockets, we needed to go back to first principles to understand what WebRTC provides and how it connects its users. We recognised that a WebRTC connection between peers can be made through paper, manually; if a peer which offers a connection receives an answer from a separate peer who reads the initial offer. Therefore, using Motoko, we built a signalling process through updates to the blockchain on who is attempting to connect, simply sharing the offers and answers between peers who represent a user on the document.

Another major issue faced with connecting peers involves the ability to connect to other users on different networks. While testing blank space locally, our solution successfully managed to connect several peers together. However, once deployed to the IC, different users will be on different networks, and this meant that the webRTC peers were no longer connecting successfully. This was solved using a STUN and TURN server, hosted on Azure to allow WebRTC to connect users on different networks.

Accomplishments that we're proud of

We are extremely proud that we were able to successfully connect users through the IC and collaborate on a live document. Our final test was to connect a user in America (myself) and a user in the UK (Hassan) over the live version of the IC. This was proof that we had successfully made a product which can be used by individuals globally, on a truly decentralised system.

What we learned

There are several skills we learned during this process, for example learning new tools and frameworks such as WebRTC, Motoko, and how real-time collaboration works for documents and the processes behind them. The most interesting takeaways revolve around how all these technologies can combine to produce a tool which can be used by several individuals around the world in a decentralised manner, working with the unique strengths that the IC blockchain provide, leading to challenges which were overcome and learning opportunities to demonstrate intuitive thinking which was a pleasure to work through.

What's next for blank space

Now, we have shown you how we brought decentralised real-time document collaboration to life with the help of the IC blockchain. But what's in store for the future of blank space? In the more immediate future we plan to add document encryption options, voice group call ability while collaborating on documents, and greater support for import/export formats, along with additional quality of life features. We will also look to scale this project further as it begins to grow, for example by adding more user canisters. Ultimately, the future of the IC blockchain looks very promising and we are looking forward to contributing to the ecosystem further!

Built With

Share this project:

Updates