Blockchain Ecosystem

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 58

Blockchain Ecosystem

1. Transaction is born
2. Transaction is broadcasted
3. Race to create a new block
A subset of nodes, called miners, organize valid transactions into
lists called blocks. A block in progress contains a list of recent
valid transactions and a cryptographic reference to the
previous block. In blockchain systems like Bitcoin and Ethereum,
miners race to complete new blocks, a process that requires
solving a labor-intensive mathematical puzzle, which is
unique to each new block. The first miner to solve the puzzle
will earn some cryptocurrency as a reward. The math
puzzle involves randomly guessing at a number called a
nonce. The nonce is combined with the other data in the
block to create an encrypted digital fingerprint, called a
hash.
4. Completing new block
The hash must meet certain conditions; if it doesn’t, the miner tries
another random nonce and calculates the hash again. It takes an
enormous number of tries to find a valid hash. This process deters
hackers by making it hard to modify the ledger.
Some blockchain uses another mechanism, to secure their chains,
called as proof-of-work.
5. Adding a new block to the chain
This is the final step in securing the ledger. When a mining node
becomes the first to solve a new block’s crypto-puzzle, it sends the
block to the rest of the network for approval, earning digital tokens
in reward. Mining difficulty is encoded in the blockchain’s protocol;
Bitcoin and Ethereum are designed to make it increasingly hard to
solve a block over time.
Case Study: Silk Road
https://www.gawker.com/the-underground-website-where-you-
can-buy-any-drug-imag-30818160
Smart Contracts
But there’s a problem: before smart contracts can do anything really
useful, they need a reliable way to connect with events in the real
world—and that has proved impossible so far. This is the so-called
"oracle problem," a technological challenge that is still hampering
any chance that blockchain will break out and become a part of our
everyday lives.
Prob:
Many organizations have no master ledger of all their activities;
instead records are distributed across internal units and functions.
The problem is, reconciling transactions across individual and
private ledgers takes a lot of time and is prone to error.
Working:
In a blockchain system, the ledger is replicated in a large number of
identical databases, each hosted and maintained by an interested
party. When changes are entered in one copy, all the other copies
are simultaneously updated. So as transactions occur, records of the
value and assets exchanged are permanently entered in all ledgers.
There is no need for third-party intermediaries to verify or transfer
ownership. If a stock transaction took place on a blockchain-based
system, it would be settled within seconds, securely and verifiably.
(The infamous hacks that have hit bitcoin exchanges exposed
weaknesses not in the blockchain itself but in separate systems
linked to parties using the blockchain.)

Blockchain has three characteristics:


(i) Security
(ii) Efficiency
(iii) Collaboration and coordination mechanism
Eg. FedEx - custodial chains outside of our possession of a Ship
man all way back to its origin at manufacture and all the way
through to the end consumption of that in a complete supply chain.
Trust in business is the expectation that the other party will act with
integrity. And integrity boils down to these four values:
Honesty, consideration, accountability, and transparency. Honesty
is not just an ethical issue, it's an economic
one. And communication is the key to creating trusting
relationships within employees, partners, customers, shareholders,
and the public.

Accountability means making clear commitments and sticking with


them. 
Now with blockchain, trust doesn't need to be established only by a
third party. And smart third parties can use blockchain to build new
levels of trust.  With blockchain, trust comes from the network
itself.  Instead of simply trusting a middleman institution, we can
trust the blockchain code. 

This method of trust requires encryption, firewalls, strong


authentication and careful vetting. The network requires investing
trust in those gaining access.

There is no central authority or trusted third party in a distributed


consensus network. That fact opens up a completely new network
model, as the network no longer needs to be closed, access-
controlled or encrypted. Trust does not depend on excluding bad
actors, as they cannot “fake” trust. They cannot pretend to be the
trusted party, as there is none. They cannot steal the central keys as
there are none. They cannot pull the levers of control at the core of
the system, as there is no core and no levers of control.
Blockchains don’t actually eliminate trust. What they do
is minimize the amount of trust required from any single actor in
the system. They do this by distributing trust among different
actors in the system via an economic game that incentivizes actors to
cooperate with the rules defined by the protocol.
in a “decentralized” system, our trust is placed elsewhere, namely
in public-key cryptography and a “consensus
mechanism” that allows us to determine the truth.

Public key cryptography (or asymmetrical cryptography) uses:

1. a set of public keys visible to anyone, and


2. a set of private keys visible only to the owner

The private key generates a “digital signature” for each blockchain


transaction that a user sends out. The signature
ensures authenticity by:

1. confirming that the transaction is coming from the user,


and
2. preventing the transaction from being altered by anyone
once it has been issued

But to ensure no double spending, we need to keep track of who


has what so that we can know whether someone is sending real
digital money or fake digital money.
This is where the “consensus system” — which allows us to
preserve a digitally shared truth — must come into play.

Machine Consensus (The Cryptoeconomic Protocol)

Blockchains have a shared ledger that gives us the absolute truth of


the state of the system. It use mathematics, economics, and
game theory to incentivize all parties in the system to reach a
“consensus”, or coming to an agreement on a single state of this
ledger.

Let’s take Bitcoin, for example. The Bitcoin protocol has a consensus
algorithm called “Proof of Work” that holds the system together. For
a transaction to be settled between two consumers, the algorithm
requires that a set of nodes (called “miners”) compete to validate
transactions by solving a complex algorithmic problem. In other
words, Bitcoin “economically incentivizes” miners to purchase and
use compute power to solve complex problems. These economic
incentives include:

1. miners earning a transaction fee that users pay for carrying


out a transaction, and
2. miners earning new Bitcoins for successfully solving the
puzzle

Because of these economic incentives, miners are constantly


watching the network so that they can gather a new set of
transactions to fit into a new “block.” Then they use their computing
resources to solve the complex algorithm in order to “prove” that
they did some work.

The first miner to solve the algorithm adds the proof and the new
block (and all the transactions in it) to the blockchain and
broadcasts it to the network. At that point, everyone else in the
network syncs the latest blockchain because it’s a “truth” everyone
believes in.
Since miners are competing to run computations, there are times
when multiple blocks get solved at the same time. This then creates
a “fork” of multiple chains:

When there are forks like this, the network’s “canonical” chain is the
one which is the “longest” — the one which the most amount of
miners trusted and continued to work on.

Every new block that’s added to the blockchain in this manner adds
more security to the system because an attacker who wants to create
new blocks that overwrite a party of history would need to
consistently solve for the puzzle faster than anyone else in the
network. This is practically impossible to do, making it’s impossible
to reverse engineer or alter the data inside these blocks. This is why
users trust continue to trust the system.

So when we transact with one another on the blockchain, we


are anchoring our trust in the miners who are giving up their
resources to do some work to ensure no double spending.

Blockchain governance and it remains an area of active research in


the community. Blockchain governance is an incredibly tricky
problem and finding a balance between centralized and distributed
control will be essential to maintaining everyone’s trust in the
system.

When we say blockchains are “trustless,” what we mean is


that there are mechanisms in place by which all parties in
the system can reach a consensus on what the canonical
truth is. Power and trust is distributed (or shared) among
the network’s stakeholders (e.g. developers, miners, and
consumers), rather than concentrated in a single
individual or entity (e.g. banks, governments, and
financial institutions).

