Skip to content

Blockchain, ethereum and contracts

P-A.Blanc edited this page Jul 25, 2018 · 7 revisions

Introduction

This project used a private blockchain, kaleido, to store data about houses, document, owners and the various links between those. This is a major step forward to decentralize data about houses and facilitate the verification of that information.

We are storing on the kaleido blockchain the metadata (described further in the implementation) of every houses and documents.

Glossary

  • Blockchain : According to Wikipedia, "A blockchain, originally block chain, is a growing list of records, called blocks, which are linked using cryptography". Ethereum is a blockchain-based distributed ledger, that has the double advantage of being open source and being able to support smart contracts, using the solidity language, which is a turing complete language.

  • Private Blockchain : A private blockchain is a type of blockchain that has restricted users privileges compared to the public blockchain.

  • Smart contracts are pieces of code, in this project written in solidity, that can be called by users of the ethereum blockchain, and be used to create and modify datasets associated to this smart contract.

Implementation

The flow of mapping is the following : account address to owner object, which contain an address, an array of string of ids of house, and finally a mapping between the ids of house and the house objects. Those house objects contains multiple informations about the house itself, those being its id, street name, zip code, city and country. To this is added, like for owner, a mapping and an array of string that contains the keys of this mapping. Here, however, the keys do not represent the id of the houses, but rather the id of the documents associated with the house. Finally for every document we store its id, when it was added, a boolean to know whether it has been verified yet and finally the hash of the pdf file.

On every documents are two informations that are vital to our implementation. The first is the hash of the pdf document, the second is the status of the file. The status of the file is initially set to false and represent whether that file has been verified yet or not.

Because of privacy concerns and the current regulations, we choose to adopt a middleware strategy. For this we made a rest API that is the only way for end users to interact with the blockchain itself.

Advantages

  • Decentralisation. Rather than having all the datasets kept on one server, every node has access to the hash of every document uploaded, ensuring transparency between every departments that has a node.

  • This project would help against corruption, via the transparency inherent to the blockchain. Indeed, it suffice to set up a node in the anti-corruption department for them to have access to every transactions. This ensure that if someone having access to the document database change a document, that modification would be evident as the hash of the modified document and the hash stored on the blockchain would not correspond.

  • Lastly, this will facilitate information sharing between departments, as every department will know exactly what all the others departments have access to, facilitating the requests for documents.

Issues

  • To ensure the privacy of the users, the blockchain shouldn't be accessible to everyone. Indeed, even if every document placed on the blockchain were encrypted, it would still possible to reveal personal information, via the links between those encrypted datasets. To solve that issue, we are currently using a middleware API, which itself call the smart contract, rather than allowing the clients direct access to the blockchain. This mean that the decentralisation is not complete as this project still require a centralised database storing the link between the ethereum accounts and the emails, along with the documents themselves.

  • An in-house blockchain, even one re-using the open source project kaleido source code require specific knowledge to set up and more importantly support.

  • It doesn't solve entirely the problem of authenticity of documents, as the blockchain itself would not be visible to the home owners or inspectors, but only to the people with access to a node. This has for effect that the end-users would need to trust the API responses about information on the blockchain rather than check by themselves that information.