All posts in "Fundamentals"

In this post Shawn Dexter explains why the Ethereum Constantinople Hard Fork was delayed. He states the reason for the delay and any actions you many need to take in response to the delay. Shawn also explains security vulnerability called a Reentrancy Attack and how it was also used in the DAO Attack of 2016.

Constantinople Hard Fork Delay

Unfortunately, the long-awaited Ethereum Constantinople Network Upgrade has been delayed. An auditing team discovered that the upgrade to Constantinople would introduce a security vulnerability. Before we go over the security vulnerability, let’s quickly answer a couple of questions I’ve been getting.

What do You Need To do?

This depends on whether you’re simply an investor/trader or if you’re a miner or node operator.

Do you need to do anything with your Ether?No – if you’re simply an investor, just sit tight. You do not have to do anything with your Trezor, Ledger, MyEthereumWallet (MEW). So, watch out for scammers who may try to confuse you.

2.Do I need to upgrade my node? Yes – if you’re a miner or node operator you will have to upgrade to a new version of Geth or Parity before approx. 4am Jan 17th GMT.

What was the Security Vulnerability in Constantinople?

Quick Answer: The security vulnerability arises from the update that introduces Cheaper Cost Of Storage [EIP1283] that we discussed in our Constantinople Simple Explanation post.

The cheaper gas costs allowed for an exploit in the Smart Contracts. This particular exploit is called a “Reentrancy Attack”.

What is being done about it?

It's already in the process of being fixed. The developers hoped that they could fix it before the network upgrade, but these things need time for proper analysis. They decided to err on the side of caution and postpone the hard fork until they fully investigate the extent of the vulnerability.

What is a Reentrancy Attack?

I’ll give you guys a simplified explanation. A Smart Contract may communicate with an external Smart Contract by “calling it”. If the external Smart Contract is malicious, it may be able to take advantage of this and take over control flow of the first Smart Contract’s code.

This allows the attacker to make unexpected changes to the first Smart Contract’s code. For example, it may repeatedly withdraw Ether from the Smart Contract by “re-entering” at a particular spot in the code. (Essentially, it makes multiple invocations of the withdrawBalance() function)

A Reentrancy Attack allows an attacker to take over control flow of the Smart Contract in concern.

Note:It’s important to note that this security vulnerability does not exist in the current Ethereum chain. All Smart Contracts on the current chain are Reentrancy-Safe!

The introduction of cheaper gas costs allows for the reentrancy attacks to be viable. Since Ethereum has not made any software upgrades yet, the main Ethereum chain is not at risk in any manner. In fact, even if the upgrade to Constantinople occured, only a small number of Smart Contracts would have been vulnerable.

So – Is this a bad thing?

Yes, and no. Yes – if you were making your investing/trading decisions solely based on this event. In a previous article we warned about how unpredictable price movement can be closer to events.

But overall this is a great thing for Ethereum – and for long term investors. Catching this security vulnerability right before the network upgrade is a gift. If Constantinople went live before and if the security vulnerability was discovered by malicious attackers, then things could got far worse!

Let’s not forget the disaster of the 2016 DAO Attack – which was actually caused by attackers exploiting code that was vulnerable to a Reentrancy Attack!

Lest We Forget: The DAO Attack of 2016

Many of you may not be aware of the DAO Attack of 2016. Attackers used a combination of two types of Reentrancy Attacks: Single Function & Cross Function.

The attackers were able to siphon 3.6 Million Ether from the DAO Smart Contract to their own accounts. Fortunately, the Ethereum community decided to Hard Fork and restored all the funds to the original Smart Contract. However, this led to a lot of controversy and led to the infamous Ethereum and Ethereum Classic network split.

Up to today, Ethereum bears the stain of the DAO controversy – albeit fading with time. It would be a disaster if it were to happen all over again.

Overall – This Is A Good Thing

The fact that this vulnerability was detected by a third party team – ChainSecurity – speaks to the network strength that Ethereum has built over the years. Ethereum has a global development strength that made itself a powerhouse. Multiple teams across the world are working on finding improvements, flaws & vulnerabilities. These are flaws that could sink other projects if gone undetected. The Ethereum community, on the other hand, is showing its strength.

Sure, prices may take a hit for the short-term. But like I said, it could have been far worse. In the long run, this delay will be forgotten. A security breach (and possible contentious hardfork that would follow) would never be forgotten.

Introduction

In a previous post we discussed the Ethereum Roadmap for the coming year. One of the key milestones on the roadmap update was the Constantinople hard fork. Constantinople was initially scheduled for 2018. However, due to inevitable software development delays, Constantinople was pushed to early 2019. That being said, the wait has definitely been worth it.

Ethereum Roadmap: Byzantium, Constantinople, Serenity

Constantinople has been much awaited by the community primarily because of the Block Reward reduction. The Block Reward reduction effectively reduces the inflation rate of Ethereum. I explain how in a simply post here: Ethereum Inflation Rate & Difficulty Bomb However, aside from the Block Reward reduction, there are few other exciting improvement updates in Constantinople which is scheduled for Jan 16th 2019.

In this post I will explain these updates simply and briefly! 🙂

Ethereum Constantinople: What Is It?

So what exactly is Constantinople? Is it a Hard fork? If so, will you be getting two coins? (like all the other hard fork fiascos?) Yes, Constantinople is a Hard fork - but you won’t be getting two coins. Unlike the other fiascos, this isn’t a “contentious” fork. To understand this, let’s go over a couple of terms quickly & simply:

What is a “Hard Fork”?

A “fork” is simply when the blockchain undergoes a software update. The fork may require all participants (primarily nodes & miners) to update their software to be part of the same network. This is because the software update is not compatible with the older version. This is called a “hard fork”

What is a “Contentious Fork”?

A contentious fork is when participants do not agree with software updates. In this case, they may choose to either stay with the old software or implement their own updates. Essentially, they choose to go their own way because they don’t agree with the direction of the core team (yay, democracy!) This causes a “fork” in the original chain, and two new chains will begin to exist independent of each other.

