Block chain transaction processing method and device, medium and electronic equipment
By encrypting and urging some fields of blockchain transaction information, the problem of poor security of blockchain data privacy is solved, and the effect of improving the security of blockchain data privacy is achieved.
Patent Information
- Application Number
- CN202311510391.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-10
- Publication Date
- 2025-05-13
AI Technical Summary
In blockchain technology, due to the open and transparent data, there is a risk of privacy leakage, resulting in poor privacy security.
By obtaining the transaction information of blockchain transactions after consensus authentication, some fields are encrypted, encrypted data including some plain text fields and some cryptographic fields are generated, and they are written to the block to be chained, and linked to the blockchain.
It cuts off the correlation between blockchain transactions in transaction information, avoids privacy leakage caused by the full disclosure of transaction information, and thus improves the privacy and security of blockchain data.
Smart Images

Figure CN119991118A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of blockchain technology, and specifically relates to a blockchain transaction processing method, a blockchain transaction processing device, a computer-readable medium, an electronic device, and a computer program product. Background Art
[0002] Blockchain is a shared digital ledger with a block chain data structure built through transparent and trusted rules in a peer-to-peer network environment. Blockchain has the characteristics of anti-counterfeiting, anti-tampering and traceability. However, it is precisely because of the open and transparent nature of blockchain that the data recorded on the blockchain is at risk of privacy leakage, resulting in poor privacy security. Summary of the invention
[0003] The present application provides a blockchain transaction processing method, a blockchain transaction processing device, a computer-readable medium, an electronic device, and a computer program product, the purpose of which is to improve the privacy security of blockchain data.
[0004] According to one aspect of an embodiment of the present application, a blockchain transaction processing method is provided, the method comprising:
[0005] Obtaining transaction information of a blockchain transaction after consensus authentication, wherein the transaction information is used to record the transaction subjects and transaction contents involved in the blockchain transaction;
[0006] Encrypting some fields in the transaction information to obtain encrypted data including some plaintext fields and some ciphertext fields;
[0007] The encrypted data is written into the block to be put on the chain, and the block to be put on the chain is linked to the blockchain.
[0008] According to one aspect of an embodiment of the present application, a blockchain transaction processing device is provided, the device comprising:
[0009] An acquisition module is configured to acquire transaction information of a blockchain transaction after consensus authentication, wherein the transaction information is used to record multiple transaction entities participating in the blockchain transaction and transaction content;
[0010] an encryption module configured to encrypt some fields in the transaction information to obtain encrypted data including some plaintext fields and some ciphertext fields, wherein the some ciphertext fields are obtained after encrypting the some fields;
[0011] The chain module is configured to write the encrypted data into the block to be chained, and link the block to be chained to the blockchain.
[0012] In some embodiments of the present application, based on the above technical solution, the encrypted data includes a plurality of ciphertext fields corresponding to the plurality of transaction entities respectively, and the encryption module further includes:
[0013] A field selection module is configured to select some fields from the transaction information as key fields to be encrypted;
[0014] A public key acquisition module is configured to respectively acquire the public key of each of the transaction entities;
[0015] The field encryption module is configured to encrypt the key field according to the public key of the transaction subject to obtain a ciphertext field corresponding to the transaction subject; wherein different transaction subjects correspond to different ciphertext fields.
[0016] In some embodiments of the present application, based on the above technical solution, the key field includes a subject identification field for indicating the transaction subject; the field encryption module further includes:
[0017] A plaintext generation module, configured to generate plaintext data to be encrypted corresponding to each of the transaction subjects according to the subject identification fields of the plurality of transaction subjects; wherein different transaction subjects correspond to different plaintext data or to the same plaintext data;
[0018] The plaintext encryption module is configured to encrypt the plaintext data to be encrypted using the public key of each transaction subject to obtain a ciphertext field corresponding to the transaction subject.
[0019] In some embodiments of the present application, based on the above technical solution, the plaintext generation module is further configured to: generate plaintext data to be encrypted corresponding to each of the transaction subjects according to the subject identification fields of the multiple transaction subjects and the preset designated fields, and the designated fields are differentiated fields used to distinguish different blockchain transactions.
[0020] In some embodiments of the present application, based on the above technical solution, the plaintext data to be encrypted includes a structure object or a field sequence; the plaintext generation module is further configured to: combine the subject identification fields of multiple transaction subjects and the preset designated fields to form the structure objects corresponding to each of the transaction subjects respectively; or, splice the multiple subject identification fields and the preset designated fields to form the field sequences corresponding to each of the transaction subjects respectively.
[0021] In some embodiments of the present application, based on the above technical solution, the designated field is the timestamp of the block in which the blockchain transaction is located.
[0022] In some embodiments of the present application, based on the above technical solution, for different transaction entities, the multiple entity identification fields contained in the plaintext data to be encrypted have different field arrangement orders.
[0023] In some embodiments of the present application, based on the above technical solution, the transaction subject includes a transaction initiator that requests to initiate the blockchain transaction and a transaction responder that responds to the blockchain transaction; in the plaintext data corresponding to the transaction initiator, the first field is the subject identification field of the transaction initiator; in the plaintext data corresponding to the transaction responder, the first field is the subject identification field of the transaction responder.
[0024] In some embodiments of the present application, based on the above technical solution, the plaintext data corresponding to the transaction initiator is a field sequence formed by sequentially concatenating the subject identification field of the transaction initiator, the subject identification field of the transaction responder, and the specified field, and the plaintext data corresponding to the transaction responder is a field sequence formed by sequentially concatenating the subject identification field of the transaction responder, the subject identification field of the transaction initiator, and the specified field.
[0025] In some embodiments of the present application, based on the above technical solution, the blockchain transaction processing device further includes:
[0026] A query module, configured to read encrypted data corresponding to each blockchain transaction from the blockchain in response to a transaction query request initiated by the transaction subject;
[0027] A decryption module, configured to decrypt each of the encrypted data according to the private key of the transaction subject to obtain a decryption result of each of the encrypted data;
[0028] The determination module is configured to determine whether the transaction subject is a transaction participant of the blockchain transaction according to the decrypted data when the decryption result of the encrypted data is successful.
[0029] In some embodiments of the present application, based on the above technical solution, the determination module is further configured to: in the decrypted data, deserialize the first field to obtain a plaintext field; match the subject identifier of the transaction subject with the plaintext field; when the match is successful, determine that the transaction subject is a transaction participant in the blockchain transaction.
[0030] In some embodiments of the present application, based on the above technical solution, the encrypted data includes a first encrypted field corresponding to the transaction initiator and a second encrypted field corresponding to the transaction responder; the determination module is further configured to: when the subject identification of the transaction subject successfully matches the plaintext field corresponding to the first encrypted field, determine that the transaction subject is the transaction initiator of the blockchain transaction; when the subject identification of the transaction subject successfully matches the plaintext field corresponding to the second encrypted field, determine that the transaction subject is the transaction responder of the blockchain transaction.
[0031] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the blockchain transaction processing method in the above technical solution is implemented.
[0032] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement a blockchain transaction processing method as in the above technical solution.
[0033] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the blockchain transaction processing method in the above technical solution.
[0034] In the technical solution provided in the embodiment of the present application, by obtaining the transaction information of the blockchain transaction after consensus authentication, some fields in the transaction information can be encrypted to obtain encrypted data including some plaintext fields and some ciphertext fields, and then the encrypted data can be written into the block to be chained, and the block to be chained can be linked to the blockchain. By encrypting some fields in the transaction information, the embodiment of the present application can cut off the correlation between different blockchain transactions in the transaction information, thereby avoiding the problem of privacy leakage caused by the full disclosure of transaction information, and thus can improve the privacy security of blockchain data. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 A schematic diagram of the system architecture of a blockchain system implemented by applying the technical solution in an embodiment of the present application is shown.
[0037] Figure 2 The component structure of the blockchain maintained on the blockchain network is shown.
[0038] Figure 3 A schematic diagram of the data structure of a block in the related technology of the present application is shown.
[0039] Figure 4 A flowchart of a blockchain transaction processing method in one embodiment of the present application is shown.
[0040] Figure 5 A schematic diagram of the process of generating blocks and uploading blocks to a blockchain in an application scenario according to an embodiment of the present application is shown.
[0041] Figure 6 A schematic diagram of the process of encrypting transaction information in an application scenario according to an embodiment of the present application is shown.
[0042] Figure 7 A schematic diagram is shown of an embodiment of the present application using the public key of a transaction subject to encrypt some fields in an application scenario.
[0043] Figure 8 A schematic diagram showing the principle of using a block API to query transactions in an application scenario in an embodiment of the present application.
[0044] Fig. 9 A schematic diagram showing the principle of using a synchronous node to query a transaction in an application scenario according to an embodiment of the present application.
[0045] Fig.10 The structural block diagram of the blockchain transaction processing device provided in an embodiment of the present application is schematically shown.
[0046] Fig.11 The structure block diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0048] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0049] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0050] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0051] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0052] In the specific implementation of this application, it involves relevant data such as the public key, private key, subject identification used by the user to register on the blockchain system, and transaction information recorded by the blockchain system. When the various embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0053] The following is an explanation of the technical terms in the related technologies of this application.
[0054] Blockchain is a shared digital ledger with a block chain data structure that is anti-counterfeiting, anti-tampering and traceable, built through transparent and trusted rules in a peer-to-peer network environment. The block chain data structure is a data structure that stores transactions that occur over a period of time in blocks and connects the blocks into a chain in chronological order using a cryptographic algorithm. The ledger is distributed to all member nodes in the network, and the history of asset transactions that occur between peer nodes in the network is permanently recorded in a sequential chain of blocks linked by a hash cryptographic algorithm. All confirmed and proven transactions are linked from the beginning of the chain to the latest block, hence the name blockchain. The blockchain can act as a single source of truth, and members in the blockchain network can only view transactions that are relevant to them.
[0055] Blockchain is generally divided into three types: public chain, private chain and consortium chain. Among them, the public chain has the highest degree of decentralization. Nodes / participants who join the public chain can read the data on the chain, publish transactions, and compete for the right to record new blocks, etc. Moreover, each node / participant can freely join and exit the public chain. On the contrary, the private chain's accounting authority is controlled by a certain organization or institution, and the data reading authority is also controlled by the organization or institution. There are few participants and they cannot join the private chain at will. They must be reviewed by the organization or institution. Consortium chain, also known as community blockchain, refers to a blockchain whose consensus process is controlled by pre-selected nodes. It is a mixture of public chain and private chain, which can achieve "partial decentralization". Each node on the chain usually has a corresponding entity or organization; participants join the network through authorization and form a stakeholder alliance to jointly maintain the operation of the blockchain. Through the consortium chain, new participants can join the established blockchain and share data without having to build it from scratch. Whether it is a public chain, a private chain or a consortium chain, it may provide smart contract functions.
[0056] Smart contracts, also known as chaincode or application code, are computer protocols designed to disseminate, verify or execute contracts in an information-based manner. They are programs deployed in nodes of a blockchain network, carry the business logic for executing transactions, and run in an isolated operating environment (such as a container or virtual machine). Contract programs that are automatically executed by each node in a blockchain system according to specific conditions can operate on data stored on the chain. They are an important way for business entities to interact with blockchains and use blockchains to implement business logic. The purpose of smart contracts is to provide a security method that is superior to traditional contracts and to reduce other transaction costs associated with contracts. It allows trusted transactions without a third party, and these transactions are traceable and irreversible. Smart contracts on blockchains are contracts that can be triggered by transactions on blockchain systems and can be defined in the form of code.
[0057] Figure 1 A schematic diagram of the system architecture of a blockchain system implemented by applying the technical solution in an embodiment of the present application is shown.
[0058] like Figure 1 As shown, the blockchain system includes a client 101, a server 102, a smart contract engine 103 and a blockchain network 104.
[0059] The client 101 may be a smart phone, tablet computer, laptop computer, desktop computer, smart wearable device, smart vehicle-mounted device, smart payment terminal or other electronic devices, and may provide a user interface for asset management, and may specifically provide functions such as user registration / logout, organization management, expense management, history query, notification, etc. The user interface provided by the client may be a web page, a hosted program running on a host program, an independently installed and run application, etc.
[0060] Server 102 can be an independent physical server, or a server cluster composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Server 102 is used to provide backend services for client 101, and integrates and calls basic smart contracts to complete payment, application for account movement, distributed approval, account movement, auditing, reporting and other functions.
[0061] The smart contract engine 103 provides the ability to orchestrate various smart contracts, and completes the functional orchestration through external authorization triggering or automatic triggering of associated smart contracts. The smart contract engine 103 can provide the blockchain system with a smart contract template library related to business applications such as on-chain storage, consensus authentication, and transaction query of blockchain transactions; multiple participants can select smart contract templates to form an integrated application.
[0062] The blockchain network 104 includes multiple blockchain nodes, which can be terminal devices or servers participating in blockchain transactions. Each blockchain node can receive input information when performing normal operations, and maintain shared data in the blockchain network based on the received input information. In order to ensure information intercommunication, information connections can exist between each blockchain node, and each blockchain node can transmit information to each other through information connections. For example, when any blockchain node in the blockchain network receives input information and broadcasts the input information in the blockchain network, other node devices in the blockchain network can obtain the input information according to the consensus algorithm and store the input information as shared data.
[0063] Each blockchain node in the blockchain network has a corresponding node identifier, and each blockchain node in the blockchain network can store the node identifiers of other nodes in the same blockchain network, so that the generated blocks can be broadcast to other nodes in the blockchain network according to the node identifiers of other blockchain nodes. A node identifier list can be maintained in the blockchain node, and the node name and node identifier are stored in the node identifier list accordingly. The node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address or any other information that can be used to identify the node.
[0064] Figure 2 The structure of the blockchain maintained on the blockchain network is shown. Figure 2 As shown in the figure, the blockchain consists of multiple sequentially connected blocks. Whenever new data needs to be written into the blockchain, the data will be aggregated into a newly generated block, which will be linked to the end of the blockchain. The consensus algorithm can ensure that the newly added blocks on each node device are exactly the same. The data of the current block is recorded in the block body of each block, and the hash value of the previous block connected to it is saved in its block header. If the transaction data in the previous block changes, the hash value of the current block will also change accordingly. Therefore, the data uploaded to the blockchain network is difficult to be tampered with, which can improve the reliability of shared data.
[0065] In the related technologies of this application, the consortium chain or the public chain stores the transaction information of the user in plain text in the block. The user only needs to traverse the transaction information in the block, or directly query the transaction information in the block through the block browser, and then it is easy to find the transfer information between users. For example, if user A transfers 1ETH to user B (ETH represents a unit of measurement of an asset), then this transaction information will be stored in the corresponding block on the chain when the consensus is reached. The transaction information recorded in the block is usually the transfer of 1ETH from the account address of user A to the account address of user B.
[0066] Figure 3 A schematic diagram of the data structure of a block in the related technology of this application is shown. Figure 3 As shown, a block on the blockchain usually stores a large amount of transaction information, wherein the transaction information of each blockchain transaction may include a transaction identifier, a source account address of the transferred asset, a target account address of the received asset, and the quantity and unit of the transferred asset.
[0067] For example, in Figure 3 In the block shown, multiple blockchain transactions with different transaction identifiers (TxID) are recorded. Among them, the blockchain transaction with transaction identifier 1 indicates the transfer of assets from the source account address 0xabc1 to the target account address 0xabc2, and the asset transfer amount is 1ETH. The blockchain transaction with transaction identifier 2 indicates the transfer of assets from the source account address 0xabc1 to the target account address 0xabc3, and the asset transfer amount is 0.5ETH; the blockchain transaction with transaction identifier 3 indicates the transfer of assets from the source account address 0xabc2 to the target account address 0xabc3, and the asset transfer amount is 0.5ETH; the blockchain transaction with transaction identifier 4 indicates the transfer of assets from the source account address 0xabc1 to the target account address 0xabc4, and the asset transfer amount is 0.5ETH.
[0068] based on Figure 3 The block data structure shown in the figure can obtain all the transfer records of user A to other users by traversing the transaction information of all blockchain transactions recorded in the block. Therefore, for user A, all his transfer records will be exposed on the blockchain in public plain text form. Any node user that can synchronize blocks can easily obtain all the transfer behaviors of user A, and the records of other users' transfers to A can also be easily obtained.
[0069] based on Figure 3As can be seen from the block data structure shown, in the related technology of this application, the transaction information in each block is stored in plain text, including the transaction ID, the Hash of the transferor's address, the Hash of the transferee's address, the transfer amount and unit, etc. When a user initiates a transaction, after the transaction is verified and a consensus is reached, the transaction will take effect, and the effective transaction information will be directly written into the block information. Any synchronization node can obtain all the historical block information in the blockchain network through block synchronization, so the user of this node can traverse and count all the block transaction information by writing scripts, etc., and obtain all the transaction operation information of a certain account or some accounts.
[0070] It can be seen that when the transaction information is recorded in plain text, when querying or traversing the transactions of the block, the transfer information between user accounts can be statistically analyzed by aggregation and other means, which can easily expose the behavioral privacy of one or some accounts. In response to this problem, the embodiment of the present application provides a transaction processing method for semi-public storage of blockchain transaction information, which implements a behavioral privacy protection mechanism for blockchain users, ensures that the full amount of transaction information is not displayed in plain text after the data is stored on the chain, and on the one hand, it can prevent the transaction behavior of users on the blockchain from being arbitrarily collected and processed by other users, and on the other hand, users can also very conveniently query the transaction information of the blockchain transactions in which they participate.
[0071] The following is a detailed description of the technical solutions such as the blockchain transaction processing method, blockchain transaction processing device, computer-readable medium, electronic device, and computer program product provided by this application in combination with specific implementation methods.
[0072] Figure 4 A flowchart of a blockchain transaction processing method in one embodiment of the present application is shown. The method can be Figure 1 The client or server shown in the figure can be executed alone, or the client and server can be executed together. The embodiment of the present application is described by the blockchain transaction processing method executed by the client. Figure 4 As shown, the blockchain transaction processing method in the embodiment of the present application may include the following steps S410 to S430.
[0073] S410: Acquire transaction information of the blockchain transaction after consensus authentication, where the transaction information is used to record multiple transaction entities involved in the blockchain transaction and the transaction content.
[0074] In the blockchain system, users can send transactions to the blockchain through SDK or client. After the user's transaction is sent, it will first be verified by the blockchain system. After verification, the transaction will be placed in the transaction pool and wait for packaging proposal. When the consensus module enters a new round of proposals, it will package the transaction from the transaction pool and generate a new proposal. Then multiple consensus nodes will conduct consensus authentication on the proposal, thereby realizing distributed shared storage of transaction information.
[0075] Typically, a block contains one or more transactions, and the corresponding transaction information is used to record the transaction entities and transaction contents involved in the blockchain transaction.
[0076] Taking the transfer transaction of virtual assets as an example, the transaction subjects of the transfer transaction may include the transaction initiator who initiates the asset transfer and the transaction responder who receives the asset transfer. The corresponding transaction content may include the asset quantity and asset unit transferred from the transaction initiator to the transaction responder.
[0077] S420: Encrypt some fields in the transaction information to obtain encrypted data including some plaintext fields and some ciphertext fields, where some ciphertext fields are obtained by encrypting some fields.
[0078] The transaction information includes multiple fields, such as the account address field corresponding to each transaction subject participating in the blockchain transaction and the content field corresponding to the transaction content. Taking the transfer transaction of virtual assets as an example, the account address field may include the account address of the transaction initiator who initiates the asset transfer transaction and the account address of the transaction responder who receives the asset transfer. The content field may include the transfer amount of virtual assets and the asset unit of virtual assets.
[0079] In the embodiment of the present application, a part of the fields of the transaction information can be encrypted to obtain the corresponding ciphertext fields, while keeping another part of the fields in the transaction information as plaintext fields. By encrypting some fields in the transaction information, a part of the information in the obtained encrypted data is presented in the form of plaintext fields, while another part of the information is presented in the form of ciphertext fields.
[0080] In one embodiment of the present application, the account address field in the transaction information is encrypted to obtain a ciphertext field, while the content field is kept as a plaintext field. In some other optional implementations, the content field in the transaction information may also be encrypted to obtain a ciphertext field, while the account address field is kept as a plaintext field. By encrypting one of the account address field and the content field, it is possible to avoid storing the full amount of transaction information in plaintext.
[0081] S430: Write the encrypted data into the blockchain.
[0082] The blockchain nodes in the blockchain network can maintain a transaction pool for storing blockchain transactions. After completing consensus authentication on the transaction information and obtaining the corresponding encrypted data by encrypting some fields, the blockchain node can write the encrypted data corresponding to each blockchain transaction into the transaction pool it maintains.
[0083] When the block generation conditions are met, the encrypted data of each blockchain transaction stored in the transaction pool is written into the block to be chained, and the block to be chained is further linked to the blockchain.
[0084] In one embodiment of the present application, the block generation condition includes at least one of a time condition and a data volume condition. If the block generation condition is a time condition, the blockchain node can monitor the time difference from the generation time of the most recent block. When the time difference is greater than a preset time threshold, it can be determined that the block generation condition is met, and then a new block can be packaged; using the time condition as the block generation condition, blocks can be generated at fixed time intervals. If the block generation condition is a data volume condition, the blockchain node can monitor the amount of data stored in the record buffer pool. When the data volume is greater than a preset data volume threshold, it can be determined that the block generation condition is met, and then a new block can be packaged; using the data volume condition as the block generation condition, the generation time of each block is not fixed, but it can be guaranteed that the amount of data of each block linked to the blockchain is the same.
[0085] In one embodiment of the present application, the blockchain node can monitor the time condition and the block generation condition at the same time. When either of the two conditions is met, it can be determined that the block generation condition is met, and then start packaging a new block.
[0086] In one embodiment of the present application, a blockchain node in the blockchain network can be designated as a packaging node through a consensus mechanism. When the block generation conditions are met, the packaging node packages the encrypted data of the blockchain transaction stored in the transaction pool it maintains as a block to be chained. The block to be chained is broadcasted on the blockchain network so that each blockchain node in the blockchain network can perform consensus authentication on the block to be chained.
[0087] Each blockchain node in the blockchain network can obtain broadcast messages on the blockchain network. When a newly generated block to be chained is obtained, the encrypted data of the blockchain transaction contained in the block to be chained can be compared with the transaction pool maintained by itself. When the encrypted data contained in the block to be chained is consistent with the data content stored in the transaction pool maintained by the blockchain node itself, a confirmation message can be broadcast to the blockchain network. When the number of confirmation messages for the block to be chained broadcasted on the blockchain network exceeds the quantity threshold, the block to be chained can be processed on the chain, so that the block to be chained carrying encrypted data can be saved on the blockchain.
[0088] After completing the block chaining, each blockchain node can clear the blockchain transactions that have been chained and saved in the transaction pool.
[0089] In the technical solution provided in the embodiment of the present application, by obtaining the transaction information of the blockchain transaction after consensus authentication, some fields in the transaction information can be encrypted to obtain encrypted data including some plaintext fields and some ciphertext fields, and then the encrypted data can be written into the block to be chained, and the block to be chained can be linked to the blockchain. By encrypting some fields in the transaction information, the embodiment of the present application can cut off the correlation between different blockchain transactions in the transaction information, thereby avoiding the problem of privacy leakage caused by the full disclosure of transaction information, and thus can improve the privacy security of blockchain data.
[0090] Figure 5 The schematic diagram of the process of generating blocks and putting blocks on the blockchain in an application scenario of the embodiment of the present application is shown. In the blockchain system, a user can create a blockchain transaction through the SDK or client and sign the transaction with the user's private key. Then, the transaction is sent to a consensus node or a specific node in the blockchain network through the RPC service or HTTP service provided by the blockchain.
[0091] like Figure 5 As shown, after the blockchain transaction sent by the user is received by the consensus node, the following transaction processing process can be executed.
[0092] S501: Verify the transaction.
[0093] The accuracy of the transaction source is determined by verifying whether the transaction signature is legitimate, and the timeliness of the transaction is ensured by verifying the timestamp. After verification, the transaction will be placed in the transaction pool.
[0094] S502: Put into the transaction pool.
[0095] The transaction pool is mainly used to cache transactions that have not yet been packaged into proposals. These transactions will be stored in the transaction pool according to certain rules and order. When waiting for the consensus module to package new proposals, the transactions will be pulled.
[0096] S503: Transaction consensus.
[0097] For blockchain, consensus is the core. For each transaction, consensus is reached before the transaction is effective. If consensus cannot be reached, the transaction is invalid and the transfer operation within the transaction will not be implemented. Therefore, the consensus module will package a batch of transactions in the transaction pool into a proposal, and then reach consensus through the consensus algorithm and other consensus nodes.
[0098] S504: Data encryption.
[0099] By executing the blockchain transaction processing method provided in the above embodiment, each blockchain transaction stored in the transaction pool can be encrypted. The result of the encryption process is to obtain encrypted data corresponding to each blockchain transaction, and the encrypted data includes some plaintext fields and some ciphertext fields.
[0100] S505: Generate a block.
[0101] After the consensus module has passed the consensus algorithm consensus on the proposal, if a consensus is reached, then all transactions in this proposal are legal transactions. The information of these transactions will be packaged to generate a new block. This block contains all the data of this transaction, but due to the existence of the ciphertext field, the transaction data can be kept semi-public, which not only ensures the transparency and traceability of the transaction, but also avoids the problem of privacy leakage caused by the full disclosure of transaction data.
[0102] In one embodiment of the present application, the encrypted data includes multiple ciphertext fields corresponding to multiple transaction entities. The method of encrypting some fields in the transaction information in step S420 may further include: selecting some fields from the transaction information as key fields to be encrypted; obtaining the public keys of each transaction entity respectively; encrypting the key fields according to the public keys of the transaction entities to obtain ciphertext fields corresponding to the transaction entities; wherein different transaction entities correspond to different ciphertext fields.
[0103] For example, a blockchain transaction involves two transaction entities, user A and user B. After selecting key fields from the transaction information, the embodiment of the present application can use the public key of user A to encrypt the key fields to obtain the ciphertext fields corresponding to user A; at the same time, the public key of user B can be used to encrypt the key fields to obtain the ciphertext fields corresponding to user B.
[0104] In one embodiment of the present application, the key field to be encrypted includes a subject identification field for indicating the transaction subject; the method for encrypting the key field according to the public key of the transaction subject may further include: generating plaintext data to be encrypted corresponding to each of the transaction subjects according to the subject identification fields of multiple transaction subjects; wherein different transaction subjects correspond to different plaintext data or correspond to the same plaintext data; for each transaction subject, the plaintext data to be encrypted is encrypted using the public key of the transaction subject to obtain a ciphertext field corresponding to the transaction subject.
[0105] For example, a blockchain transaction involves two transaction subjects, user A and user B, and the key fields to be encrypted may include a first subject identification field for indicating user A and a second subject identification field for indicating user B. According to the first subject identification field and the second subject identification field, plaintext data to be encrypted corresponding to each of the transaction subjects may be generated.
[0106] In one embodiment of the present application, generating plaintext data to be encrypted corresponding to each transaction subject according to the subject identification fields of multiple transaction subjects may further include: generating plaintext data to be encrypted corresponding to each transaction subject according to the subject identification fields of multiple transaction subjects and preset designated fields, and the designated fields are differentiated fields used to distinguish different blockchain transactions.
[0107] In one embodiment of the present application, the designated field may be the timestamp of the block in which the blockchain transaction is located. In some other optional implementations, a pre-generated random number may also be used as the designated field.
[0108] By appending differentiating fields to the plaintext data, the problem of encrypted data confusion caused by data duplication can be avoided.
[0109] In one embodiment of the present application, the plaintext data to be encrypted includes a structure object or a field sequence; generating the plaintext data to be encrypted corresponding to each of the transaction subjects according to the subject identification fields of multiple transaction subjects and the preset designated fields, may further include: combining the subject identification fields of multiple transaction subjects and the preset designated fields to form a structure object; or, splicing multiple subject identification fields and the preset designated fields to form a field sequence.
[0110] When a structure object is used as the plaintext data to be encrypted, the corresponding encrypted data can carry the object attributes of each structure field, so that independent decryption can be performed when decrypting the data without relying on regular communication between the encryption end and the decryption end.
[0111] When a field sequence is used as the plaintext data to be encrypted, the same data encryption rules can be set at the encryption end and the decryption end, that is, a unified field arrangement order can be set synchronously, so that the attribute information of each field can be obtained according to the field arrangement order when decrypting the data.
[0112] For different transaction entities, they can use their respective public keys to encrypt the same plaintext data to obtain different ciphertext fields, or they can use their respective public keys to encrypt different plaintext data to obtain different ciphertext fields.
[0113] In one embodiment of the present application, for different transaction entities, the multiple entity identification fields included in the plaintext data to be encrypted have different field arrangement orders.
[0114] For example, a blockchain transaction involves two transaction subjects, user A and user B, and the key fields to be encrypted may include a first subject identification field for indicating user A and a second subject identification field for indicating user B. For user A, the plaintext data to be encrypted may be plaintext data composed of the first subject identification field and the second subject identification field in sequence; and for user B, the plaintext data to be encrypted may be plaintext data composed of the second subject identification field and the first subject identification field in sequence.
[0115] In one embodiment of the present application, the transaction subject includes a transaction initiator that requests to initiate a blockchain transaction and a transaction responder that responds to the blockchain transaction; in the plaintext data corresponding to the transaction initiator, the first field is the subject identification field of the transaction initiator; in the plaintext data corresponding to the transaction responder, the first field is the subject identification field of the transaction responder.
[0116] In one embodiment of the present application, the plaintext data corresponding to the transaction initiator is a field sequence formed by concatenating the subject identification field of the transaction initiator, the subject identification field of the transaction responder, and the specified field in sequence, and the plaintext data corresponding to the transaction responder is a field sequence formed by concatenating the subject identification field of the transaction responder, the subject identification field of the transaction initiator, and the specified field in sequence.
[0117] For example, in a blockchain transaction, the transaction initiator is user A, and the transaction responder is user B. The key fields to be encrypted may include a first subject identification field for indicating user A and a second subject identification field for indicating user B.
[0118] For user A, the transaction initiator, the plaintext data to be encrypted may be plaintext data concatenated in the order of the first subject identification field, the second subject identification field, and the block timestamp field; and for user B, the transaction responder, the plaintext data to be encrypted may be plaintext data concatenated in the order of the second subject identification field, the first subject identification field, and the block timestamp field.
[0119] The embodiment of the present application changes the order of the fields and always keeps the subject identification field corresponding to the transaction subject in the first place. When data query and decryption are required, only the first field can be decrypted to identify the corresponding transaction subject. Therefore, on the one hand, the difference of the plaintext data corresponding to different transaction subjects can be improved, and on the other hand, the convenience of data identification can be improved.
[0120] Figure 6 A schematic diagram of the process of encrypting transaction information in an application scenario according to an embodiment of the present application is shown.
[0121] like Figure 6 As shown, the transaction information corresponding to a blockchain transaction may include multiple fields. For example, the transaction identifier (transaction ID) is 001, the source account address From for requesting to transfer out assets is 0x001, the target account address To for receiving asset transfers is 0x002, the asset transfer amount is 0.5, and the asset transfer unit Unit is ETH.
[0122] The timing for encrypting transaction information in the embodiment of the present application is after the transaction consensus is completed and before the block is packaged and uploaded to the chain. The purpose of transaction privacy encryption is when the complete information of the transaction is written into the block after the transaction has reached consensus. Therefore, transaction encryption is performed after consensus is reached. When each consensus node generates a block, it needs to traverse the transactions in the proposal and encrypt the two parameters of the source account address and the target account address of each transaction.
[0123] like Figure 6 As shown in the figure, after the source account address 0x001 is encrypted using the encryption algorithm, the corresponding ciphertext field oxhsijm is obtained; at the same time, after the target account address 0x002 is encrypted, the corresponding ciphertext field 0xjsdhsj is obtained. In the final ciphertext data, the transaction identifier, asset transfer quantity and asset transfer unit are plaintext fields, while the source account address and target account address are ciphertext fields.
[0124] For the blockchain system, information disclosure is the most essential idea. Therefore, too much data cannot be encrypted. However, in order to protect user privacy, both the information of user transfers and the information of user transfers from others are included. Therefore, the two parameters of source account address and target account address can be encrypted. After the encrypted transaction is packaged into a block by the consensus node, a new block is successfully generated.
[0125] By encrypting the key fields of the transaction, the privacy of the fields can be achieved. However, for the blockchain system, the encrypted key fields, such as the source account address and the target account address, need to be queryable by the user himself. For example: User A transfers 1ETH to user B. After the transaction is encrypted, the source account address and the target account address in the transaction details are the ciphertext fields obtained by the encryption process. Then user A needs to identify that the transaction was initiated by himself, and B also needs to identify that the transaction is a transfer to himself. Therefore, the embodiment of the present application can use A's public key to encrypt A's address, and at the same time, B's address can be encrypted using B's public key.
[0126] Figure 7 The schematic diagram of an embodiment of the present application using the public key of a transaction subject to encrypt some fields in an application scenario is shown. Figure 7 As shown, the process of encrypting the source account address From and the target account address To respectively is as follows.
[0127] Source account address encryption: The source account address plus the target account address plus the timestamp are concatenated into a fixed data structure, and then the transaction initiator's public key is used to encrypt the structure data, and finally the ciphertext field corresponding to the transaction initiator is generated. The transaction initiator only needs to use the private key to decrypt the ciphertext field to obtain the source account address, target account address and the timestamp of the block in which it is located.
[0128] Target account address encryption: Different from the address encryption of the transaction initiator, the target account address is placed in front in the fixed data structure corresponding to the transaction responder. By exchanging the order of the addresses, the final calculated ciphertext is somewhat different. After the fixed data structure corresponding to the transaction responder is spliced, the data is encrypted using the account public key of the transaction responder, and the ciphertext field corresponding to the transaction responder is finally generated.
[0129] In one embodiment of the present application, after the block to be uploaded is linked to the blockchain, the transaction subject can query the blockchain transaction in which it participates by decryption matching.
[0130] In one embodiment of the present application, in response to a transaction query request initiated by a transaction subject, encrypted data corresponding to each blockchain transaction is read from the blockchain; each encrypted data is decrypted according to the private key of the transaction subject to obtain a decryption result of each encrypted data; when the decryption result of the encrypted data is a successful decryption, it is determined whether the transaction subject is a transaction participant in the blockchain transaction based on the decrypted data.
[0131] In one embodiment of the present application, the method for determining whether a transaction subject is a transaction participant in a blockchain transaction based on decrypted data may further include: in the decrypted data, deserializing the first field to obtain a plaintext field; matching the subject identifier of the transaction subject with the plaintext field; when the match is successful, determining that the transaction subject is a transaction participant in the blockchain transaction.
[0132] In one embodiment of the present application, the encrypted data includes a first encrypted field corresponding to a transaction initiator and a second encrypted field corresponding to a transaction responder; determining whether a transaction subject is a transaction participant of a blockchain transaction includes: when a subject identifier of the transaction subject successfully matches a plaintext field corresponding to the first encrypted field, determining that the transaction subject is the transaction initiator of the blockchain transaction; when a subject identifier of the transaction subject successfully matches a plaintext field corresponding to the second encrypted field, determining that the transaction subject is the transaction responder of the blockchain transaction.
[0133] When conducting a transaction query, the transaction subject only needs to decrypt and deserialize the first field in the encrypted field to determine whether a blockchain transaction is a transaction in which it participates, without having to deserialize all the encrypted fields, which can improve the efficiency of transaction queries.
[0134] In the embodiment of the present application, users can still query the transaction information in the blockchain through transaction hash and other methods. The difference is that the addresses of both parties in the transaction are encrypted. For a third party, it is impossible to distinguish who initiated the transaction, which ensures the security of the transaction data.
[0135] Especially for alliance chains, the fairness and openness of the blockchain system itself are required, while also requiring a certain degree of privacy. The embodiment of the present application encrypts some key information of user transaction data so that the transaction information is not stored in the block in a completely public form, thus ensuring the privacy of the transaction.
[0136] In one embodiment of the present application, a user can directly search all transaction records of an account through a block browser. Then click on the Hash of any transaction to view the detailed information of the transaction. Or directly enter the transaction Hash to directly search for the details of the transaction.
[0137] There are usually two ways to implement a blockchain browser: the first is that the blockchain system directly provides some query interfaces, and the blockchain browser directly calls the query interface of the blockchain system to obtain data. Another way is that the blockchain browser itself is implemented based on a blockchain node. This blockchain node will synchronize all the blocks on the chain to the local through the block synchronization function. Then, the specific information of each transaction is obtained by traversing the blocks.
[0138] Figure 8 A schematic diagram showing the principle of using a block API to query transactions in an application scenario in an embodiment of the present application.
[0139] like Figure 8 As shown in the figure, only blockchain systems that provide an open API interface can query transaction data. Often, blockchain systems that provide an open API will not publicly provide an API for querying the transaction records of a certain account address due to security considerations. Even if this API is provided, the private key signature of the address is required for authorization.
[0140] Fig. 9 A schematic diagram showing the principle of using a synchronous node to query a transaction in an application scenario according to an embodiment of the present application.
[0141] like Fig. 9 As shown in the figure, by joining a blockchain network, you can get the ability to synchronize blocks. Then synchronize all blocks in the blockchain network to the local computer. Having all blocks is equivalent to having all transaction information. You only need to traverse the transactions in the blocks one by one to query the blockchain transactions in which the user participates.
[0142] The embodiment of the present application ensures that user transaction information cannot be retrieved and analyzed by other users after being uploaded to the chain. At the same time, users can query their own transactions, including their own transfer transactions and received transactions. At the same time, a field encryption method is proposed, so that the encrypted information of the same transfer by the same user will be encrypted inconsistently in different blocks, thereby avoiding the possibility of being analyzed and extracted by the data model.
[0143] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0144] The following introduces an embodiment of the device of the present application, which can be used to execute the blockchain transaction processing method in the above embodiment of the present application. Fig.10 The structure block diagram of the blockchain transaction processing device provided by the embodiment of the present application is schematically shown. Fig.10 As shown, the blockchain transaction processing device 1000 includes:
[0145] The acquisition module 1010 is configured to acquire transaction information of a blockchain transaction after consensus authentication, wherein the transaction information is used to record multiple transaction entities participating in the blockchain transaction and transaction content;
[0146] The encryption module 1020 is configured to encrypt some fields in the transaction information to obtain encrypted data including some plaintext fields and some ciphertext fields, where the some ciphertext fields are obtained after the encryption of the some fields;
[0147] The chain module 1030 is configured to write the encrypted data into the block to be chained, and link the block to be chained to the blockchain.
[0148] In some embodiments of the present application, based on the above technical solution, the encrypted data includes a plurality of ciphertext fields corresponding to the plurality of transaction entities respectively, and the encryption module 1020 further includes:
[0149] A field selection module is configured to select some fields from the transaction information as key fields to be encrypted;
[0150] A public key acquisition module is configured to respectively acquire the public key of each of the transaction entities;
[0151] The field encryption module is configured to encrypt the key field according to the public key of the transaction subject to obtain a ciphertext field corresponding to the transaction subject; wherein different transaction subjects correspond to different ciphertext fields.
[0152] In some embodiments of the present application, based on the above technical solution, the key field includes a subject identification field for indicating the transaction subject; the field encryption module further includes:
[0153] A plaintext generation module, configured to generate plaintext data to be encrypted corresponding to each of the transaction subjects according to the subject identification fields of the plurality of transaction subjects; wherein different transaction subjects correspond to different plaintext data or to the same plaintext data;
[0154] The plaintext encryption module is configured to encrypt the plaintext data to be encrypted using the public key of each transaction subject to obtain a ciphertext field corresponding to the transaction subject.
[0155] In some embodiments of the present application, based on the above technical solution, the plaintext generation module is further configured to: generate plaintext data to be encrypted corresponding to each of the transaction subjects according to the subject identification fields of the multiple transaction subjects and the preset designated fields, and the designated fields are differentiated fields used to distinguish different blockchain transactions.
[0156] In some embodiments of the present application, based on the above technical solution, the plaintext data to be encrypted includes a structure object or a field sequence; the plaintext generation module is further configured to: combine the subject identification fields of multiple transaction subjects and the preset designated fields to form the structure objects corresponding to each of the transaction subjects respectively; or, splice the multiple subject identification fields and the preset designated fields to form the field sequences corresponding to each of the transaction subjects respectively.
[0157] In some embodiments of the present application, based on the above technical solution, the designated field is the timestamp of the block in which the blockchain transaction is located.
[0158] In some embodiments of the present application, based on the above technical solution, for different transaction entities, the multiple entity identification fields contained in the plaintext data to be encrypted have different field arrangement orders.
[0159] In some embodiments of the present application, based on the above technical solution, the transaction subject includes a transaction initiator that requests to initiate the blockchain transaction and a transaction responder that responds to the blockchain transaction; in the plaintext data corresponding to the transaction initiator, the first field is the subject identification field of the transaction initiator; in the plaintext data corresponding to the transaction responder, the first field is the subject identification field of the transaction responder.
[0160] In some embodiments of the present application, based on the above technical solution, the plaintext data corresponding to the transaction initiator is a field sequence formed by sequentially concatenating the subject identification field of the transaction initiator, the subject identification field of the transaction responder, and the specified field, and the plaintext data corresponding to the transaction responder is a field sequence formed by sequentially concatenating the subject identification field of the transaction responder, the subject identification field of the transaction initiator, and the specified field.
[0161] In some embodiments of the present application, based on the above technical solution, the blockchain transaction processing device 1000 further includes:
[0162] A query module, configured to read encrypted data corresponding to each blockchain transaction from the blockchain in response to a transaction query request initiated by the transaction subject;
[0163] A decryption module, configured to decrypt each of the encrypted data according to the private key of the transaction subject to obtain a decryption result of each of the encrypted data;
[0164] The determination module is configured to determine whether the transaction subject is a transaction participant of the blockchain transaction according to the decrypted data when the decryption result of the encrypted data is successful.
[0165] In some embodiments of the present application, based on the above technical solution, the determination module is further configured to: in the decrypted data, deserialize the first field to obtain a plaintext field; match the subject identifier of the transaction subject with the plaintext field; when the match is successful, determine that the transaction subject is a transaction participant in the blockchain transaction.
[0166] In some embodiments of the present application, based on the above technical solution, the encrypted data includes a first encrypted field corresponding to the transaction initiator and a second encrypted field corresponding to the transaction responder; the determination module is further configured to: when the subject identification of the transaction subject successfully matches the plaintext field corresponding to the first encrypted field, determine that the transaction subject is the transaction initiator of the blockchain transaction; when the subject identification of the transaction subject successfully matches the plaintext field corresponding to the second encrypted field, determine that the transaction subject is the transaction responder of the blockchain transaction.
[0167] The specific details of the blockchain transaction processing device provided in each embodiment of the present application have been described in detail in the corresponding method embodiments and will not be repeated here.
[0168] Fig.11 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.
[0169] It should be noted that Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0170] like Fig.11As shown, the computer system 1100 includes a central processing unit 1101 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1102 (ROM) or the program loaded from the storage part 1108 to the random access memory 1103 (RAM). Various programs and data required for system operation are also stored in the random access memory 1103. The central processing unit 1101, the read-only memory 1102 and the random access memory 1103 are connected to each other through a bus 1104. An input / output interface 1105 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1104.
[0171] The following components are connected to the input / output interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the input / output interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0172] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processor 1101, various functions defined in the system of the present application are executed.
[0173] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0174] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0175] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0176] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0177] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0178] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A blockchain transaction processing method, characterized in that: include: Obtaining transaction information of a blockchain transaction after consensus authentication, wherein the transaction information is used to record multiple transaction entities involved in the blockchain transaction and the transaction content; Encrypting some fields in the transaction information to obtain encrypted data including some plaintext fields and some ciphertext fields, wherein the some ciphertext fields are obtained by encrypting the some fields; The encrypted data is written to the blockchain.
2. The blockchain transaction processing method according to claim 1, characterized in that: The encrypted data includes a plurality of ciphertext fields corresponding to the plurality of transaction entities respectively, and encrypting some fields in the transaction information includes: Selecting some fields from the transaction information as key fields to be encrypted; Obtaining the public key of each of the transaction entities respectively; The key field is encrypted according to the public key of the transaction subject to obtain a ciphertext field corresponding to the transaction subject; wherein different transaction subjects correspond to different ciphertext fields.
3. The blockchain transaction processing method according to claim 2, characterized in that: The key field includes a subject identification field for indicating the transaction subject; the key field is encrypted according to the public key of the transaction subject to obtain a ciphertext field corresponding to the transaction subject, including: Generate, according to the subject identification fields of the plurality of transaction subjects, plaintext data to be encrypted corresponding to each of the transaction subjects respectively; wherein different transaction subjects correspond to different plaintext data or to the same plaintext data; For each of the transaction entities, the plaintext data to be encrypted is encrypted using the public key of the transaction entity to obtain a ciphertext field corresponding to the transaction entity.
4. The blockchain transaction processing method according to claim 3 is characterized in that: Generating, according to the subject identification fields of the plurality of transaction subjects, plaintext data to be encrypted corresponding to each of the transaction subjects, respectively, comprising: According to the subject identification fields of the multiple transaction subjects and the preset designated fields, the plaintext data to be encrypted corresponding to each of the transaction subjects is generated, and the designated fields are differentiated fields used to distinguish different blockchain transactions.
5. The blockchain transaction processing method according to claim 4, characterized in that: The plaintext data to be encrypted includes a structure object or a field sequence; generating the plaintext data to be encrypted corresponding to each of the transaction subjects according to the subject identification fields of the plurality of transaction subjects and the preset designated fields, including: Combining the subject identification fields of the plurality of transaction subjects and the preset designated fields to form the structure objects corresponding to the respective transaction subjects; Alternatively, a plurality of subject identification fields and preset designated fields are concatenated to form the field sequences corresponding to the respective transaction subjects.
6. The blockchain transaction processing method according to claim 4, characterized in that: The designated field is the timestamp of the blockchain transaction in the block.
7. The blockchain transaction processing method according to claim 4, characterized in that: For different transaction entities, the multiple entity identification fields contained in the plaintext data to be encrypted have different field arrangement orders.
8. The blockchain transaction processing method according to claim 7, characterized in that: The transaction subject includes a transaction initiator that requests to initiate the blockchain transaction and a transaction responder that responds to the blockchain transaction; In the plaintext data corresponding to the transaction initiator, the first field is the subject identification field of the transaction initiator; in the plaintext data corresponding to the transaction responder, the first field is the subject identification field of the transaction responder.
9. The blockchain transaction processing method according to claim 8, characterized in that: The plaintext data corresponding to the transaction initiator is a field sequence formed by sequentially concatenating the subject identification field of the transaction initiator, the subject identification field of the transaction responder and the specified field; the plaintext data corresponding to the transaction responder is a field sequence formed by sequentially concatenating the subject identification field of the transaction responder, the subject identification field of the transaction initiator and the specified field.
10. The blockchain transaction processing method according to claim 2, characterized in that: After linking the block to be chained to the blockchain, the method further includes: In response to a transaction query request initiated by the transaction subject, reading encrypted data corresponding to each blockchain transaction from the blockchain; Decrypting each encrypted data according to the private key of the transaction subject to obtain a decryption result of each encrypted data; When the decryption result of the encrypted data is that the decryption is successful, it is determined whether the transaction subject is a transaction participant of the blockchain transaction based on the decrypted data.
11. The blockchain transaction processing method according to claim 10, characterized in that: Determining whether the transaction subject is a transaction participant of the blockchain transaction according to the decrypted data includes: In the decrypted data, the first field is deserialized to obtain the plaintext field; Matching the subject identifier of the transaction subject with the plaintext field; When the match is successful, it is determined that the transaction subject is a transaction participant of the blockchain transaction.
12. The blockchain transaction processing method according to claim 11, characterized in that: The encrypted data includes a first encrypted field corresponding to the transaction initiator and a second encrypted field corresponding to the transaction responder; and determining that the transaction subject is a transaction participant of the blockchain transaction includes: When the subject identifier of the transaction subject successfully matches the plaintext field corresponding to the first encrypted field, the transaction subject is determined to be the transaction initiator of the blockchain transaction; When the subject identifier of the transaction subject successfully matches the plaintext field corresponding to the second encrypted field, the transaction subject is determined to be the transaction responder of the blockchain transaction.
13. A blockchain transaction processing device, characterized in that: include: An acquisition module is configured to acquire transaction information of a blockchain transaction after consensus authentication, wherein the transaction information is used to record multiple transaction entities participating in the blockchain transaction and transaction content; an encryption module configured to encrypt some fields in the transaction information to obtain encrypted data including some plaintext fields and some ciphertext fields, wherein the some ciphertext fields are obtained after encrypting the some fields; The on-chain module is configured to write the encrypted data into the blockchain.
14. A computer readable medium, characterized in that The computer-readable medium stores a computer program, and when the computer program is executed by the processor, the blockchain transaction processing method described in any one of claims 1 to 12 is implemented.
15. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the executable instructions to implement the blockchain transaction processing method as described in any one of claims 1 to 12.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the blockchain transaction processing method described in any one of claims 1 to 12 is implemented.