Blokd

Blokd logo

Blokd is a blockchain backed framework for managing private legal contracts, for example tenancy agreements, wills. The idea was to leverage some of the properties of the Blockchain data storage format such as immutability, zero-trust, and full visibility to ensure that Legal contracts are properly fulfilled and maintained by all parties and that there can be no dispute or disagreement about the contents or who has signed what, or what the state of the contract was when it was signed. I was reading about some cases of contract fraud that occurred either due to miscommunication between the client and solicitor or because a contract apparently was lost or they accidentally signed or presented an old or outdated copy. My solution was this Blockchain framework whereby contracts were stored on a Blockchain and anytime the contract was updated or signed, or a new contract was created, this would be stored on the same Blockchain also, in a subsequent block. So let’s say you have 10 people who are entering into a complex legal agreement whereby many different contracts are likely to be exchanged, they could provision their own private Blockchain instance between the 10 of them. When they initially set up they instance, each person would have to provide a private and pubic key they can use to receive and sign contracts. They can also choose the rules under which they would allow a block to be valid and added to the Blockchain. So for example, they may say that if person a creates a contract it must at least be signed by person b, c, and g, or persons c, d and f. Or they may just say that a Contract must be signed by person a and at least 70% of all other participants, regardless of who those people are. Signing rules could be time sensitive as well, so if a contract is not signed within a certain period of time, it will not be persisted on a block. This initial configuration of how many people are included in the network, their key pairs, and the signing rules, must be signed by everyone and this is in effect the first contract of the first block, but from then on, the signing rules set out in this configuration would apply. A rough diagram of the system architecture is pictured below:

Blokd system architecture
System architecture

So in terms of the tech stack I used for this project, It can be divided into several components. The core Blockchain framework and each client node was 100% in Kotlin, packaged using cradle as a docker container, and using Apache Kafka to send contracts and communicate with other Nodes in the network. There was also a REST API and Web application to allow nodes to visualise the Blockchain, visually inspect each block, and of course read each proposed contact before signing, so the web application was essentially a visual interface to interact with the system. The REST API was also written in Kotlin, using the ktor framework for routing, handlers, security and model serialisation. I wrote the web application in Vue.js 3 using the quasar framework with the composition API and pinia for state management. The links to the corresponding Github repositories are: