计算机与现代化 ›› 2022, Vol. 0 ›› Issue (10): 106-112.

• 网络与通信 • 上一篇    下一篇

面向区块链溯源的链下扩展存储方案

  

  1. (南京邮电大学通信与信息工程学院,江苏南京210003)
  • 出版日期:2022-10-20 发布日期:2022-10-24
  • 作者简介:张斌(1997—),男,河南鹤壁人,硕士研究生,研究方向:区块链,无线通信,E-mail: 1019010307@njupt.edu.cn; 李大鹏(1982—),男,江苏南京人,教授,博士,研究方向:无线网络,区块链,人工智能,机器学习,E-mail: dapengli@njupt.edu.cn; 蒋锐(1985—),男,江苏南京人,副教授,博士,研究方向:雷达信号处理,无线信息与能量同传,移动通信,E-mail: j_ray@njupt.edu.cn; 王小明(1986—),男,山东聊城人,副教授,博士,研究方向:移动通信系统,大数据,人工智能,E-mail: xmwang@njupt.edu.cn。
  • 基金资助:
    国家自然科学基金资助项目(61801240, 61971241)

An Off-chain Extended Storage Scheme for Blockchain Traceability

  1. (School of Communication and Information Engineering, Nanjing University of Posts and Telecommunications, Nanjing 210003, China)
  • Online:2022-10-20 Published:2022-10-24

摘要: 在基于区块链的供应链管理溯源系统中,由于区块链技术是一种基于分布式的系统,对于区块链中存储的数据所有节点都会进行备份,如果直接把溯源数据存储在链上,这会导致数据占用大量内存,增加溯源系统维护成本和降低系统响应速度的问题。因此提出一种链下扩展存储方案,该方案首先利用SHA-256哈希算法的单向性对明文数据进行哈希运算得到哈希值,然后采用SM2加密算法产生的私钥对哈希值进行签名,保证信息上传者身份的可靠,最后把哈希值和签名值通过智能合约保存在区块链中,明文数据和其哈希值与签名值在区块链上存储的地址则存储在数据库中。通过结合中心化存储和区块链技术各自的优势,既可以保证溯源数据不可被篡改又可以有效减少区块链网络中溯源数据所占内存的大小。最后,在所提方案的基础上,对溯源系统进行详细设计并采用以太坊区块链平台对其进行实现。

关键词: 溯源系统, 区块链, SHA-256哈希算法, SM2加密算法, 智能合约

Abstract: In the blockchain-based supply chain management traceability system, since the blockchain technology is a distributed system, all nodes will back up the data stored in the blockchain. If the traceability data is directly stored on the chain, it will cause the data to occupy a large amount of memory, increase the maintenance cost of the traceability system and reduce the system response speed. Therefore, an off-chain expansion storage scheme is proposed. Firstly, the scheme uses the unidirectionality of SHA-256 hash algorithm to hash the plaintext data to obtain the hash value, then uses the private key generated by the SM2 encryption algorithm to sign the hash value to ensure the reliability of the identity of the information uploader. Finally, the hash value and signature value are stored in the blockchain through the smart contract. Plaintext data and the address of its hash value and signature value stored on the blockchain are stored in the database. By combining the respective advantages of centralized storage and blockchain technology, it can not only ensure that the traceability data can not be tampered, but also effectively reduce the memory size occupied by the traceability data in the blockchain network. Finally, based on the proposed scheme, the traceability system is designed in detail and implemented using the Ethereum blockchain platform.

Key words: traceability system, blockchain, SHA-256 hash algorithm, SM2 encryption algorithm, smart contract