Saturday, May 12, 2018

What exactly is a Smart contract

A smart contract is a secure and unstoppable computer program representing an agreement that is automatically executable and enforceable.
Dissecting this definition further reveals that smart contract is, in fact, a computer program that is written in a language that a computer or target machine can understand. Also, it encompasses agreement between parties in the form of business logic. Another fundamental idea is that smart contracts are automatically executed when certain conditions are met. Also, they are enforceable which means that all contractual terms are executed as defined and expected even in the presence of adversaries. Enforcement is a broader term that encompasses traditional enforcement in the form of law along with an implementation of specific measures and controls that makes it possible to execute contract terms without requiring any mediation. It should be noted that "real" smart contracts should not rely on traditional methods of enforcement instead they should work on the principle where “code is law” meaning that there is no need of an arbitrator or a third party that can control or influence the execution of the smart contract. The smart contracts are self-enforcing as opposed to legally enforceable. This might be regarded as a libertarian’s dream but is entirely possible and is in line with the true spirit of smart contracts.
Moreover, they are secure and unstoppable which means that these computer programmes are required to be designed in such a fashion that they are fault tolerant and executable in a reasonable amount of time. These programmes should be able to execute and maintain a healthy internal state even if external factors are unfavourable.
For example, imagine a standard computer programme which is encoded with some logic and performs according to the instruction coded within, but if the environment it is running in or external factors it relies on deviates from normal or expected state the programme may react arbitrarily or simply abort. It is essential that smart contracts are immune to this type of issue.
It will provide more significant benefit in the long run if security and unstoppable properties are included in the smart contract definition from the beginning. It will allow researchers to focus on these aspects from the start and will help to build strong foundations on which further research can then be based.

Monday, May 7, 2018

what is Ethereum Virtual Machine

EVM is a simple stack-based execution machine that runs bytecode instructions to transform the state from one state to another on the Ethereum blockchain. The word size of the virtual machine is set to 256-bit. The stack size is limited to 1024 elements and is based on the LIFO (Last in First Out) queue. EVM is a Turing-complete machine but is limited by the amount of gas that is required to run any instruction. This means that infinite loops that can result in denial of service due to malicious attacks or inadvertently are not possible due to gas requirements. EVM also supports exception handling in case exceptions occur, such as not having enough gas or invalid instructions, in which case the machine would immediately halt and return the error to the executing agent. EVM is a stack-based architecture. EVM is big-endian by design, and it uses 256-bit wide words. This word size allows for Keccak 256-bit hash and elliptic curve cryptography computations. EVM is a fully isolated and sandboxed runtime environment. The code that runs on the EVM does not have access to any external resources, such as a network or filesystem.

Saturday, May 5, 2018

Intelligent Smart Contracts (ISCs)

It is said that smart contracts are neither smart nor contracts. This is true to some extent, but smart contracts are and should be smart enough to do what they have been programmed to do, correctly and do it in a deterministic fashion. If contracts (business logic) are programmed within the smart contract and are enforceable, then they actually become contracts, just like real-life contracts enforceable by law. The issue, however, is that they are not really smart, or in other words intelligent.
I am proposing an idea to research building "Intelligent Smart Contracts (ISCs) " or "Smarter Contracts" or "Smart Intelligent Contracts (SICs)," which are genuinely smart and intelligent enough to learn and adapt themselves according to the external conditions and environment.
With the convergence of Artifical intelligence (AI) and machine learning with blockchain, this vision will become a reality. Soon this convergence will give rise to "Blockchain X.0"; the next generation of blockchains, where rational agents work for human beings and make intelligent decisions on behalf of humans in a truly decentralized environment.

Post trade settlement using Blockchain

This application is the most sought-after utilisation of blockchain technology. Currently, many financial institutions are exploring the possibility of using blockchain technology to simplify, automate, and speed up the costly and time-consuming post-trade settlement process. Australian Securities Exchange (ASX) is already replacing their legacy "CHESS" system with Distributed ledger technology.
To understand the problem better the trade lifecycle is described briefly. A trade lifecycle contains three steps: execution, clearing, and settlement.
Execution is concerned with the commitment of trading between two parties and can be entered into the system via the front office order management terminals or exchanges.
Clearing is the next step whereby the trade is matched between the seller and buyer based on specific attributes such as price and quantity. At this stage, accounts that are involved in payment are also identified.
Finally, the settlement is where eventually the security is exchanged for payment between the buyer and seller.
In the traditional trade lifecycle model, a central clearinghouse is required to facilitate trading between parties which bears the credit risk of both parties. The current scheme is somewhat complicated, whereby a seller and buyer have to take a complex path to trade with each other. This complexity comes from the composition of various firms, brokers, clearing houses, and custodians but with Blockchain, a single distributed ledger with appropriately designed smart contracts can simplify this whole process and can enable buyers and sellers to talk directly to each other, without the requirement of a trusted third party.
Notably, the post-trade settlement process takes two to three days and has a dependency on central clearing houses and reconciliation systems. With the shared ledger approach, all participants on the blockchain can immediately see a single version of truth regarding the state of the trade. Moreover, a peer-to-peer settlement is possible, which results in the reduction of complexity, cost, risk, and the time it takes to settle the trade. Finally, intermediaries can be eliminated by making use of appropriate smart contracts on the blockchain.

Tuesday, May 1, 2018

How Blockchains are immutable

Immutability is a crucial feature of blockchains: records once added in the blockchain are immutable. There is the possibility of rolling back the changes, but this is considered almost impossible to do as it will require an unaffordable amount of computing resources. For example, in case of bitcoin if a malicious user wants to alter the previous blocks, then it would need computing the Proof of Work (PoW) again for all those blocks that have already been added to the blockchain. This difficulty of redoing the PoW makes the records on a blockchain practically immutable.

Thrilled to see that my book Mastering blockchain - the third edition is a best-seller at Amazon!