A method for executing a smart contract of a blockchain

By segmenting and tagging smart contract images, and combining different network paths and MAC address encryption, the security issues in the transmission of blockchain smart contracts are solved, and confidential data transmission is achieved.

CN115168903BActive Publication Date: 2025-12-30GUIZHOU HUATAI ZHIYUAN BIG DATA SERVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210884342.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-25
Publication Date
2025-12-30
Estimated Expiration
2042-07-25

AI Technical Summary

Technical Problem

Existing blockchain smart contracts do not use encrypted transmission methods, making them vulnerable to theft by malicious external parties and resulting in data loss.

Method used

By segmenting the smart contract image into nine micro-images, marking and integrating these micro-images, and transmitting them using three different network paths, the micro-images are finally integrated into a smart contract image, which is then encrypted using the MAC addresses of both parties' terminals.

Benefits of technology

It improves the security of smart contract transmission, prevents data from being stolen by external personnel, and enhances data confidentiality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168903B_ABST
    Figure CN115168903B_ABST
Patent Text Reader

Abstract

The application provides a kind of smart contract execution method of blockchain, according to the data inside blockchain, the smart contract of transaction party is extracted, after extracting smart contract, the MAC address of transaction party terminal is acquired again;Acquire smart contract picture, and the nine groups of microimages are segmented to the smart contract picture, and the nine groups of microimages are marked, and the nine groups of microimages are segmented into three groups of transmission sequences, and the three groups of transmission sequences are transmitted by three different network paths, the corresponding microimage is transmitted to the corresponding terminal, the mark i in the nine groups of microimages is extracted, and the nine groups of microimages are integrated into smart contract image according to the subscript mark i, the smart contract image is transmitted by this way, this transmission mode can effectively encrypt the smart contract image, improve the security in transmission process, so as to improve the security of data, avoid the smart contract image being stolen by external personnel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a method for executing smart contracts on a blockchain. Background Technology

[0002] A blockchain is a chain of blocks. Each block stores specific information, and these blocks are linked together in chronological order of their creation. This chain is stored on all servers, and as long as at least one server in the system is operational, the entire blockchain is secure. These servers are called nodes in the blockchain system, and they provide storage space and computing power. To modify information in the blockchain, the consent of more than half of the nodes must be obtained, and the information in all nodes must be modified. Since these nodes are usually controlled by different entities, tampering with information in the blockchain is extremely difficult. Compared to traditional networks, blockchain has two core characteristics: data is difficult to tamper with, and it is decentralized. Based on these two characteristics, the information recorded by the blockchain is more authentic and reliable, helping to solve the problem of mutual distrust.

[0003] Patent publication number CN109559115A discloses a method for establishing a smart contract, a transaction method, and related apparatus. When establishing a business relationship between a first node and a second node, the current smart contract block in the smart contract blockchain is determined; a smart contract block is created based on the business relationship and the current smart contract block; the smart contract block is linked to the current smart contract block, and the current smart contract block is used as the new current smart contract block. Compared to existing technologies, in this embodiment of the invention, the establishment of the smart contract is achieved through blockchain technology based on a consensus algorithm, thus ensuring the security and accuracy of the smart contract; furthermore, blockchain technology allows for the signing of electronic contracts without requiring mutual trust between the parties, thereby improving the applicability of the smart contract establishment method.

[0004] In the actual operation of existing blockchains, corresponding smart contracts are required to restrict the two parties to the transaction. However, smart contracts contain a large amount of private data. Because the entire smart contract is not encrypted during transmission, it is easy for external criminals to steal the data during transmission, resulting in data loss.

[0005] Therefore, it is necessary to provide a blockchain smart contract execution method to solve the above-mentioned technical problems. Summary of the Invention

[0006] This invention provides a method for executing smart contracts on a blockchain, which solves the problem that when a smart contract is transmitted without internal encryption, it is easily stolen by malicious external parties, resulting in data loss.

[0007] To address the aforementioned technical problems, this invention provides a method for executing smart contracts on a blockchain, comprising the following steps:

[0008] S1. Based on the data inside the blockchain, extract the smart contracts of both parties to the transaction. After extracting the smart contracts, obtain the MAC addresses of the terminals of both parties to the transaction and set the MAC addresses of the terminals of both parties to the transaction as the terminal addresses to be processed.

[0009] S2. Obtain the smart contract image, segment the smart contract image into nine micro-images, and label the nine micro-images.

[0010] S3. Obtain the data packet to be processed, divide the nine micro-images into three transmission sequences, and transmit the three transmission sequences using three different network paths;