Constantinople: Not A Contentious Fork

Fortunately, Constantinople is not a contentious fork. Everyone (for the most part) is on the same page with the proposed software updates on the Ethereum Blockchain. So what are the updates? In the next section I will provide a simple overview of the Ethereum Constantinople 2019 Hard fork!

Constantinople: A Quick Overview

The Ethereum Constantinople 2019 hard fork marks an important milestone in Ethereum’s transition from Proof of Work to Proof Of Stake (Casper).

As mentioned in the previous section, the Constantinople hard fork is simply a software update. The software update will have improvements that have been accepted by the community. These improvements were proposed ahead of time and are simply called “Ethereum Improvement Proposals” (EIP). There are five of these Ethereum Improvement Proposals that will be included in the Constantinople Update for Jan 16th 2019.

Ethereum Constantinople: EIP1234, EIP145, EIP1052, EIP1014, EIP1283

Performance Improvements:

Block Reward Reduction ← A BIG ONE!

Cheaper Smart Contract Execution

Increased Efficiency on Verification of External Smart Contracts

State Channels!

Storage Cost Improvements

[EIP 1234] Block Reward Reduction: “The Thirdening”

This is the big one that everyone was waiting for all of 2018. The update falls under the EIP1234 proposal and will have two major changes:

Block Reward Reduction

Delaying The Difficulty Bomb

I explain both of these in more detail (with simple analogies) in this post, but I’ll go over them quickly here as well.

Block Reward Reduction:Constantinople will officially mark the reduction of the rewards issued to miners from 3 ether to 2 ether. This effectively reduces miner rewards by ⅓ and is often referred to as “The Thirdening“. This reduction in Block Rewards will significantly reduce the inflation rate of Ethereum.

Difficulty Bomb: Miners are issued rewards each time they successfully add a new block onto the chain. The Difficulty Bomb is a tool within the EVM that the developers can use to adjust how difficult it is for the miners to do this. If the bomb “detonates”, it will get exponentially harder everyday for miners to find blocks. This was put in place to incentivise miners to transition from the Proof Of Work Chain to the Proof Of Stake Chain.

So why delay? Well, two reasons:

Ethereum is not moving to Casper just yet - so there’s no reason to incentivise the miners to stop mining here just yet.

The inflation rate has already been reduced by decreasing the issuance rate.

[EIP145] Cheaper Smart Contract Execution:

Constantinople will include the EIP145 proposal which will introduce “Shifting operators” to the Ethereum Virtual Machine. Put simply, this will allow Smart Contracts to initiate certain instructions for only 3 GAS compared to the 35 GAS it would have costed without the Shifting Operators.

This is a drastic reduction in the cost of these operations and contributes to Ethereum’s efficiency improvements.

This is another key efficiency improvement in the 2019 Constantinople update. Smart Contracts often need to perform verification checks on other Smart Contracts. Currently this is done by copying the bytecode of the external Smart Contract and then performing the needed verification. However, this can unnecessarily expensive when dealing with large Smart Contracts. EIP 1052 tackles this problem by introducing a new function that will allow the Smart Contract to pull a hash of the bytecode instead. This will make verifications far more efficient.

[EIP1014] State Channels!

The Ethereum Constantinople 2019 Update will also include a keystone update for State Channels in Ethereum. EIP 1014 will allow interactions be made with addresses on the main chain that don’t exist yet. This may sound confusing but is a key milestone for the implementation of State Channels. The goal of State Channels is to have as little load on the main chain as possible while still remaining secure. Unnecessary calculations and processes will take place off chain – thereby increasing the efficiency of the main Ethereum chain.

[EIP1283] Cheaper Cost Of Storage

Constantinople will also include an update that will reduce the storage costs in Ethereum. EIP 1283 proposes a change to how gas is charged for EVM storage operations. The primary initiative of this proposal is to reduce excessive gas costs where unwarranted. And to enable new use-cases for contract storage.

With this, transactions that are making multiple updates to the same storage slot will cost significantly less!

Ethereum Constantinople Update 2019: Conclusion

​​​Ethereum’s soon approaching Constantinople hard fork, while significant, is still only a piece of the larger puzzle that is Serenity – Ethereum’s transition to Proof of Stake.​​​

Updated Ethereum Casper Release Dates (2018 Estimates]

While Constantinople brings about a reduction in miner block rewards (EIP 1234), it must be noted that the hard fork is notaContentious Fork. All 5 EIPs within Constantinople gained majority approval across the Ethereum community as a whole, thus will not result in two coins after the hard fork on January 16, 2019.

In this post Shawn breaks down the Radix Coin (RDX) as a stable and scalable cryptocurrency. He discusses Radixs' novel economic approach to solving the pain point of crypto price stability for consumers and businesses.

Radix Coin – An Intensively Scalable & Stable CryptoCurrency

Radix DLT is beginning to garner increasing attention in the crypto-space. Radix rose from an obscure and exotic "coin" in 2017 to one of the most discussed technologies in 2018. Every week, I receive several questions on Radix’s Scalability & Sharding or on their Tempo Consensus Method. But one of the more common questions goes something like this:

"Hey, what are your thoughts on the Radix Coin ? "​

It recently dawned upon me that while I’ve discussed Radix’s infrastructure, I haven’t really delved into the “Radix Coin”. While Radix does indeed sport a crypto coin, it is so much more than that. Radix DLT is a fully fledged distributed ledger technology platform. The platform will feature decentralised applications, mass scalability, and of course, the Radix Coin as well – 'RDX'.

In this post, however, we focus our discussion on the Radix Coin (RDX) and its purpose in revolutionizing the digital economy. If you’re interested in the Radix DLT Infrastructure – mainly its Consensus and Sharding approach, then you can read the following introductory & simple explanations:

The following sections will discuss how the Radix Coin will serve and benefit from the Radix DLT infrastructure.

Radix (RDX) As A Stable Coin

