CN117495559A - Transaction processing method, device, equipment and storage medium - Google Patents

Transaction processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN117495559A
CN117495559A CN202311416119.2A CN202311416119A CN117495559A CN 117495559 A CN117495559 A CN 117495559A CN 202311416119 A CN202311416119 A CN 202311416119A CN 117495559 A CN117495559 A CN 117495559A
Authority
CN
China
Prior art keywords
contract
transaction
sub
signature
algorithm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311416119.2A
Other languages
Chinese (zh)
Inventor
郑伟林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311416119.2A priority Critical patent/CN117495559A/en
Publication of CN117495559A publication Critical patent/CN117495559A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

A transaction processing method, device, equipment and storage medium are applied to a blockchain; comprising the following steps: receiving a transaction request sent by a target object; the transaction request includes: at least two sub-transaction information and a composite contract address; each sub-transaction information at least comprises an associated transaction contract; according to the comprehensive contract address, acquiring an inlet contract address stored in a target comprehensive contract, and calling a signature verification inlet contract associated with the inlet contract address to verify at least two sub-transaction information respectively; for at least two sub-transaction information, respectively performing: after the verification of the sub-transaction information is passed, a transaction contract contained in the sub-transaction information is called, and sub-transaction tasks associated with the sub-transaction information are processed to obtain corresponding sub-transaction processing results; and returning the obtained at least two sub-transaction processing results to the target object. The transaction batch processing technology is realized, the object is supported to simultaneously carry out a plurality of transactions with the blockchain, the operation is simplified, and the cost is saved.

Description

