Flexchain is a model-driven approach for the flexible execution of multi-party business processes based on blockchain. Flexchain considers permissionless blockchains, which are actually the most used typologies for addressing trust in distributed and untrusted environments. The prototypical implementation relies on Ethereum, providing a touring-complete language (Solidity) for writing smart contracts. The resulting tool exploits BPMN choreography models for the specification of multi-party business processes. After the creation, the model is automatically translated into an on-chain smart
contract, and a rule-based program implemented with the Drools engine. The first maintains
the current execution state, while the second corresponds to the choreography’s logic that is
executed in an off-chain processor.
After the deployment of the contract inside the blockchain, business parties can start to collaborate by exploiting the Flexchain interface. During this stage, choreography messages can be exchanged using the low-level contract functions and the off-chain processor. This step is done in a completely transparent manner for the final user, who does not have to know any implementation details. The main benefit of the Flexchain solution is the decoupling of the logic from its state allowing run-time updates without discontinuity in the execution. Furthermore, the usage of an off-chain processor helps to reduce execution costs and thus mitigate the scalability issues of public blockchains.