The computers connected to the blockchain network are known


as nodes. Some nodes donate their processing power to solve a
math problem associated with a new block. 

The Bitcoin community calls these people "miners," but it's


actually the computers doing all the work. There is no skill
involved. Each miner runs the blockchain software like a utility
function in the background of their computer. Serious miners
invest in high grade and specialized computers to boost their
efficiency, but anyone with a computer can do it.  Other than
the equipment, the software makes mining a level playing field. 

The math problem itself is untouched by human hands. Not all


nodes are mining however. Most of the nodes on the Bitcoin
network simply verify data. 

They send it to peer connections. So, for my art purchase, the


network verifies two pieces of data. One, that I have the amount
of bitcoin I want to send and two, that it was actually me.

Once that happens, miners race to order and record the new
transactions into a block of data, and each block has to include the
digest or hash of the previous block of transactions. A hash is like a
fingerprint for a block. It identifies the block and its contents and
it's always unique. In making a new block, the software attaches the
hash to a random number called the nonce.

Right now, it's still on the Bitcoin network but it hasn't been


recorded as a block on the chain yet. It's still being ordered with all
the other transactions in the network. The Bitcoin network
total processing power is called the hash rate. The higher a
network's hash rate, the more difficult it is to find the right
nonce. When a miner finds a hash with the correct number of
zeros, it shares its proof of work with other miners on the network. 

Proof of work is a record of the computations that it took to find the


nonce. Along with the transactions, this gets included in the new
block. Using proof of work to reach consensus in the network is the
other big breakthrough in distributed computing. The other miners
accept the block by beginning work on the next block which has to
include the hash of the newly made block and so on. When everyone
has accepted the block solution, the winning miner receives a set
quantity of new bitcoins as a reward. The Bitcoin protocols mint the
coins and send them to the miner automatically. Then the hashed
block is added to the chain. Finally, we get to completing the
transaction. Within 10 minutes of my original message, the art
gallery and I each receive a confirmation: "Done deal." If the artist
knew both my public key and the gallery's, she could see that the
deal went through and how much I paid. That's why we call it a
public ledger. All transactions are transparent, but it's also pseudo-
anonymous.

How Bitcoin works:


The Bitcoin system, unlike traditional banking and payment
systems, is based on decentralized trust. Instead of a central trusted
authority, in bitcoin, trust is achieved as an emergent property from
the interactions of different participants in the Bitcoin system. In
this chapter, we will examine bitcoin from a high level by tracking a
single transaction through the Bitcoin system and watch as it
becomes "trusted" and accepted by the bitcoin mechanism of
distributed consensus and is finally recorded on the blockchain, the
distributed ledger of all transactions. Subsequent chapters will delve
into the technology behind transactions, the network, and mining.
Transaction Inputs and Outputs

Transactions are like lines in a double-entry bookkeeping ledger.


Each transaction contains one or more "inputs," which are like
debits against a bitcoin account. On the other side of the
transaction, there are one or more "outputs," which are like credits
added to a bitcoin account. The inputs and outputs (debits and
credits) do not necessarily add up to the same amount. Instead,
outputs add up to slightly less than inputs and the difference
represents an implied transaction fee, which is a small payment
collected by the miner who includes the transaction in the ledger. A
bitcoin transaction is shown as a bookkeeping ledger entry
in Transaction as double-entry bookkeeping.

The transaction also contains proof of ownership for each amount


of bitcoin (inputs) whose value is being spent, in the form of a
digital signature from the owner, which can be independently
validated by anyone. In bitcoin terms, "spending" is signing a
transaction that transfers value from a previous transaction over to
a new owner identified by a Bitcoin address.

Transaction Chains

Alice’s payment to Bob’s Cafe uses a previous transaction’s output


as its input. In the previous chapter, Alice received bitcoin from her
friend Joe in return for cash. That transaction created a bitcoin
value locked by Alice’s key. Her new transaction to Bob’s Cafe
references the previous transaction as an input and creates new
outputs to pay for the cup of coffee and receive change. The
transactions form a chain, where the inputs from the latest
transaction correspond to outputs from previous transactions.
Alice’s key provides the signature that unlocks those previous
transaction outputs, thereby proving to the Bitcoin network that she
owns the funds. She attaches the payment for coffee to Bob’s
address, thereby "encumbering" that output with the requirement
that Bob produces a signature in order to spend that amount. This
represents a transfer of value between Alice and Bob. This chain of
transactions, from Joe to Alice to Bob, is illustrated in A chain of
transactions, where the output of one transaction is the input of the
next transaction.

Constructing a Transaction

Alice’s wallet application contains all the logic for selecting


appropriate inputs and outputs to build a transaction to Alice’s
specification. Alice only needs to specify a destination and an
amount, and the rest happens in the wallet application without her
seeing the details. Importantly, a wallet application can construct
transactions even if it is completely offline. Like writing a check at
home and later sending it to the bank in an envelope, the
transaction does not need to be constructed and signed while
connected to the Bitcoin network.

Getting the Right Inputs

Alice’s wallet application will first have to find inputs that can pay
the amount she wants to send to Bob. Most wallets keep track of all
the available outputs belonging to addresses in the wallet.
Therefore, Alice’s wallet would contain a copy of the transaction
output from Joe’s transaction, which was created in exchange for
cash (see [getting_first_bitcoin]). A bitcoin wallet application that
runs as a full-node client actually contains a copy of every unspent
output from every transaction in the blockchain. This allows a
wallet to construct transaction inputs as well as quickly verify
incoming transactions as having correct inputs. However, because a
full-node client takes up a lot of disk space, most user wallets run
"lightweight" clients that track only the user’s own unspent outputs.

If the wallet application does not maintain a copy of unspent


transaction outputs, it can query the Bitcoin network to retrieve this
information using a variety of APIs available by different providers
or by asking a full-node using an application programming interface
(API) call. Look up all the unspent outputs for Alice’s Bitcoin
address shows an API request, constructed as an HTTP GET
command to a specific URL. This URL will return all the unspent
transaction outputs for an address, giving any application the
information it needs to construct transaction inputs for spending.
We use the simple command-line HTTP client cURL to retrieve the
response.
Example 2. Look up all the unspent outputs for Alice’s Bitcoin
address

$ curl https://blockchain.info/unspent?
active=1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK
{

"unspent_outputs":[

{
"tx_hash":"186f9f998a5...2836dd734d2804fe6
5fa35779",
"tx_index":104810202,
"tx_output_n": 0,
"script":"76a9147f9b1a7fb68d60c536c2fd8aea
a53a8f3cc025a888ac",
"value": 10000000,
"value_hex": "00989680",
"confirmations":0
}

]
}

The response in Look up all the unspent outputs for Alice’s Bitcoin
address shows one unspent output (one that has not been redeemed
yet) under the ownership of Alice’s address
1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK. The response includes
the reference to the transaction in which this unspent output is
contained (the payment from Joe) and its value in satoshis, at 10
million, equivalent to 0.10 bitcoin. With this information, Alice’s
wallet application can construct a transaction to transfer that value
to new owner addresses.

As you can see, Alice’s wallet contains enough bitcoin in a single