The Radix Coin will be the token used on the Radix DLT platform to fuel various operations. However, the coin and the platform have special features that make the dynamic rather interesting. The Radix coin will be a relatively stable coin. Notice the word "relatively" – this is key. Several people mistaken the Radix Coin to be a stable coin. This can lead to confusion – especially for interested investors.

Radix DLT designed the RDX token so as to have low-volatility. In that vein, the Radix Coin will initially be pegged against the US Dollar where 1 Radix Coin will be equivalent to $1 USD. However, after a certain period, the price of the Radix coin will float free. Low-volatility and relative stability will be maintained by increasing the supply of the coins.

“Wait, what the… what do you mean by ‘increasing’ supply of the coins? “

Don’t worry – we’re not talking about ‘Supply inflation’ here. Radix DLT will be using an algorithmic model that will monitor demand and accordingly increase as well as decrease the total supply of the Radix Coin at regular periods. The low volatility of the Radix Coin will help facilitate mass adoption. And the flexible supply should satisfy investor needs as well.

In the following sections, we will discuss how investors and merchants both benefit from this flexible supply system.

Radix Coin for Investors - Should Investors Worry?

Upon first hearing “stable coin”, cryptocurrency investors are immediately skeptical. After all, why invest in something if it’s going to be stable in value? This is an understandable concern since we’re conditioned to the volatility of cryptocurrencies. The Radix Coin, however, functions sort of like a Bond with a variable interest rate. The value of each Radix Coin may not rise and fall substantially. But the investor will receive more RDX at regular intervals which should increase his total amount of RDX.

For example, let’s say John has 2000 RDX. At the time, each RDX is valued at around $1.10.

No. of RDX: 2000

Value of each RDX: $1.10

Total Value: $2200

In the coming months/years, the demand for the Radix Coin skyrockets! Now, each of John’s RDX will not increase drastically in value. Instead, the total number of RDX he has will increase. His total Radix Coins will increase to 6000 RDX and each RDX will be worth $1.15 (Remember – the Radix Coin will be relatively stable.)

No. of RDX: 6000

Value of each RDX: $1.15

Total Value: $6900

Note: This is just an example – as details on the calculations have yet to be released.

On the flip side – if the demand for the Radix Coin reduces, the platform has mechanisms in place that will perform a token-burn process to reduce the total supply of the Radix Coin. Again, details on how this process is yet to be revealed. We will all have to wait for the economic white paper that should be released closer to their mainnet launch.

However, we can rest assured that investors don’t have to worry about their investments being “stale”.

Radix Coin for Mass Adoption

Relative Price Stability

One of the biggest reasons the Radix Coin features relative stability is to facilitate mass adoption. Without stability, mass adoption across the world will be near impossible.

As things stand, the general public find it troublesome to hold cryptocurrencies for anything other than a speculative investment. You may hear increasingly more reports of merchants accepting cryptocurrencies as a form of payment. However, most of these merchants are immediately converting their cryptocurrency back into regular FIAT. Why? Well, simply because merchants need to be able to rely on their revenue holding value in the months that follow. Cryptocurrencies are far too volatile to offer the level of reliability that merchants need in order to run an efficient and sustaining business.

Similarly, regular consumers will only hold a fraction of their purchasing power in cryptocurrencies for similar reasons. With the current state of the market, it’s a serious gamble to rely solely on your holdings of cryptocurrencies to pay your rent or mortgage. The Radix coin will safeguard against violent price swings using an elastic-supply. This will allow merchants and consumers to hold their Radix Coins with reduced risk.

Decentralized Transaction Scalability

Scalability has been one of the biggest limitations of current blockchain solutions. Most DLT consensus models have to make the tradeoff between throughput and decentralization. Radix, however, achieves high throughput, security and decentralization using a unique approach to Sharding along with their Consensus Method – Tempo . The Radix DLT platform ensures that every single device can be part of the network and use the Radix Coin to transact with high speed across the globe.

Radix Coin - Conclusion

With "Stable Coins", like the Radix Coin, being the latest talk of the town, its no surprise that investors and enthusiasts alike are blazing with questions on how to seize opportunity on this relatively new crypto class.

The concept of price stability around the radix coin will be primarily based on elastic supply. Depending on the demand of RDX, there will either be a coin issuance to each RDX holder, or a coin burn. While much of the economic structure behind the Radix coin is yet to be unveiled, their scaling solution - Radix Sharding & Tempo Consensus – has been fully implemented and tested.

In this post Shawn breaks down the Ethereum Casper V2 update. He discusses ethereum's transition to Proof of Stake, and how beacon chain fits into ethereum sharding.

Casper V2: Beacon Chain , PoS , Sharding

There’s been a great deal of confusion in regard to Ethereum’s new approach to Casper. Part of the confusion stems from theupdated timeline for Ethereum’s PoS (proof of stake). And the other part of the confusion stems from this new “Beacon Chain” thingy. Yes, I said ‘thingy’.

So, in this post I’m going to try to break things down in an easy manner for you guys. What exactly is the Beacon chain? And what role does it play in Proof Of Stake and Sharding

As usual, I’ll keep it simple – and avoid the unnecessary details.

Ethereum: The Initial Roadmap

Before we go any further, allow me to break down the structure of Ethereum’s Casper V2. There will be three chains that we are concerned with:

The Ethereum PoW Chain

The Beacon Chain

The Sharding Chain(s).

All three of which will be linked together in Casper V2.

Ethereum Casper: 3 Types of Chains

Ethereum PoW Chain

This is the chain that Ethereum is currently using. It’s using the traditional Proof Of Work (PoW) consensus method. In Ethereum’s Proof Of Work chain, miners currently validate blocks by running the PoW Cryptographic Puzzle.

However, Ethereum will be using Proof Of Stake in Casper. Miners will have to transition to the Proof of Stake chain if they want to keep validating blocks for the Ethereum Network. To do so, they will have to deposit 32 Ether into the Beacon Chain. Once they do that, they will become Validators on the Beacon Chain.

