Semantic Blockchain: Semantic web on/with the blockchain

Finding all the ways to inject, insert, use, relate, apply, etc. Semantic web principles on blockchain based technologies. Author: Héctor Ugarte https://twitter.com/hectugaroj

Month: March, 2016

Multilayered architecture on Ethereum

Lets consider the next facts:

  • Smarts contracts can be written in different languages (one of them Solidity), and they will be stored on the blockchain on a precompiled format).
  • As you may know ethereum recommends to use “existing web development skills, tools, and favorite frameworks “ to develop User Interfaces.
  • web3.js API. is a way to call Smart Contracts using JavaScript.

In an architectural hardware point of view:

  • Smart contracts are replicated on the blockchain that works on a P2P environment.
  • UI framework, and connectivity, for the moment relies on a client-server architecture. Maybe in a future, P2P environments will also be used.

ethereum_architecture_blog
server-based-p2p

Multilayered architecture is defined as: “…is a software architecture that uses many layers for allocating the different responsibilities of a software product”.

For this purpose, 3 most common layers:

  • Presentation layer: Lets consider all the elements working on the the web browser environment, even if all this environment can be splited on its own on different layers, from a general point of view, on Ethereum, they form the presentation layer. [FRONTEND]
  • Application layer: Is formed by the smart contracts, [BACKEND]
  • Data access layer: Data is stored on the transactions, and could be also stored outside the blockchain (f.e. with IPFS)

Advertisements

Distributed Ledger Technology: beyond block chain

On January 2016, a report by the UK Government Chief Scientific Adviser was launched.
It sets out how this technology could transform the delivery of public services and boost productivity. It gives an interesting overview of blockchain technologies, and points over how UK governments plans to make use of it. I recommend before reading this text to be familiar with Blockchain technologies like Bitcoin.

The chapters that are covered:

Chapter 1: Vision
Chapter 2: Technology
Chapter 3: Governance and Regulation
Chapter 4: Security and Privacy
Chapter 5: Disruptive Potential
Chapter 6: Applications in Government
Chapter 7: Global Perspectives

Recommendations:

Recommendation 1: We recommend that government should:
• Provide ministerial leadership to ensure that government provides the vision, leadership and the platform for distributed ledger technology within government. Specifically, the Government Data Service should lead work in government as a user of distributed ledgers and the DCMS Digital Economy Unit should lead work on government as an enabler of distributed ledgers (working with the Department of Business, Innovation and Skills and with Innovate UK).
• The Government Digital Service and the DCMS Digital Economy Unit should develop a high-level capability road map and a supporting outline plan based on the work of this report and very early stage activity already underway in departments, and deliver this in a timely fashion; and continue to oversee the recommendations made in the rest of this report, to maintain momentum and rapid action. In undertaking this work, they should work closely with other government departments and with industry and academia and should consider setting up a time-limited expert advisory group in support.

Recommendation 2: The UK research community should invest in the research required to ensure that distributed ledgers are scalable, secure and provide proof of correctness of their contents. They need to provide high-performance, lowlatency operations, appropriate to the domain within which the technology is being deployed. They need to be energy efficient. The newly-created Alan Turing Institute, working with groupings such as the Whitechapel Think Tank, could play an important role in co-ordinating and ‘self-organising’ the public and private research and development sector interested in this and related technologies. The private sector should consider investing in the Alan Turing Institute to support the precompetitive research that will ultimately facilitate new commercial applications that are robust and secure. This includes work on obvious areas such as cryptography and cybersecurity but also extends to the development of new types of algorithm.

Recommendation 3: Government could support the creation of distributed ledger demonstrators for local government that will bring together all the elements necessary to test the technology and its application. A demonstrator at a city level could provide important opportunities for trialling and implementing distributed ledger technologies. Innovate UK could use its work with cities in the development of ‘city deals’ to implement the development of a city demonstrator.

Recommendation 4: Government needs to consider how to put in place a regulatory framework for distributed ledger technology. Regulation will need to evolve in parallel with the development of new implementations and applications of the technology. As part of the consideration of regulation, government should also consider how regulatory goals could be achieved using technical code as well as legal code. The DCMS Digital Economy Unit could take ownership of this recommendation.

Recommendation 5: Government needs to work with academia and industry to ensure that standards are set for the integrity, security and privacy of distributed ledgers and their contents. These standards need to be reflected in both regulatory and software code.

Recommendation 6: This recommendation is linked to Recommendation 5. Government needs to work with academia and industry to ensure that the most effective and usable identification and authentication protocols are implemented for both individuals and organisations. This work needs to go hand in hand with the development and implementation of international standards.

Recommendation 7: Understanding the true potential of distributed ledgers requires not only research but also using the technology for real life applications. Government should establish trials of distributed ledgers in order to assess the technology’s usability within the public sector.

