TECHNICAL FIELD

Embodiments of this specification relate to the field of information technologies, and in particular, to a dual transaction method and system based on centralization and decentralization.

BACKGROUND

It is well-known that the blockchain technology is a decentralized distributed storage technology, and may implement multi-party attestation of data. This means that data stored in a blockchain is difficult to be tampered with and is reliable.

In practice, a blockchain transaction system may be built based on the blockchain technology. The blockchain transaction system is actually a blockchain network formed by a plurality of member nodes. Any member node may accept a transaction initiated by a user, and broadcast transaction information of the accepted transaction to the blockchain network, for member nodes to publish the transaction information to a blockchain based on a consensus mechanism after transaction validity verification (generally, whether a balance of a transfer-out party is sufficient is verified) performed by the blockchain network on the transaction information is successful. With that, the transaction is completed. In this way, attestation of each transaction is implemented.

However, the decentralization characteristic of blockchain transaction systems may cause delay in confirming transactions, which brings inconvenience to users.

SUMMARY

To resolve the delay problem of transaction confirmation in existing blockchain transaction systems, embodiments of this specification provide a dual transaction method and system based on centralization and decentralization, and the technical solutions are as follows:

According to a first aspect of the embodiments of this specification, a dual transaction method based on centralization and decentralization is provided, where a blockchain network includes a plurality of member nodes, a virtual resource account is registered by a user with a designated member node, and the method includes: receiving, by the designated member node, a transaction request including a paying user identifier of a paying user, a designated resource amount, and a receiving user identifier of a receiving user, the paying user being a user paying the designated resource amount, and the receiving user being a user receiving the designated resource amount; performing transaction feasibility verification on the transaction request, and after the verification is successful, deducting the designated resource amount from a virtual resource account corresponding to the paying user identifier and adding the designated resource amount to a virtual resource account corresponding to the receiving user identifier; and constructing, according to the transaction request, target transaction information including the paying user identifier, the designated resource amount, and the receiving user identifier, and broadcasting the target transaction information to the blockchain network, for the member nodes to publish the target transaction information to a blockchain based on a consensus mechanism after transaction feasibility verification performed by the blockchain network on the target transaction information is successful.

According to a second aspect of the embodiments of this specification, a dual transaction apparatus based on centralization and decentralization is provided, where a blockchain network includes a plurality of member nodes, the apparatus is any of the member nodes, a virtual resource account is registered by a user with the apparatus, and the apparatus includes: a receiving module, configured to receive a transaction request including a paying user identifier of a paying user, a designated resource amount, and a receiving user identifier of a receiving user, the paying user being a user paying the designated resource amount, and the receiving user being a user receiving the designated resource amount; a centralization processing module, configured to perform transaction feasibility verification on the transaction request, and after the verification is successful, deduct the designated resource amount from a virtual resource account corresponding to the paying user identifier and add the designated resource amount to a virtual resource account corresponding to the receiving user identifier; and a blockchain processing module, configured to construct, according to the transaction request, target transaction information including the paying user identifier, the designated resource amount, and the receiving user identifier, and broadcast the target transaction information to the blockchain network, for the member nodes to publish the target transaction information to a blockchain based on a consensus mechanism after transaction feasibility verification performed by the blockchain network on the target transaction information is successful.

According to a third aspect of the embodiments of this specification, a dual transaction system based on centralization and decentralization is provided, where the system includes a blockchain network formed by a plurality of member nodes, and a user can register a virtual resource account with a designated member node, where the designated member node receives a transaction request that is sent by a paying user and that includes a paying user identifier of the paying user, a designated resource amount, and a receiving user identifier of a receiving user, the paying user being a user paying the designated resource amount, and the receiving user being a user receiving the designated resource amount; performs transaction feasibility verification on the transaction request, and after the verification is successful, deducts the designated resource amount from a virtual resource account corresponding to the paying user identifier and adds the designated resource amount to a virtual resource account corresponding to the receiving user identifier; and constructs, according to the transaction request, target transaction information including the paying user identifier, the designated resource amount, and the receiving user identifier, and broadcasts the target transaction information to the blockchain network; and other member nodes and the designated member node publish the target transaction information to a blockchain after transaction feasibility verification performed by the blockchain network on the target transaction information is successful.

