Quorum : Ethereum-based distributed ledger protocol

In Simple words Quorum is an Ethereum-based distributed ledger protocol that supports transaction and contract privacy.

The primary features of Quorum.

  • Transaction and contract privacy
  • Voting-based consensus mechanism
  • Network/Peer permissions management
  • Higher performance

Apart from these feature Quorum includes one of the powerful feature that is support of  Private and Public Transactions.

  • Private Transaction :- are those Transactions whose payload is only visible to the network participants whose public keys are specified in the privateFor parameter of the Transaction . privatefor can take multiple addresses in a comma separated list.
  • Public Transaction :- These are those Transactions whose payload is visible to all participants of the same Quorum network. These are created as standard Ethereum Transactions in the usual way.

The treatment of both type of transaction is different for Public Transaction it is sent to an Account that holds Contract code, each participant will execute the same code and their underlying StateDBs will be updated accordingly. But For Private Transaction  it replaces the original Transaction Payload with a hash of the encrypted Payload that it receives from Constellation. Participants that are party to the Transaction will be able to replace the hash with the actual payload via their Constellation instance, whilst those Participants that are not party will only see the hash.

Now let see how Quorum works Internally.

quorumtransactionprocessing

The process of a Transaction in Quorum is describe in the image.including Private Transaction Happening between A and B and there are 3 member in the network [A, B and C]  :-

  1. In First step the  request of Transaction is send to corresponding Quorum Node  i.e. A -> Quorum Node A. [Including Transaction A to B]
  2. A’s Quorum Node passes the Transaction on to its paired Transaction Manager, [Transaction Manager A] requesting for it to store the Transaction payload.
  3. A’s Transaction Manager makes a call to its associated Enclave to validate the sender and encrypt the payload.
  4. A’s Enclave checks the private key for Party A and, once validated, performs the Transaction conversion.
  5. Party A’s Transaction manager then stores the encrypted payload  and encrypted symmetric key and then securely transfers (via HTTPS) the hash, encrypted payload, and encrypted symmetric key that has been encrypted with Party B’s public key to Party B’s Transaction Manager. Party B’s Transaction Manager responds with an Ack/Nack response.
  6. A’s Transaction Manager returns the hash to the Quorum Node which then replaces the Transaction’s original payload with that hash.
  7. In Seventh Step Transaction is propagated to the rest of the network using the standard Ethereum P2P Protocol.
  8. A block containing Transaction AB is created and distributed to each Party on the network.
  9. In this step all Parties will attempt to process the Transaction.
  10. In this step A and B make a call to its Enclave, passing in the Encrypted Payload, Encrypted symmetric key and Signature. But C will receive NotARecipient message.
  11. The Enclave validates the signature and then decrypts the symmetric key using the Party’s private key that is held in The Enclave, decrypts the Transaction Payload using the now-revealed symmetric key and returns the decrypted payload to the Transaction Manager
  12. The Transaction Managers for Parties A and B then send the decrypted payload to the EVM for contract code execution. This execution will update the state in the Quorum Node’s Private StateDB only.

REFERENCES :-  Quorum Github Wiki

Blockchain + Digital Signature

A distributed register to store static records and/or dynamic transaction data without central coordination by using a consensus-based mechanism to check the validity of transactions. A blockchain is a distributed database that maintains a continuously growing list of data records that cannot be tampered.
Blockchain is a public ledger of all transaction made with Bitcoin. Blockchain’s intent is to replace an external, trusted third party certificate authorities, and also prevent anyone from being able to go backward and cover their tracks if they corrupted an entry.

The technology works on the following properties:

1) Log replication – To create resiliency, log-based replication is increasingly used for distributed systems to replicate logs to all peers in the network.

2) Provable Value Chain – The values stored in the blockchain can be digital currency (such as the widely known Bitcoin), data, documents, and other assets. Hash chains are kept for each block providing a history of changes, which helps protect data integrity of the block asset.

3) Public-key Cryptography – Blockchain uses different types of cryptography including ECDSA and elliptic curve to authenticate transactions.

4) Decentralized transaction ledger – The ledger is blockchain and is maintained without a central authority, and acts as a decentralized reconciliation system.

Blockchain with Digital signatures have become a key control in many organizations security strategy, relying on the use of certificates and complex mathematical algorithms to provide authenticity of the data and protection against forgery.

But, suppose a company wants to accept Bitcoins for its trades. Now, because of security reasons, the company would not want that only a single employee will have access to the company’s Bitcoin wallet’s password. Any transaction should need approval from more than one employees of the company. A multisignature address is created for that purpose.

A multisignature address is an address associated with more than one ECDSA private keys. So, in an m-of-n address, when a Bitcoin address is generated, it is associated with n private keys. And, at least m private keys will be required to make a transaction possible.

digi

And this concept can be used in making digital signatures. One can create a multisignature m-of-n address using n private keys and use that to record digital signature of documents in a blockchain. Anyone can verify the digital signature using public keys, but to make the digital signature one would need at least m private keys, out of n private keys associated with the multisignature address. By using private keys between the signer and the recipient, data transactions can be maintained by only approved parties.

Image Source : Slideshare.net

 

Introduction of Blockchain

blockchain-logo-blue6

“Blockchain is more than just ICT innovation, but facilitates new types of economic organization and governance. Suggests two approaches to economics of blockchain: innovation-centred and governance-centred. Argues that the governance approach—based in new institutional economics and public choice economics—is most promising, because it models blockchain as a new technology for creating spontaneous organizations, ie new types of economies.”

Primavera De Fillippi, Academic, researcher, author and thought leader

Sometimes people consider bitcoin and blockchain as one but the bitcoins are digital crypto-currency and blockchain are the technology that enables digital currency from one individual to another. Blockchains solves the problem in money transfer. Today if a person wants to transfer his or her money to another person then it is done through a third trusted party which takes time and fees for the transferring money.

The blockchain was conceptualized by Satoshi Nakamoto in 2008 and implemented as a core component of bitcoin but now it is also used for other crypto-currency, online signature services and many other applications.

Blockchain is a peer to peer technology that protects the integrity of a digital piece of information. It is a form of distributed public ledger or database that maintains a list of blocks. Each block contains a hash(A hash algorithm turns an arbitrarily-large amount of data into a fixed-length hash) of previous block hence creates a chronological order. Every node gets a copy of the ledger and each time any transaction occurs it is broadcast over the blockchain network. Whenever any node connects with the network it gets automatically downloaded.

Blockchain has two main concepts:

  • Distributed Network

  • Shared Ledger

 

Distributed Network

  • A decentralized peer-to-peer architecture

  • Every node in decentralized system has a copy of the blockchain.

Shared Legder

  • Database shared across network.

  • It is open for public.

  • Secure as it is public.

There are also few problems with blockchain like storage and synchronization, everytime a new block appends into blockchain very quickly but on the other hand it also has various advantages like faster transaction, transparency, lower transaction cost and much more.

Image Source: Inside Bitcoins

Insurance needs to wake up to blockchains!

In an interesting discussion that we were having with our banking client, their insurance department kept bragging about the state of the art technology that they were building. Head of Insurance was eager enough to call it InsurTech enabled and very sophisticated. However, surprisingly when I mentioned IoT and Blockchain and how it could impact the sector, the person drew a blank ( Well, to be fair, he did mention that he had heard it before, but isn’t that what you see when you are in-front of several peers)

I was curios to see how the sector in general thinks and this report from PWC does confirm to the bias that i had.

screenshot-from-2016-11-28-19-31-23
PWC Global Fintech Survey 2016

As you would see, Blockchain does find a mention even though it is a much much lower than what you would expect. Insurers, like banks, are intermediaries and, at first glance, there is great potential for insurers to use blockchain technology to streamline payments of premiums and claims.

Aso of today, Actuaries and underwriters are now heavily dependent on the data. This data can be brought to them from a lot of sensors now. For example in telematics, insurers are using data from sensors to price motor risk more accurately, reducing the premiums of young safe drivers, and this technology is spreading to other types of cover, such as home insurance.

Till date, Insurance sector, amongst other similar sectors is ridden by huge unaccountable losses in light of fraudulent claims.

As Deloitte mentioned,

In a typical motor insurance scam, for example, drivers deliberately stage or cause an accident or even pretend to have had an accident, and
claims are then made by the various criminals involved. These so-called ‘crash for cash’ scams cost the industry around £400 million a year. 4 Where claims are made against multiple policies held by different insurers, it becomes difficult to detect the fraud unless cross-industry data is shared.

We have been setting the stage a lot for blockchains but how does it help?

Now the way to get around this with blockchains is by building Smart Contracts. These contracts can manage claims in transparent and immutable manner. Both the contracts and claims would be the part of a blockchain. If there is one accident and the claim for that has already been raised then it cannot be claimed again because the chain would have a record of that. Again since this is a decentralised chain, nobody can just goto a central authority and make a change to the claim and re-trigger it. (Haven’t you heard of that friendly claims agent who tells you to file the claim and that he would take care of it or that friendly bank agent who assures that he has access to the main frames to fix your credit history?)

Smart contracts with IoT is a huge win for the insurance and the financial industry in general. With identity management being embedded in the smart contracts the situations for Crash for Cash would be long gone. Further this would be a blockchain which would be public (ideally) or private but shared within the insurance sector then all this information of a person who would jump from one insurance company to the next and not share all the information would be a distant past.

According to PWC,

Reinsurance expense ratios are typically 5%-10% of premiums. Our analysis of the potential for both more efficient data processing and reductions in claims leakage and fraud indicates that blockchain solutions could remove 15% to 25% of expenses, so delivering an industry-wide saving of $5-10 billion. And faster placement and settlement opens the way for a significant boost in client satisfaction and retention.

With blockchains, there would be a win in terms of processing, opportunities for new business lines and immense transparency which has been a thing of the past for now amongst insurance companies. With all companies sharing their information on the blockchain, it would be a different world in which legitimate insurance claims would help bring the cost of insurance down and add value to everyone.

If this sounds interesting then get in touch with us and we would show you how your company can win with blockchains.

Quick example of a block in a blockchain

Further to our earlier post, which describes the data structure of a block in the blockchain, here is a quick example of what does the block look like

 

screenshot-from-2016-11-28-18-09-25

Relating it back to the post, it contains the

  1. Size, Version, Bits and Height in the chain as to where it belongs
  2. Number of transactions
  3. Merkle root
  4. Timestamp
  5. Link to the previous block
  6. Mining Difficulty
  7. Nonce
  8. And a list of all the transactions in the block.

Again, each transaction has the following format

Screenshot from 2016-11-28 18-16-28.png

Again as per the details in the earlier post, amongst the technical information, it contains the size, mine time and the block that it is a part of , along with the details of the coinbase in input and output.

BlockChain Internals: Data Storage

A BlockChain is a public ledger that create a digital ledger of transactions and share it among a distributed network of computers. BlockChain uses cryptography to allow each participant on the network to manipulate the ledger in a secure way without the need for a central authority.

BlockChain is just an data structure i.e. how logically data can be put together and stored. BlockChain in context of data structure is similar to Book. Lets take a look how BlockChain stores data :-

  • BlockChain uses Merkle Tree to Store the data in distributed manner.
  • You can think a Block as a page in the Book. just like a page contains header and content similarly Block also contains Header and Content.
  • Header contains the data about the block (we will read later).
  • Content contains the transaction data and data related to mining rewards.

Header of the Block :-    Header of the Block stores the following informations :-

  • Technical Data :- it contains Version , size of the block  and Magic ID.
  • Previous Block Hash :-  it contains hash of previous block header generated by 2 times applying SHA256 algorithm.
  • Merkle Root :-  it contains the single hash of the Block.
  • Time Stamp :-  it contains the time stamp when the block is created.
  • Difficulty Target :-  this data is related to mining how hard it is to mine the block.
  • Nonce :- A random number.