Important: Miners are not the only ones who can become validators. Anyone can deposit 32 Ether from the Ethereum PoW Chain to the Beacon chain to become a validator

Ethereum Casper: PoW to PoS

The Beacon Chain

Alright, so the Beacon Chain is where all the confusion stems from. But it’s actually quite simple. The Beacon Chain serves two primary roles

The main Proof Of Stake chain

The base layer of the Sharding solution

To Simplify: The Beacon Chain will link to the Shard Chains and “signal” which blocks from the Shards should be added onto the main chain. The main chain will be validated & finalized using Proof Of Stake. The main chain also resides on the Beacon Chain. The Beacon Chain will also play a crucial role with the Shard Chains. It links up to the Shard Chains to listen for blocks that will be included onto the beacon chain (the PoS chain).

The Sharding Chain(s)

Yes, there are going to be multiple Shard Chains. Remember, Sharding is an attempt to avoid having “every single node validate every single transaction”. This will allow for more scalability. In order to do so, instead of having one single chain, we will have multiple shard chains. I explain Sharding in more detail in this article:Ethereum Sharding Explained Using An Analogy.

Essentially, you can think of the Shard Chain as a group/block of multiple chains. All the transactions will take place on these Shard Chains – and will be split between each shard. The account data will also be stored on these shard chains.

Above, I mentioned the Beacon Chain links up to a Shard. Well, there’s also a link from the Shards to the Beacon chain. This link needs to be attested/signed-off by a sub-group of Validators that will be pseudo-randomly picked.​

Ethereum Casper: PoW to PoS

Ethereum Casper: Validators vs Miners

Casper will be using Proof Of Stake which does not require “mining” to validate blocks. If a miner wants to continue validating blocks on Casper, he will have to deposit 32 Ether into the Beacon Chain like everybody else.

Once 32 Ether is deposited, the person will go into the “Queued Validator” pool and eventually get added to the “Active Validator” pool. Active Validators will be responsible for producing blocks, sign off on blocks and sign off on links (to shards).

Why “Beacon Chain”?

You may be wondering why the Ethereum team chose the term “Beacon Chain?”. The Beacon Chain was originally only part of the Sharding spec. It’s role was (and still is) to link up to Shard Chains and signal which blocks should be added to the main chain.

The Validators utilize the crosslinks between the two chains to “listen” for new blocks on the shard chains. They then sign off on the block and the crosslink if it is to be included on the main chain.

Beacon essentially means “Lighthouse/signal” – and that’s precisely what the role that the Beacon Chain serves.

Disclaimer: I’m sort of taking an educated-guess at this one. To be honest, a lot of the terminology in Sharding & Casper PoS is sorta...confusing (e.g: proposer, collator, validator, committee...come on Vitalik!)

Conclusion

As you can see, the Beacon Chain in the new Casper implementation isn't all that complicated. All you need to know is that it will serve as the foundation for the Proof Of Stake and facilitate the communication via the Shard Chains (via cross-links). You can become a Validator on the Beacon Chain if you deposit 32 Ether from the current PoW Chain. Once you do that, you can take part in the Proof Of Stake consensus process as well. Validation & Finality will take place on the Beacon Chain. Transactions & Account Data will be on the Shard Chain.

Simple, eh? Tbh, maybe all you need to read is the conclusion of this post. Damn. Oh well.

Shawn uses a simple example to explain the concept of blockchain clearing and settlement. He also explains what is blockchain settlement – and why businesses would opt for a blockchain for clearing and settlement of trades & securities.

Why We Need A Blockchain For Clearing And Settlement

Clearing Daily Transactions

The current process for clearing and settlement is wasteful – and blockchain tech is poised to change that. The results will be a net gain for everyone -- not just for businesses, but for consumers as well.

We tend to take our daily transactions for granted. It’s as simple as swiping your credit card or depositing a cheque, right? Wrong. It only seems that way. In truth, every transaction you make is simply a promise. Once the promise is made, a clearing housesteps into facilitate and settle the promise .

The clearing house consists of a plethora of middlemen. They ensure that the finality & settlement of the promise made. And in return for their good-deed, they charge you hidden fees. Ding!

Clearing Trades And Securities

Businesses have to endure these unnecessary fees as well – but on a grander scale. They trade securities that have various risks managed by the clearinghouse. This leads to higher fees. Businesses are then forced to pass these costs down to their consumers. Ding!

We essentially get Double-Dinged! But wait – it doesn’t end there. Since we’re getting double-dinged, we have less money to buy stuff. And because we have less money to buy stuff, businesses lose profit. Businesses now have to either increase prices or close shop. As you can see, it’s just one never-ending loop of economic waste!

However, eliminating the middlemen like settlement Clearing houses has been all but a fantasy… until the advent of blockchain technology.

Blockchain Clearing And Settlement: Efficient & Fast!

Our current models of eCommerce are facing a hasty demise. Enterprises have been swift to leverage blockchain clearing and settlement solutions. The efficiency and cost savings that the technology delivers has been far too enticing to ignore.

​A blockchain allows a network of businesses to use a shared ledger upon which they can conduct their transactions. This shared ledger provides all parties with security, speed and transparency – while removing middlemen and reducing friction.

Traditional methods of clearing and settlement rely on middlemen to facilitate trust & security. But the friction is so severe that it can take weeks to settle a single transaction.

However, blockchain and distributed ledger technology provide trust & securitywithouta middle man. This reduces friction and costs for all parties. Furthermore, transaction settlement is conducted within seconds! The resulting cost savings are massive – which are then passed down to consumers.

Blockchain Trade Settlement: The Adoption Has Begun

Across the globe, big name firms and established players have been experimenting with blockchain and distributed ledger technology. The list extends from one end of the world to the other

USA based Broadridge Financial Solutions will be using blockchain trade settlement in the repo market. Broadridge believes that blockchain technology can

Reduce counterparty risk

