SlideShare a Scribd company logo
Introduction to Blockchain
Heart of Bitcoin Revolution
1
3
2
Blockchain Trend
• A blockchain is just a file, a data structure.
• Blockchain = Chain of blocks
• Where each block stores information of transactions and chained by
storing meta-data about the previous block
Blockchain
1
1
• Immutable means that something is unchanging over time or unable to be
changed, in our context, it means once data has been written to a
blockchain no one, not even a system administrator, can change it.
• In traditional systems, an end-user may have read-only access. He will not
be able to change the contents of a row in that database.
• However, someone with higher privileged access like a systems
administrator may be able to change the data.
• We try to create segregations of responsibility, so that no single person
can do something bad undetected. However there is no control
mechanism making the data immutable in the first place.
Immutability
1
• A hash function is a type of mathematical function which turns data into a
fingerprint of that data called a hash.
• SHA-256(Ahmedabad-Java-Meetup) =
6ffacd79bc7bad8ecf50f0394f6eb16aa39167482a2717108bc157647fb92b
51
• It’s hard to back-calculate the original data from the hash
• If the input data changes in the slightest, the hash changes in an
unpredictable way
Immutability in Blockchain
1
• Each block contains:
• Hash of contents of the block
• Hash of the previous block
• Data in a blockchain is internally
consistent, that is you can run
some checks on it, and if the
data and hashes don’t match
up, there has definitely been
some tinkering.
Immutability in Blockchain
1
Let’s first see what happens if you took Bitcoin’s Blockchain and copied it onto
a USB stick (it’s about 120GB). What could you do with the data on the stick
before passing it to someone else, like a regulator? Could you change the data
and fool them?
Bitcoin’s blockchain has nearly 470,000 blocks. Let’s say you remove a
transaction from block 250,000 which is about half way through the
blockchain, trying to pretend that a specific payment never happened. What
would happen?
What if someone wants to cheat?
1
1. Hash of changed block fails, so he has to recalculate the hash of the block.
2. The chain fails, he will need to rebuild and rehash each block following
the tampered block, replacing the contents of the previous-block-hash
pointers.
However, there are safeguards to make it very hard or impossible to rebuild a
blockchain. These safeguards differ based on the block-adding mechanisms,
two dominant schemes are target hashes for proof-of-work public
blockchains; and specific signatures for (some) private blockchains.
What if someone wants to cheat?
1
Proof-of-work : Block is only considered valid if the block hash follows a strict
pattern - – namely the hash has to be smaller than a target number, often
described by “starting with a certain number of zeroes”.
Ex: SHA-256(block-data,previous-block-hash,nonce) must start with 0000
He needs to make sure that the recalculated hash is below a certain
number. Need to re-mine the block by adjusting another part of the block’s
contents (called the nonce) repeatedly until you find a hash that is smaller
than the target number. This takes some significant computational power.
And then do this for each and every block in the blockchain.
What if someone wants to cheat?
1
• Let’s say you manage to create an internally consistent blockchain by
removing the transaction and recreating all the block hashes to all conform
to the validation criteria.
• All it takes now for the regulator is to check other copies of the blockchain
– and check one single number – the hash of a recent block.
• If the hash on the last block on the USB stick is different to the hash that
they can find from any other (non-colluding) participant, then the regulator
can immediately spot that something fishy is going on and the data on the
USB stick is different to the data on the living blockchain.
• In other words, it is extremely difficult to try to create a fake blockchain.
What if someone wants to cheat?
1
Client-Server:
● The server holds 100% of the data, and the clients trust that the data is
definitive.
● This is very efficient, and a traditional model in computing.
How is new data communicated?
1
Peer-to-peer:
● A gossip network where each peer has 100% of the data (or as close to it as
possible), and updates are shared around.
● In some ways less efficient than client-server, as data is replicated many
times; once per machine, and each change or addition to the data creates
a lot of noisy gossip.
● Each peer is more independent, and can continue operating to some
extent if it loses connectivity to the rest of the network.
● More robust, as there is no central server that can be controlled, so closing
down peer-to-peer networks is harder.
How is new data communicated?
1
The problems with peer-to-peer:
With peer-to-peer models, even if all peers are ‘trusted’, there can be a
problem of agreement or consensus – if each peer is updating at different
speeds and have slightly different states, how do you determine the “real” or
“true” state of the data?
Worse, in an ‘untrusted’ peer-to-peer network where you can’t necessarily
trust any of the peers, how do you ensure that the system can’t easily be
corrupted by bad peers?
How is new data communicated?
1
• A common conflict is when multiple miners create blocks at roughly the
same time. Because blocks take time to be shared across the network,
which one should count as the legit block?
Consensus
1
• Let’s say you see 81a first. You can start building the next block on that,
trying to create 82a
Longest Chain Rule
1
• However in a few seconds you may see 81b. If you see this, you keep an
eye on it. If later you see 82b, the “longest chain rule” says that you should
regard the longer ‘b’ chain as the valid one and ignore the shorter chain. So
you stop trying to make 82a and instead start trying to make 83b
Longest Chain Rule
1
1
Public vs Private BlockChain
Public
• Open read/write access to database
• Slower in Speed
• Proof-of-Work/ Proof-of Stake.
• Anonymous identity.
19
Private
• Permissioned read/write access to
database
• Faster in speed
• Pre-Approved Participants
• Known-identities
BlockChain vs Centralized Databases
1
1
Disintermediation (No middle-man)
BlockChain
• Transactions contain their own
proof of validity and their own proof
of authorization
• Offers a way to replace these
organizations with a distributed
database, locked down by clever
cryptography
• They leverage the ever-increasing
capacity of computer systems to
provide a new way of replacing
humans with code, which is a lot
cheaper
21
Centralized Databases
• The contents of a database are stored
in the memory and disk of a particular
computer system, and anybody with
sufficient access(mostly hired people in
organisations) to that system can
destroy or corrupt the data within
• As a result, the moment you entrust
your data to a regular database, you
also become dependent on the human
organization in which that database
resides.
1
Confidentiality
BlockChain
• Every node has full visibility into the
database’s current state, the
modification requested by a
transaction, and a digital signature
which proves the transaction’s
origin, Such full transparency can be
deal-killers in some use cases.
• However there are some advances
which provides confidentiality at
the cost of computation (ex: zero
knowledge proof, confidential
transactions)
22
Centralized Databases
• Just like blockchains, they restrict the
transactions that particular users can
perform, but these restrictions are
imposed in one central location.
• As a result, the full database contents
need only be visible at that location,
rather than in multiple nodes.
• Requests to read data also go through
this central authority, which can accept
or reject those requests as it sees fit.
• In other words, if a regular database is
read-controlled and write-controlled, a
blockchain can be write-controlled only.
1
Robustness
BlockChain
• Extreme fault tolerance, which
stems from their built-in
redundancy.
• Every node processes every
transaction, so no individual node is
crucial to the database as a whole.
• Nodes connect to each other in a
dense peer-to-peer fashion, so
many communication links can fail
before things grind to a halt.
• External users can send their
transactions to any node
23
Centralized Databases
• High availability is achieved through a
combination of expensive
infrastructure and disaster recovery.
• A primary database runs on high-end
hardware which is monitored closely
for problems, with transactions
replicated to a backup system
• If the primary database fails, activity is
automatically moved over to the
backup, which becomes the new
primary. While all this is doable, it’s
expensive and notoriously difficult to
get right.
1
Performance
BlockChain
• Will always be slower than
Centralized databases, because of
the nature of blockchains as it
contains the following burden on
top things centralized systems do:
• Signature Verification
• Consensus Mechanism
• Redundancy
24
Centralized Databases
• Once a connection has been
established, there is no need to
individually verify every request that
comes over it
• Centralized databases must also
contend with conflicting and aborted
transactions, these are far less likely
where transactions are queued and
processed in a single location.
• It has to run the transactions just once
(or twice)
● Smart Contract
○ Distributed ledgers enable the coding of simple contracts that will execute when
specified conditions are met.
○ Ethereum is an open source blockchain project that was built specifically to realize this
possibility.
○ For eg, a derivative could be paid out when a financial instrument meets certain
benchmark, with the use of blockchain technology and Bitcoin enabling the payout to be
automated.
● Sharing Economy
○ Sharing Economy is already flourishing with companies like Uber and AirBnb
○ Currently, user who want to have a ride have to depend on intermediary like Uber, Ola
○ By enabling peer to peer payments, blockchain opens the door to direct interaction between
parties.
Use Cases
1
● Governance
○ By making the results fully transparent and publicly accessible, distributed database
technology could bring full transparency to elections or any other kind of poll taking.
○ Ethereum-based smart contracts help to automate the process.
● Supply Chain Auditing
○ Consumers increasingly want to know that the ethical claims companies make about their
products are real.
○ Distributed ledgers provide an easy way to certify that the backstories of the things we buy
are genuine
○ Transparency comes with blockchain-based timestamping of a date and location — on ethical
diamonds, for instance — that corresponds to a product number.
○ The UK-based Provenance offers supply chain auditing for a range of consumer goods.
Making use of the Ethereum blockchain, a Provenance pilot project ensures that fish sold in
Sushi restaurants in Japan has been sustainably harvested by its suppliers in Indonesia.
Use Cases
1
● File Storage
○ Distributing data throughout the network protects files from getting hacked or lost.
○ Eg. IPFS(Inter Planetary File System),makes it easy to conceptualize how a distributed web
might operate. Similar to the way a bittorrent moves data around the internet, IPFS gets rid
of the need for centralized client-server relationships (i.e., the current web).
● Identity Management
○ Distributed ledgers offer enhanced methods for proving who you are, along with the
possibility to digitize personal documents
○ Having a secure identity will also be important for online interactions — for instance, in the
sharing economy.
● Stock Trading
○ When executed peer-to-peer, trade confirmations become almost instantaneous (as opposed
to taking three days for clearance.
○ Potentially, this means intermediaries — such as the clearing house, auditors and custodians
— get removed from the process.
Use Cases
1
• Ethereum is software running on a network of computers that
ensures that data and small computer programs called smart
contracts are replicated and processed on all the computers on the
network, without a central coordinator.
• Ethereum is for distributed data storage plus computations. The
small computer programs being run are called Smart Contracts,
and the contracts are run by participants on their machines using a
sort of operating system called a “Ethereum Virtual Machine”.
Ethereum
1
• A smart contract is some
code which automates the “if
this happens then do that”
part of traditional contracts
• With smart contracts running
on a blockchain, the logic is
run in parallel on all the
participating computers, and
the results are compared by
all participants.
Smart Contract
1
• Smart contracts are visible to all. This means anyone can look into a
smart contract, and if you like the logic, you can use it. If you don’t,
you don’t.
Smart Contract
1
Why Smart Contracts Useful?
• Lets say two banks have a trading agreement between them with
some pre-agreed trade terms with some external dependencies.
• Ideally they both should agree on the outcome of trade but it doesnt
happen always due to reasons like mutual misunderstanding of trade
terms, disagreement with what happened to external dependency
etc.
• Now, how smart contracts solve this?
• There is only one set of trade terms, written in computer code, which
is much less fluffy than legalese, and agreed upon up-front.
• The contract will live on a blockchain, and run when an event
happens or when the bet expires.
1
Why Smart Contracts Useful?
• The external dependencies (price of oil, share price of Apple, etc)
can be fed in via a mutually agreed feed.
• The bet payout can be stored in the smart contract itself: the contract
is “primed” by both parties funding the account with their maximum
loss, and then the payout occurs at the event
1
• Ethereum has a blockchain, which contains blocks of data
(transactions and smart contracts). The blocks are created or mined
by some participants and distributed to other participants who
validate them.
• Ethereum network is a public, permissionless network – ie anyone
can download or write some software to connect to the network and
start creating transactions and smart contracts, validating them, and
mining blocks without needing to log in or sign up with any other
organisation.
Ethereum
1
• Mining participants create valid blocks by spending electricity to find
solutions to a mathematical puzzle.Hence, it is also a Proof-of-Work
mining
• Ethereum has its inbuilt cryptocurrency “ether” just like bitcoin.
• Ethereum’s block size is defined in terms of “gas” limit per block in
contrast to Mb size in BTC.
• For eg. a block can have size of 1,500,000 Gas. And the basic
transaction requires around 21000 gas so total of 1,500,000/21000 =
70 transactions can fit into one block.
Ethereum
1
• Smart Contracts are written in solidity language that is created by
ethereum organisation itself.
• When you activate a smart contract, you ask all the miners in the
whole network to each individually perform the calculations within it.
This costs them time and energy, and Gas is the mechanism by
which you pay them for that service.
• Payment (in ETH) = Gas amount (in Gas) x Gas price (in ETH/Gas)
Ethereum
1
DEMO
1
THANKS
Any Feedback is Welcome!
1
1. Create two payments with the same bitcoins: one to
an online retailer, the other to yourself (another
address you control)
2. Only broadcast the payment that pays the retailer
3. When the payment gets added in an honest block,
the retailer sends you goods
4. Secretly create a longer chain of blocks which
excludes the payment to the retailer, and includes the
payment to yourself
5. Publish the longer chain. If the other nodes are
playing by the “longest chain rule” rule, then they will
ignore the honest block with the retailer payment,
and continue to build on your longer chain. The
honest block is said to be ‘orphaned’ and does not
exist to all intents and purposes.
6. The original payment to the retailer will be deemed
invalid by the honest nodes because those bitcoins
have already been spent (in your longer chain)
Double-Spend
1
• What about trying to change the existing data in a blockchain that you are
participating in?
• How would you try to get an amended block accepted by others in the
network?
Changing a blockchain mid-flight
1
• So if you rebroadcast an amended block 250,000 you are in effect creating
a blockchain ‘fork’ which is much shorter than the real chain (whose length
is, say, 470,000).
• There are now two competing blockchains, one which is 250,000 blocks
long and contains your amended block, and another which is 470,000
blocks long.
• Existing nodes will accept your block (if it’s valid) but then immediately
ignore it because they already know about the existing longer chain.
Changing a blockchain mid-flight
1
• The only way is to make the change and create a longer chain, requiring
lots of computing power and push an entirely new lineage of blocks out,
longer than the existing one.
• You need a significant amount of computing power to be in with a chance
of outcompeting an existing proof-of-work chain like Bitcoin.
• And even if you manage to do this, although technically your new chain
would be valid, realistically the community would notice if there was a
block re-organisation more than a few blocks deep; this would get
investigated.
Changing a blockchain mid-flight
1

More Related Content

What's hot

Understanding Blockchain and why it's so popular?
Understanding Blockchain and why it's so popular? Understanding Blockchain and why it's so popular?
Understanding Blockchain and why it's so popular?
Harsh Kumar
 
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Svetlin Nakov
 
02 hello smart contracts
02 hello smart contracts02 hello smart contracts
02 hello smart contracts
BastianBlankenburg
 
Introduction to Blockchain & development
Introduction to Blockchain & developmentIntroduction to Blockchain & development
Introduction to Blockchain & development
Abdullah Aziz
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithms
Anurag Dashputre
 
Payment Protocols - Block Chain & Beyond
Payment Protocols - Block Chain & BeyondPayment Protocols - Block Chain & Beyond
Payment Protocols - Block Chain & Beyond
Alexander Kiriakou
 
Blockchain. A Guide For Beginners
Blockchain. A Guide For BeginnersBlockchain. A Guide For Beginners
Blockchain. A Guide For Beginners
ElifTech
 
Распределенный blockchain процессинг / Алексей Трошичев (QiWi, Rakuten)
Распределенный blockchain процессинг / Алексей Трошичев (QiWi, Rakuten)Распределенный blockchain процессинг / Алексей Трошичев (QiWi, Rakuten)
Распределенный blockchain процессинг / Алексей Трошичев (QiWi, Rakuten)
Ontico
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Codemotion
 
Blockchain Technology Review and Its Scope
Blockchain Technology Review and Its ScopeBlockchain Technology Review and Its Scope
Blockchain Technology Review and Its Scope
IRJET Journal
 
Blockchain - Things you need to know
Blockchain - Things you need to knowBlockchain - Things you need to know
Blockchain - Things you need to know
NAAPBOOKS
 
Build your own block chain
Build your own block chainBuild your own block chain
Build your own block chain
Bohdan Szymanik
 
Distributed Systems for Blockchain using Cloud
Distributed  Systems for Blockchain  using CloudDistributed  Systems for Blockchain  using Cloud
Distributed Systems for Blockchain using Cloud
Hridyesh Bisht
 
SpaceChain - Blockchain in Space
SpaceChain - Blockchain in SpaceSpaceChain - Blockchain in Space
SpaceChain - Blockchain in Space
AlecHo7
 
Things to do with a blockchain
Things to do with a blockchainThings to do with a blockchain
Things to do with a blockchain
Felix Albert
 
Blockchain Scalability - Themes, Tools and Techniques
Blockchain Scalability - Themes, Tools and TechniquesBlockchain Scalability - Themes, Tools and Techniques
Blockchain Scalability - Themes, Tools and Techniques
Gokul Alex
 
What to expect from Blockchain in 2019?
What to expect from Blockchain in 2019?What to expect from Blockchain in 2019?
What to expect from Blockchain in 2019?
PECB
 
Blockchain
BlockchainBlockchain
Blockchain
shyguy1188
 
Demystifying Blockchain for businesses
Demystifying Blockchain for businessesDemystifying Blockchain for businesses
Demystifying Blockchain for businesses
Scott Turner
 
Boolberry reduces blockchain bloat
Boolberry reduces blockchain bloatBoolberry reduces blockchain bloat
Boolberry reduces blockchain bloat
boolberry
 

What's hot (20)

Understanding Blockchain and why it's so popular?
Understanding Blockchain and why it's so popular? Understanding Blockchain and why it's so popular?
Understanding Blockchain and why it's so popular?
 
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
 
02 hello smart contracts
02 hello smart contracts02 hello smart contracts
02 hello smart contracts
 
Introduction to Blockchain & development
Introduction to Blockchain & developmentIntroduction to Blockchain & development
Introduction to Blockchain & development
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithms
 
Payment Protocols - Block Chain & Beyond
Payment Protocols - Block Chain & BeyondPayment Protocols - Block Chain & Beyond
Payment Protocols - Block Chain & Beyond
 
Blockchain. A Guide For Beginners
Blockchain. A Guide For BeginnersBlockchain. A Guide For Beginners
Blockchain. A Guide For Beginners
 
Распределенный blockchain процессинг / Алексей Трошичев (QiWi, Rakuten)
Распределенный blockchain процессинг / Алексей Трошичев (QiWi, Rakuten)Распределенный blockchain процессинг / Алексей Трошичев (QiWi, Rakuten)
Распределенный blockchain процессинг / Алексей Трошичев (QiWi, Rakuten)
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Blockchain Technology Review and Its Scope
Blockchain Technology Review and Its ScopeBlockchain Technology Review and Its Scope
Blockchain Technology Review and Its Scope
 
Blockchain - Things you need to know
Blockchain - Things you need to knowBlockchain - Things you need to know
Blockchain - Things you need to know
 
Build your own block chain
Build your own block chainBuild your own block chain
Build your own block chain
 
Distributed Systems for Blockchain using Cloud
Distributed  Systems for Blockchain  using CloudDistributed  Systems for Blockchain  using Cloud
Distributed Systems for Blockchain using Cloud
 
SpaceChain - Blockchain in Space
SpaceChain - Blockchain in SpaceSpaceChain - Blockchain in Space
SpaceChain - Blockchain in Space
 
Things to do with a blockchain
Things to do with a blockchainThings to do with a blockchain
Things to do with a blockchain
 
Blockchain Scalability - Themes, Tools and Techniques
Blockchain Scalability - Themes, Tools and TechniquesBlockchain Scalability - Themes, Tools and Techniques
Blockchain Scalability - Themes, Tools and Techniques
 
What to expect from Blockchain in 2019?
What to expect from Blockchain in 2019?What to expect from Blockchain in 2019?
What to expect from Blockchain in 2019?
 
Blockchain
BlockchainBlockchain
Blockchain
 
Demystifying Blockchain for businesses
Demystifying Blockchain for businessesDemystifying Blockchain for businesses
Demystifying Blockchain for businesses
 
Boolberry reduces blockchain bloat
Boolberry reduces blockchain bloatBoolberry reduces blockchain bloat
Boolberry reduces blockchain bloat
 

Similar to Mock javameetup v1

Blockchain Explained
Blockchain Explained Blockchain Explained
Blockchain Explained
wedefine
 
Block chain
Block chainBlock chain
Block chain
gehad hamdy
 
Blockchain, Hyperledger, DeFi, Web 3.0 - understanding and concepts
Blockchain,  Hyperledger, DeFi, Web 3.0 - understanding and conceptsBlockchain,  Hyperledger, DeFi, Web 3.0 - understanding and concepts
Blockchain, Hyperledger, DeFi, Web 3.0 - understanding and concepts
keithfernandez19
 
Blockchain Ecosystem and Cryptocurrency Regulations
Blockchain Ecosystem and Cryptocurrency RegulationsBlockchain Ecosystem and Cryptocurrency Regulations
Blockchain Ecosystem and Cryptocurrency Regulations
Amir Rafati
 
Block chain technology
Block chain technologyBlock chain technology
Block chain technology
Md. Syful Azam
 
Architecture and operations.pptx
Architecture and operations.pptxArchitecture and operations.pptx
Architecture and operations.pptx
harshitmittal737363
 
Blockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdfBlockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdf
adinugroho751867
 
Blockchain (1).pptx
Blockchain (1).pptxBlockchain (1).pptx
Blockchain (1).pptx
MeetPBarasara
 
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Zeeve
 
The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin
Jérôme Kehrli
 
BLOCK CHAIN technology for the students.
BLOCK CHAIN technology for the students.BLOCK CHAIN technology for the students.
BLOCK CHAIN technology for the students.
Rajasekhar364622
 
Blockchain and Decentralization
Blockchain and DecentralizationBlockchain and Decentralization
Blockchain and Decentralization
Priyab Satoshi
 
BLOCKCHAIN.pptx
BLOCKCHAIN.pptxBLOCKCHAIN.pptx
BLOCKCHAIN.pptx
ChelladuraiBose1
 
Introduction to Blockchain Governance Models
Introduction to Blockchain Governance ModelsIntroduction to Blockchain Governance Models
Introduction to Blockchain Governance Models
Gokul Alex
 
12 Myths about Blockchain Technology
12 Myths about Blockchain Technology12 Myths about Blockchain Technology
12 Myths about Blockchain Technology
Ahmed Banafa
 
Blockchain
BlockchainBlockchain
Blockchain
Yeasin Tanin
 
blockchain.pptx
blockchain.pptxblockchain.pptx
blockchain.pptx
19MEB302SahilAli
 
different consensus protocols in blockchian.pptx
different consensus protocols in blockchian.pptxdifferent consensus protocols in blockchian.pptx
different consensus protocols in blockchian.pptx
meena466141
 
Blockchain
BlockchainBlockchain
Blockchain
Sai Nath
 
Blockchain
BlockchainBlockchain
Blockchain
Abhinand Valasseri
 

Similar to Mock javameetup v1 (20)

Blockchain Explained
Blockchain Explained Blockchain Explained
Blockchain Explained
 
Block chain
Block chainBlock chain
Block chain
 
Blockchain, Hyperledger, DeFi, Web 3.0 - understanding and concepts
Blockchain,  Hyperledger, DeFi, Web 3.0 - understanding and conceptsBlockchain,  Hyperledger, DeFi, Web 3.0 - understanding and concepts
Blockchain, Hyperledger, DeFi, Web 3.0 - understanding and concepts
 
Blockchain Ecosystem and Cryptocurrency Regulations
Blockchain Ecosystem and Cryptocurrency RegulationsBlockchain Ecosystem and Cryptocurrency Regulations
Blockchain Ecosystem and Cryptocurrency Regulations
 
Block chain technology
Block chain technologyBlock chain technology
Block chain technology
 
Architecture and operations.pptx
Architecture and operations.pptxArchitecture and operations.pptx
Architecture and operations.pptx
 
Blockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdfBlockchain Fundamental_KIPMI_2022.02.26.pdf
Blockchain Fundamental_KIPMI_2022.02.26.pdf
 
Blockchain (1).pptx
Blockchain (1).pptxBlockchain (1).pptx
Blockchain (1).pptx
 
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
Journey to Blockchain Scalability: A Close Look at Complete Scaling Solutions...
 
The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin
 
BLOCK CHAIN technology for the students.
BLOCK CHAIN technology for the students.BLOCK CHAIN technology for the students.
BLOCK CHAIN technology for the students.
 
Blockchain and Decentralization
Blockchain and DecentralizationBlockchain and Decentralization
Blockchain and Decentralization
 
BLOCKCHAIN.pptx
BLOCKCHAIN.pptxBLOCKCHAIN.pptx
BLOCKCHAIN.pptx
 
Introduction to Blockchain Governance Models
Introduction to Blockchain Governance ModelsIntroduction to Blockchain Governance Models
Introduction to Blockchain Governance Models
 
12 Myths about Blockchain Technology
12 Myths about Blockchain Technology12 Myths about Blockchain Technology
12 Myths about Blockchain Technology
 
Blockchain
BlockchainBlockchain
Blockchain
 
blockchain.pptx
blockchain.pptxblockchain.pptx
blockchain.pptx
 
different consensus protocols in blockchian.pptx
different consensus protocols in blockchian.pptxdifferent consensus protocols in blockchian.pptx
different consensus protocols in blockchian.pptx
 
Blockchain
BlockchainBlockchain
Blockchain
 
Blockchain
BlockchainBlockchain
Blockchain
 

Recently uploaded

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 

Recently uploaded (20)

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 

Mock javameetup v1

  • 1. Introduction to Blockchain Heart of Bitcoin Revolution
  • 2. 1
  • 4. • A blockchain is just a file, a data structure. • Blockchain = Chain of blocks • Where each block stores information of transactions and chained by storing meta-data about the previous block Blockchain 1
  • 5. 1
  • 6. • Immutable means that something is unchanging over time or unable to be changed, in our context, it means once data has been written to a blockchain no one, not even a system administrator, can change it. • In traditional systems, an end-user may have read-only access. He will not be able to change the contents of a row in that database. • However, someone with higher privileged access like a systems administrator may be able to change the data. • We try to create segregations of responsibility, so that no single person can do something bad undetected. However there is no control mechanism making the data immutable in the first place. Immutability 1
  • 7. • A hash function is a type of mathematical function which turns data into a fingerprint of that data called a hash. • SHA-256(Ahmedabad-Java-Meetup) = 6ffacd79bc7bad8ecf50f0394f6eb16aa39167482a2717108bc157647fb92b 51 • It’s hard to back-calculate the original data from the hash • If the input data changes in the slightest, the hash changes in an unpredictable way Immutability in Blockchain 1
  • 8. • Each block contains: • Hash of contents of the block • Hash of the previous block • Data in a blockchain is internally consistent, that is you can run some checks on it, and if the data and hashes don’t match up, there has definitely been some tinkering. Immutability in Blockchain 1
  • 9. Let’s first see what happens if you took Bitcoin’s Blockchain and copied it onto a USB stick (it’s about 120GB). What could you do with the data on the stick before passing it to someone else, like a regulator? Could you change the data and fool them? Bitcoin’s blockchain has nearly 470,000 blocks. Let’s say you remove a transaction from block 250,000 which is about half way through the blockchain, trying to pretend that a specific payment never happened. What would happen? What if someone wants to cheat? 1
  • 10. 1. Hash of changed block fails, so he has to recalculate the hash of the block. 2. The chain fails, he will need to rebuild and rehash each block following the tampered block, replacing the contents of the previous-block-hash pointers. However, there are safeguards to make it very hard or impossible to rebuild a blockchain. These safeguards differ based on the block-adding mechanisms, two dominant schemes are target hashes for proof-of-work public blockchains; and specific signatures for (some) private blockchains. What if someone wants to cheat? 1
  • 11. Proof-of-work : Block is only considered valid if the block hash follows a strict pattern - – namely the hash has to be smaller than a target number, often described by “starting with a certain number of zeroes”. Ex: SHA-256(block-data,previous-block-hash,nonce) must start with 0000 He needs to make sure that the recalculated hash is below a certain number. Need to re-mine the block by adjusting another part of the block’s contents (called the nonce) repeatedly until you find a hash that is smaller than the target number. This takes some significant computational power. And then do this for each and every block in the blockchain. What if someone wants to cheat? 1
  • 12. • Let’s say you manage to create an internally consistent blockchain by removing the transaction and recreating all the block hashes to all conform to the validation criteria. • All it takes now for the regulator is to check other copies of the blockchain – and check one single number – the hash of a recent block. • If the hash on the last block on the USB stick is different to the hash that they can find from any other (non-colluding) participant, then the regulator can immediately spot that something fishy is going on and the data on the USB stick is different to the data on the living blockchain. • In other words, it is extremely difficult to try to create a fake blockchain. What if someone wants to cheat? 1
  • 13. Client-Server: ● The server holds 100% of the data, and the clients trust that the data is definitive. ● This is very efficient, and a traditional model in computing. How is new data communicated? 1
  • 14. Peer-to-peer: ● A gossip network where each peer has 100% of the data (or as close to it as possible), and updates are shared around. ● In some ways less efficient than client-server, as data is replicated many times; once per machine, and each change or addition to the data creates a lot of noisy gossip. ● Each peer is more independent, and can continue operating to some extent if it loses connectivity to the rest of the network. ● More robust, as there is no central server that can be controlled, so closing down peer-to-peer networks is harder. How is new data communicated? 1
  • 15. The problems with peer-to-peer: With peer-to-peer models, even if all peers are ‘trusted’, there can be a problem of agreement or consensus – if each peer is updating at different speeds and have slightly different states, how do you determine the “real” or “true” state of the data? Worse, in an ‘untrusted’ peer-to-peer network where you can’t necessarily trust any of the peers, how do you ensure that the system can’t easily be corrupted by bad peers? How is new data communicated? 1
  • 16. • A common conflict is when multiple miners create blocks at roughly the same time. Because blocks take time to be shared across the network, which one should count as the legit block? Consensus 1
  • 17. • Let’s say you see 81a first. You can start building the next block on that, trying to create 82a Longest Chain Rule 1
  • 18. • However in a few seconds you may see 81b. If you see this, you keep an eye on it. If later you see 82b, the “longest chain rule” says that you should regard the longer ‘b’ chain as the valid one and ignore the shorter chain. So you stop trying to make 82a and instead start trying to make 83b Longest Chain Rule 1
  • 19. 1 Public vs Private BlockChain Public • Open read/write access to database • Slower in Speed • Proof-of-Work/ Proof-of Stake. • Anonymous identity. 19 Private • Permissioned read/write access to database • Faster in speed • Pre-Approved Participants • Known-identities
  • 21. 1 Disintermediation (No middle-man) BlockChain • Transactions contain their own proof of validity and their own proof of authorization • Offers a way to replace these organizations with a distributed database, locked down by clever cryptography • They leverage the ever-increasing capacity of computer systems to provide a new way of replacing humans with code, which is a lot cheaper 21 Centralized Databases • The contents of a database are stored in the memory and disk of a particular computer system, and anybody with sufficient access(mostly hired people in organisations) to that system can destroy or corrupt the data within • As a result, the moment you entrust your data to a regular database, you also become dependent on the human organization in which that database resides.
  • 22. 1 Confidentiality BlockChain • Every node has full visibility into the database’s current state, the modification requested by a transaction, and a digital signature which proves the transaction’s origin, Such full transparency can be deal-killers in some use cases. • However there are some advances which provides confidentiality at the cost of computation (ex: zero knowledge proof, confidential transactions) 22 Centralized Databases • Just like blockchains, they restrict the transactions that particular users can perform, but these restrictions are imposed in one central location. • As a result, the full database contents need only be visible at that location, rather than in multiple nodes. • Requests to read data also go through this central authority, which can accept or reject those requests as it sees fit. • In other words, if a regular database is read-controlled and write-controlled, a blockchain can be write-controlled only.
  • 23. 1 Robustness BlockChain • Extreme fault tolerance, which stems from their built-in redundancy. • Every node processes every transaction, so no individual node is crucial to the database as a whole. • Nodes connect to each other in a dense peer-to-peer fashion, so many communication links can fail before things grind to a halt. • External users can send their transactions to any node 23 Centralized Databases • High availability is achieved through a combination of expensive infrastructure and disaster recovery. • A primary database runs on high-end hardware which is monitored closely for problems, with transactions replicated to a backup system • If the primary database fails, activity is automatically moved over to the backup, which becomes the new primary. While all this is doable, it’s expensive and notoriously difficult to get right.
  • 24. 1 Performance BlockChain • Will always be slower than Centralized databases, because of the nature of blockchains as it contains the following burden on top things centralized systems do: • Signature Verification • Consensus Mechanism • Redundancy 24 Centralized Databases • Once a connection has been established, there is no need to individually verify every request that comes over it • Centralized databases must also contend with conflicting and aborted transactions, these are far less likely where transactions are queued and processed in a single location. • It has to run the transactions just once (or twice)
  • 25. ● Smart Contract ○ Distributed ledgers enable the coding of simple contracts that will execute when specified conditions are met. ○ Ethereum is an open source blockchain project that was built specifically to realize this possibility. ○ For eg, a derivative could be paid out when a financial instrument meets certain benchmark, with the use of blockchain technology and Bitcoin enabling the payout to be automated. ● Sharing Economy ○ Sharing Economy is already flourishing with companies like Uber and AirBnb ○ Currently, user who want to have a ride have to depend on intermediary like Uber, Ola ○ By enabling peer to peer payments, blockchain opens the door to direct interaction between parties. Use Cases 1
  • 26. ● Governance ○ By making the results fully transparent and publicly accessible, distributed database technology could bring full transparency to elections or any other kind of poll taking. ○ Ethereum-based smart contracts help to automate the process. ● Supply Chain Auditing ○ Consumers increasingly want to know that the ethical claims companies make about their products are real. ○ Distributed ledgers provide an easy way to certify that the backstories of the things we buy are genuine ○ Transparency comes with blockchain-based timestamping of a date and location — on ethical diamonds, for instance — that corresponds to a product number. ○ The UK-based Provenance offers supply chain auditing for a range of consumer goods. Making use of the Ethereum blockchain, a Provenance pilot project ensures that fish sold in Sushi restaurants in Japan has been sustainably harvested by its suppliers in Indonesia. Use Cases 1
  • 27. ● File Storage ○ Distributing data throughout the network protects files from getting hacked or lost. ○ Eg. IPFS(Inter Planetary File System),makes it easy to conceptualize how a distributed web might operate. Similar to the way a bittorrent moves data around the internet, IPFS gets rid of the need for centralized client-server relationships (i.e., the current web). ● Identity Management ○ Distributed ledgers offer enhanced methods for proving who you are, along with the possibility to digitize personal documents ○ Having a secure identity will also be important for online interactions — for instance, in the sharing economy. ● Stock Trading ○ When executed peer-to-peer, trade confirmations become almost instantaneous (as opposed to taking three days for clearance. ○ Potentially, this means intermediaries — such as the clearing house, auditors and custodians — get removed from the process. Use Cases 1
  • 28. • Ethereum is software running on a network of computers that ensures that data and small computer programs called smart contracts are replicated and processed on all the computers on the network, without a central coordinator. • Ethereum is for distributed data storage plus computations. The small computer programs being run are called Smart Contracts, and the contracts are run by participants on their machines using a sort of operating system called a “Ethereum Virtual Machine”. Ethereum 1
  • 29. • A smart contract is some code which automates the “if this happens then do that” part of traditional contracts • With smart contracts running on a blockchain, the logic is run in parallel on all the participating computers, and the results are compared by all participants. Smart Contract 1
  • 30. • Smart contracts are visible to all. This means anyone can look into a smart contract, and if you like the logic, you can use it. If you don’t, you don’t. Smart Contract 1
  • 31. Why Smart Contracts Useful? • Lets say two banks have a trading agreement between them with some pre-agreed trade terms with some external dependencies. • Ideally they both should agree on the outcome of trade but it doesnt happen always due to reasons like mutual misunderstanding of trade terms, disagreement with what happened to external dependency etc. • Now, how smart contracts solve this? • There is only one set of trade terms, written in computer code, which is much less fluffy than legalese, and agreed upon up-front. • The contract will live on a blockchain, and run when an event happens or when the bet expires. 1
  • 32. Why Smart Contracts Useful? • The external dependencies (price of oil, share price of Apple, etc) can be fed in via a mutually agreed feed. • The bet payout can be stored in the smart contract itself: the contract is “primed” by both parties funding the account with their maximum loss, and then the payout occurs at the event 1
  • 33. • Ethereum has a blockchain, which contains blocks of data (transactions and smart contracts). The blocks are created or mined by some participants and distributed to other participants who validate them. • Ethereum network is a public, permissionless network – ie anyone can download or write some software to connect to the network and start creating transactions and smart contracts, validating them, and mining blocks without needing to log in or sign up with any other organisation. Ethereum 1
  • 34. • Mining participants create valid blocks by spending electricity to find solutions to a mathematical puzzle.Hence, it is also a Proof-of-Work mining • Ethereum has its inbuilt cryptocurrency “ether” just like bitcoin. • Ethereum’s block size is defined in terms of “gas” limit per block in contrast to Mb size in BTC. • For eg. a block can have size of 1,500,000 Gas. And the basic transaction requires around 21000 gas so total of 1,500,000/21000 = 70 transactions can fit into one block. Ethereum 1
  • 35. • Smart Contracts are written in solidity language that is created by ethereum organisation itself. • When you activate a smart contract, you ask all the miners in the whole network to each individually perform the calculations within it. This costs them time and energy, and Gas is the mechanism by which you pay them for that service. • Payment (in ETH) = Gas amount (in Gas) x Gas price (in ETH/Gas) Ethereum 1
  • 38. 1. Create two payments with the same bitcoins: one to an online retailer, the other to yourself (another address you control) 2. Only broadcast the payment that pays the retailer 3. When the payment gets added in an honest block, the retailer sends you goods 4. Secretly create a longer chain of blocks which excludes the payment to the retailer, and includes the payment to yourself 5. Publish the longer chain. If the other nodes are playing by the “longest chain rule” rule, then they will ignore the honest block with the retailer payment, and continue to build on your longer chain. The honest block is said to be ‘orphaned’ and does not exist to all intents and purposes. 6. The original payment to the retailer will be deemed invalid by the honest nodes because those bitcoins have already been spent (in your longer chain) Double-Spend 1
  • 39. • What about trying to change the existing data in a blockchain that you are participating in? • How would you try to get an amended block accepted by others in the network? Changing a blockchain mid-flight 1
  • 40. • So if you rebroadcast an amended block 250,000 you are in effect creating a blockchain ‘fork’ which is much shorter than the real chain (whose length is, say, 470,000). • There are now two competing blockchains, one which is 250,000 blocks long and contains your amended block, and another which is 470,000 blocks long. • Existing nodes will accept your block (if it’s valid) but then immediately ignore it because they already know about the existing longer chain. Changing a blockchain mid-flight 1
  • 41. • The only way is to make the change and create a longer chain, requiring lots of computing power and push an entirely new lineage of blocks out, longer than the existing one. • You need a significant amount of computing power to be in with a chance of outcompeting an existing proof-of-work chain like Bitcoin. • And even if you manage to do this, although technically your new chain would be valid, realistically the community would notice if there was a block re-organisation more than a few blocks deep; this would get investigated. Changing a blockchain mid-flight 1