Вы находитесь на странице: 1из 21

A lightweight BPMN

Execution Engine on
Ethereum
Luciano  García-­‐Bañuelos
University  of  Tartu
Blockchain  ...

Taken  from  hBp://smartmoney.startupitalia.eu/wp-­‐content/uploads/sites/7/2016/03/catena-­‐bitcoin.jpg  

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   1  
From  the  point  of  view  of  this  talk
• Distributed,  highly  (fully?)  replicated,  append  only  
database  
• Each  record  that  is  inserted  into  the  database  is  
secured  from  tampering  and  revision  
• Keywords  
◦  Distributed:  The  database  is  highly  replicated,  following  a  
peer-­‐to-­‐peer  architecture  (there  is  not  a  central  master  
node)  
◦  Append-­‐only  storage:  Wri_ng  to  the  database  can  only  
happen  by  adding  new  records  at  the  end  of  it  
◦  Descentralized  consensus:  the  majority  of  nodes  needs  to  
agree  that  a  yet-­‐to-­‐be-­‐added  record  is  legi_mate  or  not  

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   2  


Bitcoin’s  take  on  blockchain

Assume  “Alice”  sends  some  bitcoins  to  “Bob”,  


a  bitcoin  transac_on  will  accordingly  store:  
 
•  An  input:  This  is  a  record  of  which  bitcoin  
address  was  used  to  send  the  bitcoins  to  
“Alice”  in  the  first  place  
•  An  amount:  The  amount  of  bitcoins  being  
traded  
•  An  output:  This  is  “Bob”’s  bitcoin  address    

Image  taken  from  “Mastering  Bitcoin”  by  Andreas  M.  Antonopoulos,  O’Really  

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   3  


Ethereum’s  take  on  blockchain

Ethereum  components:          
1)  A  distributed  blockchain  (similar  to  Bitcoin)  
2)  A  compu_ng  plahorm  that  enables  the  execu_on  of  Smart  Contracts  
The  above  is  done  on  top  of  the  Ethereum  Virtual  Machine  (EVM)  
Image  taken  from  hBps://blog.ethereum.org/wp-­‐content/uploads/2015/11/ethblockchain_full.png  

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   4  
Smart  contract  …
• Programs  living  on  the  blockchain  (e.g.  Ethereum)  
with  their  own  memory  and  code  
• Blockchain  transac_ons  via  execu_on  of  contract  
func_ons  (clauses)  
• Manipulate  persistent  data  (contract  state),  
transfer  ether,  interact  with  other  contracts  or  
with  “agents”  

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   5  


Blockchain  as  a  plaEorm  for  
collaboraFve  business  processes
• Par_cipants  agree  on  a  collabora_ve  process  and  a  
model  for  it  
• The  model  is  translated  to  a  smart  contract(s)  to  
be  executed  on  the  blockchain  
• Smart  contracts  listen  to  process  execu_on  events  
and  interact  with  agents  or  other  smart  contracts  
in  order  to  monitor  and/or  execute  the  process  

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   6  


Blockchain  as  a  plaEorm  for  
collaboraFve  business  processes

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   7  


Blockchain  as  a  plaEorm  for  
6 Weber, Xu, Riveret, Governatori, Ponomare
collaboraFve  business  processes Design Time

• The  model  is  


BPMN
model

translated  to  a  smart  


contract(s)  to  be  
executed  on  the   Translator

blockchain  

Process
implementation

Factory contract

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   8  


Blockchain  as  a  plaEorm  for  
collaboraFve  business  processes
Weber, Xu, Riveret, Governatori, Ponomarev, and Mendling

Run Time • Smart  contracts  listen  


Process instance contract
(Mediator/Monitor)
On blockchain
to  process  execu_on  
Escrow Deposit collector events  and  interact  
Verification
Business logic
(Active/passive)
Factory
contract
with  agents  or  other  
Partial data
payload smart  contracts  in  
Execution
state
Participants
account order  to  monitor  and/
Trigger
Trigger
Trigger or  execute  the  process  
Data
Data
Data
payload
payload Interface
Interface
payload Interface
Internal
Internalprocess
Internalprocess
process