Transaction processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a transaction processing method, apparatus, device, and storage medium.
Background
With the continuous development of blockchain technology, more and more objects conduct transaction task processing through the blockchain technology. When transaction task processing is performed through a blockchain technology, an object needs to send a transaction request to a blockchain; after the block link receives the transaction request, firstly, a transaction is initiated to other nodes through an intelligent contract for providing an electronic asset transaction function, and then, the transaction task in the transaction request is processed through the transaction contract in the other nodes.
Currently, when a transaction task is processed through a blockchain technology, a blockchain only supports an object to send a single transaction, namely the object can only initiate one transaction to the blockchain at a time, and each transaction requires a fixed transaction fee. Therefore, when a plurality of transactions exist, an object is required to send a transaction request for each transaction, the operation is complex, and the use scene of the blockchain is limited; meanwhile, since one fee is generated for each transaction request, when a plurality of transactions exist, a plurality of transaction fees are generated, so that the transaction fees are increased.
Therefore, when transaction task processing is performed through a blockchain technology, the blockchain is enabled to support a plurality of transaction tasks which are sent by objects and are simultaneously received, and corresponding transaction tasks are executed through different transaction contracts, so that batch processing of the transaction tasks is realized, and the technical problems that operation is simplified and cost is saved are needed to be solved at present.
Disclosure of Invention
The embodiment of the application provides a transaction processing method, device, equipment and storage medium, which are used for enabling a blockchain to support a plurality of transaction tasks sent by a receiving object at the same time, realizing batch processing of the transaction tasks, simplifying operation and saving cost.
In a first aspect, embodiments of the present application provide a transaction processing method, including:
receiving a transaction request sent by a target object; the transaction request includes: at least two sub-transaction information and a composite contract address; wherein each piece of sub-transaction information is associated with one sub-transaction task, and each piece of sub-transaction information at least comprises: an associated trade contract;
according to the comprehensive contract address, acquiring an inlet contract address stored in a deployed target comprehensive contract, and calling a signature checking inlet contract associated with the inlet contract address to verify at least two sub-transaction information respectively;
for at least two sub-transaction information, the following operations are respectively executed: after the verification of the sub-transaction information is passed, a transaction contract contained in the sub-transaction information is called, and sub-transaction tasks associated with the sub-transaction information are processed to obtain corresponding sub-transaction processing results;
And returning the obtained at least two sub-transaction processing results to the target object.
In a second aspect, embodiments of the present application provide a transaction processing device, the device including:
the receiving unit is used for receiving the transaction request sent by the target object; the transaction request includes: at least two sub-transaction information and a composite contract address; wherein each piece of sub-transaction information is associated with one sub-transaction task, and each piece of sub-transaction information at least comprises: an associated trade contract;
the verification unit is used for acquiring an entry contract address stored in the deployed target comprehensive contract according to the comprehensive contract address, calling a signature entry contract associated with the entry contract address and verifying at least two sub-transaction information respectively;
the execution unit is used for respectively executing the following operations aiming at least two sub-transaction information: after the verification of the sub-transaction information is passed, a transaction contract contained in the sub-transaction information is called, and sub-transaction tasks associated with the sub-transaction information are processed to obtain corresponding sub-transaction processing results;
and the return unit is used for returning the obtained at least two sub-transaction processing results to the target object.
In one possible implementation, each sub-transaction information further includes a specified signature algorithm, and the transaction request further includes: signature data associated with each of the at least two sub-transaction information; the signature data is obtained by adopting a private key generated by a specified signature algorithm contained in the corresponding sub-transaction information to carry out signature processing on the sub-transaction information.
In one possible implementation, the verification unit is specifically configured to:
for at least two sub-transaction information, the following operations are respectively executed:
decrypting the signature data associated with the sub-transaction information based on a public key corresponding to a designated signature algorithm contained in the sub-transaction information to obtain a corresponding decryption value; the public key is obtained from the target comprehensive contract based on a specified signature algorithm;
carrying out hash processing on sub-transaction information to obtain a corresponding hash value;
when the hash value is consistent with the decryption value, verification of one piece of sub-transaction information is determined to pass.
In one possible implementation, the verification unit is specifically configured to:
for at least two sub-transaction information, the following operations are respectively executed:
in the signature verification entry contract, after the signature verification contract address corresponding to the appointed signature algorithm contained in the sub-transaction information is obtained, a verification function in the signature verification algorithm contract associated with the signature verification contract address is called, and the sub-transaction information is verified.
In one possible implementation, each sub-transaction information further includes a calling parameter; the calling parameters at least comprise calling functions and function parameter values;
the execution unit is specifically configured to:
determining an execution function required for executing the sub-transaction task in the transaction contract according to the calling function;
sub-transaction tasks are processed based on the execution function and the function parameter values.
In one possible implementation, before the receiving unit receives the transaction request sent by the target object, the receiving unit is further configured to:
receiving a comprehensive contract deployment request sent by a target object, wherein the comprehensive contract deployment request carries at least one deployment signature algorithm, a public key generated by the deployment signature algorithm and an entrance contract address;
storing the deployment signature algorithm and the associated public key correspondence in a pre-constructed composite contract, and storing the entry contract address in the pre-constructed composite contract, obtaining a target composite contract for successful deployment, and the composite contract address.
In one possible implementation, before the receiving unit receives the transaction request sent by the target object, the receiving unit is further configured to:
receiving a signature verification entry contract deployment request sent by a deployment object, wherein the signature verification entry contract deployment request carries code information of a signature verification entry contract, and the code information at least comprises a signature algorithm adding function and a signature algorithm deleting function;
And deploying the code information of the signature checking entry contract on the blockchain, and after successful deployment, obtaining the entry contract address of the signature checking entry contract.
In one possible implementation, after the receiving unit deploys the code information of the signature entry contract on the blockchain, the receiving unit is further configured to:
receiving a signature algorithm integration request sent by a deployment object; the signature algorithm integration request is used for indicating that a signature algorithm is added in the signature verification entry contract, and the signature algorithm integration request comprises an integrated signature algorithm and a corresponding signature verification contract address;
and calling a signature algorithm adding function, and correspondingly storing the integrated signature algorithm and the corresponding signature verification contract address in the signature verification contract.
In one possible implementation, after the receiving unit deploys the code information of the signature entry contract on the blockchain, the receiving unit is further configured to:
receiving a signature algorithm deleting request sent by a deployment object; the signature algorithm deleting request is used for indicating that the signature algorithm is deleted in the signature verification entry contract, and the signature algorithm deleting request comprises a signature deleting algorithm and a corresponding signature verification contract address;
and calling a signature algorithm deleting function, and deleting the signature deleting algorithm and the corresponding signature checking contract address from the signature checking entry contract.
In one possible implementation, the signing contract address is determined by:
receiving a signature verification algorithm contract deployment request sent by a deployment object, wherein the signature verification algorithm contract deployment request carries code information of a signature verification algorithm contract, and the code information at least comprises a verification function;
and deploying the code information of the signing algorithm contract on the blockchain, and after successful deployment, obtaining the signing contract address of the signing algorithm contract.
In a third aspect, embodiments of the present application provide a computing device comprising: a memory and a processor, wherein the memory is used for storing a computer program; and a processor for executing a computer program to implement the steps of the transaction processing method provided in the embodiments of the present application.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program, which when executed by a processor, implements the steps of the transaction processing method provided by embodiments of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program stored in a computer readable storage medium; when the processor of the computing device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the computing device performs the steps of the transaction processing method provided in the embodiments of the present application.
The beneficial effects of the application are as follows:
the embodiment of the application provides a transaction processing method, a transaction processing device, transaction processing equipment and a transaction processing storage medium, relates to the technical field of computers, and particularly relates to the technical field of blockchain.
In this embodiment, the blockchain first receives a transaction request sent by a target object, where the transaction request includes at least two sub-transaction information and a composite contract address, each sub-transaction information is associated with one sub-transaction task, and each sub-transaction information at least includes an associated transaction contract. Obviously, the blockchain supports receiving transaction requests which are sent by the target object and bind a plurality of transactions, namely, the blockchain supports receiving a plurality of transactions simultaneously; therefore, when a plurality of transactions exist in the target object, the plurality of transaction bundles can be sent to the blockchain without being sent separately for each transaction, so that the operation is simplified, and the cost is saved.
Meanwhile, in the scenario that the blockchain supports receiving a plurality of transactions simultaneously, if each transaction in the plurality of transactions cannot be processed, the simultaneous receiving of the plurality of transactions is meaningless, and the problems of resource waste and the like may be caused. Therefore, in the embodiment of the present application, the transaction request is required to carry a composite contract address and sub-transaction information including a transaction contract, so that after the transaction request is received, the blockchain obtains an entry contract address stored in an associated target composite contract according to the composite contract address, invokes a signature verification entry contract associated with the entry contract address to verify at least two sub-transaction information respectively, invokes a transaction contract included in one sub-transaction information after verification of the at least two sub-transaction information passes, processes a transaction task associated with the one sub-transaction information to obtain a corresponding sub-transaction processing result, and finally returns the obtained at least two sub-transaction processing results to the target object. Obviously, after the blockchain receives the transaction request, the signing checking portal contract is called to verify each piece of sub-transaction information in the transaction request, so that the safety and accuracy of the sub-transaction information are ensured, and the transaction contract is further called to process the sub-transaction task, so that the transaction batch processing technology is realized.
In summary, the transaction processing method provided by the application supports binding a plurality of sub transactions interacted with the blockchain into one transaction, and finally sending the transaction to the blockchain, and then calling the signature checking entry contract and the transaction contract by the target comprehensive contract deployed on the blockchain to complete batch processing of transaction tasks. This allows objects to interact with multiple contracts on the blockchain simultaneously, and reduces the cost required for each transaction, saving costs and simplifying operation.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a block mechanism according to an embodiment of the present disclosure;
fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application;
FIG. 3 is a flow chart of deploying a target complex contract on a blockchain provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of deploying a target complex contract on a blockchain provided in an embodiment of the present application;
FIG. 5 is a flow chart of deploying an endorsement portal contract on a blockchain provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of deploying a signature verification portal contract on a blockchain provided in an embodiment of the present application;
FIG. 7 is a flow chart of deploying an signing algorithm contract provided by an embodiment of the present application;
FIG. 8 is a schematic diagram of a deployment of a signature verification algorithm contract provided by an embodiment of the present application;
FIG. 9 is a flow chart of an add signing algorithm contract provided by an embodiment of the present application;
FIG. 10 is a schematic diagram of integrating a signing algorithm contract in a signing entry contract provided by an embodiment of the present application;
FIG. 11 is a flowchart of a method for deleting a signature algorithm contract provided by an embodiment of the present application;
FIG. 12 is a schematic diagram of deleting a signature algorithm contract in a signature entry contract according to an embodiment of the present application;
FIG. 13 is a flow chart of a transaction process provided in an embodiment of the present application;
FIG. 14 is a schematic diagram of a transaction process provided in an embodiment of the present application;
FIG. 15 is a block diagram of a transaction processing device according to an embodiment of the present application;
fig. 16 is a block diagram of a computing device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantageous effects of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments, but not all embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Some of the terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
1. Blockchain (Blockchain): comprising a series of blocks (blocks) interconnected in chronological order of generation, wherein new blocks are no longer removed once added to the blockchain, and record data submitted by nodes in the blockchain system are recorded in the blocks. Referring to fig. 1, an exemplary Block Structure (Block Structure) is provided, in which each Block includes a hash value of a transaction record stored in the Block (hash value of the Block), and a hash value of a previous Block, and the blocks are connected by the hash values to form a blockchain. In addition, the block may include information such as a time stamp at the time of block generation. The blockchain is essentially a decentralised database, and is a series of data blocks which are generated by association by using a cryptography method, and each data block contains information of a batch of network transactions and is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
The blockchain underlying platform may include processing modules for management, basic services, smart contracts, and the like. The management module is responsible for identity information management of all blockchain participants, including maintenance of public and private key generation (account management), key management, maintenance of corresponding relation between identities and blockchain addresses (authority management) and the like; the basic service module is deployed on all block chain node devices, is used for verifying the validity of a service request, recording the service request on a storage after the effective request is identified, for a new service request, the basic service firstly analyzes interface adaptation and authenticates the interface adaptation, encrypts service information (identification management) through an identification algorithm, and transmits the encrypted service information to a shared account book (network communication) in a complete and consistent manner, and records and stores the service information; the intelligent contract module is responsible for the registration and release of contracts, the triggering of contracts and the execution of contracts, developers can define contract logic through a certain programming language, release the contract logic to a blockchain (contract registration), call keys or other event triggering execution according to the logic of contract clauses to complete the contract logic, and simultaneously provide the function of logging off the upgrade of the contracts.
The platform product service layer provides basic capabilities and implementation frameworks of typical applications, and developers can complete the blockchain implementation of business logic based on the basic capabilities and the characteristics of the superposition business.
The application service layer provides the application service based on the block chain scheme to the business participants for use.
The blockchains are further divided into a public chain (Public Blockchain), a private chain (Private Blockchain) and a alliance chain (Consortium Blockchain); the core difference between these three types of blockchains is the degree of openness of the access rights, or the degree of decentralization. The public chain is public/public blockchain, and access and writing authorities are opened to all users, namely all users can access the network without authorization of a centralization mechanism; the private chain is a private blockchain, and the access and writing authority is controlled by a certain organization/organization only, namely, the organization/organization controls access and use, and a user must register and obtain permission first to use; the alliance chain is a blockchain of an organization alliance, and access and writing rights are only opened for nodes joining the organization alliance.
2. Intelligent contract: computerized agreement, which refers to a computer program capable of automatically executing contractual terms, has event driven, value transfer, automatic execution, etc. features. A smart contract is a program stored on a blockchain that runs when predetermined conditions are met. They are typically used to automatically execute protocols so that all participants can immediately determine the results without any intervening person or waste of time. They may also automatically complete the workflow, triggering the next operation when a condition is met. That is, the smart contract may execute the terms of a certain contract, implemented by the code deployed on the shared ledger for execution when certain conditions are met, for completing automated transactions, such as querying the physical distribution status of the goods purchased by the buyer, transferring the electronic assets of the buyer to the merchant's address after the buyer signs the goods; of course, the smart contract is not limited to executing the contract for the transaction, and may execute a contract that processes the received information. In the embodiment of the application, the target integrated contract, the signature verification entry contract, the transaction contract and the like belong to intelligent contracts.
3. The signature algorithm is an algorithm that refers to digital signatures. A digital signature is a digital string which can only be generated by a sender of information and cannot be forged by others, and the digital string is also a valid proof for the authenticity of the information sent by the sender of the information.
4. The comprehensive contracts are used for assisting in transaction task processing, and comprise the functions of initiating transactions to other contracts so as to finally realize transaction task processing; in the embodiment of the application, the integrated contract verifies sub-transaction information and signature sent by the target object by calling the signature verification entry contract, and sub-transaction tasks triggered by calling the transaction contract to complete the target object are used. In some applications, one skilled in the art will use "wallet contracts", "electronic asset contracts", "blockchain wallets", etc. instead of "integrated contracts" in embodiments of the present application.
5. The signing checking entrance contract is a signing checking call entrance and helps to distribute sub-transactions to appointed signing checking algorithm contracts for signing checking, wherein addresses of all signing checking algorithm contracts are integrated, and dynamic expansion of the signing checking algorithm is supported.
6. The signing verification algorithm contract is used for realizing the signing verification algorithms, and the signing verification operation of the appointed signing algorithm is completed by calling the signing verification entry contract.
7. The trade contracts are project contracts deployed by project parties in a blockchain for implementing various trade tasks.
8. The target object is a blockchain user, holds a public and private key pair, can control all money of the integrated contract through the private key, and can control the integrated contract to call the signature checking entrance contract, the transaction contract and the like so as to complete the transaction task triggered by the target object.
9. The deployment object is an object for deploying a signature verification entry contract and a signature verification algorithm contract, and is generally an operator.
The following briefly describes the design concept provided in the embodiments of the present application.
With the increasing proliferation of blockchain technology, more and more objects are transacted with the blockchain technology. When transaction task processing is performed through a blockchain technology, an object needs to send a transaction request to a blockchain; after the block link receives the transaction request, firstly, a transaction is initiated to other nodes through an intelligent contract for providing an electronic asset transaction function, and then, the transaction task in the transaction request is processed through the transaction contract in the other nodes.
Currently, when a transaction task is processed through a blockchain technology, a blockchain only supports an object to send a single transaction, namely the object can only initiate one transaction to the blockchain at a time, and each transaction requires a fixed transaction fee. Therefore, when a plurality of transactions exist, an object is required to send a transaction request for each transaction, the operation is complex, and the use scene of the blockchain is limited; also, since one fee per transaction request is generated (e.g., each transaction requires a fixed 21000 gas), when there are multiple transactions, multiple transaction fees are generated, resulting in an increase in transaction fees.
Therefore, when transaction task processing is performed through a blockchain technology, the blockchain is enabled to support a plurality of transaction tasks which are sent by objects and are simultaneously received, and corresponding transaction tasks are executed through different transaction contracts, so that batch processing of the transaction tasks is realized, and the technical problems that operation is simplified and cost is saved are needed to be solved at present.
In view of the foregoing, embodiments of the present application provide a transaction processing method, apparatus, device, and storage medium; the method is applied to the technical field of computers, in particular to the technical field of blockchain.
In this embodiment, the blockchain first receives a transaction request sent by a target object, where the transaction request includes at least two sub-transaction information and a composite contract address, each sub-transaction information is associated with one sub-transaction task, and each sub-transaction information at least includes an associated transaction contract. Obviously, the blockchain supports receiving transaction requests which are sent by the target object and bind a plurality of transactions, namely, the blockchain supports receiving a plurality of transactions simultaneously; after receiving a transaction request, the blockchain acquires an entry contract address stored in an associated target integrated contract according to the integrated contract address, invokes a signature verification entry contract associated with the entry contract address to verify at least two piece of sub-transaction information respectively, invokes a transaction contract contained in one piece of sub-transaction information to process a transaction task associated with the sub-transaction information after verifying one piece of the at least two piece of sub-transaction information, obtains a corresponding sub-transaction processing result, and finally returns the obtained at least two piece of sub-transaction processing results to a target object. Obviously, after the blockchain receives the transaction request, the signing checking portal contract is called to verify each piece of sub-transaction information in the transaction request, so that the safety and accuracy of the sub-transaction information are ensured, and the transaction contract is further called to process the sub-transaction task, so that the transaction batch processing technology is realized.
In summary, the transaction processing method of the present application provides a blockchain supporting a plurality of transaction tasks sent by an object to be received simultaneously, that is, supporting binding a plurality of sub transactions interacted with the blockchain into one transaction, and finally sending the transaction to the blockchain, and then calling a signature checking entry contract and a transaction contract by a target integrated contract deployed on the blockchain to complete batch processing of the transaction tasks. This allows objects to interact with multiple contracts on the blockchain simultaneously, and reduces the cost required for each transaction, saving costs and simplifying operation.
The inventor considers that in the blockchain technology, in order to ensure the security of at least two sub-transaction information in a transaction request, an information sender needs to sign the transaction request and the at least two sub-transaction information in the transaction request according to a private key of a signature algorithm, and an information receiver performs signature verification on the received information according to a public key of the signature algorithm so as to ensure the security of the received information. However, only a single signature algorithm is supported on the blockchain in the related art, and at this time, a public and private key pair generated by adopting the same signature algorithm is generated to verify the transaction request and at least two pieces of sub information in the transaction request.
In the scenario that the public and private key pair generated by the same signature algorithm is used for verifying the transaction request and at least two pieces of sub-information in the transaction request, if the public and private key pair is leaked, all information in the transaction request is leaked, the security of data transmission is reduced, only a single signature algorithm is supported on the blockchain, and the application development of the blockchain is influenced.
Therefore, in order to ensure the security of the transaction information and expand the application development of the blockchain, in the embodiment of the present application, a blockchain supporting a multi-signature algorithm is provided on the basis of supporting a blockchain that simultaneously receives a plurality of transaction tasks sent by an object, that is, the blockchain can verify different sub-transaction information using different signature algorithms.
For example, the signature algorithm on the blockchain proposed in the embodiment of the present application at least includes: a lister-samer-Adleman (RSA) algorithm, an elliptic curve cryptography (Ellipse Curve Cryptography, ECC) algorithm, a digital signature algorithm (Digital Signature Algorithm, DSA); at this time, if the information sender chooses to encrypt the sub-transaction information a by using the private key of the RSA algorithm, the blockchain decrypts the sub-transaction information a by using the public key of the RSA algorithm, and similarly if the information sender chooses to encrypt the sub-transaction information B by using the private key of the ECC algorithm, the blockchain decrypts the sub-transaction information B by using the public key of the ECC algorithm; different signature algorithms are adopted to process different transaction information, so that the security of the transaction information is ensured.
The application scenario set in the present application is briefly described below. It should be noted that the following concentrates are only used to illustrate the embodiments of the present application and are not limiting. In specific implementation, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs.
Referring to fig. 2, fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application. The application scene comprises the following steps: a first device 210 and a blockchain 220; wherein communication between the first device 210 and the blockchain 220 may be through a communication network. In an alternative embodiment, the communication network may be a wired network or a wireless network. Thus, the first device 210 and the blockchain 220 may be directly or indirectly connected by wired or wireless communication. For example, the first device 210 may be indirectly connected to the blockchain 220 through a wireless access point, or the first device 210 may be directly connected to the blockchain 220 through the internet, as the application is not limited herein.
The first device 210 is a terminal device of the target object, or a terminal device of the deployment object; the terminal equipment comprises, but is not limited to, mobile phones, tablet computers, notebook computers, desktop computers, electronic book readers, intelligent voice interaction equipment, intelligent household appliances, vehicle-mounted terminals and other equipment; the terminal device may be provided with various clients, which may be online platforms, applications (e.g., browsers, game software, shopping software, video players, etc.), web pages, applets, etc. that support transaction processing.
The blockchain 220 is a server that serves a background server corresponding to a client installed in a terminal device for processing transaction tasks. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligent platforms, and the like.
The transaction processing method provided in the exemplary embodiments of the present application is described below with reference to the accompanying drawings. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principles of the present application, and embodiments of the present application are not limited in any way in this respect. Furthermore, although the operations of the methods of the present application are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
In order to enable the blockchain to support a plurality of transaction tasks transmitted by a target object to be received simultaneously, realize transaction task batch processing, simplify operation and save cost, and ensure the security and accuracy of sub transaction information during transaction task batch processing and expand the application scene of the blockchain, a transaction batch processing technology supporting a plurality of signature algorithms is provided. The method comprises the steps of integrating a plurality of transaction contracts on a blockchain, wherein the transaction batch processing technology is used for binding the transaction based on the integrated contracts, so that an object invokes the integrated contracts on the blockchain, and the transaction batch processing is realized by interacting with the transaction contracts through the integrated contracts to complete the transaction task batch processing, thereby saving the cost and simplifying the operation; in addition, the invention also relates to a transaction batch processing technology supporting a plurality of signature algorithms, and a plurality of signature algorithms which are dynamically expandable are provided, so that an object can select a proper signature algorithm to initiate transaction to a blockchain according to own requirements, the safety and the accuracy are improved, and the application scene of the blockchain is expanded.
Therefore, in the embodiment of the application, the comprehensive contract needs to be deployed on the blockchain, meanwhile, the object holds the private key for controlling the ownership of the comprehensive contract, so that the object signs a plurality of sub-transaction information by using the private key, then the sub-transaction information is bound to generate a transaction request and sent to the comprehensive contract on the blockchain to form a transaction for calling the comprehensive contract, the corresponding blockchain calls the signature verification entry contract for each sub-transaction information through the comprehensive contract, and the signature verification entry contract is verified based on the signature verification algorithm contract integrated in the signature verification entry contract, therefore, the signature verification entry contract is deployed on the blockchain, the signature verification algorithm contract is integrated in the signature verification entry contract, and after verification is passed, the transaction contract of the sub-transaction information is called by the comprehensive contract, and the transaction task of the object is completed through the transaction contract.
In summary, embodiments of the present application relate to deploying target syndication on a blockchain, deploying a signature verification portal contract, integrating a signature verification algorithm contract in the signature verification portal contract, and implementing transaction task batch processing by interaction of a target object and the blockchain. The following describes each embodiment.
Embodiment one: a target complex contract is deployed on the blockchain.
Referring to fig. 3, fig. 3 is a flowchart of deploying a target composite contract on a blockchain according to an embodiment of the present application, including the following steps:
in step S301, the block link receives a comprehensive contract deployment request sent by the target object, where the comprehensive contract deployment request carries at least one deployment signature algorithm, a public key generated by the deployment signature algorithm, and an entry contract address.
In the embodiment of the application, the target object holds at least one public and private key pair, and each public and private key pair corresponds to a signature algorithm; i.e. different public-private key pairs are generated by different signature algorithms. When the target object sends the comprehensive contract request to the blockchain, at least one deployment signature algorithm carried in the comprehensive contract deployment request and a public key generated by the deployment signature algorithm are determined according to the public-private key pair held by the target object.
For example, the public and private key pairs held by the target object U are respectively: [ Public ] UR ,Prikey UR ]、[Public UE ,Prikey UE ][ Public ] UD ,Prikey UD ]. Wherein [ Public ] UR ,Prikey UR ]Public and private key pairs generated for RSA signature algorithm; [ Public ] UE ,Prikey UE ]Public and private key pairs generated for an ECC signature algorithm; [ Public ] UD ,Prikey UD ]Public-private key pairs generated for DSA signature algorithms. It should be noted that other signature algorithms can be extended according to the actual application scenario, and only three signature algorithms are taken as examples here to explain the principles of the embodiments of the present application.
At this time, the integrated contract deployment request may carry: RSA signature algorithm name and corresponding Public key Public UR ECC signing algorithm name and corresponding Public key Public UE DSA signing algorithm name and corresponding Public key Public UD . It is necessary to say thatIt is clear that the use of names to identify signature algorithms is only one implementation, and any information that may be used to identify a distinguishing signature algorithm in the embodiments of the present application may be carried in the integrated contract deployment request.
In the embodiment of the application, the integrated contract deployment request carries the signature algorithm and the corresponding public key, and also carries the entry contract address of the signature entry contract selected for use by the target object. The portal contract address is obtained through the implementation of the second embodiment, and the target object can be directly selected for use.
In one possible implementation, the target object holds a Public-private key pair [ Public ] generated by a native protocol signature algorithm based on blockchain support in addition to the three Public-private keys U ,Prikey U ]. For example, the blockchain-supported native protocol signature algorithm is elliptic curve digital signature algorithm (Elliptic Curve Digital Signature Algorithm, ECDSA), public U ,Prikey U ]Public-private key pairs generated for ECDSA signature algorithms. Wherein the private key Prikey U The method comprises the steps of signing an integrated contract deployment request sent by a target object, generating an integrated contract deployment request, and sending the integrated contract deployment request to a blockchain to request deployment of an integrated contract on the blockchain; accordingly, the blockchain receives the sent composite contract deployment request of the target object.
In step S302, the blockchain stores the deployment signature algorithm and the associated public key correspondence in the pre-constructed composite contract, and stores the entry contract address in the pre-constructed composite contract, to obtain the target composite contract for successful deployment, and the composite contract address.
In the embodiment of the application, after the block link receives the comprehensive contract deployment request, public key is used for publishing U Decrypting the comprehensive contract deployment request, obtaining information carried in the comprehensive contract deployment request, and calling a constructor to execute: storing the deployment signature algorithm and associated public key correspondence in a pre-constructed composite contract, and storing the entry address of the signature checking entry contract in the composite contract, and upon completionAfter storage, the successful deployment of the target comprehensive contract is determined, and the comprehensive contract address of the successfully deployed target comprehensive contract can be obtained.
For ease of understanding, embodiments of the present application provide a schematic diagram for deploying a target complex contract on a blockchain, see fig. 4, where it can be seen from fig. 4:
target object U holds Public-private key pair [ Public ] generated by RSA signature algorithm UR ,Prikey UR ]Public-private key pair [ Public ] generated by ECC signature algorithm UE ,Prikey UE ]Public-private key pair [ Public ] generated by DSA signature algorithm UD ,Prikey UD ]. Meanwhile, the target object U also has a Public-private key pair [ Public ] generated based on the original protocol signature algorithm U ,Prikey U ]。
Thus, the target object U will be [ [ Public ] when it determines that a target complex contract needs to be deployed UR ,RSA],[Public UE ,ECC],[Public UD ,DSA]],Contract entry To construct parameters of the target complex contract, a private key Prikey generated by a native protocol signature algorithm is adopted U For [ [ Public ] UR ,RSA],[Public UE ,ECC],[Public UD ,DSA]],Contract entry Signature processing is carried out, a comprehensive contract deployment request is generated, and the comprehensive contract deployment request is sent to a blockchain;
Correspondingly, after receiving the comprehensive contract deployment request, the blockchain adopts a Public key Public generated by a native protocol signature algorithm U Decrypting the integrated contract deployment request to obtain [ [ Public ] carried in the integrated contract request UR ,RSA],[Public UE ,ECC],[Public UD ,DSA]],Contract entry The constructor of the composite contract is then invoked and executed: storing a deployment signature algorithm name and an associated public key in a Map structure AlgotToPubKey of the integrated contract, wherein the key is the deployment signature algorithm name (Algo), and the value is the public key (PubKey) associated with the deployment signature algorithm, and the specific structure is as follows:
RSA→Public UR
ECC→Public UE
DSA→Public UD
in addition, the entry address Contract of the check entry Contract entry And also stored in the composite contract. After the storage is completed, determining that the target comprehensive Contract is successfully deployed, and obtaining the comprehensive Contract address contact of the successfully deployed target comprehensive Contract wallet
In the embodiment of the application, the target object deploys a target comprehensive contract in advance so as to bind and send a plurality of transaction tasks which the target object wants to process to the target comprehensive contract when carrying out the transaction processing of the target object, and the target comprehensive contract is used for completing batch processing of the plurality of transaction tasks.
Embodiment two: the signing entry contract is deployed on the blockchain and the signing algorithm contract is integrated in the signing entry contract.
In the embodiment of the application, since the signing algorithm contract is to be integrated in the signing access contract, the signing access contract and the signing algorithm are required to be deployed on the blockchain in advance, and after the signing access contract and the signing algorithm contract are successfully deployed on the blockchain, the signing algorithm contract is integrated into the signing access contract. It should be noted that integrating the signing algorithm contract into the signing entry contract involves operations such as adding the signing algorithm contract to the signing entry contract, and deleting the signing algorithm contract from the signing entry contract.
Next, the deployment of the signing entry contract on the blockchain, the deployment of the signing algorithm contract, and the integration of the signing algorithm contract in the signing entry contract will be described separately.
1. Deploying signature verification portal contracts
Referring to fig. 5, fig. 5 is a flowchart of deploying a signature verification portal contract on a blockchain according to an embodiment of the present application, including the following steps:
in step S501, the block link receives a signature verification entry contract deployment request sent by the deployment object, where the signature verification entry contract deployment request carries code information of the signature verification entry contract, and the code information at least includes a signature algorithm adding function and a signature algorithm deleting function.
In the embodiments of the present application, any deployment object may deploy an endorsed portal contract, where the endorsed portal contract and the corresponding portal contract address are used by the target object involved in the embodiments of the present application.
Illustratively, when the deployment object wants to deploy the signature verification portal contract in the blockchain, the code information of the signature verification portal contract is first written. In order to realize the signing verification processing of sub-transaction information in the signing verification portal contract, a Map structure AlgotAddr needs to be deployed in the signing verification portal contract, and the realization from the signing algorithm name to the signing algorithm contract is recorded, wherein the specific structure is as follows: algo→contact algo And invoking the signing verification algorithm contract to carry out signing verification processing.
Meanwhile, in order to update the data from the signing algorithm name recorded in the signing entry contract to the Map structure of the specific signing algorithm contract, the signing entry contract further comprises two functions, namely:
the signature algorithm increases the function: addAlgo (analog, contract) algo );
Signature algorithm delete function: removeAlgo (analogue, contact) algo );
Wherein AddAlgo is used for adding signature algorithm and RemoveAlgo is used for deleting signature algorithm. It should be noted that, the authority control of the two functions can be set by the deployment object; for example, it may be set that only the deployment object deploying the signature entry contract is entitled to call both functions.
In one possible implementation, after obtaining the code information of the signature verification entry contract, the private key Prikey generated using a blockchain-supported native protocol signature algorithm Y Signing the code information of the signing entry contract to generate a signing entry contract deployment request, and sending the signing entry contract deployment request to the blockchain; correspondingly, the block link receives an signing entry contract deployment request sent by the deployment object.
In step S502, the blockchain deploys the code information of the signature verification entry contract on the blockchain, and obtains the entry contract address of the signature verification entry contract after successful deployment.
In the embodiment of the application, after the block link receives the signature verification entry contract deployment request, the Public key Public generated based on the native protocol signature algorithm supported by the block link Y Decrypting the signing contract deployment request, obtaining code information of the signing contract, deploying the code information of the signing contract on the blockchain, and obtaining an entrance contract address of the signing contract.
For ease of understanding, embodiments of the present application provide a schematic diagram of deploying a signature verification portal contract on a blockchain, see fig. 6, as can be seen from fig. 6:
The deployment object Y firstly writes code information of the signature verification entry contract, wherein the code information has a Map structure AlgotAddr, and the Map structure is used for recording signature algorithm names to the realization of the signature verification algorithm contract and further comprises a signature algorithm adding function: addAlgo (analog, contract) algo ) And signature algorithm delete function: removeAlgo (analogue, contact) algo ) The method comprises the steps of carrying out a first treatment on the surface of the Then, a private key Prikey generated by adopting a primary protocol signature algorithm supported by a blockchain is adopted Y Signing the code information of the signature verification entry contract to obtain a signature verification entry contract deployment request; and finally, sending a signature verification entry contract deployment request to the blockchain.
Correspondingly, the blockchain receives a signature verification entry contract deployment request and adopts a Public key Public generated by a blockchain-supported native protocol signature algorithm Y Decrypting the signing Contract deployment request to obtain code information of signing contracts, deploying the code information on the blockchain, and obtaining an entry Contract address contact of the signing contracts after successful deployment entry
2. Deploying a signature algorithm contract
Referring to fig. 7, a flowchart for deploying an signing algorithm contract according to an embodiment of the present application includes the following steps:
In step S701, the block link receives a signing algorithm contract deployment request sent by the deployment object, where the signing algorithm contract deployment request carries code information of the signing algorithm contract, and the code information at least includes a verification function.
In embodiments of the present application, any deployment object may deploy a signature verification algorithm contract for use with the target object referred to in embodiments of the present application.
Illustratively, when the deployment object wants to deploy the signing algorithm contract in the blockchain, the code information of the signing algorithm contract is first written. Because the signing algorithm contract is mainly used for signing the received sub-transaction information, a verification function for external calling needs to be exposed, namely at least one verification function is included in the code information of the signing algorithm contract:
VerifySignature(Action,signature,PubKey)。
in one possible implementation manner, after obtaining code information of the signing algorithm contract, signing the code information of the signing algorithm contract by adopting a private key generated by a native protocol signing algorithm supported by a blockchain, generating a signing algorithm contract deployment request, and sending the signing algorithm contract deployment request to the blockchain; accordingly, the block link receives a signing algorithm contract deployment request sent by the deployment object.
In step S702, the blockchain deploys the code information of the signing algorithm contract on the blockchain, and after successful deployment, obtains the signing contract address of the signing algorithm contract.
In the embodiment of the application, after the block link receives the signing algorithm contract deployment request, the signing algorithm contract deployment request is decrypted based on a public key generated by a native protocol signature algorithm supported by the block link, code information of the signing algorithm contract is obtained, the code information of the signing algorithm contract is deployed on the block link, and the signing contract address of the signing algorithm contract can be obtained after successful deployment.
For ease of understanding, embodiments of the present application provide a schematic diagram of deploying a signature verification portal contract on a blockchain, see FIG. 8; the signature algorithm to be deployed with deployment object Y is approximately an RSA algorithm contract, as can be seen from fig. 8:
the deployment object Y firstly writes code information of RSA algorithm contracts, wherein a verification function exists in the code information: ver (Ver)ifyignature (Action, pubKey); then, a private key Prikey generated by adopting a primary protocol signature algorithm supported by a blockchain is adopted Y Signing the code information of the RSA algorithm contract to obtain a signature verification algorithm contract deployment request; and finally, sending a signing algorithm contract deployment request to the blockchain.
Correspondingly, the blockchain receives a signing algorithm contract deployment request and adopts a Public key Public generated by a blockchain-supported native protocol signing algorithm Y Decrypting the signing algorithm Contract deployment request to obtain code information of the RSA algorithm Contract, deploying the code information on the blockchain, and obtaining a signing Contract address contact of the RSA algorithm Contract after successful deployment RSA
3. Adding a signature verification algorithm contract to a signature verification entry contract
Referring to fig. 9, fig. 9 is a flowchart of adding a signature verification algorithm contract according to an embodiment of the present application, including the following steps:
in step S901, the block link receives a signature algorithm integration request sent by the deployment object, where the signature algorithm integration request is used to indicate that a signature algorithm is added in the signature verification entry contract, and the signature algorithm integration request includes an integrated signature algorithm and a corresponding signature verification contract address.
Step S902, a signature algorithm adding function is called, and the integrated signature algorithm and the corresponding signature verification contract address are correspondingly stored in the signature verification entry contract.
Illustratively, if the deployment object wants to add RSA algorithm to the signature verification portal contract of its deployment, the deployment object adopts the private key Prikey generated by the native protocol signature algorithm supported by the blockchain Y For RSA algorithm and signature Contract address contact RSA Signing is carried out, a signature algorithm integration request is generated, and the signature algorithm integration request is sent to a blockchain;
correspondingly, the block chain receives a signature algorithm integration request sent by the deployment object, and generates a Public key Public based on a native protocol signature algorithm supported by the block chain Y Decrypting the signature algorithm integration request to obtain an RSA algorithm and a signature verification Contract address contact RSA Then call the signature checking entry Contract contact entry AddAlgo function of (A) will (RSA, contract) RSA ) Stored in Map structure algo toaddr of the signature verification portal contract.
For ease of understanding, embodiments of the present application provide a schematic diagram of integrating a signature verification algorithm contract in a signature verification portal contract, see fig. 10; as can be seen from fig. 10:
the deployment object Y firstly deploys an signing entry contract and a signing algorithm contract on the blockchain, wherein the signing algorithm contract at least comprises: RSA algorithm contracts, DSA algorithm contracts, ECC algorithm contracts. Specific implementation manners of deploying the signing entry contract and the signing algorithm contract refer to the above embodiments, and are not described herein again;
then, when the target object Y wants to deploy RSA algorithm contract, DSA algorithm contract and ECC algorithm contract in the signature verification entry contract, the private key Prikey generated by adopting the signature algorithm supported by the block chain native protocol is adopted Y For [ (RSA, contact) RSA ),(DSA,Contract DSA ),(ECC,Contract ECC )]Signing is carried out, a signature algorithm integration request is generated, and the signature algorithm integration request is sent to a blockchain;
after the block chain receives the signature algorithm integration request sent by the deployment object, a Public key Public generated by adopting a native protocol signature algorithm supported by the block chain is adopted Y Decrypting the signature algorithm integration request to obtain RSA algorithm and signature verification Contract address contact RSA DSA algorithm and signature verification Contract address Contract DSA ECC algorithm and signature verification Contract address contact ECC Then call the signature checking entry Contract contact entry AddAlgo function of (A) will (RSA, contract) RSA ),(DSA,Contract DSA ),(ECC,Contract ECC ) Storing the Map structure AlgotAddr of the signature verification entry contract; the specific structure of the updated Map structural body Algo Toaddr is as follows:
RSA→Contract RSA
DSA→Contract DSA
ECC→Contract ECC
after successful storage, RSA algorithm contracts, DSA algorithm contracts, ECC algorithm contracts may be invoked through an signing-in-check contract.
4. Deleting signature algorithm contracts in signature verification portal contracts
Referring to fig. 11, fig. 11 is a flowchart of deleting a signature algorithm contract provided in an embodiment of the present application, including the following steps:
in step S1101, the block link receives a signature algorithm deletion request sent by the deployment object, where the signature algorithm deletion request is used to indicate that the signature algorithm is deleted in the signature verification entry contract, and the signature algorithm deletion request includes a signature deletion algorithm and a corresponding signature verification contract address.
In step S1102, the blockchain invokes a signature algorithm delete function to delete the signature algorithm and the corresponding signature verification contract address from the signature verification entry contract.
Illustratively, if the deployment object wants to delete the RSA algorithm in the signature verification portal contract of its deployment, the deployment object uses the private key Prikey generated by the signature algorithm supported by the blockchain native protocol Y For RSA algorithm and signature Contract address contact RSA Signing, generating a signature algorithm deleting request, and sending the signature algorithm deleting request to the blockchain;
correspondingly, the block link receives a signature algorithm deleting request sent by the deployment object, and generates a Public key Public based on a signature algorithm supported by a block chain native protocol Y Decrypting the signature algorithm integration request to obtain an RSA algorithm and a signature verification Contract address contact RSA Then call the signature checking entry Contract contact entry Will (RSA, contract) RSA ) Deleted from Map structure AlgoToAddr of the signature verification portal contract.
For ease of understanding, the embodiment of the present application provides a schematic diagram of deleting a signature verification algorithm contract in a signature verification portal contract, based on the illustration in fig. 10, see fig. 12; as can be seen from fig. 12:
store (RSA, contract) in Map structure AlgotAddr of signature verification entry Contract RSA ),(DSA,Contract DSA ),(ECC,Contract ECC ) After the corresponding relation of (a), if deployedWhen the object Y wants to delete RSA algorithm contracts in the signature verification entry contracts, a private key Prikey generated by adopting a signature algorithm supported by a block chain native protocol is adopted Y Pair (RSA, contact) RSA ) Signing, generating a signature algorithm deleting request, and sending the signature algorithm deleting request to the blockchain;
after the block chain receives the signature algorithm deleting request sent by the deployment object, a Public key Public generated by adopting a native protocol signature algorithm supported by the block chain is adopted Y Decrypting the signature algorithm deletion request to obtain an RSA algorithm and a signature verification Contract address contact RSA Then call the signature checking entry Contract contact entry Will (RSA, contract) RSA ) Deleting from the Map structure AlgotAddr of the signature verification entry contract; the specific structure of the updated Map structural body Algo Toaddr is as follows:
DSA→Contract DSA
ECC→Contract ECC
at this time, the DSA algorithm contract and the ECC algorithm contract may be called through the check entry contract.
It should be noted that the signature verification portal contract and the signature verification algorithm contract are a free competitive market, any deployment object can deploy and operate one signature verification portal contract, and various signature algorithms are dynamically expanded for the target object to select.
In the embodiment of the application, a signature algorithm dynamic expansion and deployment technology based on intelligent contracts is provided, each signature algorithm is abstracted into an intelligent contract to be deployed on a chain, and then a signature checking entry contract is deployed for integrating various signature algorithm contracts for object selection, and the purpose of dynamically expanding the signature algorithm is achieved, so that the object can select a more reliable signature algorithm according to different business scenes. And the operation of the signing checking access contract and the signing checking algorithm contract can form a free competitive market, so that the diversity development of various signature algorithms in a block chain is promoted.
Embodiment III: the target object and the blockchain are interacted to realize transaction task batch processing.
Referring to fig. 13, a flowchart of transaction processing provided in an embodiment of the present application includes the following steps:
in step S1301, the block link receives a transaction request sent by the target object, where the transaction request includes: at least two sub-transaction information and a composite contract address; wherein each piece of sub-transaction information is associated with one sub-transaction task, and each piece of sub-transaction information at least comprises: an associated trade contract.
In the embodiment of the application, the target object can trade with the blockchain, and a plurality of sub-trade is bundled in the trade, and each sub-trade is used for realizing one sub-trade task. That is, the target object sends a transaction request to the blockchain, the transaction request including a plurality of sub-transaction information therein.
Because execution of each task requires invocation of a corresponding trade contract, the trade contract associated with the sub-trade task should be included in each sub-trade information;
in addition, as different calling functions are arranged in each transaction contract, each calling function can also realize different sub-transaction tasks based on different calling parameter values, so that in order to ensure the accuracy of processing the sub-transaction tasks, each sub-transaction information comprises calling parameters, and the calling parameters at least comprise the calling functions and the function parameter values;
Meanwhile, in order to ensure the accuracy of the sub-transaction information, signature processing is required to be carried out on the sub-transaction information, and because the target object holds public and private key pairs of different signature algorithms, the target object can adopt private keys generated by different signature algorithms to sign different sub-transaction information, and in order to ensure that the blockchain can accurately verify the sub-transaction information, the sub-transaction information also comprises the signature algorithm corresponding to the private keys during signature processing, namely, the appointed signature algorithm.
In summary, each piece of sub-transaction information in the embodiments of the present application includes at least: transaction contracts, call parameters, specify signature algorithms; the concrete structure is as follows: action= < contact, calldata, algo >, wherein, action represents a sub transaction information, represents a transaction task or operation, contact represents a transaction contract, calldata represents a call parameter, algo is the name of a signature algorithm, and represents a specified signature algorithm. It should be noted that the target object may use different signature algorithms, such as the above-mentioned ECC, RSA, etc., for each Action according to its own requirements.
Since the sub-transaction information is to be subjected to signature verification processing, the transaction request includes, in addition to the plurality of sub-transaction information: signature data associated with each of the at least two sub-transaction information; the signature data is obtained by adopting a private key generated by a specified signature algorithm contained in the corresponding sub-transaction information to carry out signature processing on the sub-transaction information.
For example, if the target object needs to conduct three sub-transactions with the blockchain, then three sub-transaction information needs to be constructed, such as [ Action1, action2, action3]The method comprises the steps of carrying out a first treatment on the surface of the And signing the sub-transaction information by using a private key of a designated signature algorithm for each sub-transaction information Action according to the requirements, and obtaining corresponding signature data, e.g. using a Prikey UR Signing the Action1 to obtain signature data signature1, and signing the Prikey UE Signing the Action2 to obtain signature data signature2, and using Public UD A signature data signature3 is obtained for Action 3. At this time, the transaction request includes:
[(Action1,signature1),(Action2,signature2),(Action3,signature3)]
in the embodiment of the application, when a target object sends a transaction request binding a plurality of sub-transaction information to a blockchain, a target comprehensive contract is called to process the transaction request, and then a signature verification entry contract is called to perform signature verification processing on each sub-transaction information based on the target comprehensive contract. Thus, to ensure the accuracy of invoking the target composite contract, the composite contract address is also included in the transaction request. Thus, the final parameters for constructing the transaction request are: [ (Action 1, signature 1), (Action 2, signature 2), (Action 3, signature 3), contact wallet ]。
In one possible implementation, the target object, after determining the final parameters of the construction transaction request, uses the private key Prikey generated by the blockchain-supported native protocol signature algorithm Y For [ (Action 1, sign)ature1),(Action2,signature2),(Action3,signature3),Contract wallet ]Performing signature processing to obtain a transaction request, and sending the transaction request to a blockchain; accordingly, the block link receives the transaction request sent by the target object.
In step S1302, the blockchain obtains an entry contract address stored in the target integrated contract according to the integrated contract address, and invokes a signature entry contract associated with the entry contract address to verify at least two sub-transaction information respectively.
In this embodiment of the present application, after the blockchain receives the transaction request, the blockchain decrypts the transaction request based on the public key generated by the native protocol signature algorithm supported by the blockchain to obtain [ (Action 1, signature 1), (Action 2, signature 2), (Action 3, signature 3), and contact ] wallet ]The method comprises the steps of carrying out a first treatment on the surface of the Thereafter, according to Contract wallet The method comprises the steps of obtaining a target comprehensive contract address, and based on the knowledge of the target comprehensive contract deployed in the first embodiment, storing an entry contract address of an entry contract under test, so that after the target comprehensive contract address is determined, the entry contract address stored in the target comprehensive contract address can be obtained, and further calling the entry contract under test corresponding to the entry contract address to verify at least two sub-transaction information respectively.
Since the verification manner is consistent for each piece of sub-transaction information, the implementation manner of verifying the sub-transaction information by using the signature verification portal contract associated with the portal contract address is described below by taking one piece of sub-transaction information Action1 as an example.
In one possible implementation, when the sub-transaction information Action1 is verified, an signed entry contract associated with the entry contract address is called:
firstly, determining a specified signature algorithm contained in sub transaction information Action1, and determining a public key of the specified signature algorithm based on the specified signature algorithm in a Map structure Algo To PubKey of a target integrated contract; as can be seen from the above, using Prikey UR The Action1 is signed, so that the appointed signature algorithm included in the sub-transaction information Action1 is an RSA algorithm, and the method is further based on the RSA algorithmThe Public key Public corresponding To the RSA algorithm can be determined in the Algo To PubKey UR
Then, the signature verification entry contract is called based on the entry contract address stored in the target integrated contract, and when the signature verification entry contract is called, a parameter (Action 1, signature1, public) is sent to the signature verification entry contract UR );
Then, in the signature verification entry contract, determining whether a signature verification contract address corresponding To a designated signature algorithm contained in the sub transaction information Action1 is stored in the signature verification entry contract based on the stored Map structure Algo To Addr;
If yes, calling a verification function in a signature verification algorithm contract associated with the signature verification contract address, and verifying sub-transaction information; in one possible implementation, the verification function in the signing algorithm contract associated with the signing contract address is invoked, and when the sub-transaction information is verified: public key Public corresponding to specified signature algorithm RSA contained in sub-transaction information Action1 UR Decrypting signature data 1 associated with the sub-transaction information to obtain a corresponding decryption value, and hashing the sub-transaction information Action1 to obtain a corresponding hash value; when the hash value is consistent with the decryption value, determining that the verification of one sub-transaction information is passed, otherwise, determining that the verification fails
Illustratively, the decrypted value = verifyignature (signature 1, public) UR ) The method comprises the steps of carrying out a first treatment on the surface of the Hash value = Hash (Action); and further, comparing the decryption value with the hash value, if the decryption value is equal to the hash value, returning a verification result of passing verification to the target comprehensive contract, otherwise, returning a verification result of failed verification.
If the verification result does not exist, the corresponding signing algorithm contract is not supported, and a verification result of verification failure is returned to the target comprehensive contract.
Step S1303, for at least two sub-transaction information, the blockchain performs the following operations: and after the verification of the sub-transaction information is passed, invoking a transaction contract contained in the sub-transaction information to process a sub-transaction task associated with the sub-transaction information, and obtaining a corresponding sub-transaction processing result.
In the embodiment of the application, after the target comprehensive contract obtains the verification result returned by the signing entry contract and passing the verification, the sub-transaction task associated with the sub-transaction information is processed based on the transaction contract contained in the sub-transaction information.
In one possible implementation manner, when processing a sub-transaction task associated with sub-transaction information based on a transaction contract included in the sub-transaction information, determining an execution function required for executing the sub-transaction task in the transaction contract according to a calling function included in the sub-transaction information; and processing the sub-transaction tasks based on the execution function and the function parameter values.
The signing method includes the steps that a signing entry checking contract supports a corresponding signing algorithm, and a verification result passing verification is returned to a target comprehensive contract, then the target comprehensive contract can take out a contact and calldata of an Action1, further the contact is taken as a transaction contract, the calldata is taken as a calling parameter, a transaction task of a target object is completed by calling an execution function in a designated transaction contract through cross-contract calling, and a corresponding sub-transaction processing result is obtained, wherein the sub-transaction processing result is that: success, result, error
Where success is the bool value, representing whether the call was successful, result is the return value (which may be null) of the calling function.
In one possible implementation, the signature verification entry contract does not support the corresponding signature algorithm, and returns a verification result of the verification failure to the target composite contract, then the target composite contract does not need to call the target contract, and the call result is set to [ false, empty, signature verification failure ].
In the embodiment of the application, after one Action is completed each time, the signature verification portal contract is called again for verification aiming at other actions, the transaction contract is called to execute the sub-transaction task until all the actions in the transaction request are processed and completed, after the sub-transaction processing results of all the sub-transaction tasks are obtained, the processing is finished, and all the sub-transaction processing results are returned to the target object.
In step S1304, the blockchain returns the obtained at least two sub-transaction processing results to the target object.
For ease of understanding, embodiments of the present application provide a schematic diagram of transaction processing, see fig. 14; as can be seen from fig. 14:
the target object U constructs parameters of the transaction request: [ (Action 1, signature 1), (Action 2, signature 2), (Action 3, signature 3), contact wallet ]Private key Prikey generated by adopting original protocol signature algorithm supported by blockchain U Signing parameters of the transaction request, generating the transaction request and sending the transaction request to the blockchain;
correspondingly, after the block link receives the transaction request, the Public key Public generated by adopting the original protocol signature algorithm supported by the block chain U Decrypting the transaction request to obtain [ (Action 1, signature 1), (Action 2, signature 2), (Action 3, signature 3), and contact ] wallet ]The method comprises the steps of carrying out a first treatment on the surface of the Then based on Contract wallet Determining a target comprehensive contract, acquiring an inlet contract address from the target comprehensive contract, and determining a public key corresponding To a signature algorithm specified in each piece of sub-transaction information based on a Map structure body Algo To PubKey stored in the target comprehensive contract; then, based on the portal contract address, the signature verification portal contract is called, and parameters (Action 1, signature1, public) are sent to the signature verification portal contract for each sub-transaction information UR ) The signing entry contract is enabled to call the corresponding signing algorithm contract to verify the sub-transaction information, and a corresponding verification result (such as a verification result of successful verification) is returned to the target comprehensive contract; then, the target comprehensive contract determines that the sub-transaction task related to the sub-transaction information needs to be processed based on the transaction contract contained in the sub-transaction information based on the verification result, determines an execution function required for executing the sub-transaction task in the transaction contract according to the calling function contained in the sub-transaction information, and processes the sub-transaction task based on the execution function and the function parameter value; and finally, the transaction contract returns the task processing result of the sub-transaction task to the target comprehensive contract.
In the embodiment of the application, the blockchain firstly receives a transaction request sent by a target object, wherein the transaction request comprises at least two piece of sub-transaction information and a comprehensive contract address, each piece of sub-transaction information is associated with one sub-transaction task, and each piece of sub-transaction information at least comprises an associated transaction contract; obviously, the blockchain supports receiving transaction requests which are sent by the target object and are bundled with a plurality of transactions, namely, the blockchain supports receiving a plurality of transactions simultaneously. After receiving a transaction request, the blockchain acquires an entry contract address stored in an associated target integrated contract according to the integrated contract address, invokes a signature verification entry contract associated with the entry contract address, respectively verifies at least two piece of sub-transaction information, invokes a transaction contract contained in one piece of sub-transaction information after the verification of the one piece of sub-transaction information is passed, processes a transaction task associated with the one piece of sub-transaction information to obtain a corresponding sub-transaction processing result, and finally returns the obtained at least two piece of sub-transaction processing results to a target object; obviously, after the blockchain receives the transaction request, the signing checking portal contract is called to verify each piece of sub-transaction information in the transaction request, so that the safety and accuracy of the sub-transaction information are ensured, and the transaction contract is further called to process the sub-transaction task, so that the transaction batch processing technology is realized. Therefore, the transaction processing method provided by the application supports binding a plurality of sub transactions interacted with the blockchain into one transaction, and finally sending the transaction to the blockchain, and then calling the signing entry contract and the transaction contract by the target comprehensive contract deployed on the blockchain to complete batch processing of transaction tasks; this allows objects to interact with multiple contracts on the blockchain simultaneously, reducing the cost required for each transaction, saving costs and simplifying operations.
It should be noted that in the specific embodiments of the present application, data related to the user is involved, and when the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data is required to comply with relevant laws and regulations and standards of relevant countries and regions.
Based on the same inventive concept, the embodiments of the present application also provide a transaction processing device 1500, referring to fig. 15, the device 1500 includes: a receiving unit 1501, a verifying unit 1502, an executing unit 1503, and a returning unit 1504, wherein:
a receiving unit 1501 for receiving a transaction request sent by a target object; the transaction request includes: at least two sub-transaction information and a composite contract address; wherein each piece of sub-transaction information is associated with one sub-transaction task, and each piece of sub-transaction information at least comprises: an associated trade contract;
a verification unit 1502, configured to obtain an entry contract address stored in a deployed target integrated contract according to the integrated contract address, and invoke a signature entry contract associated with the entry contract address to verify at least two sub-transaction information respectively;
The execution unit 1503 is configured to execute the following operations for at least two sub-transaction information: after the verification of the sub-transaction information is passed, a transaction contract contained in the sub-transaction information is called, and sub-transaction tasks associated with the sub-transaction information are processed to obtain corresponding sub-transaction processing results;
a returning unit 1504, configured to return the obtained at least two sub-transaction processing results to the target object.
In one possible implementation, each sub-transaction information further includes a specified signature algorithm, and the transaction request further includes: signature data associated with each of the at least two sub-transaction information; the signature data is obtained by adopting a private key generated by a specified signature algorithm contained in the corresponding sub-transaction information to carry out signature processing on the sub-transaction information.
In one possible implementation, the verification unit 1502 is specifically configured to:
for at least two sub-transaction information, the following operations are respectively executed:
decrypting the signature data associated with the sub-transaction information based on a public key corresponding to a designated signature algorithm contained in the sub-transaction information to obtain a corresponding decryption value; the public key is obtained from the target comprehensive contract based on a specified signature algorithm;
Carrying out hash processing on sub-transaction information to obtain a corresponding hash value;
when the hash value is consistent with the decryption value, verification of one piece of sub-transaction information is determined to pass.
In one possible implementation, the verification unit 1502 is specifically configured to:
for at least two sub-transaction information, the following operations are respectively executed:
in the signature verification entry contract, after the signature verification contract address corresponding to the appointed signature algorithm contained in the sub-transaction information is obtained, a verification function in the signature verification algorithm contract associated with the signature verification contract address is called, and the sub-transaction information is verified.
In one possible implementation, each sub-transaction information further includes a calling parameter; the calling parameters at least comprise calling functions and function parameter values;
the execution unit 1503 is specifically configured to:
determining an execution function required for executing the sub-transaction task in the transaction contract according to the calling function;
sub-transaction tasks are processed based on the execution function and the function parameter values.
In one possible implementation, before the receiving unit 1501 receives the transaction request sent by the target object, the receiving unit is further configured to:
receiving a comprehensive contract deployment request sent by a target object, wherein the comprehensive contract deployment request carries at least one deployment signature algorithm, a public key generated by the deployment signature algorithm and an entrance contract address;
Storing the deployment signature algorithm and the associated public key correspondence in a pre-constructed composite contract, and storing the entry contract address in the pre-constructed composite contract, obtaining a target composite contract for successful deployment, and the composite contract address.
In one possible implementation, before the receiving unit 1501 receives the transaction request sent by the target object, the receiving unit is further configured to:
receiving a signature verification entry contract deployment request sent by a deployment object, wherein the signature verification entry contract deployment request carries code information of a signature verification entry contract, and the code information at least comprises a signature algorithm adding function and a signature algorithm deleting function;
and deploying the code information of the signature checking entry contract on the blockchain, and after successful deployment, obtaining the entry contract address of the signature checking entry contract.
In one possible implementation, after the receiving unit 1501 deploys the code information of the signature entry contract on the blockchain, it is further configured to:
receiving a signature algorithm integration request sent by a deployment object; the signature algorithm integration request is used for indicating that a signature algorithm is added in the signature verification entry contract, and the signature algorithm integration request comprises an integrated signature algorithm and a corresponding signature verification contract address;
And calling a signature algorithm adding function, and correspondingly storing the integrated signature algorithm and the corresponding signature verification contract address in the signature verification contract.
In one possible implementation, after the receiving unit 1501 deploys the code information of the signature entry contract on the blockchain, the method is further used to:
receiving a signature algorithm deleting request sent by a deployment object; the signature algorithm deleting request is used for indicating that the signature algorithm is deleted in the signature verification entry contract, and the signature algorithm deleting request comprises a signature deleting algorithm and a corresponding signature verification contract address;
and calling a signature algorithm deleting function, and deleting the signature deleting algorithm and the corresponding signature checking contract address from the signature checking entry contract.
In one possible implementation, the signing contract address is determined by:
receiving a signature verification algorithm contract deployment request sent by a deployment object, wherein the signature verification algorithm contract deployment request carries code information of a signature verification algorithm contract, and the code information at least comprises a verification function;
and deploying the code information of the signing algorithm contract on the blockchain, and after successful deployment, obtaining the signing contract address of the signing algorithm contract.
It should be noted that although several units (or modules) of the apparatus are mentioned in the above detailed description, this division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units (or modules) described above may be embodied in one unit (or module) in accordance with embodiments of the present application. Conversely, the features and functions of one unit (or module) described above may be further divided into a plurality of units (or modules) to be embodied. Of course, when implementing the present application, the functions of each unit (or module) may be implemented in the same or multiple pieces of software or hardware.
Having described the transaction processing methods and apparatus of exemplary embodiments of the present application, another exemplary embodiment computing device of the present application is described next.
Those skilled in the art will appreciate that the various aspects of the present application may be implemented as a system, method, or program product. Accordingly, aspects of the present application may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
In one possible implementation, a computing device provided by an embodiment of the present application may include at least a processor and a memory. The memory stores therein a computer program which, when executed by the processor, causes the processor to perform any of the steps of the transaction processing methods of the various exemplary embodiments herein.
In this embodiment, the mechanism of the computing device may include a memory 1601, a communication module 1603, and one or more processors 1602 as shown in FIG. 16.
A memory 1601 for storing a computer program executed by the processor 1602. The memory 1601 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, a program required for running an instant messaging function, and the like; the storage data area can store various instant messaging information, operation instruction sets and the like.
The memory 1601 may be a volatile memory (RAM) such as a random-access memory (RAM); the memory 1601 may also be a nonvolatile memory (non-volatile memory), such as a read-only memory, a flash memory (flash memory), a hard disk (HDD) or a Solid State Drive (SSD); or memory 1601, is any other medium that can be used to carry or store a desired computer program in the form of an instruction or data set and that can be accessed by a computer, but is not limited thereto. The memory 1601 may be a combination of the above memories.
The processor 1602 may include one or more central processing units (central processing unit, CPU) or digital processing units, or the like. A processor 1602 for implementing the transaction processing method described above when invoking a computer program stored in the memory 1601.
The communication module 1603 is used for communicating with terminal devices and other servers.
The specific connection medium between the memory 1601, the communication module 1603, and the processor 1602 is not limited in the embodiments of the present application. The embodiment of the present application is illustrated in fig. 16, where the memory 1601 and the processor 1602 are connected by a bus 1604, and the bus 1604 is illustrated in fig. 16 by a bold line, and the connection between other components is merely illustrative, and not limiting. The bus 1604 may be divided into an address bus, a data bus, a control bus, and the like. For ease of description, only one thick line is depicted in fig. 16, but only one bus or one type of bus is not depicted.
The memory 1601 has stored therein a computer storage medium having stored therein computer executable instructions for implementing the transaction processing method of the embodiments of the present application. The processor 1602 is configured to perform the transaction processing methods described above.
In some possible implementations, aspects of the transaction processing methods provided herein may also be implemented in the form of a program product comprising a computer program for causing a computing device to carry out the steps of the transaction processing methods according to the various exemplary embodiments of the application as described herein when the program product is run on the computing device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product of embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and comprise a computer program and may run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with a command execution system, apparatus, or device.
The readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave in which a readable computer program is embodied. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with a command execution system, apparatus, or device.
A computer program embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer programs for performing the operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer program may execute entirely on the user's computing device, partly on the user's equipment, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having a computer-usable computer program embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program commands may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable device to produce a machine, such that the commands executed by the processor of the computer or other programmable device produce a means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program commands may also be stored in a computer readable memory that can direct a computer or other programmable apparatus to function in a particular manner, such that the commands stored in the computer readable memory produce an article of manufacture including command means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (14)