Recommendation 8: As well as top-down leadership and coordination, there is also a need to build capability and skills within government. We recommend the establishment of a cross-government community of interest, bringing together the analytical and policy communities, to generate and develop potential ‘use cases’ and create a body of knowledge and expertise within the civil service. GDS and the Data Science Partnership between GDS, Office for National Statistics, Cabinet Office and the Government Office for Science could act as the convenors of this community of interest. There are important opportunities for government to stimulate the business sector by acting as a smart customer in procuring distributed ledger applications.

Some interesting ideas and concepts extracted:

  • Ledgers are in commerce activities since ancient times. Computers offered a simply transfer from paper to bytes. Now algorithms, enable the collaborative creation of digital distributed ledger, with powerfull properties.
  • Distributed ledgers may help governments to collect taxes, deliver benefits, issue paspports, record land registries, assure the supply chain of good, and generallty ensure the integrity of government records and services.
  • Estonian government has been experimenting with distributed ledger technology know as Keyless Signature Infrastructure (KSI).
  • Everledger, provides a distrivuted ledger that assures the identity of diamonds, from being mined and cut to being sold and insured.
  • The governemnt office of science establish a senior group of experts from business, government and accademia to asset the oportunities for distributed ledgers to be used within government and the private sector and to determine what actions goverrment and others need to take to facilitate the benefitial use of distributed ledger technology and to avoid possible harms.
  • Distributed ledger technology provides the framework for government to reduce fraud, corruption, error and the cost of paper-intensive propcesses.
  • Has the potential to redifine the relationship between goverment and the citizen in terms of data sharing, transparency and trust. It has similar posibilities for the private sector.
  • Benefits: Distributed extremely widely, higlhy efficeint, equally robust, smart contracts.
  • Challenges: Privacy, security, performance and scalability.
  • Offer government service more personal, inmediate and efficient.
  • It should lead to improvements in compliance, cost efficeincy and accountability.
  • We need to understand the ethical and social implications of different potential uses and the financial costs and benefits of adoptions.
  • The cryptographic codes of the digital world are extremely hard to break, but they can be vulnerable to being bypassed. Bypass mechanism rnage from the human who might give away the key accidentaly or deliberately, to the presence of black doors, due to deficciency in the software code.
  • Privacy and confidentially are key issues. The ledger may hold personal confidential records that could range from financial to familiar and helath.
  • In cyberspace trust is based on authenitcation and authorization.
  • Five uses cases: 1) Protecting critical infraestructure against cyber attacks. 2) Reducing operational costs and tracking eligibality for wellfare supprt, while offering grater financial inclusion. 3) Transparency and traceability of how aid money is spent. 4) Creating opportunities for economical growth, bolstering SMEs and increasing employment. 5) Reducing tax fraud.
  • Benefits to governments and financial services: 1) Reconciliation through cryptography. 2) Replicated to many institutions, 3) Granular access control, 4) Granular transparency and privacy.
  • Smart contract: Application layer that makes much of the promise of block chain technology a reality. Are being consider for a wide variety of users, particulary for regulators compliance, product traceability, and service managemnets, and also to defeat counterfeit products and fraud in the following sectors: Food, financial services, energy, pharmaceuticals, helath, aerospace, aviation, telecomunications. IT and communications, transport, utilities, agriculture, oil and gas.

Figure1Figure2

 

LINK: https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/492972/gs-16-1-distributed-ledger-technology.pdf

 

Why semantic web?

The aim of this blog is: “…finding all the ways to inject, insert, use, relate, apply, etc. Semantic web principles on blockchain based technologies.” I am not following a strict order when publishing blog entries, I am just sharing information that I consider important, and will help me to research and achieve the goal.

According to the W3C, “The Semantic Web provides a common framework that allows data to be shared and reused across application, enterprise, and community boundaries”

Some benefits that semantic web principles can bring on the blockchain environment are:
1. Uniform Resource Identifiers (URIs) used to identify documents and also concepts (people, places, things, abstract/intangible concepts) and properties / data relationships (consistency).
2. Resource Description Framework (RDF) provides a W3C standard way to write simple logical statements about relationships. (Standardization).
3. Ontologies are like data dictionaries with additional logical annotations Multiple ontologies can co-exist and be used in parallel. It’s also easy to cross-reference between them. (Standarization).
4. SPARQL query language enables a query to combine machine-readable data from multiple sources and also allows new data relationships to be constructed from existing data. (Linking and mappings).

Important to consider that: In 2013, more than four million Web domains contained Semantic Web markup.

Why Ethereum over Bitcoin?

bitcoin-and-ethereum-sitting-on-a-tree@2x

Bitcoin is a good, very good platform for money (bitcoins) transactions. But for more transactions than just money may not be the best choice, at least from the point of view of Vitalik Buterin: founder of Ethereum.

Blockchain 2.0 platforms, like Ethereum offers the possibility to handle Descentralized Autonomus Organizations (DAOs) very well. Defined as: –autonomous entities that operate on the blockchain without any central control whatsoever, eschewing all dependence on legal contracts and organizational bylaws in favor of having resources and funds autonomously managed by a self-enforcing smart contract on a cryptographic blockchain. There are other platforms, like Colored Coins, Master coins, etc. Working over bitcoin ledger, but those are limited, for different reasons.

