The popularity of smart contracts is on the rise, yet breaches in reliability and security linger. Among the many facets of smart contract reliability, we concentrate on faults rooted in out-of-order interactions with contract endpoints. We propose SmartScribble, a protocol language to describe valid patterns of interaction between users and endpoints. SmartScribble not only ensures correct interactive behaviour but also simplifies smart contract coding. From a protocol description, our compiler generates a smart contract that can then be completed by the programmer with the relevant business logic. The generated contracts rely on finite state machines to control endpoint invocations. As a proof of concept, we target Plutus, the contract programming language for the Cardano blockchain. Preliminary evaluation points to a 75% decrease in the size of the code that developers must write, coupled with an increase of reliability by enforcing the specified patterns of interaction.
翻译:智能合同的受欢迎程度正在上升,但可靠性和安全性方面仍有缺陷。在智能合同可靠性的许多方面,我们集中关注与合同终点点的异常互动造成的缺陷。我们提出SmartScribbbing,这是一个描述用户和终点之间有效互动模式的协议语言。SmartScrib不仅确保正确的互动行为,而且简化了智能合同编码。从协议描述中,我们的编译者生成了一个智能合同,然后程序员可以用相关的商业逻辑来完成。产生的合同依靠有限的国家机器来控制终端职业。作为概念的证明,我们针对卡达诺区链的合同编程语言Plutus。初步评估指出,开发者必须写的代码的大小将减少75%,同时通过执行特定的互动模式来提高可靠性。