unspent output to pay for the cup of coffee. Had this not been the
case, Alice’s wallet application might have to "rummage" through a
pile of smaller unspent outputs, like picking coins from a purse until
it could find enough to pay for the coffee. In both cases, there might
be a need to get some change back, which we will see in the next
section, as the wallet application creates the transaction outputs
(payments).

Creating the Outputs

A transaction output is created in the form of a script that creates an


encumbrance on the value and can only be redeemed by the
introduction of a solution to the script. In simpler terms, Alice’s
transaction output will contain a script that says something like,
"This output is payable to whoever can present a signature from the
key corresponding to Bob’s address." Because only Bob has the
wallet with the keys corresponding to that address, only Bob’s wallet
can present such a signature to redeem this output. Alice will
therefore "encumber" the output value with a demand for a
signature from Bob.
This transaction will also include a second output, because Alice’s
funds are in the form of a 0.10 BTC output, too much money for the
0.015 BTC cup of coffee. Alice will need 0.085 BTC in change.
Alice’s change payment is created by Alice’s wallet as an output in
the very same transaction as the payment to Bob. Essentially, Alice’s
wallet breaks her funds into two payments: one to Bob and one back
to herself. She can then use (spend) the change output in a
subsequent transaction.

Finally, for the transaction to be processed by the network in a


timely fashion, Alice’s wallet application will add a small fee. This is
not explicit in the transaction; it is implied by the difference
between inputs and outputs. If instead of taking 0.085 in change,
Alice creates only 0.0845 as the second output, there will be 0.0005
BTC (half a millibitcoin) left over. The input’s 0.10 BTC is not fully
spent with the two outputs, because they will add up to less than
0.10. The resulting difference is the transaction fee that is collected
by the miner as a fee for validating and including the transaction in
a block to be recorded on the blockchain.

The resulting transaction can be seen using a blockchain explorer


web application, as shown in Alice’s transaction to Bob’s Cafe.
Adding the Transaction to the Ledger

The transaction created by Alice’s wallet application is 258 bytes


long and contains everything necessary to confirm ownership of the
funds and assign new owners. Now, the transaction must be
transmitted to the Bitcoin network where it will become part of the
blockchain.

Transmitting the transaction

Because the transaction contains all the information necessary to


process, it does not matter how or where it is transmitted to the
Bitcoin network. The Bitcoin network is a peer-to-peer network,
with each Bitcoin client participating by connecting to several other
Bitcoin clients. The purpose of the Bitcoin network is to propagate
transactions and blocks to all participants.
How it propagates

Any system, such as a server, desktop application, or wallet, that


participates in the Bitcoin network by "speaking" the Bitcoin
protocol is called a Bitcoin node. Alice’s wallet application can send
the new transaction to any Bitcoin node it is connected to over any
type of connection: wired, WiFi, mobile, etc. Her bitcoin wallet does
not have to be connected to Bob’s bitcoin wallet directly and she
does not have to use the internet connection offered by the cafe,
though both those options are possible, too. Any Bitcoin node that
receives a valid transaction it has not seen before will immediately
forward it to all other nodes to which it is connected, a propagation
technique known as flooding. Thus, the transaction rapidly
propagates out across the peer-to-peer network, reaching a large
percentage of the nodes within a few seconds.

Bob’s view

If Bob’s bitcoin wallet application is directly connected to Alice’s


wallet application, Bob’s wallet application might be the first node
to receive the transaction. However, even if Alice’s wallet sends the
transaction through other nodes, it will reach Bob’s wallet within a
few seconds. Bob’s wallet will immediately identify Alice’s
transaction as an incoming payment because it contains outputs
redeemable by Bob’s keys. Bob’s wallet application can also
independently verify that the transaction is well formed, uses
previously unspent outputs, and contains sufficient transaction fees
to be included in the next block. At this point Bob can assume, with
little risk, that the transaction will shortly be included in a block and
confirmed.

Bitcoin Mining

Alice’s transaction is now propagated on the Bitcoin network. It


does not become part of the blockchain until it is verified and
included in a block by a process called mining.

The Bitcoin system of trust is based on computation. Transactions


are bundled into blocks, which require an enormous amount of
computation to prove, but only a small amount of computation
to verify as proven. The mining process serves two purposes in
bitcoin:

 Mining nodes validate all transactions by reference to


bitcoin’s consensus rules. Therefore, mining provides
security for bitcoin transactions by rejecting invalid or
malformed transactions.
 Mining creates new bitcoin in each block, almost like
a central bank printing new money. The amount of
bitcoin created per block is limited and diminishes with time,
following a fixed issuance schedule.

Mining achieves a fine balance between cost and reward. Mining


uses electricity to solve a mathematical problem. A successful miner
will collect a reward in the form of new bitcoin and transaction fees.
However, the reward will only be collected if the miner has correctly
validated all the transactions, to the satisfaction of the rules
of consensus. This delicate balance provides security for bitcoin
without a central authority.

A good way to describe mining is like a giant competitive game of


sudoku that resets every time someone finds a solution and whose
difficulty automatically adjusts so that it takes approximately 10
minutes to find a solution. Imagine a giant sudoku puzzle, several
thousand rows and columns in size. If I show you a completed
puzzle you can verify it quite quickly. However, if the puzzle has a
few squares filled and the rest are empty, it takes a lot of work to
solve! The difficulty of the sudoku can be adjusted by changing its
size (more or fewer rows and columns), but it can still be verified
quite easily even if it is very large. The "puzzle" used in bitcoin
is based on a cryptographic hash and exhibits similar
characteristics: it is asymmetrically hard to solve but easy
to verify, and its difficulty can be adjusted.

E.g. we introduced Jing, an entrepreneur in Shanghai. Jing runs


a mining farm, which is a business that runs thousands of
specialized mining computers, competing for the reward. Every 10
minutes or so, Jing’s mining computers compete against thousands
of similar systems in a global race to find a solution to a block of
transactions. Finding such a solution, the so-called Proof-of-
Work (PoW), requires quadrillions of hashing operations per
second across the entire Bitcoin network. The algorithm for Proof-
of-Work involves repeatedly hashing the header of the block and a
random number with the SHA256 cryptographic algorithm until a
solution matching a predetermined pattern emerges. The first
miner to find such a solution wins the round of competition and
publishes that block into the blockchain.

Jing started mining in 2010 using a very fast desktop computer to


find a suitable Proof-of-Work for new blocks. As more miners
started joining the Bitcoin network, the difficulty of the problem
increased rapidly. Soon, Jing and other miners upgraded to more
specialized hardware, with high-end dedicated graphical processing
units (GPUs), often used in gaming desktops or consoles. At the
time of this writing, the difficulty is so high that it is profitable only
to mine with application-specific integrated circuits (ASIC),
essentially hundreds of mining algorithms printed in hardware,
running in parallel on a single silicon chip. Jing’s company also
participates in a mining pool, which much like a lottery pool allows
several participants to share their efforts and rewards. Jing’s
company now runs a warehouse containing thousands of ASIC
miners to mine for bitcoin 24 hours a day. The company pays its
electricity costs by selling the bitcoin it is able to generate from
mining, creating some income from the profits.

Mining Transactions in Blocks