[0011] S4. When transmitting the corresponding micro-image to the corresponding terminal, extract the marker i inside the nine micro-images, and then integrate the nine micro-images according to the subscript of marker i, so that the nine micro-images are integrated into a smart contract image.

[0012] Preferably, in step S2, the method for reprocessing the smart contract image is as follows:

[0013] S21. Divide the smart contract image into nine groups of micro-images using a nine-square grid method;

[0014] S22. Label the nine groups of micro-images with i, i=1, 2, ..., 9. When i=1, it represents the first group of micro-images; when i=2, it represents the second group of micro-images; when i=9, it represents the last group of micro-images.

[0015] S23. Next, perform subscript marking processing on the marker i, changing the marker i to... i-1 i i+1 The subscript i-1 represents the image before the subscript i is labeled as i-1, and the subscript i+1 represents the image after the subscript i is labeled as i+1. The original representation of the labels is: 1, 2, ..., 9. The representation of the label i after subscript labeling is: 12, 123, 234, 345, ..., 89.

[0016] S24. The marker i that has undergone subscript identification processing is bound and attached to each corresponding group of micro-images, and multiple corresponding groups of micro-images are bound into a data packet to generate a data packet to be processed.

[0017] Preferably, in step S3, the specific processing steps for dividing the nine micro-images into three transmission sequences and transmitting the three transmission sequences using three different network paths are as follows:

[0018] S31. Randomly select three sets of micro-images from the nine sets of labeled micro-images and set the three sets of micro-images to be processed.

[0019] S32. Sequentially acquire the first three sets of micro-images, divide the first three sets of micro-images into A conduction sequence, divide the three sets of micro-images in the middle position into B conduction sequence, and divide the last three sets of micro-images into C conduction sequence;

[0020] S33. Select three network paths in sequence and transmit the transmission sequences of different capacities using network paths of different bandwidths. The network bandwidths of the three network paths are 20 bit / s, 15 bit / s, and 10 bit / s, respectively. Obtain the data capacities of the three transmission sequences A, B, and C in sequence. Obtain the transmission sequence with the largest capacity and transmit it through a network path with a bandwidth of 20 bit / s. Transmit the transmission sequence with the middle capacity through a network path with a bandwidth of 15 bit / s and transmit the transmission sequence with the smallest capacity through a network path with a bandwidth of 10 bit / s.

[0021] Preferably, in step S4, the specific processing steps for integrating the nine sets of micro-images into a smart contract image are as follows:

[0022] S41. Extract the MAC addresses of the terminals of both parties to the transaction, and transmit the corresponding nine sets of micro images to the terminal devices with the corresponding MAC addresses based on the MAC addresses.

[0023] S42. Then extract the marker i of the nine groups of micro images, then identify the subscript of marker i in sequence, and integrate the nine groups of micro images in sequence according to the subscript of marker i.

[0024] S43. After integration, integrate the images marked i=1, 2 and 3 into the first group of arranged images, then integrate the images marked i=4, 5 and 6 into the second group of arranged images, and then integrate the images marked i=7, 8 and 9 into the third group of arranged images.

[0025] S44. Integrate the first group of arranged images, the second group of arranged images, and the third group of arranged images into a smart contract image.

[0026] Compared with related technologies, the blockchain smart contract execution method provided by this invention has the following beneficial effects:

[0027] This invention provides a method for executing smart contracts on a blockchain. Based on data within the blockchain, the method extracts the smart contracts of both trading parties. After extraction, it obtains the MAC addresses of both parties' terminals and sets these MAC addresses as the terminal addresses to be processed. The method then acquires a smart contract image, segments it into nine micro-images, marks these micro-images, acquires a data packet, and divides the nine micro-images into three transmission sequences. These three sequences are transmitted using three different network paths. When a micro-image is transmitted to its corresponding terminal, the marker 'i' within each of the nine micro-images is extracted. Based on the index of marker 'i', the nine micro-images are integrated into a single smart contract image. This method effectively encrypts the smart contract image, enhancing security during transmission and improving data confidentiality, thus preventing the smart contract image from being stolen by external parties. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of a preferred embodiment of the blockchain smart contract execution method provided by the present invention. Detailed Implementation

[0029] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0030] Please refer to the following: Figure 1 ,in, Figure 1 This is a schematic flowchart of a preferred embodiment of the blockchain smart contract execution method provided by the present invention. The blockchain smart contract execution method includes the following steps:

[0031] S1. Based on the data inside the blockchain, extract the smart contracts of both parties to the transaction. After extracting the smart contracts, obtain the MAC addresses of the terminals of both parties to the transaction and set the MAC addresses of the terminals of both parties to the transaction as the terminal addresses to be processed.

[0032] S2. Obtain the smart contract image and segment it into nine micro-images. Label these micro-images. Further processing of the smart contract image follows:

[0033] S21. Divide the smart contract image into nine groups of micro-images using a nine-square grid method;

[0034] S22. Label the nine groups of micro-images with i, i=1, 2, ..., 9. When i=1, it represents the first group of micro-images; when i=2, it represents the second group of micro-images; when i=9, it represents the last group of micro-images.

[0035] S23. Next, perform subscript marking processing on the marker i, changing the marker i to... i-1 i i+1 The subscript i-1 represents the image before the subscript i is labeled as i-1, and the subscript i+1 represents the image after the subscript i is labeled as i+1. The original representation of the labels is: 1, 2, ..., 9. The representation of the label i after subscript labeling is: 12, 123, 234, 345, ..., 89.

[0036] S24. The marker i that has undergone subscript identification processing is bound and attached to each corresponding group of micro-images, and multiple corresponding groups of micro-images are bound into a data packet to generate a data packet to be processed.

[0037] S3. Obtain the data packet to be processed, divide the nine sets of micro-images into three sets of transmission sequences, and transmit the three sets of transmission sequences using three different network paths. The specific processing steps are as follows:

[0038] S31. Randomly select three sets of micro-images from the nine sets of labeled micro-images and set the three sets of micro-images to be processed.

[0039] S32. Sequentially acquire the first three sets of micro-images, divide the first three sets of micro-images into A conduction sequence, divide the three sets of micro-images in the middle position into B conduction sequence, and divide the last three sets of micro-images into C conduction sequence;

[0040] S33. Select three sets of network paths in sequence, and transmit the transmission sequences of different capacities using network paths of different bandwidths. The network bandwidths of the three sets of network paths are 20 bit / s, 15 bit / s and 10 bit / s respectively. Obtain the data capacity of the three sets of transmission sequences A, B and C in sequence, obtain the transmission sequence with the largest capacity, and transmit the transmission sequence with the largest capacity through the network path with a bandwidth of 20 bit / s. Transmit the transmission sequence with the middle capacity through the network path with a bandwidth of 15 bit / s, and transmit the transmission sequence with the smallest capacity through the network path with a bandwidth of 10 bit / s.

[0041] S4. When transmitting the corresponding micro-images to the corresponding terminals, extract the marker i within the nine micro-images, and then integrate the nine micro-images according to the index of marker i, so that the nine micro-images are integrated into a smart contract image. The specific processing steps are as follows:

[0042] S41. Extract the MAC addresses of the terminals of both parties to the transaction, and transmit the corresponding nine sets of micro images to the terminal devices with the corresponding MAC addresses based on the MAC addresses.

[0043] S42. Then extract the marker i of the nine groups of micro images, then identify the subscript of marker i in sequence, and integrate the nine groups of micro images in sequence according to the subscript of marker i.

[0044] S43. After integration, integrate the images marked i=1, 2 and 3 into the first group of arranged images, then integrate the images marked i=4, 5 and 6 into the second group of arranged images, and then integrate the images marked i=7, 8 and 9 into the third group of arranged images.

[0045] S44. Integrate the first group of arranged images, the second group of arranged images, and the third group of arranged images into a smart contract image.

[0046] The working principle of the blockchain smart contract execution method provided by this invention is as follows:

[0047] Based on the data within the blockchain, the smart contracts of both parties to the transaction are extracted. After extraction, the MAC addresses of both parties' terminals are obtained and set as the terminal addresses to be processed. The smart contract image is obtained and segmented into nine micro-images. These micro-images are then labeled. The data packet to be processed is obtained, and the nine micro-images are divided into three transmission sequences. These three transmission sequences are transmitted using three different network paths. When the corresponding micro-images are transmitted to their respective terminals, the marker 'i' within each of the nine micro-images is extracted. Based on the index of marker 'i', the nine micro-images are then integrated to form the smart contract image.

[0048] Compared with related technologies, the blockchain smart contract execution method provided by this invention has the following beneficial effects:

[0049] Based on the data within the blockchain, the smart contracts of both trading parties are extracted. After extraction, the MAC addresses of both parties' terminals are obtained and set as the terminal addresses to be processed. The smart contract image is then acquired and segmented into nine micro-images. These micro-images are then labeled. The data packet to be processed is obtained, and the nine micro-images are divided into three transmission sequences. These three transmission sequences are transmitted using three different network paths. When the corresponding micro-image is transmitted to the corresponding terminal, the marker 'i' within each of the nine micro-images is extracted. Based on the index of marker 'i', the nine micro-images are then integrated to form the smart contract image. This method of transmitting the smart contract image effectively encrypts it, enhancing security during transmission and improving data confidentiality, thus preventing the smart contract image from being stolen by external parties.

[0050] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1.A method for executing a smart contract of a blockchain, the method comprising: Includes the following steps: S1. Based on the data inside the blockchain, extract the smart contracts of both parties to the transaction. After extracting the smart contracts, obtain the MAC addresses of the terminals of both parties to the transaction and set the MAC addresses of the terminals of both parties to the transaction as the terminal addresses to be processed. S2. Obtain the smart contract image, and segment the smart contract image into nine micro-images, and label the nine micro-images with i. S3. Obtain the data packet to be processed, divide the nine micro-images into three transmission sequences, and transmit the three transmission sequences using three different network paths; S4. When transmitting the corresponding micro-image to the corresponding terminal, extract the marker i inside the nine micro-images, and then integrate the nine micro-images according to the subscript of the marker i, so that the nine micro-images are integrated into a smart contract image. In step S2, the method for reprocessing the smart contract image is as follows: S21. Divide the smart contract image into nine groups of micro-images using a nine-square grid method; S22. Label the nine groups of micro-images with i, i=1, 2, ..., 9. When i=1, it represents the first group of micro-images; when i=2, it represents the second group of micro-images; when i=9, it represents the last group of micro-images. S23, subscript identification processing is performed on the mark i again, so that the mark i is changed to i-1 i i+1 , subscript i-1 represents that the front end image of subscript i is the image marked i-1, and subscript i+1 represents that the rear end image of subscript i is the image marked i+1, wherein the original form of the mark is: 1, 2, …, 9, and the form after the subscript identification processing on the mark i is: 12, 123, 234, 345, …, 89. S24. The marker i that has undergone subscript identification processing is bound and attached to each corresponding group of micro-images, and multiple corresponding groups of micro-images are bound into a data packet to generate a data packet to be processed. In step S4, the specific processing steps for integrating the nine micro-images into a smart contract image are as follows: S41. Extract the MAC addresses of the terminals of both parties to the transaction, and transmit the corresponding nine sets of micro images to the terminal devices with the corresponding MAC addresses based on the MAC addresses. S42. Then extract the marker i of the nine groups of micro images, then identify the subscript of marker i in sequence, and integrate the nine groups of micro images in sequence according to the subscript of marker i. S43. After integration, integrate the images marked i=1, 2 and 3 into the first group of arranged images, then integrate the images marked i=4, 5 and 6 into the second group of arranged images, and then integrate the images marked i=7, 8 and 9 into the third group of arranged images. S44. Integrate the first group of arranged images, the second group of arranged images, and the third group of arranged images into a smart contract image. 2.The method of claim 1, wherein, In step S3, the specific processing steps for dividing the nine micro-images into three transmission sequences and transmitting the three transmission sequences using three different network paths are as follows: S31. Randomly select three sets of micro-images from the nine sets of labeled micro-images and set the three sets of micro-images to be processed. S32. Sequentially acquire the first three sets of micro-images, divide the first three sets of micro-images into A conduction sequence, divide the three sets of micro-images in the middle position into B conduction sequence, and divide the last three sets of micro-images into C conduction sequence; S33, three groups of network paths are selected in turn, and different capacity conduction sequences are transmitted by different bandwidth network paths, wherein the network bandwidth of the three groups of network paths is 20 bit / s, 15 bit / s and 10 bit / s respectively, the data capacity of A conduction sequence, B conduction sequence and C conduction sequence three groups of sequences is obtained in turn, the conduction sequence with the largest capacity is obtained, and the conduction sequence with the largest capacity is transmitted by the network path with a bandwidth of 20 bit / s, the conduction sequence with the medium capacity is transmitted by the network path with a bandwidth of 15 bit / s, and the conduction sequence with the smallest capacity is transmitted by the network path with a bandwidth of 10 bit / s.

Citation Information

Patent Citations

  • Smart contract establishment method, transaction method and related device

    CN109559115A

  • Data partitioning confirmation method and device based on block chain, equipment and medium

    CN110968899A

  • Intelligent contract development plug-in oriented to Hyperledger Fabric

    CN113312035A