2. The Blockchain
■ In 2008,Bitcoinwas launchedas a peer-to-peer
database that reliedona new data structure
referredto as the‘blockchain’.
■ The blockchain consists of blocks,whereeach
block holds a set of transactions anda reference
to the previous block.This helped create a chain of
all transactions that ever occurred.
■ This data structure is replicated across all
participating nodes so that every participant is
aware of the transactions withouthavingtoget them
froma centralauthority.
-
-
-
-
-
-
-
-
-
ethereumbounty resources Armenia ltd
3. Distributed Consensus
■ In orderto control how new blocks (with new
transactions) are added to the chain,the design
relies ona consensus mechanism which requires
anyone (a nodeinthe peerto peernetwork) who
wouldlike to nominate a new block (with new
transactions it has gatheredfromits peers) to solve
a puzzle that requires significant computations
(computer processing power). The difficulty of this
puzzle is dynamically adjustedsuch that it takes on
average 10 minutes for any one nodeto solve the
puzzle.Aprocess knownasmining.
■ Whenever a nodesolves the puzzle andcreate the
new block (which includes new transactions that it
has gatheredfromother peers aroundit), the nodeis
rewarded with an amountof newBitcoins which it
can use to pay for the cost of solving the puzzle
(computer equipmentandelectricity).
-
-
-
-
-
-
-
-
-
ethereumbounty investment holdings ltd
4. Decentralization
■ Given the architecture of the blockchain,the
database continues to grow so longasnodes
keeptryingto nominate andverify newblocks
regardless of nodes joiningorleaving the network
■ The factthat the entiredatabase exists without
dependingona single node,makes it very powerful
andalmost impossible to alter or destroy (the
decentralized feature of the blockchain)
■ The integrity/validityof transactions inthe block
chain is ensured throughthe use of cryptographic
techniques that make itefficient to verify if any
invalid transactions have been added
-
-
-
-
-
-
-
-
-
ethereumbounty resources
5. Beyond Bitcoin
■ The architecture of the blockchain is very powerful as
it enables decentralization while maintainingsecurity.
This has significant implications onthe design of
computersystems asit allows computerapplications
to be scalable andreduce the requirementfor a large
central infrastructure
■ While the first successful use of the blockchain
database architecture was demonstrated onthe
Bitcoin network, manystarted exploringhow theycan
utilize this design for othertransactions beyondvalue
transfer transactions which Bitcoin mainlyhandles
-
-
-
-
-
-
-
-
-
ethereumbounty resources Armenia
6. Towards a Peer to Peer Computing Framework
■ While, the design of the blockchain solved many
issues when it comes to decentralizing and
securing transactions. There was noeasy way to
specify logic that made use of that database for
purposes beyond the transfer of value between
accounts.
■ The Ethereumproject set out to design the required
pieces to evolve the blockchain froma distributed
transactional database to be part of a general
purposepeerto peercomputing framework.
■ At the heart of ethereumis a virtual machine
capable of executing instructions knownasthe
EthereumVirtual Machine (EVM), it allows the
executionof programmedinstructions stored within
theblockchain
-
-
-
-
-
-
-
-
-
ethereumLi Haidong
7. -
-
-
-
-
-
-
-
-
The Blockchain of State and Transactions
■ To introducethe ability to execute programs, the
blockchain was modifiedsuch that each block not
only contains the latesttransactions butalso the
latest state of memberprograms (aka., contracts).
■ With every new block the state of contracts in the
blockchain is updatedper the processed
transactions therebytaking the blockchain toa new
state.
■ As amean to ensure that provided instructions do
not runforever, a constraint is builtinto the execution
of every contract so that any party invokinga
contract ina transaction is required to provide
special tokens of monetaryvalue that get
consumed dependingonthe number of instructions
andthe storage used bythe contract.
ethereumLi Haidong Singapore
8. Contracts as Accounts
■ Acontract has a permanentaddressonthe
blockchain which gets assigned when it is
created. This permanentaddress isused to
identifythecontract.
■ Every contract contains a balance of the basic
monetaryunitin the ethereumnetwork referred to as
ether.
■ If a contract does not includeany programmed
instructions,it behaves as an account. It has an
address anda balance. This account can
receive/send ethers from/to other
accounts/contracts.
Address
Balance
ethereumLi Haidong
9. Contracts as Decentralized Executable Programs
■ Ether is requiredto call a contract, this is done to
ensure that infiniteexecutiondoes notoccur as the
executionstops the momentthe ether amountsent
along with the call isconsumed
■ When a contract is called, a small amountof ether
is requiredto be sent along with the call. This amount
is eventually transferredto the nodethat gets to
nominatethe nextblock inthe blockchain. However,
whena contract is called, an amountof ethercan be
directly transferred to that contract therebyinstituting
a balance transfer like in the case of apayment
■ When referringto the calling of acontract, it is in
reference to invokingone of the methods in the
programmedinstructions which can be used to
execute a certainaction
Fields
-
-
Methods
-
-
Events
-
-
Address
Balance
Li Haidong Singapore
ethereum
10. Contracts as Decentralized Executable Programs
■ The executionof amethodcan modifythe state of
the contract bymanipulatingone ormoreof its fields
■ Acontract can also have set of events which are
used to notify interested parties of the occurrence of
certain events duringthelifetime of thecontract
■ Acontract lives forever onthe blockchain once it is
created unless, the originalinstructions made use of
the suicide feature,afeature which destroys a
contract andtransfers its ether balance to another
account
Fields
-
-
Methods
-
-
Events
-
-
Address
Balance
ethereumLi Haidong
11. Messaging and File Sharing...
ethereum
swarm whisper
■ In additionto the use ofthe ethereumvirtual
machine to execute contract logic. The
ethereumproject also introducedtwo additional
protocols to provide peerto peer supportfor
exchangingmessage as well exchanging static
files
■ The peerto peerprotocol used forexchanging
message is named whisper andit provides a
powerfuldistributedandprivate messaging
capabilities with support for single cast, multicast
andbroadcastmessages
■ The peerto peerprotocol used forexchanging
static files is namedswarm andit provides a new
incentivized approach to distributestatic content
amongpeers andexchange them efficiently
ethereumLi Haidong Singapore
12. Decentralized Messaging
■ Whisper provides a peerto peerprotocolfor
exchangingshort timedmessagesprivately
■ Whisper relies ona subject key (Topic) approach to
deliver messages wheremessages are published
usinga hashedtopic
■ Messages can beencryptedwith a specific key for
privacy
■ Indirectly supportsbroadcast, multicast and
unicast
■ Whisper is ahighlatency andlow bandwidth
messagingprotocol
■ Provides the ability to use masks/filters to narrow
down topics of interest withoutgiving away what
topic is beingsought
whisper
Li Haidong ethereum
13. Incentivized File Transfer ...
swarm
■ Leverages the underlyingethereum infrastructure
throughthe use of acontracts andethers to
encourage cooperationamong nodes
■ Filesare split into chunkswhich are stored in
nodes in thenetwork
■ An accounting protocol is used bypeers tokeep track
of chunks delivered andreceived and resultingmicro-
payments owed
ethereumLi Haidong Singapore
14. DEMO
■ Assume we wouldliketo createa smart door
which opens upif given the rightkey.
■ Addinganew user requiredtwo ormoreusers to
authenticate thetransaction.
ethereumLi Haidong