New transactions are constantly flowing into the network from user
wallets and other applications. As these are seen by the Bitcoin
network nodes, they get added to a temporary pool of unverified
transactions maintained by each node. As miners construct a new
block, they add unverified transactions from this pool to the new
block and then attempt to prove the validity of that new block, with
the mining algorithm (Proof-of-Work).
Transactions are added to the new block, prioritized by the highest-
fee transactions first and a few other criteria. Each miner starts the
process of mining a new block of transactions as soon as they
receive the previous block from the network, knowing they have lost
that previous round of competition. They immediately create a new
block, fill it with transactions and the fingerprint of the previous
block, and start calculating the Proof-of-Work for the new block.
Each miner includes a special transaction in their block, one that
pays their own Bitcoin address the block reward (currently 6.25
newly created bitcoin) plus the sum of transaction fees from all the
transactions included in the block. If they find a solution that makes
that block valid, they "win" this reward because their successful
block is added to the global blockchain and the reward transaction
they included becomes spendable. Jing, who participates in a
mining pool, has set up his software to create new blocks that assign
the reward to a pool address. From there, a share of the reward is
distributed to Jing and other miners in proportion to the amount of
work they contributed in the last round.

Alice’s transaction was picked up by the network and included in


the pool of unverified transactions. Once validated by the mining
software it was included in a new block, called a candidate block,
generated by Jing’s mining pool. All the miners participating in that
mining pool immediately start computing Proof-of-Work for the
candidate block. Approximately five minutes after the transaction
was first transmitted by Alice’s wallet, one of Jing’s ASIC miners
found a solution for the candidate block and announced it to the
network. Once other miners validated the winning block they
started the race to generate the next block.

Jing’s winning block became part of the blockchain as block


#277316, containing 419 transactions, including Alice’s transaction.
The block containing Alice’s transaction is counted as one
"confirmation" of that transaction

Approximately 20 minutes later, a new block, #277317, is mined by


another miner. Because this new block is built on top of block
#277316 that contained Alice’s transaction, it added even more
computation to the blockchain, thereby strengthening the trust in
those transactions. Each block mined on top of the one containing
the transaction counts as an additional confirmation for Alice’s
transaction. As the blocks pile on top of each other, it becomes
exponentially harder to reverse the transaction, thereby making it
more and more trusted by the network.

In the diagram in Alice’s transaction included in block #277316, we