Eliminate wasteful manual intervention

Streamline current processes for confirmation

Increase audibility, and transparency

London based SETL already utilizes a blockchain platform for settlement of payments. They empower participants to deploy their own blockchain within minutes.

In 2016, India based uTrade was the first Indian company to employ a blockchain technology for trade settlement. Their “uClear” blockchain platform allows for real time clearing and settlement of securities. Fast forward to 2018, and we have the Security and Exchange Board of India (SEBI) have begun exploring blockchain technology for trading the stock market.

The Australian Securities Exchanges (ASX) isn’t interested in falling behind either. ASX will be launching their blockchain based financial services by 2021. The goal is to allow stockbrokers & fund managers to use the blockchain for real-time settlement and tracking.

Challenges in Blockchain Clearing And Settlement

Established processes and policies have firm roots in modern day operations. Uprooting these policies and redistributing resources will be the biggest challenge firms will face. Change is not easy – and will face strong resistance and certain junctions. Furthermore, the technology itself requires to be battle-tested some more. The complexity combined with the shift in mindset may cause onboarding issues.

Conclusion: Advantages Too Good To Ignore

Even with the political and regulatory resistance, the adoption of the technology has been moving forward. As understanding increases, decision makers will be coaxed into action by the following advantages:

Drastically reduced transaction costs

Near instant settlement and clearing

Easier Risk management

Increased Transparency

Blockchain technology is paving the way for a financial revolution that eliminate a lot of economic waste.

In this post Shawn explains the concept of Settlement Finality in blockchains. He then goes over finality in proof of work and finality in proof of stake, resptively.

Settlement Finality

Settlement & Finality – often heard and often misunderstood. Newer blockchains boast about their speed to "finality". But does that really mean? What is Settlement Finality?

Put simply – all transactions (daily transactions, security trades etc) have to be "settled" to be considered "final". Hence, the term Settlement Finality.

In our daily transactions, settlement banks handle the 'finalisation' of our transactions. They are the middle-man. And we pay them for the privilege. However, a blockchain manages it's own settlement finality. It does not require a middle man. This is one of the reasons why blockchain technology is so revolutionary.

Middle-men are used in the traditional systems to ensure that transactions have finality. A blockchain, on the other hand, uses a consensus method like Proof of Work or Proof of Stake to reach finality.

But before we go any further, let's quickly describe what finality really means.

Settlement & Finality: What Is Finality?

Finality:Finality simply refers to the idea that the occurrence of event is “final” and “permanent”. You cannot undo this event – it has occurred, and will remain ‘occurred’

An Example: A simplified example of Finality would be your age. Once you turn 18, you’re an adult – and you will remain an adult forever. You can be certain in the ‘finality’ of that. No one can go back and change that event. (Unless time travel is possible, and they murder you before you’re 18)

However, achieving finality with financial transactions is actually easier said than done. We tend to equate "extremely difficult" to "impossible".

To understand, let's explore settlement finality in blockchains and banks a bit more.

Settlement Finality: Blockchain vs Banks

In the finance, people & businesses want to be certain that their transactions are "settled & final".This Settlement Finality is traditionally handled by settlement banks

Businesses – small or large – face issues with finality of payments quite often. A consumer can attempt to reverse his payment made via VISA or PayPal. In these scenarios, settlement finality conflicts are handled by the middleman.

However, middleman-solutions are always going to be a point-of-weakness for finality. What if people in key positions are bribed? What if centralised servers are hacked? In a centralised solutions, there's always a chance that finality is reverted. Each intermediary will pose a risk point.

Comparatively, a blockchain uses no intermediary. It achieves finality via it's consensus method. Notable consensus methods are Proof Of Work and Proof of Stake. Both of which eliminate several weaknesses of centralised systems. However, neither of them achieve true finality. Finality will always be probabilistic (i.e there's a chance – however small – that a transaction can be reversed)

First, let's go over finality in proof of stake and proof of work.

Settlement Finality: Proof of Work & Proof Of Stake

​​Finality in PoW and PoS are achieved in different ways. In Proof Of Work, the hash puzzle plays a key role in determining when a settlement is reasonably 'final'. Proof of Stake uses a raffle system and economic incentives to arrive at finality (you could call it economic finality)

Finality in PoW

Blocks in Proof Of Work age well – the more hashpower used on future blocks, the more resilient the older blocks are to attacks. Why? Cause if someone wants to reverse a payment, he has start a new chain beginning at the old block. He has to then try to outpace the current chain. He will have to ensure that his chain is the longest chain. The only way he can do this is by consuming A LOT of electricity. This is why we wait for “Confirmations”. Each confirmation represents a block. Anything over 6 blocks gives us reasonable finality.

Finality in PoS

Casper’s Proof Of Stake uses a sorta raffle-system to facilitate finality (and other security elements too.) People who want to validate blocks deposit their Ether into a pool. This pre-registering all the possible validators. Validators are then asked to declare finality at certain intervals. Essentially saying: “I agree that every transaction/event up until this point is legit”.

If at least, ⅔ of the validators make a claim – you have reasonable finality.

Notice how I said “reasonable finality” for both – Proof Of Work and Proof Of Stake. This is because finality is always going to be probabilistic! To understand this, we have to dive a little deeper – but I’ll try to simplify.

Blockchain Settlement Finality is Probabilistic

I say "reasonable finality" because finality in proof of work and proof of stake are still not truly "final". Technically, a settled payment can still be reversed. It may be improbable – but not impossible. Let's go over some of the ways:

A 51% attack can lead to a reverse payment in Proof of Work–regardless of block age. While this is difficult, it’s not impossible – it’s improbable. ​

In Proof Of Stake, we have the Nothing At Stakeattack – which again is improbable, but not impossible. (I explained Nothing At Stake just yesterday actually) Even with punitive penalties implemented - slashing - we have the improbable chance that a bunch of validators are willing to burn their own capital to hurt the network.

