Notes Module1
Notes Module1
For example, if Alice pays to Bob $10, why would it go through a bank?
Understand block chain from a functional
perspective/ characteristics of a block chain
1. Block chain is a peer-to-peer system of transacting values with no
trusted third parties in between.
2. It is a shared, decentralized, and open ledger of transactions. This ledger
database is replicated across a large number of nodes.
3. This ledger database is an append-only database and cannot be changed
or altered. It means that every entry is a permanent entry. Any new entry
on it gets reflected on all copies of the databases hosted on different
nodes.
4. There is no need for trusted third parties to serve as intermediaries to
verify, secure, and settle the transactions.
5. It is another layer on top of the Internet and can coexist with other
Internet technologies.
6. Just the way TCP/IP was designed to achieve an open system, block chain
technology was designed to enable true decentralization. In an effort to
do so, the creators of Bitcoin open-sourced it so it could inspire many
decentralized applications.
7. Data immutability, data transparency among participants, resilience
against adversarial attacks.
8. Block chain is a secure database shared across a network of participants,
where up-to-date information is available to all participants at the same
time.
9. Block chain is a technology that enables the secure sharing of
information, Data, obviously, is stored in a database.
The block chain data structure
Every node on the block chain network has an identical copy of the
block chain shown in the diagram where every block is a collection
of transactions, hence the name block chain. And, there are two
major parts in every block. The “header” part links back to the
previous block in the chain. It means that every block header
contains the hash of the previous block so that no one can alter any
transaction in the previous block. The other part of a block is the
“body content” that has a validated list of transactions, their
amounts, the addresses of the parties involved, and some more
details. So, given the latest block, it is feasible to access all the
previous blocks in a block chain.
Example of how the transactions take place and the
ledger gets updated across the network
Assume that there are three candidates—Alice, Bob, and Charlie—who
are doing some monetary transactions among each other on a block
chain network.
Step-1:
Let us assume that Alice had $50 with her, which is the genesis of all
transactions and every node is aware of it, as shown in Figure
Step-2:
Alice makes a transaction by paying $20 to Bob. Observe how the
blockchain gets updated at each node, as shown in Figure
Step-3:
Bob makes another transaction by paying $10 to Charlie and the
blockchain gets updated as shown in Figure
The transaction data in the blocks is immutable. All transactions are
fully irreversible. Any change would result in a new transaction,
which would get validated by all contributing nodes. Every node has
its own copy of block chain.
Distributed system
A centralized distributed system is one in which there is, say, a master
node responsible for breaking down the tasks or data and distribute the
load across nodes.
Today when we order something from Amazon, we feel safe and assured of
the item’s delivery. The producer of the item is someone and the buyer is
someone else. Then what role is being played by Amazon here? It is there as
an enabler functioning as a trusted.
Intermediary, and also to take some cut of the transaction. The buyer trusts
the seller where the trust relation is actually imposed by such trusted third
parties. What block chain proposes is that, in the modern digital era, we do
not really need a third party in between to impose trust, and the technology
has matured enough to handle it. In block chain, trust is an inherent part of
the network by default
DECENTRALIZED SYSTEMS
A decentralized system does not have a centralized control and every
node has equal authority. Such systems are difficult to design, maintain,
govern, or impose trust.
Advantages:
1. They do not have a central point of failure, so more stable and fault
tolerant
2. Attack resistant, as no central point to easily attack and hence more
secured
3. Symmetric system with equal authority to all, so less scope of unethical
operations and usually democratic in nature.
4. Elimination of intermediaries
5. Easier and genuine verification of transactions
6. Increased security with lower cost
7. Greater transparency
8. Decentralized and immutable
Example of Decentralization is :
Block chain technology
Peer-to-peer
A typical decentralized and distributed system, which is effectively a
peer-to-peer system and Block chain is a peer-to-peer system of
transacting values with no trusted third parties in between the
transactions.
EXECUTION LAYER
The Execution Layer is where the executions of instructions ordered by
the Application Layer take place on all the nodes in a blockchain
network. The instructions could be simple instructions or a set of
multiple instructions in the form of a smart contract . In either case, a
program or a script needs to be executed to ensure the correct execution
of the transaction. All the nodes in a block chain network have to execute
the programs/scripts independently. Deterministic execution of
programs/scripts on the same set of inputs and conditions always
produces the same output on all the nodes, which helps avoid
inconsistencies.
SEMANTIC LAYER
The Semantic Layer is a logical layer because there is an orderliness in
the transactions and blocks. A transaction, whether valid or invalid, has a
set of instructions that gets through the Execution Layer but gets
validated in the Semantic Layer. If it is Bitcoin, then whether one is
spending a legitimate transaction, whether it is a double-spend attack,
whether one is authorized to make this transaction, etc., are validated in
this layer. In this layer, the rules of the system can be defined, such as
data models and structures. There could be situations that are a little
more complex compared with simple transactions. Complex instruction
sets are often coded into smart contracts. A smart contract is a special
type of account that has executable code and private states. A block
usually contains a bunch of transactions and some smart contracts. The
data structures such as the Merkle tree are defined in this layer with the
Merkle root in the block header to maintain a relation between the block
headers and the set of transactions in a block. it is the semantic layer that
defines how the blocks are linked with each other. Every block in a
blockchain contains the hash of the previous block, all the way to the
genesis block.
PROPAGATION LAYER
The previous layers were more of an individual phenomenon: not much
coordination with other nodes in the system. The Propagation Layer is
the peer-to-peer communication layer that allows the nodes to discover
each other, and talk and sync with each other with respect to the current
state of the network. When a transaction is made, we know that it gets
broadcast to the entire network. Similarly, when a node wants to
propose a valid block, it gets immediately propagated to the entire
network so that other nodes could build on it, considering it as the latest
block. So, transaction/block propagation in the network is defined in
this layer, which ensures stability of the whole network. By design, most
of the blockchains are designed such that they forward a
transaction/block immediately to all the nodes they are directly
connected to, when they get to know of a new transaction/block.
CONSENSUS LAYER
The Consensus Layer is usually the base layer for most of the block chain
systems. The primary purpose of this layer is to get all the nodes to agree
on one consistent state of the ledger. There could be different ways of
achieving consensus among the nodes, depending on the use case. Safety
and security of the block chain is accertained in this layer. In Bitcoin or
Ethereum, the consensus is achieved through proper incentive
techniques called “mining.” For a public block chain to be self-
sustainable,
there has to be some sort of incentivization mechanisms that not only
helps in keeping the network alive, but also enforces consensus . Bitcoin
and Ethereum use a Proof of Work (PoW) consensus mechanism to
randomly select a node that can propose a block. Once that block is
proposed and propagated to all the nodes, they check to see if it a valid
block with all legitimate transactions and that the PoW puzzle was
solved properly; they add this block to their own copy of blockchain
and build further on it. There are many different variants of consensus
protocols such as Proof of Stake (PoS), deligated PoS (dPoS), Practical
Byzantine Fault Tolerance (PBFT)
Note: Based on the marks you have to decide that how much you have to write. If
you want to add few more points you can. If any suggestions please let me know.
Please refer the prescribed text book only.