Software version control and management system based on block chain
By adopting technologies such as private chains, efficient consensus mechanisms, hybrid storage and smart contracts in the software version control system, the performance bottlenecks, high storage costs and data privacy of the blockchain version control system are solved, and efficient, secure and scalable version control management is achieved.
Patent Information
- Application Number
- CN202411817793.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing blockchain-based software version control and management system has performance bottlenecks, high storage costs, data privacy issues, complex implementation and management, poor scalability, and energy consumption issues of consensus mechanisms.
Private chains or licensed chains are adopted, combined with efficient consensus mechanisms such as Byzantine fault tolerance or proof of stake, using hybrid storage architecture and hash fingerprint technology, smart contracts are introduced for automated management, encrypted storage and access control, and system performance is optimized through incremental version storage and efficient retrieval system.
It improves the performance and storage efficiency of the system, reduces storage costs and energy consumption, enhances data privacy protection and system scalability and maintenance, and improves the operational efficiency and trust of developers.
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software version control of blockchain, and specifically to a software version control and management system based on blockchain. Background Art
[0002] The blockchain-based software version control and management system uses the decentralized, tamper-proof and transparent characteristics of blockchain to record and track the version history and management process of the software. Each time the code is submitted or the version is updated, the system will generate a block, encrypt and store the version information, submission records and related metadata on the blockchain, and ensure that all operations of software development have a traceable history and cannot be tampered with. This not only improves the security and reliability of version management, but also enhances the transparency of team collaboration, can effectively prevent code tampering and version conflicts, and provide higher trust guarantees. Through technologies such as smart contracts, the blockchain version control system can also automate some processes and improve development efficiency.
[0003] In the prior art, the software version control and management system based on blockchain has some shortcomings, including: Performance bottleneck: The transaction processing speed of the blockchain itself is relatively slow, especially on the public chain. Since each transaction needs to go through multiple node verification and consensus mechanisms, the processing efficiency is low. For large-scale software version control systems, it may not be able to meet the needs of high-frequency updates and management. High storage cost: The data storage of the blockchain is decentralized, and each version of the code and change records will be stored on the blockchain, resulting in a gradual increase in storage costs. With frequent version updates and the continuous expansion of the code base, the storage demand will also increase exponentially, increasing the maintenance cost of the system. Data privacy issues: Although blockchain technology provides a high degree of transparency and immutability, in some cases, the source code or update content of the software version may need to be kept confidential. The open and transparent nature of the blockchain may lead to the leakage of sensitive data, especially if a public chain is used. Complex implementation and management: Applying blockchain technology to software version control and management systems involves multiple technical links such as blockchain construction, smart contract writing, network maintenance, etc., which may require a high technical threshold. For developers and enterprises, the learning curve is steep, and the maintenance and management of the system may be more complicated. Poor scalability: Current blockchain-based version control systems may encounter performance bottlenecks when dealing with a large number of branches, parallel development, and complex dependencies. In particular, when the number of participants increases or the scale of the software project becomes larger, the scalability and stability of the system may be limited. Energy consumption of consensus mechanisms: Many blockchains use consensus mechanisms such as proof of work (PoW), which have high energy consumption and computing resource consumption problems. Although some new consensus mechanisms (such as proof of stake PoS) have improved, in some scenarios, the energy consumption problem cannot be ignored.
[0004] To this end, we propose a blockchain-based software version control and management system. Summary of the invention
[0005] To achieve the above purpose, the present invention provides the following technical solution: a blockchain-based software version control and management system, comprising the following steps:
[0006] S1: Choose the right blockchain platform
[0007] S1.1: Use private or licensed chains: To improve performance and control storage costs, you can choose private or licensed chains (such as Hyperledger Fabric) instead of public chains. Private or licensed chains can reduce the burden of openness and transparency, and have controllable performance, are suitable for enterprise-level applications, and support efficient consensus mechanisms and data privacy protection;
[0008] S1.2: Use a fast consensus mechanism: Choose an efficient consensus mechanism such as "Byzantine Fault Tolerance (BFT)" or "Proof of Stake (PoS)" to reduce transaction confirmation time and energy consumption, and avoid the performance bottleneck caused by Proof of Work (PoW).
[0009] S2: Improved storage
[0010] S2.1: Combination of on-chain storage and off-chain storage: In order to solve the problem of high storage costs of blockchain, a hybrid storage architecture is used, that is, a small amount of metadata (such as version number, hash value, change record, etc.) is stored on the chain, and large files (such as source code, binary files) are stored off the chain and managed through a distributed storage system (such as IPFS). This method removes a lot of storage pressure from the blockchain and reduces storage costs;
[0011] S2.2: Hash fingerprint and data pointer: The code files are stored in off-chain storage, and the hash values and pointers of these files are saved in the blockchain to ensure the integrity and verifiability of the data. Each time a submission is made, the generated hash value and pointer will be recorded in the blockchain to track and manage the files.
[0012] S3: Smart contracts and automated management
[0013] S3.1: Automated management of smart contracts: Design smart contracts to automatically manage version control. Smart contracts can set rules, such as version merging, approval, and permission control, to achieve automated code review and merging operations and avoid human operational errors. At the same time, smart contracts can also automatically generate version identification and update logs based on code submissions;
[0014] S3.2: Permission management: Use smart contracts to manage the permissions of developers and submitters to ensure that only authorized personnel can submit code or perform version updates, thereby protecting the security of the code and compliance with version control.
[0015] S4: Data Privacy Protection
[0016] S4.1: Encrypted storage and access control: In order to solve the problem of data privacy, all code files stored outside the chain should be encrypted, and only authorized users can decrypt and access these files. Through public-private key encryption technology, it can ensure that the code data remains private during the off-chain storage process;
[0017] S4.2: Selective data disclosure: For different users and teams, the selective disclosure of certain versions or modules can be achieved through the permission settings on the blockchain. Only users or developers with corresponding permissions can view or operate certain versions of information.
[0018] S5: Efficient version control and branch management
[0019] S5.1: Branch management and merging: The blockchain-based system should support the basic operations of traditional version control systems, such as creating branches, merging, and committing. Each commit and branch operation is automatically recorded through smart contracts, while ensuring that the merge operation is tamper-proof on the blockchain, thereby ensuring the transparency and accuracy of the version history;
[0020] S5.2: Incremental version storage: To improve storage efficiency, incremental storage can be used. Each time a commit or update is made, only the incremental data compared to the previous version is saved, rather than the complete file. This will greatly reduce the burden of storage and transmission for each update.
[0021] S6: Efficient retrieval and query system
[0022] S6.1: Off-chain indexing system: To improve the query efficiency of data in the blockchain, an off-chain indexing system, such as Elasticsearch or a dedicated database, can be used to store and manage version control-related metadata. Users can quickly find specific versions, commit records, or code modules through efficient search engines;
[0023] S6.2: Full-text search and version comparison: Establish a blockchain-based retrieval interface that supports full-text search, version comparison, historical backtracking, etc. This will enable developers to efficiently locate historical versions and facilitate code rollback and debugging.
[0024] S7: Improved scalability and maintainability
[0025] S7.1: Modular architecture: In order to improve the scalability and maintainability of the system, a modular architecture can be used to combine the blockchain management system with the traditional version control system (such as Git). The core metadata of version control (such as hash values, submission records, and permission control) is managed in the blockchain, while the management of the code itself relies on existing distributed version control tools. This can take advantage of the decentralization and immutability of the blockchain while avoiding performance issues caused by over-reliance on the blockchain;
[0026] S7.2: Visual management platform: Design a user-friendly management platform for viewing version history, auditing code changes, viewing permission records and submission logs. The platform can provide a graphical interface to allow developers and administrators to easily understand the version flow, merge status and permission changes of the code.
[0027] Preferably, in S1, an enterprise-level permissioned chain platform such as Hyperledger Fabric or Quorum is selected, which can provide high performance, permission control, flexible smart contract support, and support customizable consensus mechanisms; Hyperledger Fabric uses consensus mechanisms such as Kafka or Raft, which are faster and consume less energy than public chains such as Bitcoin's PoW; during the deployment process, blockchain nodes, channels, and organizations need to be set up to manage the permissions of different developers and teams and ensure control of data access; consensus algorithms such as Byzantine Fault Tolerance (BFT) or Proof of Stake (PoS) are used to reduce the time of each block generation and ensure efficient transaction confirmation. For example, Hyperledger Fabric supports multiple consensus protocols, and the appropriate protocol can be selected according to performance requirements.
[0028] Preferably, the off-chain storage in S2: use a distributed file system such as IPFS (InterPlanetary File System) to store large files (such as source code, binary files, etc.), and store the hash value and metadata (such as submission records, version numbers, etc.) of the file on the blockchain. IPFS will return a unique content-addressable identifier (CID), which can be stored in the blockchain to ensure the integrity of the file; implementation process: develop a smart contract to automatically generate a file hash and store it in the blockchain when submitting the code. Upload the code file through IPFS, and return the corresponding CID, and bind the CID to the version information. Hash fingerprint and data pointer: Generate a hash value for the file, such as using the SHA-256 algorithm, to ensure that each submitted code file has a unique identifier. Each time it is submitted, the smart contract will generate a hash value for the new version and store it on the blockchain. When a developer or user queries a specific version, the system locates the corresponding file through the hash value and pointer.
[0029] Preferably, a smart contract is written in the S3 to automatically manage version submission, merging, and permission control. Rules can be defined in the smart contract, such as only specific developers can perform merge operations, or each submission must pass an automated review. For example, when submitting a new version, the contract automatically verifies the submitted file hash value and ensures that the file is consistent with the historical record on the chain to ensure the integrity of the code. Permission management: Role-based permission control (RBAC) is implemented in smart contracts. Different roles for developers, administrators, and reviewers can be set to ensure that the submission, merging, and viewing permissions of the code are controllable. Permissions can be controlled through public-private key pairs or digital certificates to ensure that only authorized users can access or modify the code.
[0030] Preferably, the code files stored in the off-chain storage system such as IPFS are symmetrically encrypted using AES-256 in S4 to ensure that even if the files are stored on a public network, unauthorized users cannot view the content. Using public and private key encryption, only users with private keys can decrypt the code files. File access rights are controlled through access control lists (ACLs) or smart contracts. Selective data disclosure:
[0031] Add access control rules to blockchain smart contracts to support selective disclosure of data. For certain versions or modules, only designated users or teams are allowed to view or operate them. By setting access control rules in smart contracts, certain code submissions and version information can be set to private, and only authorized developers can view or operate them.
[0032] Preferably, branch management and merging in S5: implement branch management mechanism in blockchain. A traditional version control model (such as Git's branch model) can be used, and each branch is recorded by a smart contract with a hash value and ensured to be unique. Merge operation: When multiple branches are merged, the smart contract verifies the correctness and consistency of the merge, and submits the merged new version to the blockchain. A strategy similar to Git Merge can be used to ensure the correctness of the merge. Incremental version storage: Using an incremental storage method, record the change data compared to the previous version each time the code is submitted, rather than the content of the entire file. This can reduce storage requirements and improve query efficiency. The record of incremental updates is implemented through hash values and off-chain storage pointers to ensure the traceability of historical versions.
[0033] Preferably, the off-chain indexing system in S6: uses Elasticsearch or a dedicated database to store and manage metadata (such as submission records, version numbers, etc.) on the blockchain. Elasticsearch provides full-text indexing and an efficient retrieval mechanism, allowing developers to easily query historical versions and update records. Full-text search and version comparison: Provides an API or Web interface that allows users to search by multiple dimensions such as version number, submission time, submitter, etc., and supports comparison functions between different versions. Using the full-text search function of Elasticsearch allows developers to quickly find changes to a specified version or file.
[0034] Preferably, the modular architecture in S7: Use microservice architecture to design the various components of the system, and deploy blockchain management, version control, permission management, storage management, etc. separately so that each part can be expanded as needed. For example, use Docker containerization to deploy various services for easy expansion and maintenance. Upgradability design: At the blockchain level, use version control of smart contracts to ensure that when the system needs to be upgraded, it can be done through contract iteration. Extension interfaces need to be reserved during design so that the consensus mechanism, storage method or version management strategy can be flexibly adjusted when needs change.
[0035] Compared with the prior art, the present invention provides a blockchain-based software version control and management system, which has the following beneficial effects:
[0036] This blockchain-based software version control and management system achieves higher security, transparency and automated management by combining blockchain technology with traditional version control tools. By using private chains or permissioned chains and efficient consensus mechanisms, the system avoids the performance bottleneck of public chains while ensuring controllable performance and storage costs. The hybrid storage architecture and hash fingerprint technology reduce the storage pressure of the blockchain and ensure the integrity and verifiability of the data. The introduction of smart contracts automates code review, merging and permission management, improves the efficiency and compliance of operations, and protects the privacy of developers. Incremental version storage and efficient retrieval systems optimize storage and query performance and improve the scalability and maintainability of the system. In addition, the integration with existing tools and the visual management platform enable developers to perform version control operations more easily, and enhance the trust of the system through the immutability provided by the blockchain, promoting the efficiency, security and transparency of the software development process. DETAILED DESCRIPTION
[0037] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] Example
[0039] Implementation of a blockchain-based software version control and management system
[0040] The blockchain-based software version control and management system includes the following steps:
[0041] S1: Choose the right blockchain platform
[0042] S1.1: Use private or licensed chains: To improve performance and control storage costs, you can choose private or licensed chains (such as Hyperledger Fabric) instead of public chains. Private or licensed chains can reduce the burden of openness and transparency, and have controllable performance, are suitable for enterprise-level applications, and support efficient consensus mechanisms and data privacy protection;
[0043] S1.2: Use a fast consensus mechanism: Choose an efficient consensus mechanism such as "Byzantine Fault Tolerance (BFT)" or "Proof of Stake (PoS)" to reduce transaction confirmation time and energy consumption, and avoid the performance bottleneck caused by Proof of Work (PoW).
[0044] S2: Improved storage
[0045] S2.1: Combination of on-chain storage and off-chain storage: In order to solve the problem of high storage costs of blockchain, a hybrid storage architecture is used, that is, a small amount of metadata (such as version number, hash value, change record, etc.) is stored on the chain, and large files (such as source code, binary files) are stored off the chain and managed through a distributed storage system (such as IPFS). This method removes a lot of storage pressure from the blockchain and reduces storage costs;
[0046] S2.2: Hash fingerprint and data pointer: The code files are stored in off-chain storage, and the hash values and pointers of these files are saved in the blockchain to ensure the integrity and verifiability of the data. Each time a submission is made, the generated hash value and pointer will be recorded in the blockchain to track and manage the files.
[0047] S3: Smart contracts and automated management
[0048] S3.1: Automated management of smart contracts: Design smart contracts to automatically manage version control. Smart contracts can set rules, such as version merging, approval, and permission control, to achieve automated code review and merging operations and avoid human operational errors. At the same time, smart contracts can also automatically generate version identification and update logs based on code submissions;
[0049] S3.2: Permission management: Use smart contracts to manage the permissions of developers and submitters to ensure that only authorized personnel can submit code or perform version updates, thereby protecting the security of the code and compliance with version control.
[0050] S4: Data Privacy Protection
[0051] S4.1: Encrypted storage and access control: In order to solve the problem of data privacy, all code files stored outside the chain should be encrypted, and only authorized users can decrypt and access these files. Through public-private key encryption technology, it can ensure that the code data remains private during the off-chain storage process;
[0052] S4.2: Selective data disclosure: For different users and teams, the selective disclosure of certain versions or modules can be achieved through the permission settings on the blockchain. Only users or developers with corresponding permissions can view or operate certain versions of information.
[0053] S5: Efficient version control and branch management
[0054] S5.1: Branch management and merging: The blockchain-based system should support the basic operations of traditional version control systems, such as creating branches, merging, and committing. Each commit and branch operation is automatically recorded through smart contracts, while ensuring that the merge operation is tamper-proof on the blockchain, thereby ensuring the transparency and accuracy of the version history;
[0055] S5.2: Incremental version storage: To improve storage efficiency, incremental storage can be used. Each time a commit or update is made, only the incremental data compared to the previous version is saved, rather than the complete file. This will greatly reduce the burden of storage and transmission for each update.
[0056] S6: Efficient retrieval and query system
[0057] S6.1: Off-chain indexing system: To improve the query efficiency of data in the blockchain, an off-chain indexing system, such as Elasticsearch or a dedicated database, can be used to store and manage version control-related metadata. Users can quickly find specific versions, commit records, or code modules through efficient search engines;
[0058] S6.2: Full-text search and version comparison: Establish a blockchain-based retrieval interface that supports full-text search, version comparison, historical backtracking, etc. This will enable developers to efficiently locate historical versions and facilitate code rollback and debugging.
[0059] S7: Improved scalability and maintainability
[0060] S7.1: Modular architecture: In order to improve the scalability and maintainability of the system, a modular architecture can be used to combine the blockchain management system with the traditional version control system (such as Git). The core metadata of version control (such as hash values, submission records, and permission control) is managed in the blockchain, while the management of the code itself relies on existing distributed version control tools. This can take advantage of the decentralization and immutability of the blockchain while avoiding performance issues caused by over-reliance on the blockchain;
[0061] S7.2: Visual management platform: Design a user-friendly management platform for viewing version history, auditing code changes, viewing permission records and submission logs. The platform can provide a graphical interface to allow developers and administrators to easily understand the version flow, merge status and permission changes of the code.
[0062] Specifically, in step S1, an enterprise-level permissioned chain platform such as Hyperledger Fabric or Quorum is selected, which can provide high performance, permission control, flexible smart contract support, and support customizable consensus mechanisms; Hyperledger Fabric uses consensus mechanisms such as Kafka or Raft, which are faster and consume less energy than public chains such as Bitcoin's PoW; during the deployment process, blockchain nodes, channels, and organizations need to be set up to manage the permissions of different developers and teams and ensure control of data access; consensus algorithms such as Byzantine Fault Tolerance (BFT) or Proof of Stake (PoS) are used to reduce the time for each block generation and ensure efficient transaction confirmation. For example, Hyperledger Fabric supports multiple consensus protocols, and the appropriate protocol can be selected according to performance requirements.
[0063] Specifically, in step S2, off-chain storage: use a distributed file system such as IPFS (InterPlanetary File System) to store large files (such as source code, binary files, etc.), and store the file's hash value and metadata (such as submission records, version numbers, etc.) on the blockchain. IPFS returns a unique content-addressable identifier (CID), which can be stored in the blockchain to ensure the integrity of the file; implementation process: develop a smart contract to automatically generate a file hash and store it in the blockchain when submitting the code. Upload the code file through IPFS, and return the corresponding CID, and bind the CID to the version information. Hash fingerprint and data pointer: Generate a hash value for the file, such as using the SHA-256 algorithm, to ensure that each submitted code file has a unique identifier. Each time it is submitted, the smart contract will generate a hash value for the new version and store it on the blockchain. When a developer or user queries a specific version, the system locates the corresponding file through the hash value and pointer.
[0064] Specifically, in step S3, a smart contract is written to automatically manage version submission, merging, and permission control. Rules can be defined in the smart contract, such as only specific developers can perform merge operations, or each submission must pass an automated review. For example, when submitting a new version, the contract automatically verifies the submitted file hash value and ensures that the file is consistent with the historical record on the chain to ensure the integrity of the code. Permission management: Implement role-based permission control (RBAC) in smart contracts. Different roles for developers, administrators, and reviewers can be set to ensure that the submission, merging, and viewing permissions of the code are controllable. Permissions can be controlled through public-private key pairs or digital certificates to ensure that only authorized users can access or modify the code.
[0065] Specifically, in step S4, the code files stored in off-chain storage systems such as IPFS are symmetrically encrypted using AES-256 to ensure that even if the files are stored on a public network, unauthorized users cannot view the content. Using public and private key encryption, only users with private keys can decrypt the code files. File access rights are controlled through access control lists (ACLs) or smart contracts. Selective data disclosure:
[0066] Add access control rules to blockchain smart contracts to support selective disclosure of data. For certain versions or modules, only designated users or teams are allowed to view or operate them. By setting access control rules in smart contracts, certain code submissions and version information can be set to private, and only authorized developers can view or operate them.
[0067] Specifically, branch management and merging in step S5: implement branch management mechanism in blockchain. The traditional version control model (such as Git's branch model) can be used, and each branch is recorded by the smart contract with a hash value and ensures uniqueness. Merge operation: When multiple branches are merged, the smart contract verifies the correctness and consistency of the merge, and submits the merged new version to the blockchain. A strategy similar to Git Merge can be used to ensure the correctness of the merge. Incremental version storage: Using an incremental storage method, record the change data compared to the previous version each time the code is submitted, rather than the content of the entire file. This can reduce storage requirements and improve query efficiency. The record of incremental updates is implemented through hash values and off-chain storage pointers to ensure the traceability of historical versions.
[0068] Specifically, in step S6, the off-chain index system: uses Elasticsearch or a dedicated database to store and manage metadata on the blockchain (such as submission records, version numbers, etc.). Elasticsearch provides full-text indexing and an efficient retrieval mechanism, allowing developers to easily query historical versions and update records. Full-text search and version comparison: Provide an API or web interface that allows users to search by multiple dimensions such as version number, submission time, submitter, etc., and supports comparison functions between different versions. Using the full-text search function of Elasticsearch allows developers to quickly find the changes to a specified version or file.
[0069] Specifically, the modular architecture in S7: Use microservice architecture to design each component of the system, and deploy blockchain management, version control, permission management, storage management, etc. separately so that each part can be expanded as needed. For example, use Docker containerization to deploy each service for easy expansion and maintenance. Upgradability design: At the blockchain level, use smart contract version control to ensure that when the system needs to be upgraded, it can be upgraded through contract iteration. When designing, it is necessary to reserve extension interfaces so that the consensus mechanism, storage method or version management strategy can be flexibly adjusted when the demand changes.
[0070] Through the above technical solutions, in the present invention, by combining blockchain technology and traditional version control tools, higher security, transparency and automated management are achieved. By using private chains or permissioned chains and efficient consensus mechanisms, the system avoids the performance bottleneck of the public chain while ensuring that performance and storage costs are controllable. The hybrid storage architecture and hash fingerprint technology reduce the storage pressure of the blockchain and ensure the integrity and verifiability of the data. The introduction of smart contracts automates code review, merging and permission management, improves the efficiency and compliance of operations, and protects the privacy of developers. Incremental version storage and efficient retrieval systems optimize storage and query performance and improve the scalability and maintainability of the system. In addition, the integration with existing tools and the visual management platform enable developers to perform version control operations more easily, and enhance the trust of the system through the immutability provided by the blockchain, promoting the efficiency, security and transparency of the software development process.
[0071] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. Blockchain-based software version control and management system, characterized by: The following steps are involved: S1: Choose the right blockchain platform S1.1: Use private or licensed chains: To improve performance and control storage costs, you can choose private or licensed chains (such as Hyperledger Fabric) instead of public chains. Private or licensed chains can reduce the burden of openness and transparency, and have controllable performance, are suitable for enterprise-level applications, and support efficient consensus mechanisms and data privacy protection; S1.2: Use a fast consensus mechanism: Choose an efficient consensus mechanism such as "Byzantine Fault Tolerance (BFT)" or "Proof of Stake (PoS)" to reduce transaction confirmation time and energy consumption, and avoid the performance bottleneck caused by Proof of Work (PoW). S2: Improved storage S2.1: Combination of on-chain storage and off-chain storage: In order to solve the problem of high storage costs of blockchain, a hybrid storage architecture is used, that is, a small amount of metadata (such as version number, hash value, change record, etc.) is stored on the chain, and large files (such as source code, binary files) are stored off the chain and managed through a distributed storage system (such as IPFS). This method removes a lot of storage pressure from the blockchain and reduces storage costs; S2.2: Hash fingerprint and data pointer: The code files are stored in off-chain storage, and the hash values and pointers of these files are saved in the blockchain to ensure the integrity and verifiability of the data. Each time a submission is made, the generated hash value and pointer will be recorded in the blockchain to track and manage the files. S3: Smart contracts and automated management S3.1: Automated management of smart contracts: Design smart contracts to automatically manage version control. Smart contracts can set rules, such as version merging, approval, and permission control, to achieve automated code review and merging operations and avoid human operational errors. At the same time, smart contracts can also automatically generate version identification and update logs based on code submissions; S3.2: Permission management: Use smart contracts to manage the permissions of developers and submitters to ensure that only authorized personnel can submit code or perform version updates, thereby protecting the security of the code and compliance with version control. S4: Data Privacy Protection S4.1: Encrypted storage and access control: In order to solve the problem of data privacy, all code files stored outside the chain should be encrypted, and only authorized users can decrypt and access these files. Through public-private key encryption technology, it can ensure that the code data remains private during the off-chain storage process; S4.2: Selective data disclosure: For different users and teams, the selective disclosure of certain versions or modules can be achieved through the permission settings on the blockchain. Only users or developers with corresponding permissions can view or operate certain versions of information. S5: Efficient version control and branch management S5.1: Branch management and merging: The blockchain-based system should support the basic operations of traditional version control systems, such as creating branches, merging, and committing. Each commit and branch operation is automatically recorded through smart contracts, while ensuring that the merge operation is tamper-proof on the blockchain, thereby ensuring the transparency and accuracy of the version history; S5.2: Incremental version storage: To improve storage efficiency, incremental storage can be used. Each time a commit or update is made, only the incremental data compared to the previous version is saved, rather than the complete file. This will greatly reduce the burden of storage and transmission for each update. S6: Efficient retrieval and query system S6.1: Off-chain indexing system: To improve the query efficiency of data in the blockchain, an off-chain indexing system, such as Elasticsearch or a dedicated database, can be used to store and manage version control-related metadata. Users can quickly find specific versions, commit records, or code modules through efficient search engines; S6.2: Full-text search and version comparison: Establish a blockchain-based retrieval interface that supports full-text search, version comparison, historical backtracking, etc. This will enable developers to efficiently locate historical versions and facilitate code rollback and debugging. S7: Improved scalability and maintainability S7.1: Modular architecture: In order to improve the scalability and maintainability of the system, a modular architecture can be used to combine the blockchain management system with the traditional version control system (such as Git). The core metadata of version control (such as hash values, submission records, and permission control) is managed in the blockchain, while the management of the code itself relies on existing distributed version control tools. This can take advantage of the decentralization and immutability of the blockchain while avoiding performance issues caused by over-reliance on the blockchain; S7.2: Visual management platform: Design a user-friendly management platform for viewing version history, auditing code changes, viewing permission records and submission logs. The platform can provide a graphical interface to allow developers and administrators to easily understand the version flow, merge status and permission changes of the code.
2. The blockchain-based software version control and management system according to claim 1, characterized in that: In step S1, an enterprise-level permissioned chain platform such as Hyperledger Fabric or Quorum is selected, which can provide high performance, permission control, flexible smart contract support, and support customizable consensus mechanisms; Hyperledger Fabric uses consensus mechanisms such as Kafka or Raft, which are faster and consume less energy than public chains such as Bitcoin's PoW; during the deployment process, blockchain nodes, channels, and organizations need to be set up to manage the permissions of different developers and teams and ensure control of data access; consensus algorithms such as Byzantine Fault Tolerance (BFT) or Proof of Stake (PoS) are used to reduce the time for each block generation and ensure efficient transaction confirmation. For example, Hyperledger Fabric supports multiple consensus protocols, and the appropriate protocol can be selected according to performance requirements.
3. The blockchain-based software version control and management system according to claim 1, characterized in that: In step S2, off-chain storage: use a distributed file system such as IPFS (InterPlanetary File System) to store large files (such as source code, binary files, etc.), and store the hash value and metadata (such as submission records, version numbers, etc.) of the file on the blockchain. IPFS will return a unique content addressable identifier (CID), which can be stored in the blockchain to ensure the integrity of the file; Implementation process: Develop smart contracts to automatically generate file hashes and store them in the blockchain when submitting code. Upload code files through IPFS, return the corresponding CID, and bind the CID to the version information. Hash fingerprint and data pointer: Generate the hash value of the file, such as using the SHA-256 algorithm, to ensure that each submitted code file has a unique identifier. Each time a submission is made, the smart contract will generate a hash value for the new version and store it on the blockchain. When a developer or user queries a specific version, the system locates the corresponding file through the hash value and pointer.
4. The blockchain-based software version control and management system according to claim 1, characterized in that: In step S3, a smart contract is written to automatically manage version submission, merging, and permission control. Rules can be defined in the smart contract, such as only specific developers can perform merge operations, or each submission must pass an automated review. For example, when submitting a new version, the contract automatically verifies the submitted file hash value and ensures that the file is consistent with the historical record on the chain to ensure the integrity of the code. Permission management: Role-based permission control (RBAC) is implemented in the smart contract. Different roles for developers, administrators, and reviewers can be set to ensure that the submission, merging, and viewing permissions of the code are controllable. Permissions can be controlled through public-private key pairs or digital certificates to ensure that only authorized users can access or modify the code.
5. The blockchain-based software version control and management system according to claim 1, characterized in that: In step S4, the code files stored in the off-chain storage system such as IPFS are symmetrically encrypted using AES-256 to ensure that even if the files are stored on a public network, unauthorized users cannot view the content. Using public and private key encryption, only users with private keys can decrypt the code files. File access rights are controlled through access control lists (ACLs) or smart contracts. Selective data disclosure: Access control rules are added to blockchain smart contracts to support selective disclosure of data. For certain versions or modules, only specified users or teams are allowed to view or operate. By setting access control rules in smart contracts, certain code submissions and version information are set to private, and only authorized developers can view or operate them.
6. The blockchain-based software version control and management system according to claim 1, characterized in that: Branch management and merging in step S5: Implement branch management mechanism in blockchain. Traditional version control models (such as Git's branch model) can be used, and each branch is recorded by a smart contract with a hash value to ensure uniqueness. Merge operation: When multiple branches are merged, the smart contract verifies the correctness and consistency of the merge, and submits the merged new version to the blockchain. A strategy similar to Git Merge can be used to ensure the correctness of the merge. Incremental version storage: Using an incremental storage method, record the change data compared to the previous version each time the code is submitted, rather than the content of the entire file. This can reduce storage requirements and improve query efficiency. The record of incremental updates is implemented through hash values and off-chain storage pointers to ensure the traceability of historical versions.
7. The blockchain-based software version control and management system according to claim 1, characterized in that: The off-chain indexing system in step S6: uses Elasticsearch or a dedicated database to store and manage metadata (such as submission records, version numbers, etc.) on the blockchain. Elasticsearch provides full-text indexing and an efficient retrieval mechanism, allowing developers to easily query historical versions and update records. Full-text search and version comparison: Provide an API or web interface that allows users to search by multiple dimensions such as version number, submission time, submitter, etc., and supports comparison between different versions. Using the full-text search function of Elasticsearch allows developers to quickly find the changes to a specified version or file.
8. The blockchain-based software version control and management system according to claim 1, characterized in that: The modular architecture in S7: Use microservice architecture to design the various components of the system, and deploy blockchain management, version control, permission management, storage management, etc. separately so that each part can be expanded as needed. For example, use Docker containerization to deploy various services for easy expansion and maintenance. Upgradability design: At the blockchain level, use smart contract version control to ensure that when the system needs to be upgraded, it can be upgraded through contract iteration. When designing, it is necessary to reserve extension interfaces so that the consensus mechanism, storage method or version management strategy can be flexibly adjusted when the demand changes.