Finally, even our current centralized solutions don’t have finality because they can alwaysbe hacked, burned down, gun-to-the-headetc etc. Perfect finality is probably impossible. There are too many external factors outside of the system that can remove finality.

Final Thoughts

No system is perfect – yet. A bank can be hacked. Proof of Work is subject to a 51% Attack. Proof Of Stake is subject a 1% Attack. However, blockchains and distributed ledger technologies have come a long way in increasing the likeliness of finality.

In this post, Krisha explains the 2 Types of Blockchains - Public vs Permissioned Blockchains

We have witnessed the term “blockchain” evolve from something dark and unknown, to the hottest topic on the block. While many are drawn to the ‘Investment’ opportunities that the technology presents, others have latched onto the efficiencies that blockchain promises.

This disparity in interests has prompted questions on the multipletypes of blockchains available. Questions like, 'Which type of blockchain would best serve an individual's or company’s interests?"

However, when broken down simply, you’ll realize that there’s only one pivotal difference between each of these blockchain types:

The need for Permissionto participate in each of them.

In essence, every blockchain can be categorized under one of these 2 types:​Public (Permissionless) Blockchain​Permissioned Blockchain

Blockchain Consensus Rules All

A Blockchain's Consensus Mechanismallows participants to come to agreement on a truth that the network was intended to acertain.

The context of “permission” in blockchain lies within this Consensus mechanism.

Depending on the type of blockchain, an individual or entity may or may not require permission to participate in the consensus process.

In Public (Open) Blockchains,no permission is required whatsoever. Anyone can participate in the consensus process.

In Permissioned Blockchains, an individual will require permission to participate in the consensus process.

A Little Perspective- The blockchain consensus mechanism is akin to a jury in a case trial. A jury reaches consensus on the final verdict - they agree on the truth. Consensus is as crucial a function to blockchain, as it is to a case trial.

​​​​Public vs Permissioned Blockchains

In Public Blockchains, anyone can participate in the consensus process. The network is open for Public use in every capacity. Public blockchains are “permissionless blockchains”, and are considered as “fully decentralized”

An individual/entity does notrequire permission to …

Send/ receive transactions on the network

Read the transactions on the chain

Secure the integrity of the network by validating transactions and participating in the consensus process (i.e - being a node).

In Permissioned Blockchains however, the consensus process is either controlled by a group ofknown entities, or a single entity.

The network requires permission for one or all of the following:​​

Send/ receive transactions on the network - Write permissions

Read the transactions/events on the chain - Read permissions

A Permissioned Blockchain controlled by a single entity can be deemed a 'Private Blockchain' - A subset of permissioned blockchains

Permissioned vs Private Blockchain

Note that The lower the number of entities participating in the consensus process, the more centralized the network.

Permissioned Blockchains? For What?

At this point you’re probably wondering:“Don’t permissioned blockchains defeat the idea of a ‘decentralized’ network’?”

Simple Answer:​Yes, it does. But permissioned blockchains are more than willing to make that trade-off. ​Confused??Think back to theblockchain trilemma

The blockchain trilemma states that one sacrificewill have to be made among the three: Security, Scalability and Decentralization

Permissioned blockchains choose to sacrifice Decentralization for Security and Scalability

The sacrifice of decentralization in favour for security and scalability is particularly attractive to large entities. It enables them to leverage blockchain’s cryptographic security measures, and still ensure scalability to meet the needs of a growing customer base.

As of now, permissioned blockchains are the only viable solution for large entities looking to implement blockchain technology. This may change in the future if public blockchains break the trilemma, and learn to scale.

Wrapping Up

The difference between public and permissioned blockchains ultimately boils down to, "who gets to participate in the consensus process ? "- Every network participant? Few known, trusted entities? Or one single entity?

Between Scalability, Security and Decentralization – a tradeoff needs to made. As things stand, Public blockchains have sacrificed scalability, while Permissioned blockchainssacrificed decentralization.

Both, Public and Permissioned Blockchains have their pros and cons. Depending on who you ask, and where their interests lie, one will always be more beneficial than the other.

​In this post Shawn explains the Nothing At Stake Problem simply. He goes over the nothing at stake definition, and also touches on nothing at stake Casper issue.

Barging into the bosses office and flipping him off may sometimes be too tempting to resist. But we manage to refrain. Why? Cause we're incentivised against doing so. Usually, there are consequences – like losing your job. Bad behaviour usually has associated costs. Behave badly – lose something.

Sometimes, however, there are situations that allow you to act badly and lose… nothing. If the bad behaviour results in the most fruitful outcome, you’re most likely going to capitalize on it. This usually results from overlooked incentivization models. In blockchain technology, The Nothing of Stake problem is an example of an incentivization structure that allows someone misbehave – and get away with it.

Nothing At Stake definition: – a situation where someone loses nothing when behaving badly, but stands to gain everything.​

Nothing At Stake Problem in PoS

When a fork occurs, the Consensus Method helps the network agree between the two chains. Participants have to choose which chain to follow, and the majority wins. Ideally, you want the Consensus Method to incentivize people to choose only one of the chains.

Kinda like you having your employees choose between this: “Should I should I slap my boss across the face – or should I keep my job?”

You can’t have both. You can’t act “badly” and have no costs. (Unless you have another job waiting for you, in which case – power to you!)

Proof Of Stake allows you to slap your boss and keep your job - You have nothing at stake.

Proof Of Stake: The Costs To Validate

In PoS, participants compete in a lottery to win the right to propose the next block. Each participant deposits tokens into a pool from which a “winner” is chosen. This deposit is the primary cost that a participant has to incur.All other costs are negligible.

The winner’s block is either accepted or rejected – and the process continues with the chain being extended on each “accepted” block.

Proof Of Stake: A Fork In Mess

However, things can get really messy if we run into a “Fork”. A “fork” in the chain may occur if:

There’s a malicious attack – an attempt to reverse a transaction​

Two winners are chosen ​

In both cases, two new blocks are proposed – and hence we have a split in the chain:

Now, participants have to pick one of the two chains. The problem, however, is each participant can choose to follow both chains. Ideally, one chain will be picked:

Remember, the only real cost to a validator was his deposit.Since the chain forked, his deposit exists on both chains. So it costs him nothing more to validate on both chains. This allows him to collect transactions fees and rewards on both chains.

Nothing At Stake Problem: Best To Cheat

If he picks only one chain, he risks losing the transaction fees on the orphaned chain.

However, If he picks both chains, he simply has to wait for one of the chains to be picked as a winner – and he gets his rewards either way. ​

When every validator picks the optimal strategy, we will end up with a chain like this:

Why? Because we’d have 100% consensus on both chains. Everyone’s voting for both sides – so the chains extend at the same pace. At first glance, it may not seem like a big deal. But this compromises the security of the network drastically. A malicious actor can intentionally fork the chain, and get away with a double-spend. All he has to do is the following steps:

Keeps validating on both chains as well.

Wait for confirmation of the bad transaction.

Stop validating on the first chain.

This would tip the balance of the vote onto the other side of the chain – the one with his bad transaction. Eventually, the second chain would outpace the original chain. The bad transaction will be officially accepted, and first chain will be orphaned.

Opportunity Cost

The key point to notice is that the validator can follow both chains and have no opportunity cost.For example, when you decide to quit your job for a new job, there's an opportunity cost. What if your boss was intending on promoting you? However, Proof Of Stake allows you to have two full-time jobs at no cost. If you don't get promoted in the first job – big deal. You have the second job that will promote you. You have Nothing at stake – no opportunity cost.

Being able to validate on both chains with no costs is like having two jobs.​​If the first chain gets orphaned, you still get all transaction fees & rewards from the second chain. In fact, if you pick only one chain you stand to lose your rewards & fees IF your chain gets orphaned. Hence, the optimal strategy is to pick both chains.

Nothing At Stake Problem: PoW vs PoS

Proof Of Work is not vulnerable to a Nothing At Stake problem. Why? Because , unlike PoS, a participant has to use external costs to build blocks in Proof Of Work. An external cost forces participants to place his "bet" on one chain or the other. The external cost in Proof Of Work is the electricity/hash power used by the miner.

To understand this better, we can go back to our Farmer's Analogy. Farmer's had to place their sacks of rice in one of the two rows. The more sacks they had, the more votes they got. The rice was their "external cost". They couldn't vote on both rows with all their sacks. They'd either have to split their sacks of rice or pick one row. The external factor of "rice" ensured that the village mayor didn't have to worry about the nothing at stake problem.

Similarly, In order to build blocks on a chain, he needs to place his electricity on the chain he believes in. To build blocks on both chains – he will have to split his electricity in two. He has an opportunity cost here. As he will not be using the full potential of his hash power on either chain. Since he is not building optimally on either chain, he will lose out on potential rewards. Regardless of which chain is eventually picked as a winner, he will have had some opportunity cost.

In Proof Of Stake a participant does not have any external costs to build blocks.

Remember:the only cost was the initial deposit. Because of this, he can place his bets on both chains.He can simply build blocks on both chains – and wait for a winner. Regardless of which chain wins, he comes out ahead – and no opportunity cost. He had nothing at stake.

Nothing At Stake & Casper: Hypothetical?

It's important to note that we are assuming that all participants act “optimally”. The more likely scenario is that there will be some people who act honestly and reject the “bad chain”. That’s not to say, though, that the Nothing of Stake problem should be ignored. Even if a portion of validators acting selfishly, then attacking the network becomes easier.

But the great news is that the Casper team is not taking the nothing at stake problem lightly – be it a hypothetical problem or not. Ethereum Casper will include punitive measures like “Slashing” that addresses the Nothing At Stake problem. I will discuss and explain that in part 2 of this post!

Randy asked a great question in regard to The Longest Chain Rule & Forks. Over the last few posts, we’ve established that Consensus Methods are not as worried about “verifying” transaction but are more concerned with the “ordering” of transaction. When a fork occurs – we have a dispute in the correct ordering. The Longest Chain Rule kicks in and will fix that dispute for us. Awesome! Hope that is clear. If not, I suggest you read through the posts linked above!

Today, its Cassidy’s turn to ask a great question!

“ What happens if I send a transaction that ends up in an orphaned block? Do I lose my BTC or ETH ??“

Ah, this is such a great question! Because it brings us one step closer to understanding the 51% Attack and Double Spends.

Cassidy is concerned about losing her BTC – and understandably so. She’s always trusted the bitcoin blockchain, but now I’m telling her that her transaction may end up on an “orphaned chain”.

Does this mean that her transaction is in peril too? And does that, in turn, mean that she may lose her BTC?

No, not at all.Her BTC is safe – and so is her transaction. She will not lose any BTC and her transaction will go through regardless of the fork.

Orphaned Blocks - The Key is in your Wallet....

A common misconception is that people tend to believe that their BTC or ETH is stored “within” their Wallet. So, when they send a transaction – there is a belief that they are taking out some BTC (or ETH) and putting it in someone else’s wallet.

This is completely untrue. But I don’t blame people for thinking that way. The term “wallet” is probably what confuses people. The term “wallet” was probably used to help user adoption, but it’s made explaining the technology even more difficult.

Your Bitcoin or Ethereum Wallet is not like your traditional wallet. It does not hold any of your funds.

Instead, your wallet holds the keys to access your funds. Your funds are located on the blockchain – and will always be there. Your keys allow you to say to the blockchain “I have the right to spend these funds”

Don’t think of your Wallet as something that holds your BTC or ETH – but more so as something that holds the keys to access your funds.

Your keys allow you to say to the blockchain, “I have the right to spend these funds”

Orphaned Block - Does Cassidy Lose Her Funds?!

Okay, so now we understand that our funds are not really located in our wallet – but on the blockchain. In particular, our funds are located in the current valid Longest Chain! Afterall, the Longest Chain is what represents the blockchain.

