2 Introduction Blockchain
2 Introduction Blockchain
Blockchain basics
Blockchain demo
- Hash
- Block
- Blockchain
- Distributed
- Tokens
- Coinbase
[Source - https://andersbrownworth.com/blockchain ]
What is Blockchain?
• A Linked List
– Replicated
– Distributed
– Consistency maintained by Consensus
– Cryptographically linked
– Cryptographically assured integrity of data
• Used as
– Immutable Ledger of events, transactions or time stamped data
– Tamper resistant log
– Platform to Create and Transact in Cryptocurrency
– log of events/transactions unrelated to currency
[Source – Lecture slides of Prof. Sandeep K. Shukla IIT Kanpur – NPTEL course]
Why a course on Blockchain?
• Have you seen the news lately?
– Bitcoin
– Ethereum
– Blockchain for E‐governance
– Blockchain for supply chain management
– Blockchain for energy management ……
– Soon: Block chain for Nirvana
• Is it just a hype and hyperbole?
– Hopefully this course will teach you otherwise
– Even if you do not care about cryptocurrency and its market volatility
[Source – Lecture slides of Prof. Sandeep K. Shukla IIT Kanpur – NPTEL course]
Distributed Ledger Technology
• Distributed ledger technology (DLT) is a digital system for
recording the transaction of assets in which the transaction
and their details are recorded in multiple places at the same
time.
• Unlike traditional databases, distributed ledgers have no
control data store or administrative functionality.
• Blockchain is well known example of DLT.
[Source – Belotti, Marianna, et al. "A vademecum on blockchain technologies: When, which, and how." IEEE
Communications Surveys & Tutorials 21.4 (2019): 3796-3838.]
Blockchain Technology
• Blockchain is an emerging technology and is a distributed
ledger or a database that consists of non-erasable records of
information.
• Blockchain is a distributed network and chain of cryptographic
blocks combined together to form a Peer-to-Peer (P2P)
network that is decentralized and distributed in nature.
• This technique allows users to share information among nodes
in the network that do not trust each other
[Source –Aggarwal, Shubhani, et al. "Blockchain for smart communities: Applications, challenges and
opportunities." Journal of Network and Computer Applications 144 (2019): 13-48.]
Blockchain Technology
• The universally recognised father of blockchain technology is
Satoshi Nakamoto that formally theorised and implemented it
(2008 and 2009 respectively) as a core component of
cryptocurrency Bitcoin.
• Types of cryptocurrencies are: Bitcoin, Bitcoin cash, Litcoin,
Ethereum and many more
[Nakamoto, Satoshi. "Bitcoin: A peer-to-peer electronic cash system." Decentralized Business Review (2008): 21260]
Satoshi Nakamoto:
The Mysterious Founder of Bitcoin
https://youtu.be/2Mlw_jVHq7U
DLT Evolution
[Source – Belotti, Marianna, et al. "A vademecum on blockchain technologies: When, which, and how." IEEE
Communications Surveys & Tutorials 21.4 (2019): 3796-3838.]
[Source – Dr. Raju Halder, IIT Patna, Block ATAL FDP]
[Source – Dr. Raju Halder, IIT Patna, Block ATAL FDP]
[Source – Dr. Raju Halder, IIT Patna, Block ATAL FDP]
Why Blockchain?
• Blockchain is a technology that increases transparency, as
everybody on the network has a copy of the ledger.
• This makes the blockchain ledge tamper-proof.
• Blockchain is a safer way to record activity and keep data
updated, while maintaining a record of its history.
• The features of the blockchain (Decentralization, Immutability,
auditability, Integrity, Authenticity, Non-Repudiation and fault
tolernce) make it attractive for various applications.
[Source – Belotti, Marianna, et al. "A vademecum on blockchain technologies: When, which, and how." IEEE
Communications Surveys & Tutorials 21.4 (2019): 3796-3838.]
[Source : Salman, Tara, et al. "Security services using blockchains: A state of the art survey." IEEE Communications
Surveys & Tutorials 21.1 (2018): 858-880.]
[Source – Belotti, Marianna, et al. "A vademecum on blockchain technologies: When, which, and how." IEEE
Communications Surveys & Tutorials 21.4 (2019): 3796-3838.]
[Source – Belotti, Marianna, et al. "A vademecum on blockchain technologies: When, which, and how." IEEE
Communications Surveys & Tutorials 21.4 (2019): 3796-3838.]
[Source: Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive
survey." IEEE Communications Surveys & Tutorials 21.2 (2018): 1676-1717]
Important Terminology
• Transaction - A process that changes the state of the blockchain ledger. Depending on the application, the
transaction can be the transfer of a financial value or the execution of a smart contract.
• Block – It consists of a block header and a block data.
• Block hash - It is the unique identifier of a particular block and is obtained by hashing the block header twice
• Merkle tree root hash: All the transactions in the block are hashed individually using a hashing algorithm. The
hash values are then combined pairwise and are hashed again until a single hash value is obtained. This value is
known as the merkle tree root hash value.
• Previous block hash - It is the hash of the block preceding the current block in the chain. The
preceding block is known as the parent of the current block. The use of previous block’s
hash value in a block header is to ensure the immutability of blockchain ledger.
• Genesis block - This is the first block in the ledger. All the following blocks in the chain are linked to the genesis
block. The genesis block generally includes the configuration for the network characteristics, the consensus
protocol to be used, the access control rights, the hash function, the block generation interval, and the block
size.
• Time stamp - It indicates the time at which the block is created.
• Block version - It indicates the version of the blockchain protocols used.
• Mining - It is the process of adding the valid transactions in a block and broadcasting that block to the network.
• Consensus protocols – Consensus protocols are used for validating transactions on the blockchain
[Source - Ismail, Leila, and Huned Materwala. "A review of blockchain architecture and consensus protocols:
Use cases, challenges, and solutions." Symmetry 11.10 (2019): 1198]
Terminology
• A distributed ledger is a type of digital data structure residing
across multiple computer devices, generally at geographically
distinguished locations
• Distributed Ledger Technology (DLT) designs a type of technology
enabling storing and updating a distributed ledger in a
decentralized manner.
• A blockchain is a P2P DLT structured as a chain of blocks, forged by
consensus, which can be combined with a data model and a
communication language enabling smart contracts and other
assisting technologies.
[Source - Ismail, Leila, and Huned Materwala. "A review of blockchain architecture and consensus protocols:
Use cases, challenges, and solutions." Symmetry 11.10 (2019): 1198.
Terminology
• In all DLTs, there is an initial record - in a blockchain it is called
a genesis block.
• The blockchain ledger consists of digital transactions
representing interactions between nodes of a P2P network.
• Transactions are individual and indivisible operations that
involve exchange or transfer of digital assets (information,
goods, services, funds or set of rules which can trigger another
transaction).
[Source - Ismail, Leila, and Huned Materwala. "A review of blockchain architecture and consensus protocols:
Use cases, challenges, and solutions." Symmetry 11.10 (2019): 1198.
Terminology
• Blockchain nodes are computing device connected to the
blockchain that support the network by maintaining a copy of the
ledger.
• Blockchain transactions are grouped into blocks, and there can be
any number of transactions per block while respecting a given
block size limit.
• Nodes on a blockchain network group up these transactions and
send them throughout the network. Eventually peers synchronize
to an exact copy of the blockchain throughout the network.
[Source - Ismail, Leila, and Huned Materwala. "A review of blockchain architecture and consensus protocols:
Use cases, challenges, and solutions." Symmetry 11.10 (2019): 1198.
Terminology
• The blockchain updating procedure needs a consensus, i.e., an
agreement among the network peers.
• Consensus in the network refers to the process of achieving
agreement among the network participants as to the correct state of
data on the system.
• Consensus leads to all nodes sharing the exact same data.
• Therefore a consensus algorithm
– (i) ensures that the data on the ledger is the same for all network nodes, and
– (ii) prevents malicious actors from manipulating the data.
[Source - Ismail, Leila, and Huned Materwala. "A review of blockchain architecture and consensus protocols:
Use cases, challenges, and solutions." Symmetry 11.10 (2019): 1198.
Terminology
• The consensus procedure varies with different blockchain
implementations.
• The Bitcoin blockchain uses a PoW based consensus mechanism,
other blockchains and distributed ledgers are deploying a variety
of consensus algorithms belonging to two main classes:
– (i) Proof-of-X-based algorithms and
– (ii) Byzantine Fault Tolerant algorithms.
[Source - Ismail, Leila, and Huned Materwala. "A review of blockchain architecture and consensus protocols:
Use cases, challenges, and solutions." Symmetry 11.10 (2019): 1198.
Terminology
• A generic DLT can fit any digital asset exchange requirement.
Contractual aspects of an exchange, involving nodes’ rights and
obligations, can be digitalized and controlled by proper digital
(smart) contracts.
• A smart contract is a computer program that executes predefined
actions when certain conditions within the system are met.
• Smart contracts provide the transactions language allowing the
ledger state to be modified.
• They can facilitate the exchange and transfer of any asset (e.g.,
shares, currency, content, property).
[Source - Ismail, Leila, and Huned Materwala. "A review of blockchain architecture and consensus protocols:
Use cases, challenges, and solutions." Symmetry 11.10 (2019): 1198.
Terminology
• Blockchain – the actual ledger
• Blockchain technology – a term to describe the technology in the most generic
form
• Blockchain network – the network in which a blockchain is being used
• Blockchain implementation – a specific blockchain
• Blockchain network user – a person, organization, entity, business, government,
etc. which is utilizing the blockchain network
• Immutability: Since all new entries made in the blockchain are agreed upon by peers via
decentralized consensus, the blockchain is censorship-resistant and is nearly impossible to tamper.
Similarly, all previously held records in the blockchain are also immutable and, in order to alter any
previous records, an attacker would need to compromise a majority of the nodes involved in the
blockchain network. Otherwise, any changes in the blockchain contents are easily detected.
• Auditability : All peers hold a copy of the blockchain, and can thus access all timestamped transaction
records. This transparency allows peers to look up and verify transactions involving specific
blockchain addresses. Blockchain addresses are not associated with identities in real life, so the
blockchain provides a manner of pseudo-anonymity.
[Source: Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive
survey." IEEE Communications Surveys & Tutorials 21.2 (2018): 1676-1717]
Salient features of the blockchain
• Integrity, Authenticity, Non-Repudiation : The data hashing grants that data is not modified
during its transmission (i.e., integrity). Moreover, the origin of a transaction can be
ascertained by the senders’ public key dissemination, while the evidence of the sending
action is represented by the data signing procedure involving the private key (i.e.,
authenticity and non-repudiation).
• fault tolerance: All blockchain peers contain identical replicas of the ledger records. Any
faults or data leakages that occur in the blockchain network can be identified through
decentralized consensus, and data leakages can be mitigated using the replicas stored in
blockchain peers.
[Source: Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive
survey." IEEE Communications Surveys & Tutorials 21.2 (2018): 1676-1717]
Types of blockchain
• Public Blockchains
• Private Blockchains
• Consortium Blockchains
Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive survey." IEEE
Communications Surveys & Tutorials 21.2 (2018): 1676-1717.
Types of blockchain
• Public Blockchains: Public blockchains are truly decentralized, where all
members can participate in publishing new blocks and accessing
blockchain contents.
• Public blockchains are termed permissionless in that it allows anyone to
maintain a copy of the blockchain and engage in validating new blocks.
Examples of public blockchain implementation are cryptocurrency
networks, such as Bitcoin, Ethereum, and so on.
• Publishing new blocks in a public blockchain involves either
computationally expensive puzzle solving, or staking one’s own
cryptocurrency. Each transaction has a processing fee attached to it, which
serves as an incentive to the peers attempting to publish new blocks onto
the blockchain.
Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive survey." IEEE
Communications Surveys & Tutorials 21.2 (2018): 1676-1717.
Types of blockchain
• Private Blockchains: private blockchains are permissioned, and
every node joining the network is a known member of a single
organization.
• Private blockchains are suited for single enterprise solutions
and are utilized as a synchronized distributed database meant
to keep track of data exchanges occurring between different
departments or individuals.
Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive survey." IEEE
Communications Surveys & Tutorials 21.2 (2018): 1676-1717.
Types of blockchain
• Private Blockchains: private blockchains are permissioned, and every node
joining the network is a known member of a single organization.
• Private blockchains are suited for single enterprise solutions and are
utilized as a synchronized distributed database meant to keep track of data
exchanges occurring between different departments or individuals.
• Private blockchains do not require currency or tokens to function, and
there are no processing fees included in its transactions.
• Since blocks are published by delegated nodes within the network, a
private blockchain is not as tamper-resistant as a public blockchain, and
the organization may choose to roll back their blockchain to any point in
the past.
Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive survey." IEEE
Communications Surveys & Tutorials 21.2 (2018): 1676-1717.
Types of blockchain
• Consortium Blockchains: Consortium blockchains, or federated
blockchains, are similar to private blockchains in the sense that it is
a permissioned network.
• Consortium networks span multiple organizations and help
maintain transparency among the involved parties.
• A consortium blockchain is used as an auditable and reliably
synchronized distributed database, that keeps track of data
exchanges taking place between the participating consortium
members.
• While it does provide auditability and lower latency in transaction
processing, it is not entirely decentralized or censorship-resistant.
Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive survey." IEEE
Communications Surveys & Tutorials 21.2 (2018): 1676-1717.
Ali, Muhammad Salek, et al. "Applications of blockchains in the Internet of Things: A comprehensive survey." IEEE
Communications Surveys & Tutorials 21.2 (2018): 1676-1717.
Blockchain Components
• Cryptographic Hash Functions : Within a blockchain network,
cryptographic hash functions are used for many tasks, such as:
– Address derivation : public key cryptographic hash function address
– Creating unique identifiers.
– Securing the block data – a publishing node will hash the block data,
creating a digest that will be stored within the block header.
– Securing the block header – a publishing node will hash the block header.
– If the blockchain network utilizes a proof of work consensus model, the
publishing node will need to hash the block header with different nonce
values until the puzzle requirements have been fulfilled.
– The current block header’s hash digest will be included within the next
block’s header, where it will secure the current block header data.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Cryptographic Nonce :
• A cryptographic nonce is an arbitrary number that is only used
once.
• A cryptographic nonce can be combined with data to produce
different hash digests per nonce:
hash (data + nonce) = digest
• Only changing the nonce value provides a mechanism for
obtaining different digest values while keeping the same data.
• This technique is utilized in the proof of work consensus model
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Transactions :
• A transaction represents an interaction between parties.
Blockchain Components
Asymmetric-Key Cryptography :
• A summary of the use of asymmetric-key cryptography in many
blockchain networks:
– Private keys are used to digitally sign transactions.
– Public keys are used to derive addresses.
– Public keys are used to verify signatures generated with private keys.
– Asymmetric-key cryptography provides the ability to verify that the
user transferring value to another user is in possession of the private
key capable of signing the transaction.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Addresses and Address Derivation :
• Most blockchain implementations make use of addresses as
the “to” and “from” endpoints in a transaction.
• Addresses are shorter than the public keys and are not secret.
• One method to generate an address is to create a public key,
applying a cryptographic hash function to it, and converting
the hash to text:
public key cryptographic hash function address
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Private Key Storage :
• With some blockchain networks (especially with permissionless
blockchain networks), users must manage and securely store
their own private keys.
• Instead of recording them manually, they often use software to
securely store them. This software is often referred to as a
wallet.
• The wallet can store private keys, public keys, and associated
addresses. It may also perform other functions, such as
calculating the total number of digital assets a user may have.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Private Key Storage :
• If a user loses a private key, then any digital asset associated with that key
is lost, because it is computationally infeasible to regenerate the same
private key.
• If a private key is stolen, the attacker will have full access to all digital
assets controlled by that private key.
• The security of private keys is so important that many users use special
secure hardware to store them; alternatively, users may take advantage of
an emerging industry of private key escrow services.
• These key escrow services can also satisfy KYC laws in addition to storing
private keys as users must provide proof of their identity when creating an
account.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Ledgers :
• A ledger is a collection of transactions.
• Throughout history, pen and paper ledgers have been used to keep
track of the exchange of goods and services.
• In modern times, ledgers have been stored digitally, often in large
databases owned and operated by a centralized trusted third party
(i.e., the owner of the ledger) on behalf of a community of users.
• These ledgers with centralized ownership can be implemented in a
centralized or distributed fashion (i.e., just one server or a
coordinating cluster of servers).
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Ledgers :
• Blockchain technology enables such an approach using both
distributed ownership as well as a distributed physical
architecture.
• The distributed physical architecture of blockchain networks
often involve a much larger set of computers than is typical for
centrally managed distributed physical architecture.
• The growing interest in distributed ownership of ledgers is due
to possible trust, security, and reliability concerns related to
ledgers with centralized ownership:
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Blocks :
• Blockchain network users submit candidate transactions to the
blockchain network via software (desktop applications,
smartphone applications, digital wallets, web services, etc.)
• The software sends these transactions to a node or nodes
within the blockchain network.
• For many blockchain implementations, once a pending
transaction has been distributed to nodes, it must then wait in
a queue until it is added to the blockchain by a publishing
node.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Blocks :
• The block data contains a list of validated and authentic transactions which
have been submitted to the blockchain network.
• Validity and authenticity is ensured by checking that the transaction is
correctly formatted and that the providers of digital assets in each
transaction (listed in the transaction’s ‘input’ values) have each
cryptographically signed the transaction.
• This verifies that the providers of digital assets for a transaction had access
to the private key which could sign over the available digital assets.
• The other full nodes will check the validity and authenticity of all
transactions in a published block and will not accept a block if it contains
invalid transactions.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Blocks :
• Block Header
– The block number, also known as block height in some blockchain
networks.
– The previous block header’s hash value.
– A hash representation of the block data (different methods can be
used to accomplish this, such as a generating a Merkle tree (defined
in Appendix B), and storing the root hash, or by utilizing a hash of all
the combined block data).
– A timestamp.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Blocks :
• Block Header
– The size of the block.
– The nonce value. For blockchain networks which utilize mining, this is
a number which is manipulated by the publishing node to solve the
hash puzzle.
– Other blockchain networks may or may not include it or use it for
another purpose other than solving a hash puzzle.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Blockchain Components
Blocks :
• Block Data
– A list of transactions and ledger events included within the block.
– Other data may be present.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Pseudonymous
• In Bitcoin, the blockchain enabled users to be pseudonymous.
• This means that users are anonymous, but their account
identifiers are not; additionally, all transactions are publicly
visible.
• This has effectively enabled Bitcoin to offer pseudo-anonymity
because accounts can be created without any identification or
authorization process (such processes are typically required by
Know-Your-Customer (KYC) laws).
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Consensus Models
• Proof of Work (PoW)
• Proof of Stake (PoS)
• Round Robin
• Proof of Authority/Proof of Identity
• Proof of Elapsed Time (PoET)
• ….
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Work (PoW)
• Proof of Work (PoW)
– In the proof of work (PoW) model, a user publishes the next block by
being the first to solve a computationally intensive puzzle.
– The solution to this puzzle is the “proof” they have performed work.
– The puzzle is designed such that solving the puzzle is difficult but
checking that a solution is valid is easy.
– This enables all other full nodes to easily validate any proposed next
blocks, and any proposed block that did not satisfy the puzzle would
be rejected.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Work (PoW)
• hash (data + nonce) = digest
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Work (PoW)
SHA256(“blockchain” + Nonce) = Hash Digest starting with “000000”
• SHA256("blockchain0") =
0xbd4824d8ee63fc82392a6441444166d22ed84eaa6dab11d4923075975acab938 (not solved)
• SHA256("blockchain1") =
0xdb0b9c1cb5e9c680dfff7482f1a8efad0e786f41b6b89a758fb26d9e223e0a10 (not solved)
• …
• SHA256("blockchain10730895") =
0x000000ca1415e0bec568f6f605fcc83d18cac7a4e6c219a957c10c6879d67587 (solved)
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Work (PoW)
• In this example, each additional “leading zero” value increases the difficulty.
• By increasing the target by one additional leading zero (“0000000”), the same hardware
took 934,224,175 guesses to solve the puzzle (completed in 1 hour, 18 minutes, 12
seconds):
SHA256("blockchain934224174") =
0x0000000e2ae7e4240df80692b7e586ea7a977eacbd031819d0e603257edb3a81
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Consensus Models
• Proof of Work (PoW)
• Proof of Stake (PoS)
• Round Robin
• Proof of Authority/Proof of Identity
• Proof of Elapsed Time (PoET)
• ….
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Stake (PoS)
• The proof of stake (PoS) model is based on the idea that the more stake a user has
invested into the system, the more likely they will want the system to succeed, and the
less likely they will want to subvert it.
• Stake is often an amount of cryptocurrency that the blockchain network user has
invested into the system (through various means, such as by locking it via a special
transaction type, or by sending it to a specific address, or holding it within special
wallet software).
• Once staked, the cryptocurrency is generally no longer able to be spent.
• Proof of stake blockchain networks use the amount of stake a user has as a determining
factor for publishing new blocks.
• Thus, the likelihood of a blockchain network user publishing a new block is tied to the
ratio of their stake to the overall blockchain network amount of staked cryptocurrency.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Stake (PoS)
• With this consensus model, there is no need to perform resource intensive
computations (involving time, electricity, and processing power) as found in
proof of work.
• The methods for how the blockchain network uses the stake can vary.
– random selection of staked users
– multi-round voting
– coin aging systems
– delegate systems.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Stake (PoS) –
Random selection of staked users
• When the choice of block publisher is a random choice (sometimes referred to as
chain-based proof of stake), the blockchain network will look at all users with stake and
choose amongst them based on their ratio of stake to the overall amount of
cryptocurrency staked.
• So, if a user had 42% of the entire blockchain network stake they would be chosen 42 %
of the time; those with 1 % would be chosen 1 % of the time.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Stake (PoS) –
Multi-round voting
• When the choice of block publisher is a multi-round voting system (sometime referred
to as Byzantine fault tolerance proof of stake ) there is added complexity.
• The blockchain network will select several staked users to create proposed blocks.
• Then all staked users will cast a vote for a proposed block.
• Several rounds of voting may occur before a new block is decided upon.
• This method allows all staked users to have a voice in the block selection process for
every new block.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Stake (PoS) –
Coin aging systems
• When the choice of block publisher is through a coin age system referred to as a coin
age proof of stake, staked cryptocurrency has an age property.
• After a certain amount of time (such as 30 days) the staked cryptocurrency can count
towards the owning user being selected to publish the next block.
• The staked cryptocurrency then has its age reset, and it cannot be used again until after
the requisite time has passed.
• This method allows for users with more stake to publish more blocks, but to not
dominate the system – since they have a cooldown timer attached to every
cryptocurrency coin counted towards creating blocks.
• Older coins and larger groups of coins will increase the probability of being chosen to
publish the next block.
• To prevent stakeholders from hoarding aged cryptocurrencies, there is generally a built-
in maximum to the probability of winning.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Stake (PoS) - delegate systems
• When the choice of block publisher is through a delegate system, users vote for nodes to
become publishing nodes – therefore creating blocks on their behalf.
• Blockchain network users’ voting power is tied to their stake so the larger the stake, the more
weight the vote has.
• Nodes who receive the most votes become publishing nodes and can validate and publish
blocks.
• Blockchain network users can also vote against an established publishing node, to try to
remove them from the set of publishing nodes.
• Voting for publishing nodes is continuous and remaining a publishing node can be quite
competitive.
• The threat of losing publishing node status, and therefore rewards and reputation is constant
so publishing nodes are incentivized to not act maliciously.
• Additionally, blockchain network users vote for delegates, who participate in the governance of
the blockchain.
• Delegates will propose changes, and improvements, which will be voted on by blockchain
network users.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Round Robin Consensus Model
• Round Robin is a consensus model that is used by some
permissioned blockchain networks.
• Within this model of consensus, nodes take turns in creating
blocks.
• To handle situations where a publishing node is not available to
publish a block on its turn, these systems may include a time limit
to enable available nodes to publish blocks so that unavailable
nodes will not cause a halt in block publication.
• This model ensures no one node creates the majority of the blocks.
• It benefits from a straightforward approach, lacks cryptographic
puzzles, and has low power requirements.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Round Robin Consensus Model
• Since there is a need for trust amongst nodes, round robin
does not work well in the permissionless blockchain networks
used by most cryptocurrencies.
• This is because malicious nodes could continuously add
additional nodes to increase their odds of publishing new
blocks.
• In the worst case, they could use this to subvert the correct
operation of the blockchain network.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Authority/Proof of Identity
• The proof of authority (also referred to as proof of identity)
consensus model relies on the partial trust of publishing nodes
through their known link to real world identities.
• Publishing nodes must have their identities proven and verifiable
within the blockchain network (e.g., identifying documents which
have been verified and notarized and included on the blockchain).
• The idea is that the publishing node is staking its identity/
reputation to publish new blocks.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Authority/Proof of Identity
• Blockchain network users directly affect a publishing node’s reputation
based on the publishing node’s behavior.
• Publishing nodes can lose reputation by acting in a way that the
blockchain network users disagree with, just as they can gain
reputation by acting in a manner that the blockchain network users
agree with.
• The lower the reputation, the less likelihood of being able to publish a
block. Therefore, it is in the interest of a publishing node to maintain a
high reputation.
• This algorithm only applies to permissioned blockchain networks with
high levels of trust.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Elapsed Time Consensus
• Within the proof of elapsed time (PoET) consensus model, each
publishing node requests a wait time from a secure hardware time
source within their computer system.
• The secure hardware time source will generate a random wait time
and return it to the publishing node software.
• Publishing nodes take the random time they are given and become
idle for that duration.
• Once a publishing node wakes up from the idle state, it creates and
publishes a block to the blockchain network, alerting the other nodes
of the new block; any publishing node that is still idle will stop waiting,
and the entire process starts over.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Elapsed Time Consensus
• This model requires ensuring that a random time was used, since
if the time to wait was not selected at random a malicious
publishing node would just wait the minimum amount of time by
default to dominate the system.
• This model also requires ensuring that the publishing node waited
the actual time and did not start early.
• These requirements are being solved by executing software in a
trusted execution environment found on some computer
processors (such as Intel’s Software Guard Extensions, or AMD’s
Platform Security Processor, or ARM’s TrustZone).
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Proof of Elapsed Time Consensus
• Verified and trusted software can run in these secure execution
environments and cannot be altered by outside programs.
• A publishing node would query software running in this secure
environment for a random time and then wait for that time to pass.
• After waiting the assigned time, the publishing node could request a
signed certificate that the publishing node waited the randomly
assigned time.
• The publishing node then publishes the certificate along with the
block.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Comparison of Consensus models
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Comparison of Consensus models
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Forking
• Soft forks
• Hard forks
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Soft Fork
• A soft fork is a change to a blockchain implementation that is
backwards compatible.
• Non-updated nodes can continue to transact with updated
nodes.
• If no (or very few) nodes upgrade, then the updated rules will
not be followed.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Soft Fork
• An example of a soft fork occurred on Bitcoin when a new rule was
added to support escrow.
• For nodes that implement this change, the node software will
perform this new operation, but for nodes that do not support the
change, the transaction is still valid, and execution will continue as
if a NOP 8 and time-locked refunds.
• In 2014, a proposal was made to repurpose an operation code that
performed no operation (OP_NOP2) to CHECKLOCKTIMEVERIFY,
which allows a transaction output to be made spendable at a point
in the future had been executed.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Soft Fork
• A fictional example of a soft fork would be if a blockchain decided
to reduce the size of blocks (for example from 1.0 MB to 0.5 MB).
• Updated nodes would adjust the block size and continue to
transact as normal;
• non-updated nodes would see these blocks as valid – since the
change made does not violate their rules (i.e., the block size is
under their maximum allowed).
• However, if a non-updated node were to create a block with a size
greater than 0.5 MB, updated nodes would reject them as invalid.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Hard Fork
• A hard fork is a change to a blockchain implementation that is not
backwards compatible.
• At a given point in time (usually at a specific block number), all
publishing nodes will need to switch to using the updated protocol.
• Additionally, all nodes will need to upgrade to the new protocol so
that they do not reject the newly formatted blocks.
• Non-updated nodes cannot continue to transact on the updated
blockchain because they are programmed to reject any block that
does not follow their version of the block specification.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Hard Fork
• A well-known example of a hard fork is from Ethereum.
• In 2016, a smart contract was constructed on Ethereum called the
Decentralized Autonomous Organization (DAO).
• Due to flaws in how the smart contract was constructed, an
attacker extracted Ether, the cryptocurrency used by Ethereum,
resulting in the theft of $50 million.
• A hard fork proposal was voted on by Ether holders, and the clear
majority of users agreed to hard fork and create a new version of
the blockchain, without the flaw, and that also returned the stolen
funds.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Hard Fork
• With cryptocurrencies, if there is a hard fork and the
blockchain splits then users will have independent currency on
both forks (having double the number of coins in total).
• If all the activity moves to the new chain, the old one may
eventually not be used since the two chains are not compatible
(they will be independent currency systems).
• In the case of the Ethereum hard fork, the clear majority of
support moved to the new fork, the old fork was renamed
Ethereum Classic and continued operating.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Smart contracts
• The term smart contract dates to 1994, defined by Nick Szabo
as “a computerized transaction protocol that executes the
terms of a contract.
• The general objectives of smart contract design are to satisfy
common contractual conditions (such as payment terms, liens,
confidentiality, and even enforcement), minimize exceptions
both malicious and accidental, and minimize the need for
trusted intermediaries.”
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Smart contracts
• Smart contracts extend and leverage blockchain technology.
• A smart contract is a collection of code and data (sometimes
referred to as functions and state) that is deployed using
cryptographically signed transactions on the blockchain network
(e.g., Ethereum’s smart contracts, Hyperledger Fabric’s chaincode).
• The smart contract is executed by nodes within the blockchain
network;
• all nodes that execute the smart contract must derive the same
results from the execution, and the results of execution are
recorded on the blockchain.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Smart contracts
• The code, being on the blockchain, is also tamper evident and
tamper resistant and therefore can be used (among other
purposes) as a trusted third party.
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Smart contracts
• For smart contract enabled permissionless blockchain networks
(such as Ethereum) the user issuing a transaction to a smart
contract will have to pay for the cost of the code execution.
• There is a limit on how much execution time can be consumed by a
call to a smart contract, based on the complexity of the code.
• If this limit is exceeded, execution stops, and the transaction is
discarded.
• This mechanism not only rewards the publishers for executing the
smart contract code, but also prevents malicious users from
deploying and then accessing smart contracts that will perform a
denial of service on the publishing nodes by consuming all
resources (e.g., using infinite loops).
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
Smart contracts
• For smart contract enabled permissioned blockchain networks,
such as those utilizing Hyperledger Fabric’s chaincode, there
may not be a requirement for users to pay for smart contract
code execution.
• These networks are designed around having known
participants, and other methods of preventing bad behavior
can be employed (e.g., revoking access).
Source : Yaga, Dylan, et al. "Blockchain technology overview." arXiv preprint arXiv:1906.11078 (2019).
What Is Cryptocurrency?
• How does one put the technology in place? Create a white paper or other
document outlining the system, make a website or app describing how it works,
and seek funding.
• Advertising is key since there are so many competing coins on the market, so
figuring out how to appeal to the target demo is crucial.
• Not looking to launch a new coin, but rather, to invest in a new coin? Make sure
to do thorough research, as there are a number of scams.
Source : Coursera Course ‘Blockchain: Foundations and Use Cases’
Source : Coursera Course ‘Blockchain: Foundations and Use Cases’
Token Data models
[Source : Lesavre, Loïc, Priam Varin, and Dylan Yaga. Blockchain Networks: Token Design and Management Overview.
No. NIST Internal or Interagency Report (NISTIR) 8301 (Draft). National Institute of Standards and Technology, 2020.]
Token Data models
Source : Lesavre, Loïc, Priam Varin, and Dylan Yaga. Blockchain Networks: Token Design and Management Overview.
No. NIST Internal or Interagency Report (NISTIR) 8301 (Draft). National Institute of Standards and Technology, 2020.