Some of the reasons to use Ethereum vs Bitcoin blockchain based 2.0 protocols for Blockchain 2.0 applications are:

1. Most of the protocols that have been invented have been specialized, attempting to offer specific and rich feature sets targeted toward specific industries or applications usually financial in nature. Ethereum intends to be as generalized as possible, allowing anyone to create specialized applications on top for almost any purpose imaginable.

2. Turing-complete, universal scripting language vs Scripting systems of Bitcoin, and even proto-cryptocurrency-2.0 alternatives such as the Bitcoin-based colored coins protocol and so-called “metacoins”, are far too limited to allow the kind of arbitrarily complex computation that DAOs require.

3. Fees – Ethereum contracts will regulate its Turing-complete functionality and prevent abusive transactions such as memory hogs and infinite loop scripts by instituting a transaction fee for each computational step of script execution.

4. Mining algorithms – there has been a lot of interest into making cryptocurrencies whose mining is resistant against specialized hardware, allowing ordinary users with commodity hardware to participate without any capital investment and helping to avoid centralization. Scrypt and Primecoin mining, exist, but both are imperfect; neither require nearly as much memory as an ideal memory-hard function could require, and both suffer from time-memory tradeoff attacks, where the function can be computed with significantly less memory than intended at the cost of sacrificing some computational efficiency. Ethereum instead uses an algorithm called Dagger, a memory-hard proof of work based on moderately connected directed acyclic graphs (DAGs, hence the name), which, while far from optimal, has much stronger memory-hardness properties than anything else in use today. In a near future, Ethereum will migrate its mining procedure to “Proof of Stake” (asks users to prove ownership of a certain amount of currency (their “stake” in the currency) to achieve distributed consensus).

5. Over colored coins master coins specifically: The specific failure of Bitcoin is particularly concentrated in one place: scalability. Bitcoin itself is as scalable as a cryptocurrency can be; even if the blockchain balloons to over a terabyte, there is a protocol called “simplified payment verification”, described in the Bitcoin whitepaper that allows “light clients” with only a few megabytes of bandwidth and storage to securely determine whether or not they have received transactions. With colored coins and Mastercoin, however, this possibility disappears. The reason is this. In order to determine what color a colored coin is, you need to not just use Bitcoin simplified payment verification to prove that it exists; you also need to trace it all the way back to its genesis, and do an SPV check each step of the way. Sometimes, the backward scan is exponential; and with metacoin protocols there is no way to know anything at all without verifying every single transaction.

Most information here was written by Vitalik Buterin.
SOURCE 1: https://bitcoinmagazine.com/articles/ethereum-next-generation-cryptocurrency-decentralized-application-platform-1390528211

SOURCE 2: http://vbuterin.com/ethereum.html

Setting up a private Ethereum blockchain

For testing purposes on a single node, like when we are developing on our local PC. Is recommended to use: ethereumjs/testrpc

“Limited RPC client intended for quick testing and development. Uses ethereumjs to simulate a full client and make development of Ethereum applications much faster”

Git: https://github.com/ethereumjs/testrpc 

For building a private Ethereum blockchain, with multiple nodes one option is to use Geth.

“geth is the the command line interface for running a full ethereum node implemented in Go. It is the main deliverable of the Frontier Release”

Git documentation: https://github.com/ethereum/go-ethereum/wiki/geth

I made a small and very basic tutorial on setting up a private blockchain on a virtual environment with vmware:

Direct link: https://es.scribd.com/doc/305789330/Setting-up-a-private-Ethereum-blockchain-with-two-nodes

Storing data on the blockchain

On Bitcoin blockchain.
There are different ways to store data on top of the Bitcoin blockchain.
1.Value: Encode data in the number of satoshis being sent to an address.
2.Vanity address: Brute force through keys until you get an address that encodes your data.
3.Fake Address: Encode data in the Address itself. Because the Address encodes data of your choice it cannot have been the result of a derivation from a private key 1 of N.
4.MultisigAddress: These are more complex Bitcoin addresses that require one key out of N to redeem.
5.OPRETURN: Command in the Bitcoin scripting language that was specifically added to allow the inclusion of metadata on the block chain. Currently 40 bytes.
6.Sequence: This is an unused integer.
7.Coinbase: Miners can include data in a coinbase transaction.

chart

On Ethereum blockchain (Ethereum data storage).
Every contracts on Ethereum’s blockchain has its own storage which only it can write to. This is known as the contracts state and it is a flexible database which allows you almost unlimited storage space. A contract’s storage is at its most basic a key-value store with 2256 possible keys and 2256. This makes for sufficient possible storage to create database structures of any type imaginable, but there exists limits in terms of processing speed, since on average every 12.7 seconds the state of the database is updated. In the other hand each computation has a fixed gas(fees) cost and miners pick what ether price to charge for the gas. That is why storage on Ethereum blockchain is more for storing variables like a user’s balance etc. Large text files would be very expensive. Other companion technologies to Ethereum, current on development like Swarm will allow to work with bigger data.