According to a fourth aspect of the embodiments of this specification, a dual transaction method based on centralization and decentralization, wherein a blockchain network comprises a plurality of member nodes, a virtual resource account is registered by a user with a designated member node, and the method comprises: receiving, by the designated member node, a transaction request comprising a paying user identifier of a paying user, a designated resource amount, and a receiving user identifier of a receiving user, the paying user being a user paying the designated resource amount, and the receiving user being a user receiving the designated resource amount; performing, by the designated member node, transaction feasibility verification on the transaction request off the blockchain network, and after the verification is successful, deducting the designated resource amount from a virtual resource account corresponding to the paying user identifier and adding the designated resource amount to a virtual resource account corresponding to the receiving user identifier; transmitting, by the designated member node, a confirmation message to a computing device of the paying user and/or a computing device of the receiving user, wherein the confirmation message confirms a successful transaction feasibility verification of the transaction request; and constructing, by the designated member node according to the transaction request, target transaction information comprising the paying user identifier, the designated resource amount, and the receiving user identifier, and broadcasting, by the designated member node, a blockchain transaction comprising the target transaction information and the confirmation message to the blockchain network, for the member nodes to publish the blockchain transaction to a blockchain based on a consensus mechanism after transaction feasibility verification performed by the blockchain network on the blockchain transaction is successful.

According to a fifth aspect of the embodiments of this specification, one or more non-transitory computer-readable storage media storing instructions executable by one or more processors, wherein execution of the instructions causes the one or more processors to perform operations comprising: receiving a transaction request comprising a paying user identifier of a paying user, a designated resource amount, and a receiving user identifier of a receiving user, the paying user being a user paying the designated resource amount, and the receiving user being a user receiving the designated resource amount, wherein a blockchain network comprises a plurality of member nodes, a virtual resource account is registered by a user with a designated member node; performing transaction feasibility verification on the transaction request off the blockchain network, and after the verification is successful, deducting the designated resource amount from a virtual resource account corresponding to the paying user identifier and adding the designated resource amount to a virtual resource account corresponding to the receiving user identifier; transmitting a confirmation message to a computing device of the paying user and/or a computing device of the receiving user, wherein the confirmation message confirms a successful transaction feasibility verification of the transaction request; and constructing, according to the transaction request, target transaction information comprising the paying user identifier, the designated resource amount, and the receiving user identifier, and broadcasting a blockchain transaction comprising the target transaction information and the confirmation message to the blockchain network, for the member nodes to publish the blockchain transaction to a blockchain based on a consensus mechanism after transaction feasibility verification performed by the blockchain network on the blockchain transaction is successful.

According to a sixth aspect of the embodiments of this specification, a system comprising one or more processors and one or more non-transitory computer-readable memories coupled to the one or more processors and configured with instructions executable by the one or more processors to cause the system to perform operations comprising: receiving a transaction request comprising a paying user identifier of a paying user, a designated resource amount, and a receiving user identifier of a receiving user, the paying user being a user paying the designated resource amount, and the receiving user being a user receiving the designated resource amount, wherein a blockchain network comprises a plurality of member nodes, a virtual resource account is registered by a user with a designated member node; performing transaction feasibility verification on the transaction request off the blockchain network, and after the verification is successful, deducting the designated resource amount from a virtual resource account corresponding to the paying user identifier and adding the designated resource amount to a virtual resource account corresponding to the receiving user identifier; transmitting a confirmation message to a computing device of the paying user and/or a computing device of the receiving user, wherein the confirmation message confirms a successful transaction feasibility verification of the transaction request; and constructing, according to the transaction request, target transaction information comprising the paying user identifier, the designated resource amount, and the receiving user identifier, and broadcasting a blockchain transaction comprising the target transaction information and the confirmation message to the blockchain network, for the member nodes to publish the blockchain transaction to a blockchain based on a consensus mechanism after transaction feasibility verification performed by the blockchain network on the blockchain transaction is successful.

In the technical solutions provided in the embodiments of this specification, a blockchain network includes a plurality of member nodes, and a virtual resource account is registered by a user with a designated member node. When receiving a transaction request, on one hand, the designated member node performs transaction feasibility verification on the transaction request, and after the verification is successful, deducts a designated resource amount from a virtual resource account corresponding to a paying user identifier and adds the designated resource amount to a virtual resource account corresponding to a receiving user identifier. On the other hand, the designated member node broadcasts target transaction information to the blockchain network according to the transaction request, for the member nodes to publish the target transaction information to a blockchain based on a consensus mechanism after transaction feasibility verification performed by the blockchain network on the target transaction information is successful. In this way, on one hand, a transaction between users can be quickly confirmed by a designated member node, which has an advantage of a centralized transaction mode. On the other hand, the transaction between users is also submitted to a blockchain network for verification, and is published by the member nodes to the blockchain based on a consensus mechanism (that is, the transaction is confirmed by the member nodes). Because the transaction has been quickly confirmed by the designated member node, even if the transaction confirmation speed in the blockchain network is low, no inconvenience is caused to users, and a feasible transaction is finally published to the blockchain for attestation.

It should be understood that the foregoing general description and detailed description in the following are merely exemplary and explanative, and cannot constitute a limitation to the embodiments of this specification.

In addition, any one of the embodiments of this specification does not need to achieve all the foregoing effects.

