Blockchain consensus protocols and how to use them?

A consensus is a dynamic way to reach an agreement in a group. It is done with an aim to benefit the entire group as a whole. The method through which consensus decision-making is achieved is called “consensus mechanism.”

Now, which consensus protocols should be used for a wavering entity like blockchain?

As understood, blockchain is a decentralized peer-to-peer ledger without a central authority or a leader controlling it.  It creates a system which is devoid of corruption from a single source. In blockchain, independent nodes in the network must come to a consensus on the ledger status. This consensus mechanism ensures that all participants of a distributed ledger are on the same page.

Below are some standard consensus protocols used in the crypto space and their working:

Proof-of-Work ( PoW )

Bitcoin’s creator, Satoshi Nakamoto, invented the proof-of-work protocol. Going by the protocol’s name, the mechanism requires nodes to prove the work that has been done to have the right to add a new transaction to the blockchain. The transactions are done by ‘miners’ who solve cryptographic puzzles to “mine” a block to add to the blockchain. When a miner solves the puzzle, they present their block to the network for verification and in turn receiving the newly created cryptocurrency unit provided by the protocol as a reward. This entire process is energy intensive as it involves the nodes hashing data through high-performance, application-specific integrated circuit (ASIC) chips. Proof-of-work involves high computation energy and electricity which makes it an expensive process.

Proof-of-Stake ( PoS )

Proof-of-stake differs from the proof-of-work protocol. In this consensus algorithm, mining new blocks become easier for those who hold the highest amounts of the cryptocurrency. In other words, a proof-of-stake system requires the user to show ownership of a certain number of cryptocurrency units. The miners or creators of the new block are chosen randomly. It depends on the user’s wealth, also defined as ‘stake.’ In the proof of stake system, blocks are said to be ‘forged’ or ‘minted,’ not mine. Forgers are referred to users who validate transactions and create new blocks in this system. Validation of a transaction and creation of a new block requires the forgers to put their coins at ‘stake.’ Proof of stake protocol is a lot more resource-friendly than proof-of-work.

Proof-of-Capacity (PoC)

Proof-of-Space or proof of capacity algorithm uses the existing free space on hard drive to mine coins. Its very nature makes it more decentralized and low on power usage. Assigning more hard drive space will allow users to have more “plots” of data. The nodes receive a reward in the form of the native coin depending on the space made available by the nodes to the network.

Proof-of-Burn ( PoB)

Proof-of-Burn is consensus protocol which is an alternative to Proof-of-Work and Proof-of-Stake. In this algorithm, the coins are sent by the miners to an unspendable address ( eater address), and efficiently burning them. The burnt coins cannot be accessed an spent again. The idea behind burning a cryptocurrency is that the user is willing to undergo a short-term loss for a more long-term investment. Users are rewarded over time as they earn a lifetime privilege to mine on the system. The more coins a user burns, the higher the chance he or she will have of mining the next block. Proof-of-burn works like virtual mining.

Delegated Byzantine Fault Tolerance (DBFT)

The Byzantine alternative or distributed Byzantine Fault Tolerance algorithm is named after the Byzantine Generals problem. It addresses the issue of achieving consensus in distributed systems. DBFT recognizes two kinds of participants in the blockchain ecosystem: professional node operators or bookkeeping nodes, who run nodes to make money; and users who are just interested in making use of the blockchain. Delegated Byzantine Fault Tolerance utilizes this division of labor to provide better security for blockchains. The professional node broadcasts its version of the blockchain to the network. If 66% of the other nodes agree with the information, a consensus is achieved. When the consensus is not reached, there is an appointment of a different professional node broadcast its blockchain version until a consensus can be established.

Public Blockchains to secure Global Assets

It won’t be wrong to say that Blockchain technology is transforming our world, it is the invisible force which is changing the way business runs. Blockchain has become a buzzword. You might not be able to see it or touch it, but you can feel its impact. We can say that blockchain is the answer to the question: “How can we trust what happens online?”

What is blockchain?

The blockchain is a distributed ledger which has all the transaction stored in chronological order. It is decentralized and is visible to all the people in the network also known as nodes. Thus, making it a highly transparent and trustworthy. It is because of these features that blockchain has become a popular concept underlying the foundation of the modern system.

Well, our perspective of discussion in this blog is how public blockchain secure global assets. I will cover both these points separately.

Let’s begin with digital assets-

When it comes to the prominent applications of the blockchain, then digital asset management is the new entrant in the league. The next question that pops u os how does blockchain play a vital role in this. The answer is that it reduces the need of intermediaries between issuer and consumers. It also decouples the task related to asset management like transaction processing, issuance, establishing users’ identities.

What are digital assets?

There is a recent trend emerging in the market with the name digital assets. To understand blockchain in a better way, you must realize the compact of digital assets.They are a decentralized currency which can be earned and exchanged on the internet. It omits the need for third party or verification. Also, there is no need for an additional fee which is otherwise associated with physical currency.

In this blog we are talking about the use of blockchain for digital assets, it is a platform for digital assets. Bitcoin is the most popular digital assets. Today we are witnessing the use of blockchain in different business niches, and digital assets is one of them

Using the blockchain infrastructure for digital assets can solve various uncertainties which are associated with digital asset management. Some of the problems which can be easily sorted with blockchain include the following :

  • No counterfeit
  • Immutability
  • No intermediaries and ease the transfer process
  • Transparency
  • Auditability
  • No overhead related to transaction processing

What are the challenges with the traditional digital assets?

Fragmented ecosystem – The issuer of the digital asset has a custom process for managing, distributing and tracking the assets.

Poor control of the secondary market – Difficult to identify if the assets are genuine and or counterfeit.

Poor record keeping – This is the most common problem associated with the traditional method, it’s challenging to keep a consistent record of all the practices between the sellers.

Centralized solutions- It can be biased and may result in conflict of interest

Blockchain

The Blockchain technology holds a promising future and immense potential to cut down the problem posed by the traditional system. Blockchain can replace the conventional banking and financial institutions with a peer-to-peer system which works at the backend.

There are two types of blockchain: Public and Private.  Although their objective of both is the same, the difference arises in their functionality. Here I will be highlighting them and how they differ.

  • Public blockchains – As the name indicates public, it means that the blockchain grant read access and ability to create transactions to all the blockchain users. In simple words, the user can transfer value without the expressed consent of blockchain operators.
  • Private blockchains – In case of the private blockchain, the read access is limited to only predefined auditors.

Properties of public blockchains 

  • They are easy to entry and exit
  • Openness
  • Transparency
  • In-built precautions

How will public blockchain emerge as a solution to the problems above of traditional digital assets?

I have already mentioned that there are two types of the blockchain, public and private. The security of public blockchain comes from proof-of-work making it almost impossible to fake or reverse transactions. The security of a public blockchain like Bitcoin comes from its proof-of-work, which makes it mathematically impossible to fake or reverse transactions.

To put it simply, public blockchain can simply send and receive a transaction from anybody. Another good point of public blockchain is that every node can audit the transactions thus, making the system transparent and secure. Since each node on public blockchain has as much transmission and receipt power as any other node, they are decentralized and distributed.

Electronic money is one of the categories of the digital asset. Here the asset is a claim to real-world currency. Paypal, Google Wallet, etc. ate centralized electronic money system. This system works password-based authentication which is vulnerable to attack like phishing. Here comes the role of Blockchain-based ledgers. They provide a great alternative to the centralized digital asset management system. It cuts down the need for various tasks which are performed by the centralized system in the following ways :

Transaction processing: Various nodes in the network do this work in a decentralized way.

Securing user’s funds:  It is done by third parties using non-custodial and custodial wallets.

Identities of services: It is achieved by building public key infrastructure based on blockchain

Blockchain provides a decentralized digital asset management model which is less demanding for the issuer, services, and the customers.

When we talk about any online transaction or dealings, the primary question that pops up is the security of information. We have seen digital assets use cases in various business verticals like shares, coupons, etc. Merging this with the public blockchain which is a very open and transparent infrastructure, can create a system which highly secure.

I will take a simple example here of exchange of financial securities. If something is decided between the two parties and this transaction or data is stored in public blockchain. This information is visible to all and thus, unalterable. In case of the public blockchain, the time taken for transaction or exchange conformation is lesser than the private one, thus ensuring the exchange of digital asset at a faster pace.

Conclusion-

Digital assets on blockchains can prove to be effective in established financial services and on consumer-to-consumer and IoT market. The digital assets can be used in a variety of applications like crowdfunding, peer-to-peer lending, smart property, digital subscription, and event tickets. With the aid of blockchain, it could facilitate the asset management. It could help in reducing cost and expanding the reach of e-money services. To sum, I can say that public blockchains can create a ubiquitous environment for the Internet of Value (IoV), with digital assets being the core of it.

Bitcoin versus Multichain versus Ethereum

Do you know what is common in Bitcoin, Multichain, and Ethereum? Its Blockchain, one of the most popular trends of 2017 was Blockchain, and it continues to be rising high in 2018. In this blog, I will be focusing on various Blockchain platform which has become a basis for ensuring quick, fast and safe transactions. The blockchain is a distributed digital ledger which has all the information related to transactions in the form of blocks. Decentralization, immutability, safety, transparency are the key features of it which make it a versatile technology finding use in almost all the business niches.

Popular Blockchain Platforms:

Here I will be highlighting on some of the most popular platforms of this technology which include the following :

  • Multichain
  • Ethereum

Bitcoin- If it about Blockchain then how can we miss Bitcoin. Blockchain came into the picture because of Bitcoin. It is the cryptocurrency which is entirely decentralized, open-source and censorship-resistant. 2008-2209 is the year that marks the surge of Bitcoin. Soon after the launch Bitcoin became a popular alternative medium for the peer-to-peer transaction.

Bitcoin’s mining is done on Bitcoin’s Blockchain. When we are talking about Bitcoin Blockchain, then there are thousands of bitcoin nodes on the Blockchain which equally participate in verification of the legitimacy of the payment. All these nodes work independently and don’t need third-party interference.

It is an open network. It is the pioneer of Blockchain which has further given rise to many other open-source platforms that I will be highlighting further.

 

Ethereum- Ethereum is a cryptocurrency and also offers an open-source platform. Similar to Bitcoin Blockchain, it is also a decentralized platform which runs smart contracts. It was in July 2014 when Ethereum came into existence. Many people claim that Etehreum is just vaporware where everything still exists in theoretical format. However, its supports claim differently.

It allows developers to create stored registries of markets, debts, move funds as per the instructions gave in the past.

Well, if you think that Ethereum is just digital money, then you must know that it not only handles accounts and transactions but at the same time it also stores the information of new programming logic.

Let me explain the programming logic with this example:

Let’s say that on July 10th A transfers some money to B’s account if only Account A has more than $y. If not then don’t transfer $y to B.

Such programming logic is written, stored and executed on Ethereum Blockchain which is not the case with Bitcoin Blockchain. Hence, Etehreum is also known as a programmable cryptocurrency. Once this programming logic gets stored on Ethereum, it can be used for future reference.

So, we can say that with Ethereum you can not only transfer the money but also execute smart contracts and make DApps. All this takes place on EVM or Ethereum Virtual Machine with the help of Solidity. Solidity is Ethereum’s native programming language which is inbuilt.

Ethereum’s key features include:

  • Ethereum Wallet — it facilitates crypto-assets holding, writing and such smart contracts
  • Can be used for creation of cryptocurrencies
  • Creation of DApps
  • Creation of democratic autonomous organizations or DAOs
  • Supported languages- Python, Go, C++
  • Consensus mechanism: Ethash, proof of work but now planning to move to a proof-of-stake.

 

Multichain

It is a platform for the creation and deployment of private Blockchains. It can be within the organization or between the organizations. Multichain is an open source Blockchain platform which is based on Bitcoin’s Blockchain but is an enhanced version of the same. In case of Bitcoin, anyone can connect and transfer the assets on the chain; however, if we talk about Multichain then first you need to configure multichain at every node. Only after this, you can transfer the asset.

Key Features :

  • Native multi-currency support.
  • Expected to be faster than Bitcoin
  • Permissioned management
  • Quick deployments
  • Supported languages- Python, C#, JavaScript, PHP, Ruby

The Difference

We know that Bitcoin is a pioneer in digital currency and it has its own sets of benefits. But, at the same time, we cannot ignore the fact that its uses are yet to reach the masses. There is sluggish growth in the Bitcoin does the presence of easy-to-use wallets and the fact that bitcoin can now be used at many mainstream businesses like Microsoft, Overstock, and Dell.

The reason for slow adoption:

  • End-user satisfaction
  • Difficulty in purchasing the Bitcoin
  • The security issues related to Bitcoin
  • The volatility of Bitcoin’s value as compared to government-issued currencies
  • Limited capacity of Bitcoin blockchain, it can only handle 300,000 transactions every day with a block size o maximum 1 MB
  • The Bitcoin blockchain is too open, anybody with the internet connection can connect to the Bitcoin network and transact. There is no screening of the participants.

Multichain, forked from Bitcoin Blockchain lays emphasis n end-user choice allowing the customer to control whether the chain is private or public, who can connect to the network, the target time for blocks, the screening of people who can connect to the network, maximum block size, and metadata. All these features are covered in Multichain and are a solution to the problems which currently exists with the Bitcoin Blockchain.

Apart from function and operational benefits which Multichain has to offer, it covers most use cases for blockchain. Furthermore, it has an easy-to-interact API; there is no need to learn a new programming language. When it comes to hosting solutions Multichain blockchain is cheaper and better than Ethereum. Thus if you are willing to develop DApps, then Multichain is better than Ethereum.

Here is a tabular representation of different between Bitcoin, Ethereum, and Multichain :

Bitcoin Ethereum Multichain
Release Date 2008-2009 July and August 2014. The system went live on 30 July 2015 First alpha release of MultiChain in June 2015
Founder Satoshi Nakamoto Vitalik Buterin

Dr. Gideon Greenspan

 

Type of Network Open Network Public, Smart Contract based Private, Permissioned
Supported languages C++ Python, Go, C++ Python,  C#, JavaScript, PHP, Ruby
Consensus mechanism Proof of Work Ethash, proof of work but now planning to move to a proof of stake.

 

 

The distributed consensus among identified block validators.

 

I hope that this post would have given you a better insight into, Bitcoin, Multichain, and Ethereum. Similar to any new theology, this is also at a nascent stage where we are witnessing new changes every day.

Centralized vs Decentralized Blockchain

Blockchains have garnered interest from investors from all over the world due to their incredible promise of being an incorruptible ledger. When most people think of blockchains, they are referring to the decentralized or public blockchains like Bitcoin which anyone can access and participate in. However, blockchain technology is not limited to being just decentralized as the centralized or private blockchains also have some advantages for corporations over the public ones. Private blockchains are useful for corporations who want to use the power of decentralized ledgers to improve the ongoing function. Let’s take a look at an in-depth comparison of public and private blockchains.

 

Similarities Between Centralized and Decentralized Blockchains

From a technological standpoint, both centralized and decentralized blockchains are very similar as both are distributed peer to peer networks where every node is responsible for storing and securing the shared ledger. Both public and private blockchains require a consensus mechanism (like proof-of-work or proof-of-stake) among nodes to establish a single ledger. Both of these types of blockchains also have to provide upper and lower bounds on the security and efficiency of the network.

 

Differences Between Centralized and Decentralized Blockchains

The biggest factor that differentiates public blockchains from private ones is the pool of nodes that can participate in the network, and make administrative changes to the network. So, for example, Bitcoin which is the largest public blockchain in the world has no barrier to entry when it comes to accessing the ledger and sharing computer power to execute its proof of work algorithm. By contrast, IBM’s HyperLedger Fabric is more customizable in the sense that the organization that is deploying the blockchain has a say in every aspect of blockchain participation. Private blockchains are typically more restrictive in who they allow making changes to the ledger as they use the blockchain for the internal records.

 

Advantages of Decentralized Blockchains

Decentralized blockchains like Bitcoin, which is the most popular blockchain in the world, have very high security because of the enormous amount of mining resources that go in to secure the network. That means to coordinate a successful attack on the Bitcoin network; a malicious actor would have to acquire a massive amount of resources which is economically unviable. Another advantage is that anyone can use the network to send funds to any part of the world without going through an intermediary.

 

Disadvantages of Decentralized Blockchains

Due to their public nature, public blockchains like Bitcoin are susceptible to all kinds of analyses that can reveal more information about the network participants making the blockchain less private. The massive amount of miners mining on the network means that difficulty needs to keep increasing thereby leading to mostly useless computations done by miners to outcompete each other. It is estimated that every Bitcoin transaction costs about as much electricity that is required to power an average home for eight days. Therefore public ledgers are not very environment-friendly.

 

Advantages of Centralized Blockchains

Centralized blockchains offer much more customizability and control over the network to the organization deploying it as they can decide who gets to participate in the network. That means that not as much resources have to be invested in competing to secure the network which makes Centralized Blockchains more environment-friendly compared to their Decentralized counterparts. This also means that they have higher overall throughput because they get to decide the hardware that the network runs on. In practice, this means that corporations could use private blockchains to store sensitive information among nodes that they trust. This allows them to use the incredible power of blockchains without having to make the sensitive information public.

 

Disadvantages of Centralized Blockchains

Since there is not as much computing power securing the network as in the case of decentralized blockchains, centralized blockchains are less secure. It only requires a few of the nodes hosting the network to collude by amassing enough resources to hack the network. Also, since transactions are not publically viewable, it is harder to verify the authenticity of the transactions for an outside party. Also since private ledgers are not available for public use, they are of little use to anyone besides the corporations that deploy them.

 

 

Challenges Faced By Current Record Management

Records Management is an incredibly complex job which is made even more complicated due to the enormous quantities of data that is being generated in the world currently. Record Management involves not only safely storing the sensitive data, but also to making it accessible and making sure that ample copies of it exist if the data is lost. The implications of an incompetent record management system are extraordinary, not only for the organization that suffers from a hack but also for the people whose personal information is compromised. Let’s take a look at some of the challenges faced by record management systems and how blockchains can help.

 

Ensuring Accessibility to Records

Accessibility is perhaps the most critical use case for a records management software as data is no good if no one can access it. To make records accessible, corporations need to digitize records and add metadata to it so that data can be easily searched. Once the database is created, record management also involves managing the rights of access to ensure that no unauthorized access takes place. This involves setting up their servers and employing user access software.

 

Ensuring Immutability and Data Integrity

Data Integrity is a huge aspect of efficient record keeping in this day and age as user data is a very valuable commodity. Large corporations want to acquire this valuable information so that they could use machine learning to identify the underlying patterns in the data to gain a competitive edge. This is also one of the most controversial aspects of records management because it is very hard to make sure that the stored data is secure. The recent Equifax hack is the most prominent slap in the face of records management as hackers were able to steal compassionate information like people’s social security numbers and house addresses.

 

Making Records Easily Auditable

It is essential when dealing with sensitive information that records management provides a way to verify that the data has not been modified or corrupted in any way. That would allow third parties to verify the authenticity of the records independently. This requires additional database infrastructure to safely store the hashes of the data to compare against later.

 

How Can Blockchains Help?

At their core, blockchains are nothing but distributed databases that exist on millions of devices simultaneously. Because of their architecture, they are entirely immutable so for all practical purposes, information stored on a blockchain is permanent. Blockchains can be public or private depending on the nature of the use case. Public blockchains, which are the dominant type of blockchains that exist in the world today are useful because they have no barriers to entry concerning who can participate in the network. All of these properties that blockchains have built in are very useful to record management systems.

  • Accessibility – This is especially true in the case of public blockchains as anyone can participate in the network by sharing their computing resources. Bitcoin, the worlds largest open blockchain, can be used by anyone in the world to send money to any part of the world. Private blockchains can be used by corporations who want to have greater control over who can make changes to the blockchain as they deal with sensitive information.
  • Security – Blockchains by their design have been made so that they are entirely resistant to tampering and censorship. Any changes to contents of the blockchain require a majority of the support which is very hard to acquire due to their decentralized nature. That is why for all practical purposes, information once posted on the blockchain is permanent. This makes blockchains an instrumental candidate for storing sensitive data.
  • Data Integrity Audits – Because of the properties of blockchain mentioned above, they are very effective in checking against possible corruptions in the data. Factom, one of the biggest blockchain based data integrity solutions has developed a unique method of data audits. Factom takes hashes of the entire database at different times and stores that information in their blockchain which is anchored into Bitcoin’s blockchain. Then, if a third party wants to verify that the database hasn’t been modified, they can only do so by comparing the saved hash with the original hash.

Common Misconceptions about Blockchain

The market is abuzz with the advent of the blockchain. It has now become a ‘term’ which evokes strong public opinion, comments- whether valid or not. Let us begin by understanding the term blockchain. In simple terms, blockchain is a technology that serves as an alternative to centralized data storage. Instead of the data being stored on one or multiple servers which are prone to hacks, blockchain is distributed among computers. Radically challenging the status quo, blockchain works on a peer-to-peer verification of transactions. It allows for complete transparency as no single entity can possess the system.

However, the contemporary era is always ‘high’ on misconceptions surrounding any innovation. Just like the introduction of smartphones and internet dazzled the market and ‘legendary myths’ engulfed the mass, the world of blockchain has already created a lot of misconception.

DEBUNKING MYTHS

● The existence of the only Blockchain. Nooooo!

This belief is conclusively false. Although blockchain is commonly compared to the internet, unlike the internet, there are numerous blockchain- each designed to serve a distinct purpose. The common denominator is that they are distributed, have some form of consensus mechanism. Examples could be Bitcoin’s blockchain, ethereum, hyperledger, IBM and Microsoft blockchain, etc.

● Blockchain applications are used for criminal activities. Nooooo!

The collective mass is tied to the belief of cryptocurrencies supporting nefarious activities. It has its roots in the silk road and the dark web along with the mistaken belief of blockchains offering anonymity. While it is true that, to an extent, cryptocurrencies are a virtual boon for drug-trafficking, illegal pornography, and even terrorism, it’s ignorant to assume that it is an untraceable underworld enabler. On the open side, cryptocurrencies are a means to exchange digital assets. Bitcoin being a public ledger, there is always a record of any transaction taking place. The transactions can be traced anytime, anywhere, regardless the purpose of the transaction.

● Blockchain and bitcoin can be used interchangeably. Nooooo!

For beginners and most of the mass, blockchain is always understood as bitcoin and vice versa, creating a lot of confusion.
The blockchain was born with bitcoin, as the underlying technology. Simply put, blockchain is a technology whereas bitcoin is the application based on this technology. What bitcoin is to blockchain is what email is to the internet – its first ‘killer app.’

● All the Blockchains are public. Nooooo!

It is true that bitcoin, along with many well-known blockchains are public, but not all blockchains are. There exist private and semi-private blockchains with varying degrees of penetrability, approachability, and transparency. A public blockchain is open to the public where all the transactions are visible, and anyone can participate at any level. On a private blockchain, only parties with necessary keys can review private transactions. Technically, public blockchains utilize proof-of-work methodology whereas private blockchains use proof-of-stake.

● The Blockchain acts as magical data storage in the cloud. Nooooo!

The working of blockchain and cloud are poles apart. The common misconception is due to their intangibility. A blockchain doesn’t store physical information like PDF files or a word documents. It only provides for a proof-of-existence. Blockchain, conceptually, is a flat file, a linear list of simple transaction records. This ‘flat file’ holds code that certifies the existence of a particular document and not the document itself.

● The Blockchain is used only in the financial sector. Nooooo!

Blockchain technology was highlighted because of the introduction of bitcoin, its first application. Blockchain can be used in numerous areas referencing its implementation; finance incontestably is one of them. In fact, the Indian government is looking forward to employing the blockchain technology in education, health, and agriculture to fulfill its aim of India going truly digital.

● Cryptocurrencies are a replacement to traditional currencies. Nooooo!

As no single entity, corporation or a nation owns or controls the blockchain, it is often hailed as a revolutionary technology. With financial intermediaries,a.k.a middlemen flocking every sphere of our lives, this technology might bring in a new global economy. However, it is unlikely to happen, not anytime soon. The reason accounts for the exorbitant cost of mining, and also that blockchains are not scalable or efficient enough to support global usage. The difference can be seen in the duration of the transaction. Bitcoin can process a maximum of seven transactions a second whereas Visa can process thousands of transactions a second.

The blockchain technology is very much in its nascent stage- or experimental, according to some. The misconceptions mentioned above are few of many, and debunking such myths will provide a field for developers and researchers to produce more viable and efficient solutions. The blockchain technology can transform the society at all the levels. All we need is exploration and experimentation with the aim of a new invention.

Hash Function attacks

Blockchain technology is one of the most innovative discoveries in recent years. One of its core principles is the hash function.

What is Hashing?

Hashing is, simply put, taking an input string of any length and giving out an output of a fixed length.

Cryptographic hashing refers a special class of hash functions with set properties. To be considered secure, a cryptographic hash function needs to include properties such as always getting a consistent result irrespective of how many times you parse through an input, quick computation, and pre-image resistant among others.

In case of cryptocurrencies such as bitcoin, the transactions are taken as an input and run through a hashing algorithm (Bitcoin uses SHA-256) which gives an output of a fixed length.

Each input has its own unique hash. For examples, take inputs A and B where H(A) and H(B) are their respective hashes. It is infeasible for H(A) to be equal to H(B). Infeasible but unfortunately, not impossible.

What is a Hash Function Attack?

A hash function attack is an attempt to find two input strings of a hash function that produce the same hash result. Because hash functions have infinite input length and a predefined output length, there is inevitably going to be the possibility of two different inputs that produce the same output hash.

A hash collision occurs when two separate inputs produce the same hash output. This can be exploited by an application that compares two hashes together (such as password hashes, file integrity checks). However, the odds of a collision are extremely low, especially for functions with a large output size such as lengthy and widespread document formats or protocols but as available computational power increases, the ability to attack hash functions becomes more feasible.

How Does a Hash Function Attack Occur?

There are several ways a hash collision could be exploited. There are mainly three types of hash function attacks:

Collision attack: A collision attack on a cryptographic hash tries to find two inputs producing the same hash value. The attacker does not have control over the content of the message, but they are arbitrarily chosen by the algorithm. In this case, H(A) is equal to H(B).

Pre-image attack: In contrast to a collision attack, in a pre-image attack the hash value is specified.

Birthday attack: The birthday attack is based on the birthday paradox, i.e., the probability that in a set of n randomly chosen people, some pair of them will have the same birthday. Applied to hash function attacks, this means you have a 50% chance to break the collision resistance.

How Secure are Hash Functions?

No hash function is collision free, but it usually takes extremely long to find a collision.

Even if a hash function has never been broken, a successful attack against a weakened variant may undermine the experts’ confidence and lead to its abandonment. In the past, weaknesses had been found in several then-popular hash functions, including SHA-0, RIPEMD, and MD5. These weaknesses called into question the security of stronger algorithms derived from the weak hash functions such as the SHA-1, RIPEMD-128, and RIPEMD-160.

Also, there are applications of cryptographic hash functions that do not rely on collision resistance. This means that collision attacks do not affect their security. For example, HMACs are not vulnerable. For the hash attack to be successful, the attacker must be in control of the input to the hash function.

Are hash function attacks something to worry about?

The truth is that it depends on the hash function. Even MD5 and SHA-1 are not completely collision resistant but stronger functions such as SHA-256 appear to be safe for now.