Immutability of a blockchain using proof of work.
Consensus is probabilistic in nature.
There is always a chance that the most recent few blocks are replaced by a competing chain fork.
At the time of fork occurs, there is usually no certainty as to which branch will be permanently kept
in the blockchain and which branches will be discarded.
The transactions that were included in the branches being discarded eventually go back to the transaction
pool and being added into the later block.
Confirmation pattern provides the solution for the same by mentioning that we can wait for enough number
of blocks as confirmations to ensure that a transaction is added into the blockchain and is immutable
with high probability.
There are few forces which led to the X confirmation pattern.
The first one is Blockchain Fork.
A chain fork may occur on a blockchain using proof of work consensus like bitcoin and Ethereum.
Whenever there is a major change in the parameters or the structure of the blockchain.
For example, in Bitcoin blockchain, a fork appeared when we separated into two different chains.
One was Bitcoin gold and the other one was Bitcoin.
Similarly, in Ethereum also we had major hard forks where we separated into Ethereum main network and
Ethereum Classic.
Another important force which led to the creation of X confirmation pattern is because of the frequency
of blockchain fork, transaction handling and inter block time differ significantly from one blockchain
to another.
A shorter inter block time would lead to an increased frequency of forks.
That's why X confirmation pattern provides us the right standards and help us to govern that at how
many confirmations we can take up the blockchain transaction as immutably stored with high probability
over the blockchain.
The solution provided by the X confirmation pattern is from the application perspective.
One security strategy is to wait for certain number of X blocks to be generated after the transaction
is included into one block.
After X blocks, the transaction is taken to be committed and thus preserved as immutable.
The value of X can be decided by the developers of the blockchain projects.
One of the major benefits provided by such a design pattern is related to immutability.
The more blocks being generated after the block, including the transaction, the higher probability
of the immutability of the transactions can be guaranteed.
But there are also few drawbacks related to confirmation pattern.
One of the major drawback is related to latency.
Latency between submission and confirmation of a transaction has been included on a blockchain and is
affected by the consensus protocol.
The x value of X confirmation, for example in Bitcoin is about six, which means that you have to wait
for one hour to make sure that your transaction is immutably available over the blockchain.
Why this value is one hour.
Because the X confirmation pattern is governing that you have to wait for at least six blocks confirmation
and one block confirmation over Bitcoin.
Blockchain requires ten minutes.
The larger the value of X, the longer the latency of the confirmation of transaction over the blockchain.
Some of the known implementations of X confirmation pattern is with Bitcoin, which uses six confirmation.
The value of six by Bitcoin blockchain was chosen based on the assumption that an attacker is unlikely
to amass more than 10% of the total amount of computing power within Bitcoin network.
It provides us the risk factor of 0.1% with Bitcoin blockchain, which is under acceptable standards.
Another known implementation is with Ethereum, where Ethereum recommends to wait for 11 confirmations
after the block inclusion before assuming that a transaction is committed permanently with high probability.
In this image.
You can see the X confirmation pattern in action.
In this image, we are showcasing that a new block has been included in the blockchain.
Once this block has been included.
The new transactions are also now stored inside the blockchain.
After these new transactions are present in the blockchain, then we wait for the number of confirmations
to make sure that this transaction is immutable on top of the blockchain project.
So here you can see that a new block came in.
Then we included the first confirmation.
After the second block, we included the second confirmation and after the third block we included the
third confirmation.
The value of X can be determined by the developers who are creating the blockchain project as per that
it introduces less risk factor for any transaction to be manipulated or changed within the blockchain
network.
So that was about the security patterns and security patterns.
Help us to determine the design in such a way that we are able to securely create the blockchain application
architectures.
In the next lecture, we are going to learn about the contract structural patterns.
Contract structural patterns.
Discuss about the smart contracts which are running on top of the blockchain smart contracts in terms
are applications, and some of the existing design patterns could be applied to these applications too.
If you have any queries, feel free to contact us at info at the rate v2 blocks.com.
Thank you.