(You’re probably having a “Oooh, I see where this is going” moment about now)

The transaction that Cassidy sent to Tom gets “orphaned” as well. But Block A still exists – so Cassidy still has her 10 BTC in the Main Chain (longest chain)

In the above illustration, Cassidy still has 10 BTC in Block A

So to answer the question:No - Cassidy does not lose her funds!​

Does Cassidy have to RESEND her funds to Tom?

Again – No, Cassidy doesn’t need to resend her funds 🙂

Why? -- Because when a block gets orphaned, which in our case is Block B2, all the transactions in block B2 simply go back in the queue and wait to be added to the next block. Cassidy’s transaction will most likely get added in the next block.

In the above illustration, Cassidy's transaction to Tom will be put in queue, and will likely be added to Block D

Concluding Thoughts

I tried to keep this one short and simple. Believe me, I removed a lot of text that went into more detail. But I think this is more than enough to give you guys the core idea of what’s going on. The nitty-gritty stuff can wait for later!

The key point to remember is that your funds exist on the chain. A fork would entail you now have funds on two chains. But only the chain that ends up being the Longest Chain will be the one that matters! (Yes, the longest chain rule is that important!)

In the previous post I explained the Longest Chain Rule using an analogy. The analogy seemed to help several of the Mango Readers grasp the importance the rule plays. If you haven’t read it yet, I urge you to do so. The Longest Chain Rule plays a vital role in the Bitcoin and Ethereum consensus mechanism. Furthermore, it may also clear out other doubts you may have concerning Blockchain Forks.

This brings me to a question I received from Randy yesterday:

“Hey man, Great explanation on longest chain! Quick question:" Why do we have 'Forks' if we have the Longest Chain Rule? Is the longest chain rule applied during a 'fork' ? "​Cheers! - Randy “

Quick Answer: Yes, the Longest Chain Rule will kick in when forks appear. Each fork will have its own chain and miners can pick which one to apply their work on. But eventually the longer of the chains will be declared the winner – and all miners will apply their work onto that chain.

That’s the quick and dirty answer. But I’d like to dive a bit deeper into this – and run you guys through exactly how this happens.

Why? Because understanding the Longest Chain Rule will be fundamental in allowing you to grasp other ideas (for example: 51% Attack). In fact, once you grasp this idea – most of the other concepts will become super easy and intuitive.

Longest Chain & Blockchain Forks

But what exactly is a “fork” ? A fork is simply an occurence of a disagreement. Remember, the primary aim of a consensus model is “ordering of events”.

Questions that fall under “ordering of events” criteria:Q) “Who gets to place the next block?”Q)“Whose transaction gets verified first?”

So when we have a disagreement in who gets to place the next block – we will have a “fork”

Going back to the Farmer Analogy – the fork was simply the two rows that were placed at the townhall. Up until the disagreement, everything was fine and dandy. Once the disagreement occurred – two rows were laid. Each row represented a decision. Villagers will vote by placing their sacks of rice in each of the two rows and the longer of the two rows will win.

It’s a similar process in a blockchain. Initially, everything is fine & dandy – and there’s only one “main chain”. When a disagreement occurs, the chain splits into two. This is called a “fork”.

(It’s kinda like when you’re driving down the main road and it “forks” into two different paths. You have to now choose between two paths. In the blockchain, the mainchain splits into two – and the miners now choose between two chains.)

But why do disagreements occur? Isn’t proof of work supposed to solve that?

Why Do Blockchain Forks Occur ?

The Proof Of Work Consensus model is designed to allow the network come to agreement. So forks like this shouldn’t happen, right?

If you read my post on the PoW Cryptographic Puzzle, you know that miners compete against each other to win the right to place the next block.

The “winner” is the miner who solves the puzzles first. The rest of the network then “agrees’ that he gets to place the next block – and they will continue the process with his block being deemed the last approved/valid block.

Let’s say the last valid block is Block A. Miners are now competing fo Block B. Miners will attempt to solve the puzzle until they hear a winner is declared. “

However, ever so often – we may have two “winners” simultaneously.

Since, the winner is broadcasted and propagated through the network – different participants may hear a different winner. Once a winner is declared and “heard”, the miners accept that winning block and move on to the next block.

So now we may have one group of miners accepting Block B, and the rest of the miners accepting Block B2. Hence, fork…

How Are Blockchain Forks Resolved - Orphaned Chains

Alright, so a fork has occurred. What now? How do we achieve consensus again? Did the Proof Of Work Consensus method fail here? No – it didn’t.

The Longest Chain Rule ensures that network will recognise the “chain with most work” as the main chain. The chain with the most work is typically (not always) the longest of the forks.

In the figure, the chain split after Block A.

Block B and Block B2 seemed to have won the Cryptographic Puzzle at the same time. The chain splits. There are now two scenarios that may take place:

Scenario 1: Majority of the other miners pick Block B as the “last valid block”​

OR

Scenario 2:Majority of the other miners pick BlockB2 as the “last valid block”

Let’s assume Scenario #1takes place.

This would mean that there are far more people solving for the cryptographic puzzle on Chain B.Remember – the chance to solve the puzzle is random. But since Chain B has more people trying to solve the puzzle, it will probably solve it faster. The key word here is “probably”. Chain B2 may still solve the next (or next few) puzzles faster.However, over a longer period of time – the probability will win out. Eventually Chain B will outpace Chain B2. The Longest Chain Rule will then kick in – and the following will happen:

Chain B will be considered the main chain.

The transactions contained within all the blocks on Chain B will be considered true and valid.

All the blocks & transactions on Chain B2 will be considered orphaned and will be ignored.

Concluding Thoughts

That’s pretty much it – simpler than you thought it’d be eh? The longest chain rule plays a crucial role in achieving consensus. You can probably use this explanation to figure out how this would play out in a 51% attack as well. If not, I’ll be writing a post on that soon. And now that you know the Longest Chain Rule, it’ll be a breeze to understand 🙂