Smart contracts are self-executing programs on a blockchain to ensure immutable and transparent agreements without the involvement of intermediaries. Despite the growing popularity of smart contracts for many blockchain platforms like Ethereum, smart contract developers cannot prevent copying their smart contracts from competitors due to the absence of technical means available. However, applying existing software watermarking techniques is challenging because of the unique properties of smart contracts, such as a code size constraint, non-free execution cost, and no support for dynamic allocation under a virtual machine environment. This paper introduces a novel software watermarking scheme, dubbed SmartMark, aiming to protect the piracy of smart contracts. SmartMark builds the control flow graph of a target contract runtime bytecode and locates a series of bytes randomly selected from a collection of opcodes to represent a watermark. We implement a full-fledged prototype for Ethereum, applying SmartMark to 27,824 unique smart contract bytecodes. Our empirical results demonstrate that SmartMark can effectively embed a watermark into smart contracts and verify its presence, meeting the requirements of credibility and imperceptibility while incurring a slight performance degradation. Furthermore, our security analysis shows that SmartMark is resilient against foreseeable watermarking corruption attacks; e.g., a large number of dummy opcodes are needed to disable a watermark effectively, resulting in producing illegitimate smart contract clones that are not economical.
翻译:智能合约是区块链上的自执行程序,旨在确保在没有中介参与的情况下实现不可变和透明的协议。尽管在许多区块链平台(如以太坊)中,智能合约变得越来越流行,但由于缺乏技术手段,智能合约开发者不能防止其合约被竞争对手抄袭。然而,由于智能合约具有代码大小的限制、非免费的执行成本和虚拟机环境下动态分配方面的不支持等独特属性,因此应用现有的软件水印技术具有挑战性。本文提出了一种新颖的软件水印方案,称为SmartMark,旨在保护智能合约的盗版。SmartMark构建目标合约运行时的代码控制流图,并从一组运算码中随机选择一系列字节来表示水印。我们为以太坊实现了一个完整的原型,将SmartMark应用于27,824个独特的智能合约二进制代码。我们的实证结果表明,SmartMark可以有效地将水印嵌入智能合约并验证其存在,满足可信性和不可察觉性的要求,同时产生轻微的性能下降。此外,我们的安全分析表明,SmartMark对可预见的水印破坏攻击具有抵抗力;例如,需要大量虚假运算码才能有效地禁用水印,导致产生非经济合理的智能合约克隆。