can see block #277316, which contains Alice’s transaction. Below it
are 277,316 blocks (including block #0), linked to each other in a
chain of blocks (blockchain) all the way back to block #0, known as
the genesis block. Over time, as the "height" in blocks increases,
so does the computation difficulty for each block and the chain as a
whole. The blocks mined after the one that contains Alice’s
transaction act as further assurance, as they pile on more
computation in a longer and longer chain. By convention, any block
with more than six confirmations is considered irrevocable, because
it would require an immense amount of computation to invalidate
and recalculate six blocks.
Spending the Transaction

Now that Alice’s transaction has been embedded in the blockchain


as part of a block, it is part of the distributed ledger of bitcoin and
visible to all bitcoin applications. Each Bitcoin client can
independently verify the transaction as valid and spendable. Full-
node clients can track the source of the funds from the moment the
bitcoin were first generated in a block, incrementally from
transaction to transaction, until they reach Bob’s address.
Lightweight clients can do what is called a simplified payment
verification by confirming that the transaction is in the blockchain
and has several blocks mined after it, thus providing assurance that
the miners accepted it as valid.

Bob can now spend the output from this and other transactions. For
example, Bob can pay a contractor or supplier by transferring value
from Alice’s coffee cup payment to these new owners. Most likely,
Bob’s bitcoin software will aggregate many small payments into a
larger payment, perhaps concentrating all the day’s bitcoin revenue
into a single transaction. This would aggregate the various
payments into a single output (and a single address).

As Bob spends the payments received from Alice and other


customers, he extends the chain of transactions. Let’s assume that
Bob pays his web designer Gopesh in Bangalore for a new web page.
Now the chain of transactions will look like Alice’s transaction as
part of a transaction chain from Joe to Gopesh, where the output of
one transaction is spent as the input of the next transaction.
We can define the blockchain as a system that allows a group of
connected computers to maintain a single updated and secure
ledger. In order to perform transactions on the blockchain, you need
a wallet, a program that allows you to store and exchange your
bitcoins. Since only you should be able to spend your bitcoins, each
wallet is protected by a special cryptographic method that uses a
unique pair of distinct but connected keys: a private and a public
key.

If a message is encrypted with a specific public key, only the owner


of the paired private key can decrypt and read the message. The
reverse is also true: If you encrypt a message with your private key,
only the paired public key can decrypt it. When David wants to send
bitcoins, he needs to broadcast a message encrypted with the private
key of his wallet. As David is the only one who knows the private key
necessary to unlock his wallet, he is the only one who can spend his
bitcoins. Each node in the network can cross-check that the
transaction request is coming from David by decrypting the message
with the public key of his wallet.

When you encrypt a transaction request with your wallet’s private


key, you are generating a digital signature that is used by blockchain
computers to verify the source and authenticity of the transaction.
The digital signature is a string of text resulting from your
transaction request and your private key; therefore it cannot be used
for other transactions. If you change a single character in the
transaction request message, the digital signature will change, so no
potential attacker can change your transaction requests or alter the
amount of bitcoin you are sending.

Tracking Your Wallet Balance


Each node in the blockchain is keeping a copy of the ledger. So, how
does a node know your account balance? The blockchain system
doesn’t keep track of account balances at all; it only
records each and every transaction that is verified and
approved. The ledger in fact does not keep track of balances, it only
keeps track of every transaction broadcasted within the bitcoin
network. To determine your wallet balance, you need to analyze and
verify all the transactions that ever took place on the whole network
connected to your wallet.
Blockchain Benefits and Challenges

Now that you have a general understanding of how the blockchain


works, let’s take a quick look at why it’s so interesting.
Using blockchain technology has remarkable benefits:

 You have complete control of the value you own; there is no


third party that holds your value or can limit your access to
it.
 The cost to perform a value transaction from and to
anywhere on the planet is very low. This
allows micropayments.
 Value can be transferred in a few minutes, and the
transaction can be considered secure after a few hours,
rather than days or weeks.
 Anyone at any time can verify every transaction made on
the blockchain, resulting in full transparency.

 It’s possible to leverage the blockchain technology to


build decentralized applications that would be able to
manage information and transfer value fast and securely.

However, there are a few challenges that need to be addressed:


 Transactions can be sent and received anonymously. This
preserves user privacy, but it also allows illegal activity on
the network.
 Though many exchange platforms are emerging, and digital
currencies are gaining popularity, it’s still not easy to trade
bitcoins for goods and services.
 Bitcoin, like many other cryptocurrencies, is very volatile:
There aren’t many bitcoins available in the market and the
demand is changing rapidly. Bitcoin price is erratic,
changing based on large events or announcements in the
cryptocurrencies industry.

BC works through the mass collaboration of miners, public key,


cryptography, and some clever code. You've walked through the
steps of a transaction. The parties broadcast their
transactions. Members of the network validate those
transactions. Every 10 minutes or so, 
the miners bundle all these transactions into blocks of data. They
race to solve difficult cryptographic puzzles. Winning the race
means, getting to create the next block. 
To win the race, a miner must find the right nonce and show a proof
of work. The winner receives a number of bitcoins as a
reward. Everyone's incentives are aligned. So that's collaboration,
cryptography, and code in action.
Blockchain 101: Blockchain For Beginners
Blockchain technology is the concept or protocol behind the
running of the blockchain. Blockchain technology
makes cryptocurrencies (digital currencies secured by
cryptography) like Bitcoin work just like the internet makes email
possible.
The blockchain is an immutable (unchangeable, meaning a
transaction or file recorded cannot be changed) distributed digital
ledger (digital record of transactions or data stored in multiple
places on a computer network) with many use cases beyond
cryptocurrencies.

Immutable and distributed are two fundamental blockchain


properties. The immutability of the ledger means you can always
trust it to be accurate. Being distributed protects the blockchain
from network attacks.
Each transaction or record on the ledger is stored in a “block.” For
example, blocks on the Bitcoin blockchain consist of an average of
more than 500 Bitcoin transactions.

The information contained in a block is dependent on and linked to


the information in a previous block and, over time, forms a chain of
transactions. Hence the word blockchain.

Types of Blockchains
There are four types of blockchains:

1. Public Blockchains
Public blockchains are open, decentralized networks of computers
accessible to anyone wanting to request or validate a transaction
(check for accuracy). Those (miners) who validate transactions
receive rewards.

Public blockchains use proof-of-work or proof-of-stake consensus


mechanisms (discussed later). Two common examples of public
blockchains include the Bitcoin and Ethereum (ETH) blockchains.

2. Private Blockchains
Private blockchains are not open, they have access restrictions.
People who want to join require permission from the system
administrator. They are typically governed by one entity, meaning
they’re centralized. For example, Hyperledger is a private,
permissioned blockchain.
3. Hybrid Blockchains or Consortiums
Consortiums are a combination of public and private blockchains
and contain centralized and decentralized features. For example,
Energy Web Foundation, Dragonchain, and R3.
Take note: There isn’t a 100 percent consensus on whether these
are different terms. Some make a distinction between the two, while
others consider them the same thing.
4. Sidechains
A sidechain is a blockchain running parallel to the main chain. It
allows users to move digital assets between two different
blockchains and improves scalability and efficiency. An example of
a sidechain is the Liquid Network.
Each new block added to the network is assigned a unique key (via
cryptography). To obtain each new key, the previous block’s key and
information are inputted into a formula.

As new blocks are continually added through the ongoing mining


process, they become increasingly secure and harder to tamper
with. Anyone caught trying to edit a record will simply be ignored.
All future blocks then depend on information from prior blocks—
and this dependency from one block to the next forms a secure
chain: the blockchain.

You can see this depicted below for house records stored on the
blockchain. For example, Block 2 provides a key after taking all the
information from Block 1 into account (including the key) and
inputting it into a formula. Block 3, in turn, provides a new key after
taking all the information from Block 1 and Block 2 into account
(including the key) and inputting it into a formula. And so, the
process repeats itself indefinitely.
Proof of Work (PoW) vs. Proof of Stake (PoS)

A public blockchain functions through consensus mechanisms: the


process for validating transactions without a third party like a bank.

PoW and PoS are two such mechanisms. While their goal—to reach
a consensus that a transaction is valid—remains the same, how they
get there is a little different.

What Is PoW?

PoW, the technical term for mining, is the original consensus


mechanism. It is still used by Bitcoin and Ethereum as of writing
but, as mentioned, Ethereum will move to PoS by 2022. PoW is
based on cryptography, which uses mathematical equations only
computers can solve.
The example in the previous section of how blocks get added to the
Bitcoin Blockchain explains this system.

The two big problems with PoW are that it uses a lot of electricity
and can only process a limited number of transactions
simultaneously (seven for Bitcoin). Transactions typically take at
least ten minutes to complete, with this delay increasing when the
network is congested. Though compared to the days-long wait
required to wire money across the globe, or even to clear a check,
Bitcoin’s ten-minute delay is quite remarkable.

Other consensus mechanisms were created to solve these PoW


problems; the most popular being PoS.
What Is PoS?

PoS still uses cryptographic algorithms for validation, but


transactions get validated by a chosen validator based on how many
coins they hold, also known as their stake.

Individuals aren’t technically mining, and there’s no block reward.


Instead, blocks are ‘forged.’ Those participating in this process lock
a specific number of coins on the network.

The bigger a person’s stake, the more mining power they have—and
the higher the chances they’ll be selected as the validator for the
next block.

To ensure those with the most coins aren’t always selected, other
selection methods are used. These include randomized block
selection (forgers with the highest stake and lowest hash value are
chosen) and coin age selection (forgers are selected based on how
long they’ve held their coins)
The results are faster transaction times and lower costs. The NEO
and Dash cryptocurrencies, for example, can send and receive
transactions in seconds.

Blockchain or Scalability Trilemma: Decentralization,

Security, and Scalability

Most blockchain projects are built around three core properties:

decentralization, scalability, and security. Developers are constantly

trying to balance these aspects, so one isn’t compromised.


But they often have to sacrifice one for the others. The ‘blockchain

trilemma,’ concept was first coined the ‘scalability trilemma’ by

Ethereum founder, Vitalik Buterin.

Let’s look at these concepts in more detail and explore the tradeoffs:

Decentralization

Decentralization means there’s no central point of control. Instead,

decisions are made via consensus over a distributed network of

computers.

There is, however, one significant tradeoff: speed. Sending

transactions takes longer because multiple confirmations are

required to validate a transaction. Hence why Bitcoin is slow.

Scalability

Scalability is the ability of the system to cope with a growing

number of transactions. Scalability is crucial for mass adoption

because any system needs to operate efficiently as more people use

it.

Below is a rough breakdown of how many transactions Ethereum,

Bitcoin, and credit card companies can process per second:

 Bitcoin: seven per second


 Ethereum: 30 per second

 Credit cards: 5,000 credit card transactions per second with

the ability to process much more if needed. Visa, for

example, can process up to 24,000 transactions per second.

But achieving scalability often comes at the expense of

decentralization. EOS, for example, promises a maximum of 4000

TPS but has come under criticism for being too centralized.

Security

Security is the ability of a blockchain to be protected from attacks.

Unfortunately, exchanges and source code have been hacked on

many occasions, suggesting that many developers focus

on scalability and decentralization at the expense of security.


What Are the Benefits of Blockchains Over Traditional
Finance?

1. Trustless: The blockchain is immutable and automates


trusted transactions between counterparties who do not
need to know each other. Transactions are only executed
when programmed conditions are met by both parties.
2. Unstoppable: Once the conditions programmed into a
blockchain protocol are met, an initiated transaction cannot
be undone, changed, or stopped. It’s going to execute and
nothing – no bank, government, or third party – can stop it.
3. Immutable: Records on a blockchain cannot be changed or
tampered with – Bitcoin has never been hacked. A new
block of transactions is only added after a complex
mathematical problem is solved and verified by a consensus
mechanism. Each new block has a unique cryptographic key
resulting from the previous block’s information and key
being added into a formula.
4. Decentralized: No single entity maintains the network.
Unlike centralized banks, decisions on the blockchain are
made via consensus. Decentralization is essential because it
ensures people can easily access and build on the platform,
and there are multiple points of failure.
5. Lower Cost: In the traditional finance system, you pay
third parties like banks to process transactions. The
blockchain eliminates these intermediaries and reduces
fees, with some systems returning fees to miners and
stakers.
6. Peer-to-Peer: Cryptocurrencies like Bitcoin, let you send
money directly to anyone, anywhere in the world, without
an intermediary like a bank charging transaction or
handling fees.
7. Transparent: Public blockchains are open-source
software, so anyone can access them to view transactions
and their source code. They can even use the code to build
new applications and suggest improvements to the code.
Suggestions are accepted or rejected via consensus.
8. Universal Banking: 2 Billion people globally do not have
a bank account. Because anyone can access the blockchain
to store money, it’s a great way to bank the unbanked and
protect against theft that can happen due to holding cash in
physical locations.
What Are the Disadvantages of Blockchains?
Public open source blockchains are not without their hazards and
challenges. Here is a list of the top concerns:

1. Environmental Impact
Blockchain networks like Bitcoin use a lot of electricity to validate
transactions, leading to environmental concerns. For example,
Bitcoin consumes more electricity than a small, medium-sized
European country, and Bitcoin mining is threatening China’s
climate change goals.
However, many would argue that Bitcoin is held to higher
environmental standards than anyone and anything. This may be
true, especially if you consider that the blockchain and Bitcoin are
an alternative to the traditional finance system that uses much more
electricity and has a much larger environmental impact.

A study by Galaxy Digital suggests Bitcoin energy consumption is


less than half that of the traditional banking system. If anything,
you could argue that Bitcoin is a step in the right direction for the
environment.
No one is saying that making strides to lowering the carbon
footprint shouldn’t be on the agenda (this is already happening with
some mining farms shifting to renewable energy sources like solar
panels and the El Salvadoran President calling for a plan to use
geothermal energy (volcanoes) to mine Bitcoin).
But it’s crucial to maintain a balanced view when viewing the cost,
environmental impact, and blockchain benefits.

2. Personal Responsibility
One of blockchains and cryptocurrencies’ most significant
advantages is also its biggest weakness. When you invest in public
open-source blockchains by mining or buying cryptocurrencies and
store it in your cryptocurrency wallet (your wallet is like your bank
account, except only you can access it and have the passwords), only
you control your money.

You are your own bank— and this is great! But if you lose your seed
phrases – the list of words that give you access to recover your
wallets – there is no recourse (compared to banks where you can
reset your password). Your money is lost forever.

Unsurprisingly, a large portion of Bitcoin remains permanently lost.


According to some estimates, 20% or 3.7 million of the currently
minted Bitcoin is probably lost forever.
3. Growing Pains
Even though public blockchains remain more efficient than
traditional banking systems, decentralization comes at the cost of
scalability. Trying to grow blockchain networks to global capacity,
in turn, is the root cause of speed inefficiencies. It’s why, as we saw,
Bitcoin and Ethereum can only process a maximum of seven and 30
transactions, respectively, compared to Visa’s 24,000.
Luckily solutions are being built to improve scalability and the
speed of transactions. For example, the lightning network allows
transactions to happen off the Bitcoin blockchain to speed up
transactions. On Ethereum, many innovative Layer 2 (L2) solutions
are being developed to improve scalability and speed including
rollups, zero-knowledge proofs and side chains.
4. False Narratives
Some cryptocurrencies are undoubtedly used in unlawful activity.
The most famous example is Silk Road: people laundered money
and bought drugs on the platform using Bitcoin.

However, this is no different from the illegal activity that constantly


happens when people use other currencies like the Dollar.

This false narrative that cryptocurrencies are only or mainly used


for illicit activities only delays their inevitable adoption, which can
hugely benefit everyone, including the financial system.
Blockchain technology is currently used across various industries
like supply chain, healthcare, retail, media and advertising, financial
services, insurance, travel and transportation, oil and gas, and
gaming.
Here are some promising use cases:
1. Cryptocurrencies: The ‘killer app’ of blockchains today is
internet money. Cryptocurrencies let you transfer value
faster and cheaper across borders without a bank. Besides
Bitcoin and Ethereum, other digital currency examples
include Polkadot (DOT), NEO, Cardano (ADA), Tether
(USDT), Binance Coin (BNB), and Litecoin (LTC).
2. Smart Contracts: These blockchain applications are
contracts that automatically execute without an
intermediary once conditions written into the computer
code are met.
3. Decentralized Banking: The use of blockchain
technology is also proliferating in banking. For example,
many banks like Barclays, Canadian Imperial Bank, and
UBS are interested in how blockchain can make their back-
office settlement systems more efficient.
4. Video Games/Art: You may have heard Crypto Kitties—a
game launched on the Ethereum blockchain. One of the
virtual pets in the game was sold for over $100,000.
5. Peer-to-peer Energy Trading: People buy or sell energy
directly without an intermediary.
6. Supply chain and logistics tracking: Blockchain is
being used to track precious metals’ origins and foods. For
example, Walmart and IBM worked together to create a
food traceability system based on open-source ledger
technology, making it easier to trace contaminated food.
7. Healthcare process optimization: Blockchain can
speed up the time required to pay health insurance
payments to patients and store and securely share medical
data and records.
8. Real estate processing platform: Property ownership
records can be securely stored and verified on the
blockchain. These records cannot be tampered with, so you
can trust they’re accurate and more easily verify property
ownership.
9. NFT marketplaces: These are marketplaces that allow
you to buy nonfungible tokens (NFTs): digital tokens of
things like paintings and clothing.
10. Music royalties tracking: Blockchain can trace music
streams and immediately pay those who contributed to a
song.
11.Anti-money laundering tracking system: Authorities
can more easily track the original source of money because
every transaction on the blockchain is recorded and leaves
behind a tamper-proof trail.
12. Personal identity security: Traditional systems for
storing identities are insecure and fragmented. Blockchain
provides a unified, immutable, and interoperable
infrastructure so you can store and manage records securely
and efficiently.
13. New insurance distribution methods: For example,
peer-to-peer insurance, parametric insurance, and
microinsurance.
14. Automated Advertising Campaigns: Advertisers can
use smart contracts to automate advertising campaigns, e.g.,
an audience is only shown an ad when specific criteria are
met.

How to Invest in Blockchain Technology


With blockchain offering some promising use cases, helping many
companies become more efficient, and attracting big companies like
Amazon and Tesla, it can be an attractive investment.

But there are risks: It’s a new technology, and many projects will
not pan out. So, invest only what you can afford to lose, do your own
research to determine if the project (or initial coin offering) is worth
investing in, and decide what level of exposure you want.
For example, you can get more exposure by investing in
cryptocurrencies directly instead of an exchange-traded fund (ETF).

Traditional Finance and Blockchain Investment Strategies


In some ways, the process of investing in shares and
cryptocurrencies is the same. First, you can buy cryptocurrencies on
exchanges like you can buy shares through an online broker.

Second, you are also able to apply traditional investment principles


to investing in cryptocurrencies and the blockchain. For example,
you can invest the same amount of money into Bitcoin each month
regardless of price (dollar-cost averaging) to remove any emotion
out of the investment process.

But there are also investment strategies that are unique to the
blockchain and cryptocurrencies, like yield farming.
Read on to learn about ten common traditional finance and
blockchain investment strategies you can use when investing in
public blockchain companies and cryptocurrencies.

The new era will be powered by a combination of computer


engineering, mathematics, cryptography, and
behavioral economics. 
Seven design principles underlying blockchain. 
Our first principle is networked integrity: On the blockchain,
trust doesn't come from an outside source. That means that the
four values of integrity (honesty,
consideration, accountability, and transparency) are
coded into the blockchain. They're baked into decision rights,
incentive structures and operations. Integrity is distributed among
nodes, not vested in a single member. That means acting without
integrity is either impossible or 
it costs far too much time, money, energy, and reputation. Cheaters
never prosper.

Problem with Integrity Online:


If you send a selfie to a friend, you can still share it with
another. But you can't give your friend a dollar you've already given
to someone else. The money must leave your account to go into your
friend's. It can't exist in two places at once. If the Internet treated
money just like information, there would be a risk if you're spending
the same money twice. That's called the double-spend problem. 
Traditionally, the double-spend problem has been solved by
clearing every transaction through a third party. This could be a
bank, money transfer service, credit card company, government, or
an online payment platform.

On the Bitcoin blockchain, the network timestamps that first


transaction where the owner spends a particular coin. It rejects
any more spends of the coin, eliminating a double
spend. Miners, people who run Bitcoin nodes, gather up the
recent transactions, order the them in to a block of data
and add it to the chain. Each block must refer to the previous one
to be valid. And since the blockchain is public, Bitcoin is more
traceable than cash. 
When the network reaches consensus about what happened, it
records it on the blockchain.

How the network reaches consensus is a critical factor. The Bitcoin


network relies on what is called a proof of work. Because we can't
rely on the identity of the miners to select who creates the next
block, the network instead creates a puzzle. 
Miners use their resources, namely computing hardware
and electricity, to solve the puzzle by finding the right
hash. Remember a hash is a unique fingerprint for the text
or the data file.

This puzzle requires a lot of computing to solve. But when


someone solves it, everyone else can check the work
quickly. Whoever solves the problem first gets to create the
next block. And for each block a miner creates, he or she
receives bitcoin as a reward. 
There are no shortcuts to solving the problem, so when the rest of
the network 
sees the answer, everyone trusts a lot of work went into producing
it.

Now there are types of consensuses:


Proof of stake requires validators to invest in and hang on to a
native token of the blockchain, whether it's Peercoin, NXT, or
something else. They needn't spend energy to vote.
Blockchains such as Ripple and Stellar rely on social networks for
consensus. They might require new nodes to generate a unique
list of at least 100 nodes they can trust in voting on an update. This
type of proof is biased. Newcomers need social intelligence and
reputation to participate. 
There's also proof of activity, combining proof of work and proof of
stake. There's also proof of capacity requiring miners to devote a lot
of hard drive space to mining. 
A similar concept, proof of storage, requires miners to share their
disk space in a distributed cloud. The platform Cosmos uses
something called byzantine fault tolerance. 
Storage does matter too. Data on blockchains are different from
data on the Internet, and in one important way in particular. On the
Internet most of the information is malleable and fleeting. The exact
date and time of its publication isn't critical to past or future
information. On a blockchain, the truth of the present relies on the
details of the past. Bitcoins moving across the network have been
permanently stamped from the moment of their coinage.

The history will be all there. It's checkable and it's


unchangeable. The platform ensures trust in transactions
and recorded information no matter how the other party acts. And
this has enormous implications for social, political, and economic
activity.

blockchain has no “leader”. For the blockchain to make decisions,


they need to come to a consensus using “consensus mechanisms”.
“Consensus decision-making is a group decision-making process in
which group members develop, and agree to support a decision in
the best interest of the whole. Consensus may be defined
professionally as an acceptable resolution, one that can be
supported, even if not the “favourite” of each individual. Consensus
is defined by Merriam-Webster as, first, general agreement, and
second, group solidarity of belief or sentiment.”
consensus on the other hand of voting principle makes sure that an
agreement is reached which could benefit the entire group as a
whole.
A method by which consensus decision-making is achieved is called
“consensus mechanism”. Objectives of a consensus mechanism are:
 Agreement Seeking: A consensus mechanism should bring
about as much agreement from the group as possible.

 Collaborative: All the participants should aim to work


together to achieve a result that puts the best interest of the
group first.
 Cooperative: All the participants shouldn’t put their own
interests first and work as a team more than individuals.

 Egalitarian: A group trying to achieve consensus should be


as egalitarian as possible. What this basically means that
each and every vote has equal weightage. One person’s vote
can’t be more important than another’s.

 Inclusive: As many people as possible should be involved in


the consensus process. It shouldn’t be like normal voting
where people don’t really feel like voting because they
believe that their vote won’t have any weightage in the long
run.

 Participatory: The consensus mechanism should be such


that everyone should actively participate in the the overall
process.

Before bitcoin, there were loads of iterations of peer-to-peer


decentralized currency systems which failed because they were
unable to answer the biggest problem when it came to reaching a
consensus. This problem is called “Byzantine Generals Problem”.

imagine that there is a group of Byzantine generals and they want to


attack a city. They are facing two very distinct problems:
 The generals and their armies are very far apart so
centralized authority is impossible, which makes
coordinated attack very tough.
 The city has a huge army and the only way that they can win
is if they all attack at once.
 
In order to make successful coordination the armies on the left of
the castle send a messenger to the armies on the right of the castle
with a message that says “ATTACK WEDNESDAY.” However,
suppose the armies on the right are not prepared for the attack and
say, “NO. ATTACK FRIDAY” and send back the messenger through
the city back to the armies on the left.
 
This is where we face a problem.
 
A number of things can happen to the poor messenger. He could get
captured, compromised, killed and replaced with another
messenger by the city. This would lead to the armies getting
tampered information which may result in an uncoordinated attack
and defeat.
This has clear references to blockchain as well. The chain is a huge
network; how can you possibly trust them? If you were sending
someone 4 Ether from your wallet, how would you know for sure
that someone in the network isn’t going to tamper with it and
change 4 to 40 Ether?
What these generals need, is a consensus mechanism which can
make sure that their army can actually attack as a unit despite all
these setbacks.
We are now going to go through a list of consensus mechanisms
which can solve the Byzantine Generals problem.
#1 Proof Of Work
Satoshi Nakamoto, Bitcoin’s creator, was able to bypass the problem
by inventing the proof of work protocol.
First let’s see how it work in context of the Byzantine Generals
problem.
Suppose the army on the left want to send a message called
“ATTACK MONDAY” to the army on the right, they are going to
follow certain steps.
 
 Firstly, they will append a “nonce” to the original
text. The nonce can be any random hexadecimal value.

 After that, they hash the text appended with a nonce


and see the result. Suppose, hypothetically speaking, the
armies have decided to only share messages which, on
hashing, gives a result which starts with 5 zeroes.
 
 If the hash conditions are satisfied, they will send the
messenger with the hash of the message. If not, then
they will keep on changing the value of the nonce randomly
until they get the desired result. This action is extremely
tedious and time consuming and takes a lot of
computation power.
 
 If the messenger does get caught by the city and the
message is tampered with, according to hash
function properties, the hash itself will get
drastically changed. If the generals on the right side, see
that the hashed message is not starting with the
required amount of 0s then they can simply call off
the attack.
there is a possible loophole.
No hash function is 100% collision free. So what if the city gets the
message, tampers with it and then accordingly change the nonce
until they get the desired result which has the required number of
0s? This will be extremely time consuming but it is still possible. To
counter this, the generals are going to use strength in numbers.
The generals on the right have it pretty easy. All they have to do is to
append the message with the correct nonce that will be given to
them, hash them, and see whether the hash matches or not.
Hashing a string is very easy to do. That in essence is the process
behind proof-of-work.
 
 The process behind finding the nonce for the appropriate
hash target should be extremely difficult and time
consuming.
 However, the process of checking the result to see if no
malpractice has been committed should be very simple.
 
So, if we are to summarize how Proof Of Work Protocol
works with the blockchain.
 
 The miners solve cryptographic puzzles to “mine” a block in
order to add to the blockchain.

 This process requires immense amount of energy and


computational usage. The puzzles have been designed in a
way which makes it hard and taxing on the system.

 When a miner solves the puzzle, they present their block to


the network for verification.

 Verifying whether the block belongs to the chain or not is an


extremely simple process

there are some issues with proof-of-work:


 First and foremost, proof of work is an extremely inefficient
process because of the sheer amount of power and energy
that it eats up.

 People and organizations that can afford faster and more


powerful ASICs usually have better chance of mining than
the others.

 As a result of this, bitcoin isn’t as decentralized as it wants


to be. Let’s check the hashrate distribution graph:
As you can see, ~65% of the hashrate is divided among 5 mining
pools alone!
 Theoretically speaking, these big mining pools can simply
team up with each other and launch a 51% on the bitcoin
network.

#2 Proof Of Stake

Ethereum is soon planning to move on from Proof of Work (POW)


to Proof of Stake (POS).
Proof of stake will make the entire mining process virtual and
replace miners with validators.
This is how the process will work:
 The validators will have to lock up some of their coins as
stake.
 After that, they will start validating the blocks. Meaning,
when they discover a block which they think can be added to
the chain, they will validate it by placing a bet on it.

 If the block gets appended, then the validators will get a


reward proportionate to their bets.

The Biggest Roadblock to Proof of Stake


 
Ethereum developers always planned to eventually move on to
proof of stake, that was always their plan. However, before they
could do so, they had to address one of the biggest flaws of proof of
stake(POS).

Suppose we have a situation like the one above.  There is a main


blue chain and a red chain which sort of branches from the main
itself. What is there to stop a malicious miner from mining on the
red blocks and force a hardfork?
In a proof-of-work(POW) system, this risk can be
mitigated.
Suppose malicious miner Alice wants to mine on the red chain.
Even if she dedicates all of her hash power to it, she won’t get any
other miner to join her on the new chain. Everyone else will still
continue to mine on the blue chain, because it is more profitable
and risk-free to mine on the longer chain.
Now remember, POW is extremely expensive resource-wise.
It makes no sense for a miner to waste so much resource
on a block that will be rejected by the network anyway.
Hence chain splits are avoided in a proof of work system
because of the amount of money that the attacker will
have to waste.
However, things look a little different when you bring in POS.
If you are a validator, then you can simply put your money
in both the red chain and blue chain without any fear of
repercussion at all. No matter what happens, you will always win
and have nothing to lose, despite how malicious your actions
maybe.
 This is called the “Nothing at Stake” problem.
In order to incorporate the POS consensus
system, cryptocurrencies need to address this issue and Ethereum is
going to do this in a very interesting way by adapting their Casper
protocol.
Casper is the POS protocol that Ethereum has chosen to go with.
While there has been an entire team busy creating it, Vlad Zamfir is
often credited as being the “Face of Casper”.
how is Casper different from other Proof of Stake
protocols?

This is how POS under Casper would work: 


 The validators stake a portion of their Ethers as stake.

 After that, they will start validating the blocks. Meaning,


when they discover a block which they think can be added to
the chain, they will validate it by placing a bet on it.

 If the block gets appended, then the validators will get a


reward proportionate to their bets.

 However, if a validator acts in a malicious manner and tries


to do a “nothing at stake”, they will immediately be
reprimanded and all of their stake is going to get slashed.

Casper is deigned to work in a trustless system and be more


Byzantine Fault Tolerant.
Anyone who acts in a malicious/Byzantine manner will get
immediately punished by having their stake slashed off. This is
where it differs from most other POS protocols. Malicious elements
have something to lose so it is impossible for there to be nothing at
stake.
#3 Delegated Proof Of Stake

EOS is an acronym for Electro-Optical System. EOS is a


decentralized operating system based on blockchain technology.
The EOS.IO is an open-source platform that's designed to allow
developers to build decentralised apps, also known as dApps. The
cryptocurrency that derives the network is called EOS. A year before
its launch, the whitepaper for its software was released.
DPOS or Delegated Proof Of Stake. EOS is using this consensus
mechanism to scale up to millions of transactions per second.
Firstly, anyone who holds tokens on a blockchain integrated in the
EOS software can select the block producers through a continuous
approval voting system. Anyone can participate in the block
producer election and they will be given an opportunity to produ all
other producers.
How does it work?

 
 Blocks are produced in the rounds of 21.

 At the start of every round 21 block producers are chosen.


Top 20 are automatically chosen while the 21st one is
chosen proportional to the number of their votes relative to
the other producers.

 The producers are then shuffled around using a


pseudorandom number derived from the block time. This is
done to ensure that a balance connectivity to all other
producers is maintained.

 To ensure that regular block production is maintained and


that block time is kept to 3 seconds, producers are punished
for not participating by being removed from consideration.
A producer has to produce at least one block every 24 hours
to be in consideration.
The DPOS system doesn’t experience a fork because instead of
competing to find blocks, the producers will have to co-operate
instead. In the event of a fork, the consensus switches automatically
to the longest chain.
A DPOS blockchain typically has 100% block producer
participation. A transaction is usually confirmed within 1.5 seconds
from the time of broadcast by a 99.9% certainty. In order to have
absolute certainty over the validity of a transaction, a node need
only to wait for 15/21 (i.e. a 2/3 majority) producers to arrive to a
consensus.
what happens in the event of a fork caused by negligence or
malicious intent?
All the nodes will, by default, not switch to a fork which doesn’t
include any blocks not finalized by 15/21 producers. This will stand
true regardless of chain length. Each block must gain a 15/21
approval to be considered a part of the chain.
Because of the short block creation time, it is possible to warn nodes
of whether they are in the major or minor chain within 9 seconds.
The reason why that is so is simple. Remember, the average time
elapsed between each block is 3 seconds.
If a node misses 2 consecutive blocks there is a 95% chance that
they in a minority fork.
If a node misses 3 blocks, then there is a 99% chance of them being
on a minority chain.

You might also like