Blockchain & Robotic Process Automation

23
Blockchain & Robotic Process Automation Prof. Dr. Agnes Koschmider

Transcript of Blockchain & Robotic Process Automation

Page 1: Blockchain & Robotic Process Automation

Blockchain &

Robotic Process AutomationProf. Dr. Agnes Koschmider

Page 2: Blockchain & Robotic Process Automation

Lecture Overview

Page 3: Blockchain & Robotic Process Automation

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

Page 4: Blockchain & Robotic Process Automation

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

Page 5: Blockchain & Robotic Process Automation

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

Page 6: Blockchain & Robotic Process Automation

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.

Page 7: Blockchain & Robotic Process Automation

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

Page 8: Blockchain & Robotic Process Automation

▪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

Page 9: Blockchain & Robotic Process Automation

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

Page 10: Blockchain & Robotic Process Automation

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

Page 11: Blockchain & Robotic Process Automation

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:

Page 12: Blockchain & Robotic Process Automation

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?

Page 13: Blockchain & Robotic Process Automation

On-Chain vs. Off-chain

source: https://blog.enigma.co/building-on-chain-reputation-79139abe1730

Page 14: Blockchain & Robotic Process Automation

Blockchain Systems

source: https://hackernoon.com/comparison-of-smart-contract-platforms-2796e34673b7

Page 15: Blockchain & Robotic Process Automation

Difference between

Etherum and Hyperledger

Page 16: Blockchain & Robotic Process Automation

• K. Zhang, H.-A. Jacobsen: Towards

Dependable, Scalable, and Pervasive

Distributed Ledgers with Blockchains

Blockchain Stack

Page 17: Blockchain & Robotic Process Automation

▪ 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

Page 18: Blockchain & Robotic Process Automation

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

Page 19: Blockchain & Robotic Process Automation

Smart Contracts

Vehicle Manufacture Network (Example)

– Interaction with the smart contract

User + Application

Person PlaceOrder

Smart

Contract

Update

Ledger

Order#123

Blockchain network

Request

Page 20: Blockchain & Robotic Process Automation

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

Page 21: Blockchain & Robotic Process Automation

Blockchain – yes or no?

souce: https://eprint.iacr.org/2017/375.pdf

Page 22: Blockchain & Robotic Process Automation

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/

Page 23: Blockchain & Robotic Process Automation

https://kahoot.it/