TY - GEN
T1 - Transformation from MVC Applications to Smart Contracts
AU - Gu, Qiqi
AU - Ke, Wei
AU - Yang, Yilong
N1 - Publisher Copyright:
© 2022 IEEE.
PY - 2022
Y1 - 2022
N2 - A smart contract is a program running on a blockchain platform. Smart devices send data to smart contracts or change their own status based on smart contracts. Businesses want to use smart devices and smart contracts to streamline workflow because smart contracts reduce the need in trusted intermediators and cut down enforcement costs. However, developing smart contract applications is challenging due to different memory models, different interaction models, and a dearth of supporting tools and libraries. When developers are asked to reimplement conventional applications to smart contracts, it is thus ideal to automatically transform them, avoiding manual labor, as well as ensuring reliability and security. This paper contributes a set of rules to transform conventional applications in the Model-View-Controller (MVC) pattern into smart contracts running on Hyperledger Fabric, a blockchain platform preferred by businesses. Major transformations are performed in the model, while in the controller, model calls are replaced by smart contract calls. The source application and the target smart contract are all written in Java. Our rules add read-your-writes consistency that Hyperledger Fabric does not natively support. Runtime pre- and post-condition checking in the original application is supported in the transformed smart contract. We evaluated our rules on CoCoME and other MVC applications, and all code ran correctly and passed unit tests.
AB - A smart contract is a program running on a blockchain platform. Smart devices send data to smart contracts or change their own status based on smart contracts. Businesses want to use smart devices and smart contracts to streamline workflow because smart contracts reduce the need in trusted intermediators and cut down enforcement costs. However, developing smart contract applications is challenging due to different memory models, different interaction models, and a dearth of supporting tools and libraries. When developers are asked to reimplement conventional applications to smart contracts, it is thus ideal to automatically transform them, avoiding manual labor, as well as ensuring reliability and security. This paper contributes a set of rules to transform conventional applications in the Model-View-Controller (MVC) pattern into smart contracts running on Hyperledger Fabric, a blockchain platform preferred by businesses. Major transformations are performed in the model, while in the controller, model calls are replaced by smart contract calls. The source application and the target smart contract are all written in Java. Our rules add read-your-writes consistency that Hyperledger Fabric does not natively support. Runtime pre- and post-condition checking in the original application is supported in the transformed smart contract. We evaluated our rules on CoCoME and other MVC applications, and all code ran correctly and passed unit tests.
KW - Code generation
KW - Hyperledger fabric
KW - IoT
KW - Smart contract
KW - Transformation
UR - http://www.scopus.com/inward/record.url?scp=85153860822&partnerID=8YFLogxK
U2 - 10.1109/EUC57774.2022.00025
DO - 10.1109/EUC57774.2022.00025
M3 - Conference contribution
AN - SCOPUS:85153860822
T3 - Proceedings - 2022 IEEE 20th International Conference on Embedded and Ubiquitous Computing, EUC 2022
SP - 104
EP - 111
BT - Proceedings - 2022 IEEE 20th International Conference on Embedded and Ubiquitous Computing, EUC 2022
PB - Institute of Electrical and Electronics Engineers Inc.
T2 - 20th IEEE International Conference on Embedded and Ubiquitous Computing, EUC 2022
Y2 - 9 December 2022 through 11 December 2022
ER -