Key distributor

Off blockchain

Figure 2: Overview of our approach

Design Time: Translator


8/11/16   time: it takesBPMN  
translator is used at design ENGINE  ON  business
an existing ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS  
process 9  
fication as input and generates smart contracts. These implement the C-
tor or mediator and can be deployed and executed on the blockchain.
Smart  contract  ...  
• Described  by  Nick  Szabo  in  the  late  90s  

The  basic  idea  behind  smart  contracts  is  that  many  


kind  of  contractual  clauses  (e.g.  collaterals,  bonding,  
delinea_on  of  property  rights)  can  be  embedded  in  
hardware  and  solware  in  such  a  way  as  to  make  
breach  of  contract  expensive  for  the  breacher  

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   10  


Smart  contract?
• Contract:  Tradi_onal  way  to  formalize  a  
rela_onship  
• Defini_on  from  Merriam-­‐Webster  
◦ A  binding  agreement  between  two  or  more  persons  
or  par_es,  especially  one  legally  enforceable  
◦ A  business  arrangement  for  the  supply  of  goods  or  
services  at  a  fixed  price  
◦ The  act  of  marriage  or  an  agreement  to  marry  

◦ A  document  describing  the  terms  of  a  contract  

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   11  


A  concrete  example  …
• Within  a  limited  amount  of  
poten_al  loss,  the  vending  
machine  takes  in  coins  and  
dispenses  change  and  product  
according  to  the  displayed  price  
• Vending  machine  implements  a  
sort  of  contract  with  bearer:  
◦  Anybody  with  coins  can  
par_cipate  
◦  Some  security  mechanisms  
protect  stored  coins  and  product  
from  aBackers  

By  Minnesota  Historical  Society  -­‐  Original  Image  taken  from  The  Minnesota  Historical  Society  on  
Flickr,  CC  BY-­‐SA  2.0,  hBps://commons.wikimedia.org/w/index.php?curid=6608597  

8/11/16   BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  GARCÍA-­‐BAÑUELOS   12  


Another  example:  Remote  purchase

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   13  
BPMN  view  of  the  process
Seller
Escrow (Smart contract)

Notify Buyer  Confirm 
Notify Seller  Confirm  Notify Seller 
about contract  purchase 
about payment reception about reception
creation (payment)
Purchase contract
created

Remote purchase - Choreography


Buyer

Purchase details Shipment details

Seller Seller Seller Shipping company Seller

Create purchase contract Confirm purchase


Ship product Deliver product Confirm reception
(payment)

Buyer Buyer Shipping company Buyer Buyer

Payment details Delivery details

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   14  
Another  example:  Remote  purchase

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   15  
Remote  purchase    (cont)

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   16  
Remote  purchase  …  middleman

Escrow  

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   17  
Smart  contract  on  BPMN
Seller

Unblock Seller's
deposit
Escrow (Smart contract)

Cancel  Purchase 
transaction cancelled by 
Notify Buyer  Seller
Block Seller 
about contract 
deposit
creation
Purchase contract Transfer 
created Block buyer's  payment to 
Notify Seller  Confirm  Unblock Buyer's  Notify Seller 
payment and  Seller and 
about payment reception deposit about reception
deposit unblock Seller's 
Confirm purchase deposit Purchase 
completed
Buyer

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   18  
Demo  Fme

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   19  
Temporal  constraints  on  BPMN

Cancellation by 
guest

Block host & 
guest deposit
Cancellation by 
host

7 days before 
check­in

BPMN  ENGINE  ON  ETHEREUM                              LUCIANO  


8/11/16  
GARCÍA-­‐BAÑUELOS   20  

Вам также может понравиться