After the Header There is another part of the block that stores the Transaction count i.e. the total number of transaction this block stores.

Content of the Block :-  Content of the block contains the following informations:-

  • Coinbase Transactions:-    this contains the data related to mining reward, processing fees. its special type of transaction where there  is no input and from address.
  • BitCoin Transaction :-   this contains all to information related to all the transactions.

Transaction :-   Each transaction is the bitcoin payment. Each transaction contains the following informations :-

  • Technical Data :-  it contains Version number, Transaction lock time, Input count and Output Count.
  • Inputs :-   it contains the information about which coin are being spent. it includes Sequence number, script data, input script length, Previous transaction hash and index.
  • Output :-  it contains the information about who is getting the coin. in includes Output script length, Amount and output script.

These are information that are stored inside the Block of the BlockChain. Block contains lot of Hashes of different values thats makes it kind of immutable.

Each Block contains the reference of the previous block so, each block is connected with other block in chain like form which is more similar to pages link to each other in book.

Are we really eliminating central authorities with blockchain?

There is a lot of promise around blockchains. While we at DeepChains do subscribe to the philosophy and would be eager to provide business solutions to meet the industry needs but there has been a lot of double talk, it seems with blockchains.

The premise of blockchain is the following

  • No central registration – No big papa.
  • Decentralized – there is no single point of failure.
  • Safe – Encrypted and secure.
  • Private – My data as an individual is not held by a central authority. I choose what to share
  • Secure – end-to-end encrypted communication routed over Tor.
  • Open – Open source code

However, for all the so-called currency exchanges, this does not seem to be the case. Let us understand the premise of Bitcoins philosophy first. If you look at the image below, we are trying to get rid of any central agencies,

screenshot-from-2016-11-27-13-37-34

We are trying to get rid of any paperwork that needs to be submitted to these central agencies which make me share more information than what i need to.

Screenshot from 2016-11-27 13-38-03.png

and I need to be working without any central control in a true P2P manner.

screenshot-from-2016-11-27-13-41-19

However, let us cut to the current state of things with any blockchain enabled exchange that we are talking about. The current set of exchanges work on the concept of centralisation. They would become the man in the middle instead. So now we take out the banks but we have these men in the middle which would peddle less money than the traditional banks but peddle nevertheless. They would keep your information and subver the ideal blockchain model.

Screenshot from 2016-11-27 14-56-32.png

Let us take the example of a leading Bitcoin exchange called Unocoin in India. It provides a valuable service for converting Bitcoins into currency of choice but it does charge a fee. It asks me to store by Bitcoins in a wallet that it gives me and also asks me to submit a lot of information about me including some of my key identities (which is probably required by the law of the land). Let us see how it defeats the purpose on the parameters that we discussed.

  • No central registration – It is Central
  • Decentralized – Single point of failure. If Unocoin is down, i cannot transact
  • Safe – Encrypted and secure. Probably true.
  • Private – My data is held in central repo. I cannot decide what i need to share and what not to share.
  • Secure – Yes
  • Open – No

So as we see it fails to deliver some of the credible requirements from the original philosophy. Also, since there are so many central exchanges present, it almost ends up being like banks competing with each other on their exchange rates and you have to do the homework to get to the right one. I have seen so many videos and tips on how to buy on one exchange and transfer to another and then sell it on another exchange so that you can get the best leeway.

So essentially, YOU (A) as a person cannot decide how much you would want to transfer to another person (B) exactly the way you would want to. You would have to go through an intermediary (central system) to make the transfer happen. Ideally, we would like to see  NO CENTRAL system and the money should just be transferred form computer to computer on a P2P network. Something like this

Screenshot from 2016-11-27 15-11-36.png

In support of this paradigm, Bitsquare seems to be working on this model with a software which works. This seems to gel well with the idea of actual decentralisation.

In the next few blogs, we would be looking at these differences in detail but for now a lot of new exchanges are spinning up which seem to be creating pseudo central agencies rather than decentralised ones.

Keep tuned.


References and image courtesy:-

[1] https://bitsquare.io/

[2]https://blockchainedu.org