1. A method of transaction processing, the method comprising:
receiving a transaction request sent by a target object; the transaction request includes: at least two sub-transaction information and a composite contract address; wherein each piece of sub-transaction information is associated with one sub-transaction task, and each piece of sub-transaction information at least comprises: an associated trade contract;
according to the comprehensive contract address, acquiring an inlet contract address stored in a target comprehensive contract, and calling a signature verification inlet contract associated with the inlet contract address to verify the at least two sub-transaction information respectively;
for the at least two sub-transaction information, respectively executing the following operations: after the verification of one piece of sub-transaction information is passed, invoking a transaction contract contained in the sub-transaction information to process a sub-transaction task associated with the sub-transaction information, and obtaining a corresponding sub-transaction processing result;
and returning the obtained at least two sub-transaction processing results to the target object.
2. The method of claim 1, wherein each sub-transaction message further comprises a specified signature algorithm, and wherein the transaction request further comprises: signature data associated with each of the at least two sub-transaction information; the signature data is obtained by adopting a private key generated by a specified signature algorithm contained in corresponding sub-transaction information to carry out signature processing on the sub-transaction information.
3. The method of claim 2, wherein invoking the signed entry contract associated with the entry contract address verifies the at least two sub-transaction information separately, comprising:
for the at least two sub-transaction information, respectively executing the following operations:
based on a public key corresponding to a designated signature algorithm contained in one piece of sub-transaction information, decrypting the signature data associated with the sub-transaction information to obtain a corresponding decryption value; the public key is obtained from the target complex contract based on the specified signature algorithm;
carrying out hash processing on the sub-transaction information to obtain a corresponding hash value;
and when the hash value is consistent with the decryption value, determining that the verification of the sub-transaction information is passed.
4. The method of claim 2, wherein invoking the signed entry contract associated with the entry contract address verifies the at least two sub-transaction information separately, comprising:
for the at least two sub-transaction information, respectively executing the following operations:
and in the signing checking access contract, after a signing checking contract address corresponding to a designated signature algorithm contained in one piece of sub-transaction information is acquired, a verification function in a signing checking algorithm contract associated with the signing checking contract address is called, and the one piece of sub-transaction information is verified.
5. The method according to any one of claims 1-4, wherein each sub-transaction message further comprises a calling parameter; the calling parameters at least comprise calling functions and function parameter values;
the step of calling the transaction contract contained in the sub-transaction information to process the sub-transaction task associated with the sub-transaction information comprises the following steps:
determining an execution function required for executing the sub-transaction task in the transaction contract according to the calling function;
and processing the sub-transaction tasks based on the execution function and the function parameter value.
6. The method according to any one of claims 1-4, further comprising, prior to receiving the transaction request sent by the target object:
receiving an integrated contract deployment request sent by a target object, wherein the integrated contract deployment request carries at least one deployment signature algorithm, a public key generated by the deployment signature algorithm and the entrance contract address;
storing the deployment signature algorithm and the associated public key correspondence in a pre-constructed composite contract, and storing the entry contract address in the pre-constructed composite contract, obtaining a target composite contract of successful deployment, and the composite contract address.
7. The method of claim 1, further comprising, prior to receiving the transaction request sent by the target object:
receiving a signature verification entry contract deployment request sent by a deployment object, wherein the signature verification entry contract deployment request carries code information of a signature verification entry contract, and the code information at least comprises a signature algorithm adding function and a signature algorithm deleting function;
and deploying the code information of the signing entry contract on a blockchain, and after successful deployment, obtaining the entry contract address of the signing entry contract.
8. The method of claim 7, wherein after deploying the code information of the signature entry contract on a blockchain, further comprising:
receiving a signature algorithm integration request sent by the deployment object; the signature algorithm integration request is used for indicating that a signature algorithm is added in the signature verification entry contract, and the signature algorithm integration request comprises an integrated signature algorithm and a corresponding signature verification contract address;
and calling the signature algorithm adding function, and correspondingly storing the integrated signature algorithm and the corresponding signature verification contract address in the signature verification contract.
9. The method of claim 7, wherein after deploying the code information of the signature entry contract on a blockchain, further comprising:
receiving a signature algorithm deleting request sent by the deployment object; the signature algorithm deleting request is used for indicating that the signature algorithm is deleted in the signature verification entry contract, and the signature algorithm deleting request comprises a signature deleting algorithm and a corresponding signature verification contract address;
and calling the signature algorithm deleting function, and deleting the signature deleting algorithm and the corresponding signature checking contract address from the signature checking entry contract.
10. The method of claim 8 or 9, wherein the signing contract address is determined by:
receiving a signature verification algorithm contract deployment request sent by the deployment object, wherein the signature verification algorithm contract deployment request carries code information of a signature verification algorithm contract, and the code information at least comprises a verification function;
and deploying the code information of the signing algorithm contract on a blockchain, and after successful deployment, obtaining the signing contract address of the signing algorithm contract.
11. A transaction processing device, the device comprising:
The receiving unit is used for receiving the transaction request sent by the target object; the transaction request includes: at least two sub-transaction information and a composite contract address; wherein each piece of sub-transaction information is associated with one sub-transaction task, and each piece of sub-transaction information at least comprises: an associated trade contract;
the verification unit is used for acquiring an entry contract address stored in the deployed target comprehensive contract according to the comprehensive contract address, calling a signature verification entry contract associated with the entry contract address and respectively verifying the at least two sub-transaction information;
the execution unit is used for respectively executing the following operations for the at least two sub-transaction information: after the verification of one piece of sub-transaction information is passed, invoking a transaction contract contained in the sub-transaction information to process a sub-transaction task associated with the sub-transaction information, and obtaining a corresponding sub-transaction processing result;
and the return unit is used for returning the obtained at least two sub-transaction processing results to the target object.
12. A computing device, the computing device comprising: a processor and a memory, wherein:
The memory is used for storing a computer program;
the processor being adapted to execute the computer program for implementing the method of any of claims 1-10.
13. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1-10.
14. A computer program product comprising a computer program which, when executed by a processor, implements the method of any of claims 1-10.
CN202311416119.2A 2023-10-27 2023-10-27 Transaction processing method, device, equipment and storage medium Pending CN117495559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311416119.2A CN117495559A (en) 2023-10-27 2023-10-27 Transaction processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311416119.2A CN117495559A (en) 2023-10-27 2023-10-27 Transaction processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117495559A true CN117495559A (en) 2024-02-02

Family

ID=89668238

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311416119.2A Pending CN117495559A (en) 2023-10-27 2023-10-27 Transaction processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117495559A (en)

Similar Documents

Publication Publication Date Title
US11159526B2 (en) System and method for decentralized-identifier authentication
US11316697B2 (en) System and method for issuing verifiable claims
US11277268B2 (en) System and method for verifying verifiable claims
EP3721603B1 (en) System and method for creating decentralized identifiers
CN113438289B (en) Block chain data processing method and device based on cloud computing
CN111066047A (en) Implementing a blockchain based workflow
CN117495559A (en) Transaction processing method, device, equipment and storage medium
CN117061089B (en) Voting management method, device, equipment and storage medium
US11683173B2 (en) Consensus algorithm for distributed ledger technology
CN111915313B (en) Digital asset transfer control method, device and communication system for blockchain
CN116975901A (en) Identity verification method, device, equipment, medium and product based on block chain
CN117040930A (en) Resource processing method, device, product, equipment and medium of block chain network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication