A blockchain-based method and system for software copyright trading and protection.
By combining blockchain and IPFS technologies, a consortium blockchain was established and the abstract syntax tree and Jaccard coefficient algorithm were used to solve the problems of high cost and plagiarism detection in software copyright protection. This enabled low-cost and efficient copyright transactions and plagiarism detection, and enhanced the transparency and fairness of copyright protection.
Patent Information
- Application Number
- CN202411674150.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-21
AI Technical Summary
Existing technologies for software copyright protection suffer from high costs, complex transaction processes, and difficulties in plagiarism detection, especially lacking effective means for software copyright confirmation and protection.
It adopts a combination of blockchain-based consortium blockchain and InterPlanetary File System (IPFS) technology. The consortium blockchain is established through a consensus mechanism. Software developers upload copyright information and generate digital signatures. The code structure is analyzed using abstract syntax trees, transactions are conducted in conjunction with smart contracts, and plagiarism is determined through an improved Jaccard coefficient algorithm.
It enables low-cost and efficient software copyright transactions and plagiarism detection, improves the transparency and traceability of copyright evidence preservation, reduces judicial costs, and enhances the fairness of copyright protection and the system's resistance to attacks.
Smart Images

Figure CN119622670B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain application technology, and more specifically, to a method and system for software copyright transaction and protection based on blockchain. Background Technology
[0002] In current software copyright protection practices, while traditional centralized storage methods ensure the security of copyright information to some extent, they have significant limitations, including high storage costs, cumbersome application processes, lengthy waiting times, and susceptibility to tampering and misappropriation. These shortcomings not only make it difficult to fully protect the rights of original creators but also exacerbate the complexity of copyright protection. Although there are suggestions to utilize IPFS and blockchain technology to strengthen the protection of digital media copyright—for example, Dr. Kwame, in "Digital Media Copyright and Content Protection Using IPFS and Blockchain," proposes combining the InterPlanetary File System (IPFS) and Fabric Alliance blockchain technology to help protect digital media copyright and ensure full ownership—software copyright protection is more complex than digital copyright. On the one hand, software copyright research focuses primarily on code plagiarism detection, failing to fundamentally address the issues of copyright confirmation and protection; on the other hand, defining software plagiarism remains difficult. Although blockchain technology provides an immutable and traceable method of copyright registration, how to effectively utilize these technologies to detect and prevent software plagiarism in practice remains an unresolved issue.
[0003] This invention proposes a blockchain-based system that integrates software copyright transactions and software plagiarism detection, resulting in higher integration, faster response times, and better storage efficiency compared to previous systems. The system combines two methods to ensure the traceability of copyright information, while facilitating the detection of infringing software and subsequent legal action. Summary of the Invention
[0004] In view of the shortcomings of the above-mentioned technologies, the purpose of this invention is to provide a software copyright transaction and protection method and system based on blockchain, so as to solve the problems of high copyright storage costs, complex transactions and difficulty in plagiarism detection in the prior art;
[0005] To achieve the above objectives, the present invention adopts the following technical solution, including:
[0006] S1. Several software vendors establish a consortium blockchain through consensus, with each offline terminal device serving as an InterPlanetary File System (IPFS) node.
[0007] S2. Software developers upload the finished software and its copyright information to the InterPlanetary File System (IPFS), and record and verify the copyright information on the blockchain digital node.
[0008] S3. Generate a digital signature based on copyright information. The software extracts the syntax structure of the software code through an abstract syntax tree. The extracted tree is a tree-like representation of the abstract syntax structure of the source code. Each node in the tree represents a structure in the source code. The digital signature, abstract syntax tree, copyright information, and software version information are integrated and written into the blockchain digital node as the initial block of the consortium blockchain.
[0009] S4. After the software purchaser and buyer reach a transaction agreement, the copyright transaction is conducted through a smart contract. The buyer conducts an off-chain transaction after meeting the conditions of the smart contract. After the transaction is completed, the transaction process is stored in the consortium blockchain digital node. The buyer obtains the hash value index CID of the latest version of the software on the InterPlanetary File System (IPFS). The CID is the only way to accurately obtain the corresponding software file in IPFS.
[0010] S5. When both parties to a software purchase discover suspected infringing software, they submit a testing request. The suspected software is processed through an abstract syntax tree and uploaded to the consortium blockchain. The smart contract will automatically compare the abstract syntax tree structures of the genuine software and the suspected software.
[0011] S6. Set a similarity threshold and calculate the similarity between the two software programs using the improved Jaccard coefficient determination interval algorithm. Based on the calculation results, determine whether plagiarism has occurred.
[0012] Software vendors establish consortium blockchains through a consensus mechanism. Initially, software vendors must undergo real-name authentication; vendors joining the consortium blockchain must verify their identity through authoritative authentication; after authentication, other vendors on the consortium blockchain will allow the vendor to join and grant them rights such as uploading software and participating in voting. Through real-name authentication and authoritative authentication, the authenticity of the vendor's identity is ensured, the occurrence of malicious behavior is reduced, and the credibility of the system is further enhanced.
[0013] Abstract syntax trees extract the syntactic structure of software code. First, the source code to be transformed is preprocessed, including removing comments and whitespace characters, standardizing code format, and normalizing variable names. This transforms the code into a standardized JavaScript code form with unified specifications, reducing the complexity of subsequent processing and analysis, and improving the efficiency of code transformation, optimization, and analysis.
[0014] A sidechain is created to separate copyright transactions for different software. The number of sidechains is the same as the number of software involved in the copyright transactions. The initial node for generating the sidechain will be recorded in the main chain. As the number of software increases, the system capacity can be easily expanded, performance optimized, and transaction processing speed improved by adding sidechains.
[0015] The second objective of this invention is to provide a copyright trading system generated according to the aforementioned software copyright protection method based on blockchain technology, comprising the following steps:
[0016] The data upload module is used by software vendors to upload information related to the finished software and the abstract syntax tree of the software after identity verification. This information will serve as the basic data for copyright protection and transactions, and provide necessary data support for subsequent processes.
[0017] The storage module includes the InterPlanetary File System (IPFS) and a consortium blockchain. The former is used to permanently store detailed information about the finished software and its suppliers, while the latter records software version update information and evidence of copyright transactions.
[0018] The data processing module is used to process and transform uploaded data, including generating digital signatures for the identity of software vendors, providing software source code preprocessing, and extracting the abstract syntax tree structure of the software.
[0019] The transaction module includes a platform that allows both parties in a software copyright transaction to negotiate the software price, and is also responsible for the delivery of the software after the transaction is completed and the packaging of the transaction data for storage;
[0020] The plagiarism detection module is used to determine whether suspected software has plagiarized behavior. It extracts non-obfuscated features from the source code and converts them into abstract syntax trees, identifies the similarity between abstract syntax trees, and provides technical support for plagiarism detection.
[0021] The threshold change module is used to improve the plagiarism range judgment threshold, and dynamically adjusts the threshold according to the complexity and fullness of the software.
[0022] The data upload module, transaction module, data processing module, and plagiarism detection module are all connected to the record storage module to ensure data consistency and traceability throughout the system. The threshold change module is connected to the plagiarism detection module, and every change in the threshold directly affects the results obtained by the plagiarism detection module.
[0023] As described above, the blockchain-based software copyright transaction and protection method of the present invention has the following beneficial effects:
[0024] This invention integrates software copyright transactions and software plagiarism detection into the same environment, which significantly reduces the difficulty of use and improves the ease of use compared to methods with only a single function.
[0025] Employing consortium blockchain technology, this solution offers a low-cost, efficient, traceable, and trustworthy solution that reduces judicial costs, protects legitimate rights, and enhances copyright preservation and enforcement capabilities. Establishing a consortium blockchain through consensus among software vendors ensures the chain's decentralized nature and democratic governance structure, strengthening the system's attack resistance and transparency. Each offline terminal acts as an IPFS node, facilitating distributed data storage and improving data availability and disaster resilience.
[0026] Generating digital signatures and extracting abstract syntax trees from software code provides a unique, content-based identifier for copyright information. Writing this information as initial blocks to the blockchain establishes a clear and immutable record of software copyright, providing a solid foundation for copyright verification and dispute resolution.
[0027] After the software purchaser and seller reach an agreement, the transaction is conducted off-chain via smart contracts, simplifying the transaction process and reducing costs. Once the transaction is complete, relevant information is stored on the consortium blockchain, ensuring transparency and traceability.
[0028] By setting a similarity threshold and calculating similarity using an interval-based algorithm, a clear standard for plagiarism detection is provided. This method not only improves the objectivity of plagiarism detection but also helps reduce subjective judgment errors, making copyright protection more fair and reliable.
[0029] Meanwhile, the blockchain-based software copyright transaction and protection system of the present invention has the following beneficial effects:
[0030] The system uses software sharding for storage, uploads it to the IPFS network, and combines it with a consortium blockchain for copyright transactions, thus realizing a decentralized storage and processing model. By separating the software upload and copyright transaction processes, the system's operational efficiency and overall security are effectively improved.
[0031] Furthermore, the system utilizes an abstract syntax tree structure for comparison and introduces an improved Jaccard coefficient algorithm to accurately identify software plagiarism. To adapt to the complexity of different types of software, the system can dynamically adjust the plagiarism detection threshold, ensuring the accuracy and flexibility of the copyright protection process. This further enhances the system's application effectiveness in the field of copyright protection and ensures its long-term applicability and innovation capabilities. Attached Figure Description
[0032] The advantages of the above aspects of the present invention will become apparent and readily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0033] Figure 1 This is a flowchart illustrating a blockchain-based software copyright transaction and protection method according to a specific embodiment of the present invention.
[0034] Figure 2 This is a schematic diagram of a software supplier's software copyright transaction process according to a specific embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of a software copyright transaction process conducted by a software purchaser according to a specific embodiment of the present invention.
[0036] Figure 4 This is a schematic diagram illustrating the detailed steps of plagiarism detection according to a specific embodiment of the present invention. Detailed Implementation
[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] Example 1: Please refer to Figure 1 As shown, this example provides a blockchain-based method for software copyright trading and protection. The copyright trading process includes the following steps:
[0039] S1. Several software vendors establish a consortium blockchain through consensus, with each offline terminal device serving as an InterPlanetary File System (IPFS) node.
[0040] S2. Software developers upload the finished software and its copyright information to the InterPlanetary File System (IPFS), and record and verify the copyright information on the blockchain digital node.
[0041] S3. Generate a digital signature based on copyright information. The software extracts the syntax structure of the software code through an abstract syntax tree. The extracted tree is a tree-like representation of the abstract syntax structure of the source code. Each node in the tree represents a structure in the source code. The digital signature, abstract syntax tree, copyright information, and software version information are integrated and written into the blockchain digital node as the initial block of the consortium blockchain.
[0042] S4. After the software purchaser and buyer reach a transaction agreement, the copyright transaction is conducted through a smart contract. The buyer conducts an off-chain transaction after meeting the conditions of the smart contract. After the transaction is completed, the transaction process is stored in the consortium blockchain digital node. The buyer obtains the hash value index CID of the latest version of the software on the InterPlanetary File System (IPFS). The CID is the only way to accurately obtain the corresponding software file in IPFS.
[0043] In this scheme, software vendors undergo real-name authentication through an authoritative certification authority, obtain digital certificates, generate digital signatures based on copyright information, and then write these digital signatures, copyright information, and the software's abstract syntax tree structure together as initial nodes into the consortium blockchain. This process establishes a unique correspondence between copyright information and the software vendor, ensuring the authenticity of the vendor's identity. Copyright information can be verified before each transaction, thus achieving effective protection of software copyright.
[0044] By enabling suppliers to join the consortium blockchain through a consensus mechanism, the security of the transaction environment is ensured, effectively preventing common transaction vulnerabilities such as double-spending attacks. Each offline terminal acts as an IPFS node, participating in data storage and retrieval. This eliminates the single point of failure problem caused by centralized software storage, reduces costs, and also ensures the ease of subsequent software updates and the addition of new software.
[0045] Example 2: Please refer to Figure 2 , Figure 3 and Figure 4 As shown, this example provides a blockchain-based method for software copyright trading and protection. The software protection process includes the following steps:
[0046] S1. When both parties to a software purchase discover suspected infringing software, they submit a testing request. The suspected software is processed through an abstract syntax tree and uploaded to the consortium blockchain. The smart contract will automatically compare the abstract syntax tree structures of the genuine software and the suspected software.
[0047] S2. Set a similarity threshold and calculate the similarity between the two software programs using the improved Jaccard coefficient determination interval algorithm. Based on the calculation results, determine whether plagiarism has occurred.
[0048] Leveraging the features of IPFS, the system divides the finished software into fixed-size data blocks and uploads them to decentralized nodes. This process generates the software's hash value, and thanks to the advantages of distributed storage, it significantly improves the system's throughput, enabling it to handle access requests from different completed transactions in real time. This achieves parallel processing of software delivery after copyright transactions, reducing the transaction complexity that may arise during copyright transfers, i.e., reducing the amount of data information that software authors and buyers need to process during the transaction. Moreover, when the software needs to be updated, for modules with unchanged functionality, files with the same content will have the same index value, eliminating the need for repeated uploads. Suppliers can use this feature to conveniently manage versions and trace the history of software copyright information.
[0049] When suspected plagiarism occurs, potentially originating from external sources or other similar software within the consortium blockchain, the first step is source code preprocessing. This step aims to remove parts of the source code irrelevant to the programming logic. Furthermore, functions with diverse implementation possibilities are standardized into a unified form. Subsequently, the compiler's parser analyzes the code to generate an Abstract Syntax Tree (AST). These ASTs typically contain a large amount of information unrelated to the logic and structure of the source code; to eliminate unnecessary nodes, all nodes lacking program structure information are removed. Finally, the resulting tree contains only important nodes and includes the program's structural information; this is called the Abstract Syntax Tree. When software in the consortium blockchain is uploaded to IPFS, its Abstract Syntax Tree structure is already stored in the consortium blockchain nodes. When suspected plagiarism exists externally, both parties can directly upload the Abstract Syntax Tree of the software to be detected, triggering a smart contract for automatic detection. The contract automatically calculates the similarity coefficient between the two ASTs using a formula as follows:
[0050]
[0051] In the above formula, Sc1 and Sc2 are two software source codes that need to be verified for similarity. SET(Sc1) and SET(Sc2) are the standardized JavaScript code formats of Sc1 and Sc2, respectively. The similarity between the two source codes is represented by a similarity score. The similarity score ranges from 0 to 100, where 0 represents completely different source codes and 100 represents an exact copy without modifications. Then, based on a reasonable threshold, if the similarity score exceeds the threshold, it can be determined whether the code is original or plagiarized. Furthermore, the threshold can vary with the amount of code. For example, for software with a large amount of code and more comprehensive functions, the similarity between them tends to be relatively high, and therefore, the corresponding threshold will be lower.
[0052] The present invention also provides a blockchain-based software copyright transaction and protection system, characterized in that it includes a data upload module, a record storage module, a data processing module, a transaction module, a plagiarism detection module, and a threshold change module;
[0053] Data Upload Module: After authentication, software vendors upload relevant information about the finished software and its abstract syntax tree. This data not only forms the core foundation for copyright protection and transactions but also provides essential support for subsequent system processing and analysis.
[0054] The storage module includes the InterPlanetary File System (IPFS) and a consortium blockchain. IPFS is responsible for permanently storing detailed information about the finished software and its suppliers, ensuring the data is immutable and can be stored for a long time. The consortium blockchain records software version update information and evidence of copyright transactions, ensuring the transparency and traceability of the transaction process.
[0055] Data processing module: This module is primarily responsible for processing and transforming uploaded data. It can generate digital signatures for software vendors to ensure the uniqueness and authenticity of their identities. Simultaneously, it provides preprocessing of software source code and extracts the software's abstract syntax tree structure, supporting plagiarism detection and subsequent transactions.
[0056] The transaction module provides a negotiation platform for both parties in a software copyright transaction, allowing them to negotiate the software price. After the transaction is completed, the system automatically delivers the latest version of the software by sending the IPFS software node information to the buyer, and packages the transaction data and uploads it to the storage module to ensure the integrity of the entire transaction process and guarantee the fairness and legality of the transaction.
[0057] The plagiarism detection module is responsible for determining whether suspected software has engaged in plagiarism. By extracting non-obfuscated features from the source code and converting them into an abstract syntax tree, the system uses an improved Jaccard coefficient to evaluate the similarity between software, providing technical support for plagiarism detection and ensuring the effectiveness of copyright protection.
[0058] The threshold adjustment module dynamically adjusts the plagiarism detection threshold range based on the complexity and functionality of the software. As the threshold changes, the system can flexibly adapt to the needs of different software, further improving the accuracy of plagiarism detection.
[0059] The data upload module, transaction module, data processing module, and plagiarism detection module are all connected to the record storage module to ensure the consistency and traceability of data throughout the system. The threshold change module is connected to the plagiarism detection module, and each change in the threshold directly affects the plagiarism detection results, ensuring that the detection process has high flexibility and accuracy.
[0060] Compared with existing copyright trading platforms, this blockchain-based software copyright trading and protection system achieves significant improvements. The system stores software fragments on IPFS and conducts transactions on a consortium blockchain, ensuring decentralized software storage and effectively separating the software upload and copyright trading processes, thus improving transaction efficiency and security. Simultaneously, the system employs a comparative abstract syntax tree structure and an improved Jaccard coefficient to determine software plagiarism, enhancing the accuracy of plagiarism detection. By dynamically adjusting the plagiarism threshold, it adapts to the complexity of different software, resulting in more refined copyright protection.
[0061] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for software copyright transaction and protection based on blockchain, characterized in that, Includes the following steps: S1. Several software vendors establish a consortium blockchain through a consensus mechanism, with each offline terminal device serving as an IPFS node. S2. Software developers upload the finished software and its copyright information to the InterPlanetary File System (IPFS), and record and verify the copyright information on the consortium blockchain digital node. S3. Generate a digital signature based on copyright information. The software extracts the syntax structure of the software code through an abstract syntax tree. The extracted abstract syntax tree is a tree-like representation of the abstract syntax structure of the source code. Each node in the tree represents a structure in the source code. Digital signatures, abstract syntax trees, copyright information, and software version information are integrated and written into the blockchain digital node as the initial block of the consortium blockchain; S4. After the software purchaser and buyer reach a transaction agreement, the copyright transaction is conducted through a smart contract. The buyer conducts an off-chain transaction after meeting the conditions of the smart contract. After the transaction is completed, the transaction process is stored in the consortium blockchain digital node. The buyer obtains the hash value index CID of the latest version of the software on the InterPlanetary File System (IPFS). The CID is the only way to accurately obtain the corresponding software file in IPFS. S5. When both parties to a software purchase discover suspected infringing software, they submit a testing request. The suspected software is processed through an abstract syntax tree and uploaded to the consortium blockchain. The smart contract will automatically compare the abstract syntax tree structures of the genuine software and the suspected software. S6. Set a similarity threshold and calculate the similarity between the two software programs using the improved Jaccard coefficient determination interval algorithm. The algorithm includes the following steps: Sc1 and Sc2 are the source codes of two software programs that need to be verified for similarity. Define SET(Sc1) and SET(Sc2) as the standardized Javascript code sets of Sc1 and Sc2 after preprocessing. Then, use the improved Jaccard coefficient to evaluate the similarity score between Sc1 and Sc2. The calculation method is as follows: The result of this formula will not be affected by the difference between the two hash values or the process of generating the hash index; in this way, the similarity between two pieces of software source code is normalized to the range of 0% to 100%; based on a pre-set reasonable threshold, if the similarity score exceeds the threshold, it is judged that the code has plagiarism; the threshold will vary with the amount of code; for software with a large amount of code and more comprehensive functions, the corresponding threshold will be lowered accordingly; based on the calculation results, it is determined whether plagiarism has occurred.
2. The method for software copyright transaction and protection based on blockchain according to claim 1, characterized in that, In step S1, the software vendor establishes a consortium blockchain through consensus. Initially, the software vendor needs to undergo real-name authentication. Vendors joining the consortium blockchain need authoritative certification to prove their identity. Authentication methods include certificates issued by the industrial and commercial departments and digital certificates issued by digital certificate authentication authorities. After the vendor meets the certification standards of the consortium blockchain, it will receive a digital certificate allocated by the consortium blockchain. Only after certification is completed will other suppliers on the consortium blockchain allow the organization or node to enter and obtain the right to upload software and vote.
3. The method for software copyright transaction and protection based on blockchain according to claim 1, characterized in that, In step S3, copyright information and software version information are used as the initial block of the consortium blockchain. The method includes creating a sidechain to separate copyright transactions of different software. The number of sidechains is the same as the number of software in the copyright transactions. The initial node for generating the sidechain will be recorded in the main chain.
4. A blockchain-based software copyright transaction and protection system, characterized in that, The system is used to implement the software copyright transaction and protection method based on blockchain as described in any one of claims 1-3, including a data upload module, a record storage module, a data processing module, a transaction module, a plagiarism detection module, and a threshold change module. The data upload module is used by software vendors to upload information related to the finished software and the abstract syntax tree of the software after identity verification. This information will serve as the basic data for copyright protection and transactions, and provide necessary data support for subsequent processes. The storage module includes the InterPlanetary File System (IPFS) and a consortium blockchain. The former is used to permanently store detailed information about the finished software and its suppliers, while the latter records software version update information and evidence of copyright transactions. The data processing module is used to process and transform uploaded data, including generating digital signatures for the identity of software vendors, providing software source code preprocessing, and extracting the abstract syntax tree structure of the software. The transaction module includes a platform that allows both parties in a software copyright transaction to negotiate the software price, and is also responsible for the delivery of the software after the transaction is completed and for packaging the transaction data and sending it to the storage module. The plagiarism detection module is used to determine whether suspected software has plagiarized behavior. It extracts non-obfuscated features from the source code and converts them into abstract syntax trees, identifies the similarity between abstract syntax trees, and provides technical support for plagiarism detection. The threshold change module is used to improve the plagiarism range judgment threshold, and dynamically adjusts the threshold according to the complexity and fullness of the software. The data upload module, transaction module, data processing module, and plagiarism detection module are all connected to the record storage module; the threshold change module is connected to the plagiarism detection module, and every change in the threshold directly affects the result obtained by the plagiarism detection module.
5. A blockchain-based software copyright transaction and protection system according to claim 4, characterized in that, The data upload module includes an authentication module, where users must authenticate themselves before proceeding to the next step.
6. A blockchain-based software copyright transaction and protection system according to claim 4, characterized in that, For the record storage module, each modification result of the sidechain is recorded in the main chain.
7. A blockchain-based software copyright transaction and protection system according to claim 4, characterized in that, In the data processing module, the system uses the black-box upload method provided by the InterPlanetary File System (IPFS) to store the software in blocks. Each software block is organized in the form of a Merkle Directed Acyclic Graph (DAG), and the hash value of the root node serves as the unique identifier of the software.
Citation Information
Patent Citations
Copyright protection system and method based on block chain and IPFS
CN114722355A
Software copyright protection method and system based on block chain technology
CN116563030A