blockchain & robotic process automation
TRANSCRIPT
Blockchain &
Robotic Process AutomationProf. Dr. Agnes Koschmider
Lecture Overview
History of Blockchain
• Basic features of secured linking of single blocks
was described in 1991 by Haber & Stornetta
• In the year 2000, a general theory for secured
linking of blocks was presented
• In 2008, Blockchain was mentioned as a protocol
and distributed database (by Satoshi Nakamoto)
• First implementation of the Bitcoin software took
place in 2009
Blockchain
• The blockchain is a distributed peer-to-peer system of
subsequently unchangeable ledgers whose information content is
preserved as sorted and concatenated data blocks by means of
cryptographic security technologies to maintain integrity.
• peer-to-peer system
• concatenated data blocks
• cryptographic security technologies:
network participants have their own private keys
• maintain integrity
(immutable)PoW PoS
How does the blockchain work?
• A and B carry out a transaction
• Cryptographic keys are assigned to the A and
B transaction
• A new block is created that represents the
transaction
• The transaction is transmitted and validated by
a distributed network
• The block is then assigned to the blockchain,
which is a permanent record
• The transaction between A and B has ended
Elements of a Block: Nonce
Block x+1 Block x+2 Block x+3
Hash of x Nonce1
Transaction time-stamp
Hash of x+1 Nonce2
Transaction time-stamp
Hash of x+2 Nonce3
Transaction time-stamp
Nonce: is a random string that edits so-called "miners" to ensure that the hash
of the block meets the network's goals. It ensures uniqueness and prevent the
rerunning of transactions.
Elements of a Block: Hash
The most commonly used hashing algorithm is SHA-256:
For the same input, the SHA-256 algorithm will always
generate the same fixed-length output
▪ Hash should serve as a digital fingerprint
▪ Usually can not be decoded
Input SHA-256 Hash value
m 62C66A7A5DD70C3146618063C344E531E6D4B59808443CE962B3ABD63C5A
M 08F271887CE94707DA822D5263BAE19D5519CB3614E0DAEDC4C7CE5DAB7
M1 2D214CA69B86C255BE416D42CCA977A59B34A7492873105522C3501FAB806
▪Hash-based data structure that maps data to a
key
▪A representative hash of all
transactions included in the block
▪Used for data transmission
▪ Instead of an information file,
hashes are used
Merkle Tree
▪ K. Zhang, H.-A. Jacobsen: Towards Dependable,
Scalable, and Pervasive
Distributed Ledgers with Blockchains
Concatenation
• the first block is called the genesis block
• anyone can group transactions into blocks
• if two participants calculate a valid block almost
simultaneously, then the longer chain will remain
• The other chain is returned to the pool with unconfirmed
transactions and reprocessed in the next block
• the consensus algorithm provides a way to append new
blocks to the chain
Block x+1
Block x+2 Block x+3
Block x+2 Block x+3
Block x+4
Consensus Algorithm
(Proof of Work)
Algorithm:
• retrieves a set of transactions from pending transactions
• the algorithm rewards participants who solve cryptographic puzzles
• broad proof-of-work for all nodes (code to open the lock)
• write transactions to the blockchain if a proof-of-work is valid for the
majority of nodes (nodes can open the lock)
node
start process
to validate
transactions
55445544
node
node
node
5544
5544
validated transactionsavailable transactions
group to be validated
Consensus Algorithm
– Acceptance of the rules and laws defined in the
protocol
– Acceptance of nodes and interest groups that
adhere to these rules
– equal treatment for all network participants
If the rules are ignored, a node can be excluded
Functional requirements:
Consensus Algorithm
(Proof of Stake)
• a set of validators take turns proposing and voting on the next
block
• anyone who holds the blockchain's base cryptocurrency can
become a validator by sending a special type of transaction
• the weight of each validator's vote depends on the size of its
deposit (i.e. stake)
→ This algorithms depends on a validator's economic stake in
the network
risks of PoS:
• how to select the next validator
• what if a validator does not complete this job?
On-Chain vs. Off-chain
source: https://blog.enigma.co/building-on-chain-reputation-79139abe1730
Blockchain Systems
source: https://hackernoon.com/comparison-of-smart-contract-platforms-2796e34673b7
• K. Zhang, H.-A. Jacobsen: Towards
Dependable, Scalable, and Pervasive
Distributed Ledgers with Blockchains
Blockchain Stack
▪ a smart contract defines the executable logic that generates new facts that
are added to the ledger. 1
Smart Contracts
1 https://hyperledger-fabric.readthedocs.io/en/release-1.4/smartcontract/smartcontract.html
Input
Contract ID
Transaction
request
Current
State
Code
Contract
Interpreter
Smart Contract
Business Logic
Accept/Reject
Attestation of
Correctness
State Delta
Output
Smart Contracts
Vehicle Manufacture Network1 (Example)
– „This network tracks the manufacture of vehicles from an
initial order request through to their completion by the
manufacturer…“ 2
1 https://www.npmjs.com/package/vehicle-manufacture-network2 https://github.com/hyperledger/composer-sample-networks/tree/master/packages/vehicle-manufacture-network
• Order
• Vehicle
• Person
• Manufacturer
• PlaceOrder
• UpdateOrderStatus
Assets Participants Transactions
Smart Contracts
Vehicle Manufacture Network (Example)
– Interaction with the smart contract
User + Application
Person PlaceOrder
Smart
Contract
Update
Ledger
Order#123
Blockchain network
Request
How Blockchain could end
the trade in blood diamonds
source: https://medium.com/the-future-of-financial-services/are-diamonds-forever-how-millennials-are-changing-the-jewelry-game-part-ii-f5e6b82b339e
Blockchain – yes or no?
souce: https://eprint.iacr.org/2017/375.pdf
Does a Blockchain always
make sense?
Use Case:• We want our customers to be absolutely sure they are buying
expensive goods, such as watches, wines, or cars
• we link our wine bottle to a token supported by blockchain and put a
QR code on it
• Now, every step of the way (from manufacturer, to carrier, to store,
to customer) is confirmed by a separate blockchain transaction and
the customer can track their bottle online
• solution: a dishonest seller can make a copy of a real bottle with a
token, fill it with wine of lower quality, and either steal your expensive
wine or sell it to someone who does not care about tokens
→ is this system vulnerable?
https://forkast.news/2019/09/09/opinion-you-do-not-need-blockchain-eight-popular-use-cases-and-why-they-do-not-work/
https://kahoot.it/