For most of us, blockchain is just a virtuous technology that holds the key to flip around our current business and economy models to lay a more efficient foundation for them. Words like decentralisation, consensus protocol, fault tolerance, and digitisation are often thrown around when talking about blockchain technology.
Amid all this technical discussion, the one thing that we often overlook is the unlikely and rare cross over of technology and philosophy that happens in the background of blockchain. One of the three pillars of blockchain technology, consensus, relies on the philosophy called determinism.
The concept of determinism says that every event or every action that takes place is purely due to a set of previously happened events or actions. And there cannot possibly be any other way things could have happened.
The earliest discussion about determinism has been found to date back to the 6th Century BC. But beyond its philosophical significance, determinism plays a fundamental role in blockchain’s ability to approve transactions in a secure manner.
Blockchain and determinism
The very reason why so many technology enthusiasts and innovators are leveraging the potential of blockchain technology solely lies in the fact that blockchain is extremely deterministic. What do we mean by that? Let’s see:
Blockchain is known for carrying out transactions in a transparent and highly secure way. These transactions are approved by blockchain nodes, who have the exact same copy of the complete blockchain ledger — or technically called the “state” of the blockchain — at any given time. The “state” of the blockchain refers to the data contained in the blockchain ledger and a new state is achieved every time a new transaction is added to the blockchain.
No node on the blockchain can have a different state compared to the rest of the network. This is only possible when each node can produce the same result for the same input at any point in time. And as blockchains are transparent, any node that tries to manipulate the state can easily be noticed and thus, disregarded, keeping the integrity of the system intact.
This makes blockchain a system that supports only one version of the truth and thus, makes it deterministic. And due to the deterministic nature of blockchains, every operation carried out by smart contracts and other applications on a blockchain must be deterministic too. Otherwise, it would be impossible to reach consensus and approve transactions.
By deterministic smart contracts, we mean that each node on a blockchain network must be able to fetch the same results for a given input at any point in time for a contract method.
This brings to light a common issue developers face while coding smart contracts for blockchain: coding deterministic smart contracts.
Most programming languages we know today are non-deterministic. Hence, if developers code their smart contracts on non-deterministic programming languages, they must take extra care to avoid non-deterministic sources. For ease, however, most developers choose a deterministic language such as Solidity on Ethereum.
Determinism is an interesting concept quite skillfully integrated into the blockchain technology that is driving us towards a more digitised and decentralised future. While it certainly creates some hurdles for developers to create smart contracts on a blockchain network, determinism is what renders blockchain its true value.