WO2021088702A1 - Group transaction method and device, and storage medium - Google Patents

Group transaction method and device, and storage medium Download PDF

Info

Publication number
WO2021088702A1
WO2021088702A1 PCT/CN2020/124475 CN2020124475W WO2021088702A1 WO 2021088702 A1 WO2021088702 A1 WO 2021088702A1 CN 2020124475 W CN2020124475 W CN 2020124475W WO 2021088702 A1 WO2021088702 A1 WO 2021088702A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
group
user
server
chain
Prior art date
Application number
PCT/CN2020/124475
Other languages
French (fr)
Chinese (zh)
Inventor
袁兴强
王志文
吴思进
Original Assignee
杭州复杂美科技有限公司
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 杭州复杂美科技有限公司 filed Critical 杭州复杂美科技有限公司
Publication of WO2021088702A1 publication Critical patent/WO2021088702A1/en

Links

Images

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/79Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories
    • A63F13/792Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories for payment purposes, e.g. monthly subscriptions
    • 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

Definitions

  • This application relates to the field of Internet finance technology, and specifically to a group transaction method, device and storage medium.
  • the current Lightning Network provides users with a one-to-one, safe and efficient transaction channel for off-chain transactions.
  • the Lightning Network only supports one-to-one transaction channels between two users.
  • a group composed of multiple users needs to conduct multiple transactions (for example, multiple game users need to open a game in the course of the game. Game currency transactions)
  • users of the Lightning Network need to configure the user terminal as a node of the Lightning Network to achieve the above functions, and the above functions cannot be achieved through a lightweight user terminal such as a mobile phone.
  • the present invention provides a group transaction method suitable for users, including:
  • a first deposit transaction is generated and sent to the server for the server to:
  • a second off-chain transaction is generated and sent to the server for pushing to the user end of each member for depositing certificates and updating the balance of the corresponding user.
  • the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group.
  • the asset liquidation is performed by the current user on behalf of the The other members of a group proceed with the first member.
  • the present invention provides another group transaction method suitable for users, including:
  • a fourth deposit transaction is generated and sent to the server for the server:
  • a third off-chain transaction is generated and sent to the server for the server to:
  • the server Receive the fifth-chain transaction pushed by the server to deposit the certificate and update the balance of the corresponding user; among them, the fifth-chain transaction is generated and passed by other users in the first group except the first user and the current user.
  • the server sends the signature to the first client, and then pushes it to the client of each member through the server.
  • third-chain off-chain transactions fourth-chain off-chain transactions, and fifth-chain off-chain transactions are used as proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group.
  • the liquidation is performed by the first user on behalf of the other members of the first group and the first member.
  • the present invention provides a group transaction method suitable for servers, including:
  • Receive the second off-chain transaction push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is responded by the first user end in the first channel Perform exchange generation.
  • the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group, and the asset liquidation is performed on behalf of the first user.
  • the other members of the first group proceed with the first member.
  • the present invention provides a group transaction method suitable for blockchain nodes, including:
  • the group creation transaction is executed through the first contract to create the first group, so that the server can obtain the execution result of the group creation transaction from the blockchain and push it to the client of each member of the first group that has registered the service on the server ;
  • the group creation transaction is generated by the first user terminal in response to the first user creating the group and sent through the server;
  • the deposit transaction is executed through the first contract, and several assets of the corresponding user are frozen in the first group, so that the server can obtain the execution result of the deposit transaction from the blockchain and push it to the user end of each member to update the corresponding locally.
  • the above server is also used for:
  • Receive the second off-chain transaction push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is responded by the first user end in the first channel Perform exchange generation.
  • the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group, and the asset liquidation is performed on behalf of the first user.
  • the other members of the first group proceed with the first member.
  • the present invention also provides a device that includes one or more processors and a memory, where the memory contains instructions executable by the one or more processors to make the one or more processors execute each of the processors according to the present invention.
  • the group transaction method provided by the embodiment includes one or more processors and a memory, where the memory contains instructions executable by the one or more processors to make the one or more processors execute each of the processors according to the present invention.
  • the present invention also provides a storage medium storing a computer program, which causes the computer to execute the group transaction method provided according to the embodiments of the present invention.
  • the group transaction method, device and storage medium provided by many embodiments of the present invention register the group in the contract, freeze the assets of the group members in the contract as a guarantee for the group chain transaction, and perform settlement based on the chain transaction through the contract.
  • the framework of the off-chain transaction group is constructed, and on the basis of this framework, a clearing mechanism is designed in which the group initiator signs each off-chain transaction in the group, and the group initiator and quit members clear the settlement mechanism.
  • any group member in the above framework is not online and cannot guarantee fair settlement, it realizes the safe and efficient off-chain transaction in the group composed of multiple users; in addition, it is configured to send on-chain transactions and push on-chain transactions.
  • the centralized server with functions such as group information, realizes support for lightweight clients.
  • FIG. 1 is a flowchart of a group transaction method provided by an embodiment of the present invention.
  • Fig. 2 is a flowchart of a preferred embodiment of the method shown in Fig. 1.
  • Fig. 3 is a flowchart of a preferred embodiment of the method shown in Fig. 1.
  • FIG. 4 is a flowchart of another method for group trading according to an embodiment of the present invention.
  • Fig. 5 is a flowchart of a preferred embodiment of the method shown in Fig. 4.
  • Fig. 6 is a flowchart of a preferred embodiment of the method shown in Fig. 4.
  • FIG. 7 is a flowchart of yet another group transaction method provided by an embodiment of the present invention.
  • FIG. 8 is a flowchart of a preferred embodiment of the method shown in FIG. 7.
  • FIG. 9 is a flowchart of a preferred embodiment of the method shown in FIG. 7.
  • FIG. 10 is a flowchart of still another group transaction method according to an embodiment of the present invention.
  • FIG. 11 is a flowchart of a preferred embodiment of the method shown in FIG. 10.
  • Fig. 12 is a flowchart of a preferred embodiment of the method shown in Fig. 10.
  • FIG. 13 is a schematic structural diagram of a device provided by an embodiment of the present invention.
  • FIG. 1 is a flowchart of a group transaction method provided by an embodiment of the present invention.
  • the present invention provides a group transaction method suitable for a user end, including:
  • S11 Generate a group creation transaction and send it to the server for the server to:
  • S12 In response to depositing several assets in the first group, generate a first deposit transaction and send it to the server for the server to:
  • S13 Receive the execution result of the second deposit transaction pushed by the server to locally update the balance of the corresponding user in the first group; wherein the second deposit transaction is generated by the user terminal of the corresponding user and sent to the server for the server to send to Block chain node for the block chain node to execute through the first contract;
  • S14 Receive the first off-chain transaction pushed by the server, sign the first off-chain transaction, and return the signed first off-chain transaction to the server for the server to push to the client of each member for deposit and update The balance of the corresponding user;
  • the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group.
  • the asset liquidation is performed by the current user on behalf of the The other members of a group proceed with the first member.
  • a user A, B, C, D, and D through a user terminal configured on a mobile phone or a tablet to perform several rounds of games that require multiple transactions of game currency during the game is taken as an example to illustrate the above solution as an example.
  • each user Before starting the game, each user needs to register for the group service in the server so that the server can push information to the registered users.
  • tx1 can include any one or more of information such as group name, member ID, member address, group configuration information, etc., and can also include related information created by other groups or specified by the first contract on the blockchain Other Information.
  • the server After the server receives tx1, it sends tx1 to the blockchain node.
  • the blockchain node receives and broadcasts tx1, packs tx1 into the block and executes tx1 through the first contract: If tx1 is executed successfully, the first group created will be assigned a group ID, and the creation will be recorded in the contract The group ID, member information and other information of the first group.
  • the server obtains the execution result of tx1 by synchronizing the blockchain data, and pushes the execution result of tx1 to the clients of each member of the first group.
  • the server is temporarily unable to push the member, and the client of the member can register the group service with the server according to the group name or group Parameters such as ID request the server to obtain relevant information.
  • the client of each member A, B, C, D receives the execution result of tx1 pushed by the server, the relevant information of the first group is stored locally, and the subsequent steps can be executed.
  • step S12 in response to the user A depositing 100 game coins in the first group, the user terminal of the user A generates a first deposit transaction tx2 and sends it to the server.
  • the server After the server receives tx2, it sends tx2 to the blockchain node.
  • the blockchain node receives and broadcasts tx2, packs tx2 into the block and executes tx2 through the first contract: if tx2 is executed successfully, the 100 game coins deposited by user A will be frozen in the first group for subsequent follow-up Thaw and liquidate.
  • the server obtains the execution result of tx2 by synchronizing the blockchain data, and pushes the execution result of tx2 to the clients of each member of the first group.
  • the user end of each member A, B, C, D updates the balance of user A in the first group locally (game currency + 100).
  • the user terminal of user B/C/D in response to user B/C/D depositing a number of game coins in the first group, the user terminal of user B/C/D generates a second deposit transaction tx3/tx4/tx5 and sends it to the server.
  • the server After the server receives tx3/tx4/tx5, it sends tx3/tx4/tx5 to the blockchain node.
  • the blockchain node receives and broadcasts tx3/tx4/tx5, packs tx3/tx4/tx5 into the block and executes tx3/tx4/tx5 through the first contract: if tx3/tx4/tx5 is successfully executed, then user B/ Several game coins deposited by C/D are frozen in the first group for subsequent unfreezing and liquidation.
  • the server obtains the execution result of tx3/tx4/tx5 by synchronizing the blockchain data, and pushes the execution result of tx3/tx4/tx5 to the clients of each member of the first group.
  • step S13 after receiving the execution result of tx3/tx4/tx5 pushed by the server, the user end of user A locally updates the balance of user B/C/D in the first group (game currency + some). The same goes for the user end of E, C, D.
  • a non-group sponsor (users other than user A in the first group) needs to pay another user in game currency, for example, user B needs to pay user C for 15 games Currency
  • user B’s user terminal generates the first off-chain transaction tx6 signed by user B, and sends tx6 to the server.
  • the server After receiving tx6, the server pushes tx6 to the client of user A, the initiator of the first group.
  • step S14 after receiving tx6, the user terminal of user A signs tx6, and returns the tx6' signed by user A to the server.
  • the server receives tx6' and pushes tx6' to the user terminals of each member of the first group (it can also be configured to only push tx6' to the user terminals of the non-initiator members).
  • Each user terminal respectively deposits certificates according to tx6', and updates the balance of the corresponding user in the first group (user B's game currency-15, user C's game currency +15).
  • step S15 user A’s user
  • the terminal generates the second off-chain transaction tx7 signed by User A, and sends tx7 to the server.
  • the server After receiving tx7, the server pushes tx7 to the client of each member of the first group (also can be configured to only push tx7 to the client of non-initiator members).
  • Each user terminal respectively deposits certificates according to tx7, and updates the balance of the corresponding user in the first group (user A's game currency -20, user D's game currency + 20).
  • the client of each user can submit their own first-chain and second-chain transactions through the server for the settlement of the first contract; If a group is not disbanded temporarily, it may not be liquidated temporarily until a user (non-sponsor user A, if the initiator quits, the group will be dissolved) exits the first group, the user and the initiator user A will submit separately
  • the first off-chain transaction and the second off-chain transaction of the respective certificates are for the first contract to be cleared; in addition, the clearing rules can also be configured to other different rules that can be understood by those skilled in the art, for example, the validity period is configured for the group And time-limited liquidation (can be liquidated in advance) and so on.
  • the above example takes users A, B, C, D as an example to illustrate the method shown in Figure 1.
  • the method provided in this application can also be applied to different scenarios and different numbers of users. The same technical effect.
  • Fig. 2 is a flowchart of a preferred embodiment of the method shown in Fig. 1. As shown in Figure 2, in a preferred embodiment, the above method further includes:
  • step S17 generate a first evidence submission transaction based on each first off-chain transaction and each second off-chain transaction and send it to the server for the first evidence submission transaction to be sent to the blockchain node for passing the first evidence submission transaction
  • a contract is executed to determine whether to modify the first clearing evidence submitted by the second user by requesting the exchange by exiting the group.
  • the exit group request transaction is generated by the second user’s client in response to the second user’s request to exit the first group, generated according to the off-chain transaction related to the second user, and sent to the blockchain node through the server for Executed through the first contract.
  • user C’s user terminal In response to user C’s request to log out of the first group, user C’s user terminal generates a logout based on off-chain transactions related to user C (for example, user B pays user C 15 game coins, and user C pays user D 10 game coins).
  • the group requests transaction tx8 and sends tx8 to the server.
  • the server After the server receives tx8, it sends tx8 to the blockchain node.
  • the blockchain node receives and broadcasts tx8, packs tx8 into the block and executes tx8 through the first contract: if tx8 is executed successfully, update the first group (user C exits), and submit the first clearing evidence submitted by tx8 (User B pays 15 game coins to user C, user C pays 10 game coins to user D) is recorded on the blockchain and waits for the first evidence to submit the transaction within the waiting period according to the pre-configured waiting period length.
  • the server obtains the execution result of tx8 by synchronizing the blockchain data, and pushes the execution result of tx8 to the clients of each member A, B and D of the first group and user C of the withdrawal requesting party.
  • step S16 user A’s client verifies whether the first clearing evidence submitted by tx8 is correct according to each first-chain off-chain transaction and each second-chain off-chain transaction stored in the certificate (usually to verify whether user C concealed part or all of the evidence) Off-chain expenditure):
  • step S17 is executed: generating the first evidence submission transaction tx9 according to each first-chain off-chain transaction and each second-chain off-chain transaction stored in the certificate and sending it to the server.
  • the server After the server receives tx9, it sends tx9 to the blockchain node.
  • the blockchain node receives and broadcasts tx9, packs tx9 into the block and executes tx9 through the first contract (if tx9 exceeds the above waiting period, tx9 execution fails): If tx9 is executed successfully, then tx9 is submitted for liquidation The evidence is recorded on the blockchain, and based on the clearing evidence submitted by tx9, it is judged whether the first clearing evidence submitted by tx8 needs to be amended (it can also be judged at the time of liquidation).
  • the first contract can be automatically cleared, or it can not be cleared temporarily, waiting for either of the two parties (the requesting party user C and the group initiator user A) to send a request transaction through the server Complete liquidation.
  • Fig. 3 is a flowchart of a preferred embodiment of the method shown in Fig. 1. As shown in Figure 3, in a preferred embodiment, the above method further includes:
  • S18 In response to the current user closing the first channel, generate a channel closing request transaction for submitting the second clearing evidence according to each first-chain off-chain transaction and each second-chain off-chain transaction and send it to the server for:
  • the second evidence submission transaction is generated and sent to the server for sending the second evidence submission transaction to the blockchain node for execution through the first contract to determine whether to modify the second clearing evidence.
  • the clearing principle of the method shown in Figure 3 is roughly the same as that of the method shown in Figure 2, the difference is that in the method shown in Figure 3, when the initiator of the group closes the channel, it cannot be performed by a user on behalf of other users.
  • Liquidation means that all users in the channel conduct supervision and liquidation at the same time.
  • the above method further includes:
  • the above configuration includes at least one of the following: configuration of the upper limit of the number of group members, configuration of the group whitelist, configuration of the group blacklist, and the time interval for re-applying to join after leaving the group.
  • the above-mentioned embodiments construct the framework of the off-chain transaction group by registering the group in the contract, freezing the assets of the group members in the contract as the guarantee of the off-chain transaction of the group, and clearing the transaction based on the off-chain transaction through the contract.
  • a clearing mechanism is designed in which the group initiator signs each off-chain transaction in the group, and the group initiator and the withdrawn members perform liquidation to solve the problem that any group member in the above framework is not online and cannot guarantee fairness.
  • the issue of clearing realizes safe and efficient off-chain transactions in groups composed of multiple users; in addition, it is realized by configuring a centralized server for sending on-chain transactions and pushing group information on the chain. Added support for lightweight client.
  • FIG. 4 is a flowchart of another method for group trading according to an embodiment of the present invention. The method shown in FIG. 4 can be executed in conjunction with the method shown in FIG. 1.
  • the present invention provides another group transaction method suitable for the user end, including:
  • S21 Receive the execution result of the third deposit transaction pushed by the server to locally update the balance of the corresponding user in the first group; wherein the third deposit transaction is responded to by the user terminal of the corresponding user in response to depositing several deposits in the first group
  • the asset is generated and sent to the blockchain node through the server for execution through the first contract;
  • S22 In response to depositing several assets in the first group, generate a fourth deposit transaction and send it to the server for the server to:
  • S24 Receive the fourth off-chain transaction pushed by the server to deposit the certificate and update the balance of the first user; wherein, the fourth off-chain transaction is generated by the first user and pushed through the server;
  • S25 Receive the fifth-chain transaction pushed by the server to deposit the certificate and update the balance of the corresponding user; wherein the fifth-chain transaction is generated by other users in the first group except the first user terminal and the current user terminal It is sent to the first client through the server for signing, and then pushed to the client of each member through the server.
  • third-chain off-chain transactions fourth-chain off-chain transactions, and fifth-chain off-chain transactions are used as proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group.
  • the liquidation is performed by the first user on behalf of the other members of the first group and the first member.
  • the above method further includes: receiving the execution result of the group creation transaction pushed by the server.
  • the group creation transaction is generated by the first client and sent to the blockchain node through the server for execution through the first contract to create the first group.
  • the above method further includes: in response to the request to join the first group, generating a group joining request transaction and sending it to the blockchain node through the server for execution through the first contract.
  • the method shown in Figure 1 is applicable to the user end of the group initiator (such as user A in the above example), while the method shown in Figure 4 is applicable to users other than the group initiator (such as the user in the above example).
  • the group transaction principle of the method shown in Fig. 4 can refer to the method shown in Fig. 1, which will not be repeated here.
  • Fig. 5 is a flowchart of a preferred embodiment of the method shown in Fig. 4. The method shown in FIG. 5 can be performed in conjunction with FIG. 2.
  • the above method further includes:
  • S26 In response to the current user's request to withdraw from the first group, generate the first group withdrawal request transaction that submits the first clearing evidence according to the off-chain transaction related to the current user and send it to the server for:
  • the first evidence is generated to submit the transaction and sent to the blockchain node through the server for execution through the first contract to determine whether to modify the first clearing evidence.
  • Fig. 6 is a flowchart of a preferred embodiment of the method shown in Fig. 4. The method shown in FIG. 6 can be executed in conjunction with FIG. 3.
  • the above method further includes:
  • step S28 generate a second evidence submission transaction and send it to the server for sending the second evidence submission transaction to the blockchain node for execution through the first contract to determine whether to modify the second clearing evidence.
  • the channel closing request transaction is generated by the first user terminal in response to the first user closing the first channel and sent to the blockchain node through the server for execution through the first contract.
  • FIG. 7 is a flowchart of yet another group transaction method provided by an embodiment of the present invention. The method shown in FIG. 7 can be executed in conjunction with the methods shown in FIG. 1 and FIG. 4.
  • the present invention also provides a group transaction method suitable for a server, including:
  • S31 Receive the group creation transaction, and send the group creation transaction to the blockchain node for execution through the first contract to create the first group; wherein the group creation transaction is responded to by the first user terminal to the first user Generated by creating a group;
  • S32 Obtain the execution result of the group creation transaction from the blockchain and push it to the client of each member of the first group that has registered the service on the server;
  • S33 Receive the deposit transaction, and send the deposit transaction to the blockchain node for execution through the first contract to freeze several assets of the corresponding user in the first group; wherein the deposit transaction is responded to by the user terminal of the corresponding user Generated by depositing certain assets in the first group;
  • S34 Obtain the execution result of the deposit transaction from the blockchain and push it to the user terminal of each member, so as to update the balance of the corresponding user in the first group locally;
  • S35 Receive the first off-chain transaction, push the first off-chain transaction to the first user terminal for signature and return, and push the signed first off-chain transaction to the user side of each member for the certificate and update the corresponding The user’s balance; where the first off-chain transaction is generated by the second user terminal in the first group in response to the transaction in the first channel;
  • S36 Receive the second off-chain transaction, push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is responded by the first user end to the first user end.
  • Exchange generation in the channel
  • the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group, and the asset liquidation is performed on behalf of the first user.
  • the other members of the first group proceed with the first member.
  • the above method further includes:
  • the above configuration includes at least one of the following: configuration of the upper limit of the number of group members, configuration of the group whitelist, configuration of the group blacklist, and the time interval for re-applying after leaving the group.
  • the above method further includes:
  • the group joining request transaction is generated by the third user terminal in response to the third user's request to join the first group.
  • FIG. 7 The principle of the method shown in FIG. 7 can be referred to the methods shown in FIG. 1 and FIG. 4, which will not be repeated here.
  • FIG. 8 is a flowchart of a preferred embodiment of the method shown in FIG. 7. The method shown in FIG. 8 can be executed in conjunction with FIG. 2 and FIG. 5.
  • the above method further includes:
  • S371 Receive the group exit request transaction sent by the second client, and send the exit group request transaction to the blockchain node for execution through the first contract;
  • S373 Obtain the execution result of the exit group request transaction from the blockchain and push it to the first client terminal for judging whether evidence needs to be submitted: yes, then the first client terminal will follow each first-chain transaction and each second-chain transaction Submit the transaction as the first evidence generated by the transaction;
  • S375 In response to receiving the first evidence submission transaction, send the first evidence submission transaction to the blockchain node for execution through the first contract to determine whether to modify the first clearing evidence submitted by the exchange requesting to withdraw from the group.
  • FIG. 9 is a flowchart of a preferred embodiment of the method shown in FIG. 7. The method shown in FIG. 9 can be executed in conjunction with the methods shown in FIG. 3 and FIG. 6.
  • the above method further includes:
  • S381 Receive the channel closing request transaction sent by the first client, send the channel closing request transaction to the blockchain node for execution through the first contract to close the first channel, and request the second clearing evidence submitted by the exchange to close the channel Record on the blockchain, and wait for the second evidence to submit the transaction during the waiting period; wherein, the channel closing request transaction is closed by the first user terminal in response to the first user to close the first channel according to each first off-chain transaction and each transaction. Generation of transactions under the second chain;
  • S383 Obtain the execution result of the channel closing request transaction from the blockchain and push it to the user end of each member to judge whether it is necessary to submit evidence according to the off-chain transaction related to the respective user: yes, then generate the second evidence to submit the transaction ;
  • S385 In response to receiving the second evidence submission transaction, send the second evidence submission transaction to the blockchain node for execution through the first contract to determine whether to modify the second clearing evidence.
  • FIG. 10 is a flowchart of still another group transaction method according to an embodiment of the present invention. The method shown in FIG. 10 can be executed in conjunction with the methods shown in FIG. 1, FIG. 4, and FIG. 7.
  • the present invention also provides a group transaction method suitable for blockchain nodes, including:
  • S41 Perform the group creation transaction through the first contract to create the first group, so that the server can obtain the execution result of the group creation transaction from the blockchain and push it to each member of the first group that has registered for the service on the server User side; wherein, the group creation transaction is generated by the first user side in response to the first user to create the group and sent through the server;
  • S42 The deposit transaction is executed through the first contract, and several assets of the corresponding user are frozen in the first group, so that the server can obtain the execution result of the deposit transaction from the blockchain and push it to the user terminal of each member for local localization. Update the balance of the corresponding user in the first group; wherein, the deposit transaction is generated by the user terminal of the corresponding user in response to depositing several assets into the first group and sent through the server;
  • the above server is also used for:
  • Receive the second off-chain transaction push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is responded by the first user end in the first channel Perform exchange generation.
  • the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group, and the asset liquidation is performed on behalf of the first user.
  • the other members of the first group proceed with the first member.
  • the above method further includes:
  • the group configuration transaction is executed through the first contract, and the first channel is configured for the server to obtain the execution result of the group configuration transaction from the blockchain and push it to the client of each member.
  • the group configuration transaction is generated by the first client and sent through the server.
  • the above configuration includes at least one of the following: configuration of the maximum number of group members, configuration of group whitelist, configuration of group blacklist, and reapply after exiting the group The time between joining.
  • the above method further includes:
  • the group request transaction is executed through the first contract, so that the server obtains the execution result of the group request transaction from the blockchain and pushes it to the user end of each member.
  • the group joining request transaction is generated by the third user terminal in response to the third user's request to join the first group and sent through the server.
  • FIG. 11 is a flowchart of a preferred embodiment of the method shown in FIG. 10. The method shown in FIG. 11 can be executed in conjunction with the methods shown in FIG. 2, FIG. 5, and FIG. 8.
  • the above method further includes:
  • S43 Execute the group exit request transaction through the first contract, so that the server obtains the execution result of the exit group request transaction from the blockchain and pushes it to the first user terminal for judging whether evidence needs to be submitted: yes, then the first user The terminal submits the transaction according to the first evidence generated by each first-chain transaction and each second-chain transaction and sends it through the server; wherein, the exit group request transaction is made by the second user terminal in response to the second user exiting the first group, Generated according to the off-chain exchange related to the second user and sent through the server;
  • S44 Execute the first evidence submission transaction through the first contract, and determine whether to modify the first clearing evidence submitted by the exchange for exiting the group.
  • Fig. 12 is a flowchart of a preferred embodiment of the method shown in Fig. 10. The method shown in FIG. 12 can be executed in conjunction with the methods shown in FIG. 3, FIG. 6, and FIG.
  • the above method further includes:
  • S45 Execute the channel closing request transaction through the first contract, close the first channel, record the second clearing evidence submitted by the channel closing request exchange on the blockchain, and wait for the second evidence to submit the transaction during the waiting period to For the server to obtain the execution result of the channel closing request transaction from the blockchain and push it to the user end of each member to judge whether it needs to submit evidence according to the off-chain transaction related to the respective user: yes, then generate the second evidence to submit the transaction And sent through the server; wherein, the channel closing request transaction is generated by the first user terminal in response to the first user to close the first channel, and generated and sent through the server according to each first chain transaction and each second chain transaction;
  • S46 Perform the second evidence submission transaction through the first contract to determine whether to modify the second clearing evidence.
  • FIG. 13 is a schematic structural diagram of a device provided by an embodiment of the present invention.
  • the present application also provides a device 1300, including one or more central processing units (CPU) 1301, which can be based on a program stored in a read-only memory (ROM) 1302 or The program loaded from the storage portion 1308 into the random access memory (RAM) 1303 executes various appropriate actions and processing.
  • CPU central processing units
  • RAM random access memory
  • various programs and data required for the operation of the device 1300 are also stored.
  • the CPU 1301, ROM 1302, and RAM 1303 are connected to each other through a bus 1304.
  • An input/output (I/O) interface 1305 is also connected to the bus 1304.
  • the following components are connected to the I/O interface 1305: input part 1306 including keyboard, mouse, etc.; output part 1307 including cathode ray tube (CRT), liquid crystal display (LCD), etc. and speakers, etc.; storage part 1308 including hard disk, etc. ; And a communication section 1309 including a network interface card such as a LAN card, a modem, and the like.
  • the communication section 1309 performs communication processing via a network such as the Internet.
  • the driver 1310 is also connected to the I/O interface 1305 as needed.
  • a removable medium 1311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed, so that the computer program read from it is installed into the storage portion 1308 as needed.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly embodied on a machine-readable medium, and the computer program includes program code for executing any of the foregoing methods.
  • the computer program may be downloaded and installed from the network through the communication part 1309, and/or installed from the removable medium 1311.
  • the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be the computer-readable storage medium included in the device of the above-mentioned embodiment;
  • the computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the methods described in this application.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logical function Executable instructions.
  • the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • General Business, Economics & Management (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

A group transaction method and device, and a storage medium, the method comprising: generating a group creation transaction and sending same to a server (S11); in response to depositing several assets in a first group, generating a first deposit transaction and sending same to the server (S12); receiving an execution result of a second deposit transaction pushed by the server so as to locally update the balance of a corresponding user in the first group (S13); receiving a first off-chain transaction pushed by the server, signing the first off-chain transaction, and returning the signed first off-chain transaction to the server (S14); and in response to making a transfer in the first group, generating a second off-chain transaction and sending same to the server (S15). The first off-chain transaction and the second off-chain transaction are used as proof of the basis for asset liquidation of a first contract when a member of the first group requests to withdraw from the first group. The present method achieves safe and efficient off-chain transactions in a group consisting of a plurality of users, and supports lightweight user terminals.

Description

群组交易方法、设备和存储介质Group transaction method, equipment and storage medium 技术领域Technical field
本申请涉及互联网金融技术领域,具体涉及一种群组交易方法、设备和存储介质。This application relates to the field of Internet finance technology, and specifically to a group transaction method, device and storage medium.
背景技术Background technique
当前闪电网络为用户提供了一对一的安全高效地进行链下交易的交易通道。The current Lightning Network provides users with a one-to-one, safe and efficient transaction channel for off-chain transactions.
上述方案存在以下缺陷:The above scheme has the following shortcomings:
一方面,闪电网络仅支持两个用户之间一对一的交易通道,当多个用户所组成的群组需要进行多次交易时(例如,多个游戏用户开启一局在游戏过程中需要多次进行游戏币交易的游戏),只能选择通过复杂的通道复用方案或在多个用户之间两两建立交易通道来解决问题,前者存在,方案的复杂度随着群组中用户数量增多呈指数级增长的问题,后者存在,交易通道的数量随着群组中用户数量增多呈指数级增长的问题;On the one hand, the Lightning Network only supports one-to-one transaction channels between two users. When a group composed of multiple users needs to conduct multiple transactions (for example, multiple game users need to open a game in the course of the game. Game currency transactions), you can only choose to solve the problem through a complicated channel multiplexing scheme or two-by-one establishment of a transaction channel between multiple users. The former exists, and the complexity of the scheme increases with the number of users in the group. The problem of exponential growth, the latter exists, the number of trading channels increases exponentially with the increase in the number of users in the group;
另一方面,闪电网络的用户需要将用户端配置为闪电网络的节点才能实现上述功能,而不能通过手机等轻量级的用户端实现上述功能。On the other hand, users of the Lightning Network need to configure the user terminal as a node of the Lightning Network to achieve the above functions, and the above functions cannot be achieved through a lightweight user terminal such as a mobile phone.
发明内容Summary of the invention
鉴于现有技术中的上述缺陷或不足,期望提供一种适用于多个用户所组成的群组安全高效地进行链下交易,同时支持轻量级用户端的群组交易方法、设备和存储介质。In view of the above-mentioned shortcomings or deficiencies in the prior art, it is desirable to provide a group transaction method, device and storage medium suitable for groups composed of multiple users to conduct off-chain transactions safely and efficiently, while supporting a lightweight user terminal.
第一方面,本发明提供一种适用于用户端的群组交易方法,包括:In the first aspect, the present invention provides a group transaction method suitable for users, including:
生成群组创建交易并发送给服务器,以供服务器:Generate a group creation transaction and send it to the server for the server:
将群组创建交易发送至区块链节点,以供通过第一合约执行以创建第一群组;Send the group creation transaction to the blockchain node for execution through the first contract to create the first group;
获取群组创建交易的执行结果并推送至已在服务器注册服务的第一群组的各成员的用户端;Obtain the execution result of the group creation transaction and push it to the client of each member of the first group that has registered for the service on the server;
响应于在第一群组中存入若干资产,生成第一存款交易并发送给服务器,以供服务器:In response to depositing several assets in the first group, a first deposit transaction is generated and sent to the server for the server to:
将第一存款交易发送至区块链节点,以供通过第一合约执行以将当前用户的若干资产冻结在第一群组中;Send the first deposit transaction to the blockchain node for execution through the first contract to freeze several assets of the current user in the first group;
获取第一存款交易的执行结果并推送至各成员的用户端,以供分别在本地更新当前用户在第一群组的余额;Obtain the execution result of the first deposit transaction and push it to the user terminal of each member, so as to update the current user's balance in the first group locally;
接收服务器推送的第二存款交易的执行结果以在本地更新相应用户在第一群组的余额;其中,第二存款交易由相应用户的用户端生成并发送至服务器,以供服务器发送至区块链节点,以供区块链节点通过第一合约执行;Receive the execution result of the second deposit transaction pushed by the server to locally update the balance of the corresponding user in the first group; wherein the second deposit transaction is generated by the user terminal of the corresponding user and sent to the server for the server to send to the block Chain node for the block chain node to execute through the first contract;
接收服务器推送的第一链下交易,对第一链下交易进行签名,将签名后的第一链下交易返回给服务器,以供服务器推送给各成员的用户端以供存证并更新相应用户的余额;Receive the first off-chain transaction pushed by the server, sign the first off-chain transaction, and return the signed first off-chain transaction to the server for the server to push to the client of each member for storage of the certificate and update the corresponding user Balance
响应于在第一群组中进行转账,生成第二链下交易并发送给服务器以供推送给各成员的用户端以供存证并更新相应用户的余额。In response to the transfer in the first group, a second off-chain transaction is generated and sent to the server for pushing to the user end of each member for depositing certificates and updating the balance of the corresponding user.
其中,第一链下交易和第二链下交易用于在第一群组的第一成员请求退出第一群组时作为第一合约进行资产清算的依据证明,该资产清算由当前用户代第一群组的其他成员与第一成员进行。Among them, the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group. The asset liquidation is performed by the current user on behalf of the The other members of a group proceed with the first member.
第二方面,本发明提供另一种适用于用户端的群组交易方法,包括:In the second aspect, the present invention provides another group transaction method suitable for users, including:
接收服务器推送的第三存款交易的执行结果以在本地更新相应用户在第一群组的余额;其中,第三存款交易由相应用户的用户端响应于在第一群组中存入若干资产所生成并通过服务器发送至区块链节点,以供通过第一合约执行;Receive the execution result of the third deposit transaction pushed by the server to locally update the balance of the corresponding user in the first group; wherein, the third deposit transaction is performed by the user terminal of the corresponding user in response to depositing several assets in the first group. Generate and send to the blockchain node through the server for execution through the first contract;
响应于在第一群组中存入若干资产,生成第四存款交易并发送给服务器,以供服务器:In response to depositing several assets in the first group, a fourth deposit transaction is generated and sent to the server for the server:
将第四存款交易发送至区块链节点,以供通过第一合约执行以将当前用户的若干资产冻结在第一群组中;Send the fourth deposit transaction to the blockchain node for execution through the first contract to freeze several assets of the current user in the first group;
获取第四存款交易的执行结果并推送至已在服务器注册服务的第一群组的各成员的用户端,以供分别在本地更新当前用户在第一群组的余额;Obtain the execution result of the fourth deposit transaction and push it to the user terminal of each member of the first group that has registered for the service on the server, so as to locally update the current user's balance in the first group;
响应于在第一群组中进行转账,生成第三链下交易并发送至服务器,以供服务器:In response to the transfer in the first group, a third off-chain transaction is generated and sent to the server for the server to:
将第三链下交易推送至创建第一通道的第一用户的第一用户端,以供第一用户端签名并返回给服务器;Push the third-chain off-chain transaction to the first user end of the first user who created the first channel for the first user end to sign and return to the server;
将签名后的第三链下交易推送给各成员的用户端以供存证并更新相应用户的余额;Push the signed third-chain off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user;
接收服务器推送的第四链下交易以存证并更新第一用户的余额;其中,第四链下交易由第一用户端生成并通过服务器推送;Receive fourth-chain transactions pushed by the server to deposit certificates and update the balance of the first user; among them, the fourth-chain transactions are generated by the first user and pushed through the server;
接收服务器推送的第五链下交易以存证并更新相应用户的余额;其中,第五链下交易由第一群组中除第一用户端和当前用户端之外的其它用户端生成并通过服务器发送至第一用户端进行签名,再通过服务器分别推送给各成员的用户端。Receive the fifth-chain transaction pushed by the server to deposit the certificate and update the balance of the corresponding user; among them, the fifth-chain transaction is generated and passed by other users in the first group except the first user and the current user. The server sends the signature to the first client, and then pushes it to the client of each member through the server.
其中,第三链下交易、第四链下交易和第五链下交易用于在第一群组的第一成员请求退出第一群组时作为第一合约进行资产清算的依据证明,该资产清算由第一用户代第一群组的其他成员与第一成员进行。Among them, third-chain off-chain transactions, fourth-chain off-chain transactions, and fifth-chain off-chain transactions are used as proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group. The liquidation is performed by the first user on behalf of the other members of the first group and the first member.
第三方面,本发明提供一种适用于服务器的群组交易方法,包括:In the third aspect, the present invention provides a group transaction method suitable for servers, including:
接收群组创建交易,将群组创建交易发送至区块链节点,以供通过第一合约执行以创建第一群组;其中,群组创建交易由第一用户端响应于第一用户创建群组所生成;Receive the group creation transaction, and send the group creation transaction to the blockchain node for execution through the first contract to create the first group; wherein, the group creation transaction is generated by the first client in response to the first user creating the group Generated by the group;
从区块链获取群组创建交易的执行结果并推送至已在服务器注册服务的第一群组的各成员的用户端;Obtain the execution result of the group creation transaction from the blockchain and push it to the client of each member of the first group that has registered the service on the server;
接收存款交易,将存款交易发送至区块链节点,以供通过第一合约执行以将相应用户的若干资产冻结在第一群组中;其中,存款交易由相应用户的用户端响应于将若干资产存入第一群组所生成;Receive deposit transactions, and send deposit transactions to blockchain nodes for execution through the first contract to freeze several assets of the corresponding user in the first group; wherein, the deposit transaction is executed by the corresponding user’s client in response to several Generated when assets are deposited in the first group;
从区块链获取存款交易的执行结果并推送至各成员的用户端,以供分别在本地更新相应用户在第一群组的余额;Obtain the execution result of the deposit transaction from the blockchain and push it to the user terminal of each member, so as to update the balance of the corresponding user in the first group locally;
接收第一链下交易,将第一链下交易推送给第一用户端以供签名并返回,将签名后的第一链下交易推送给各成员的用户端以供存证并更新相应用户的余额;其中,第一链下交易由第一群组中的第二用户端响应于在第一通道中进行交易所生成;Receive the first off-chain transaction, push the first off-chain transaction to the first user terminal for signature and return, and push the signed first off-chain transaction to the user side of each member to provide evidence and update the corresponding user’s Balance; where the first off-chain transaction is generated by the second user terminal in the first group in response to the transaction in the first channel;
接收第二链下交易,将第二链下交易推送给各成员的用户端以供存证并更新相应用户的余额;其中,第二链下交易由第一用户端响应于在第一通道中进行交易所生成。Receive the second off-chain transaction, push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is responded by the first user end in the first channel Perform exchange generation.
其中,第一链下交易和第二链下交易用于在第一群组的第一成员请求退出第一群组时作为第一合约进行资产清算的依据证明,该资产清算由第一用户代第一群组的其他成员与第一成员进行。Among them, the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group, and the asset liquidation is performed on behalf of the first user. The other members of the first group proceed with the first member.
第四方面,本发明提供一种适用于区块链节点的群组交易方法,包括:In a fourth aspect, the present invention provides a group transaction method suitable for blockchain nodes, including:
通过第一合约执行群组创建交易以创建第一群组,以供服务器从区块链获取群组创建交易的执行结果并推送至已在服务器注册服务的第一群组的各成员的用户端;其中,群组创建交易由第一用户端响应于第一用户创建群组所生成并通过服务器发送;The group creation transaction is executed through the first contract to create the first group, so that the server can obtain the execution result of the group creation transaction from the blockchain and push it to the client of each member of the first group that has registered the service on the server ; Wherein, the group creation transaction is generated by the first user terminal in response to the first user creating the group and sent through the server;
通过第一合约执行存款交易,将相应用户的若干资产冻结在第一群组中,以供服务器从区块链获取存款交易的执行结果并推送至各成员的用户端以供分别在本地更新相应用户在第一群组的余额;其中,存款交易由相应用户的用户端响应于将若干资产存入第一群组所生成并通过服务器发送;The deposit transaction is executed through the first contract, and several assets of the corresponding user are frozen in the first group, so that the server can obtain the execution result of the deposit transaction from the blockchain and push it to the user end of each member to update the corresponding locally. The balance of the user in the first group; wherein the deposit transaction is generated by the user terminal of the corresponding user in response to depositing several assets in the first group and sent through the server;
上述服务器还用于:The above server is also used for:
接收第一链下交易,将第一链下交易推送给第一用户端以供签名并返回,将签名后的第一链下交易推送给各成员的用户端以供存证并更新相应用户的余额;其中,第一链下交易由第一群组中的第二用户端响应于在第一通道中进行交易所生成;Receive the first off-chain transaction, push the first off-chain transaction to the first user terminal for signature and return, and push the signed first off-chain transaction to the user side of each member to provide evidence and update the corresponding user’s Balance; where the first off-chain transaction is generated by the second user terminal in the first group in response to the transaction in the first channel;
接收第二链下交易,将第二链下交易推送给各成员的用户端以供存证并更新相应用户的余额;其中,第二链下交易由第一用户端响应于在第一通道中进行交易所生成。Receive the second off-chain transaction, push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is responded by the first user end in the first channel Perform exchange generation.
其中,第一链下交易和第二链下交易用于在第一群组的第一成员 请求退出第一群组时作为第一合约进行资产清算的依据证明,该资产清算由第一用户代第一群组的其他成员与第一成员进行。Among them, the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group, and the asset liquidation is performed on behalf of the first user. The other members of the first group proceed with the first member.
第五方面,本发明还提供一种设备,包括一个或多个处理器和存储器,其中存储器包含可由该一个或多个处理器执行的指令以使得该一个或多个处理器执行根据本发明各实施例提供的群组交易方法。In a fifth aspect, the present invention also provides a device that includes one or more processors and a memory, where the memory contains instructions executable by the one or more processors to make the one or more processors execute each of the processors according to the present invention. The group transaction method provided by the embodiment.
第六方面,本发明还提供一种存储有计算机程序的存储介质,该计算机程序使计算机执行根据本发明各实施例提供的群组交易方法。In a sixth aspect, the present invention also provides a storage medium storing a computer program, which causes the computer to execute the group transaction method provided according to the embodiments of the present invention.
本发明诸多实施例提供的群组交易方法、设备和存储介质通过在合约中注册群组、在合约中冻结群组成员的资产作为群组链下交易的保障、通过合约依据链下交易进行清算构建了链下交易群组的框架,并在此框架基础上设计了由群组发起人对群组中每笔链下交易进行签名、由群组发起人与退出的成员进行清算的清算机制以解决上述框架中任一群组成员不在线无法保障公平清算的问题,实现了多个用户所组成的群组中安全高效地进行链下交易;此外还通过配置了用于发送链上交易、推送链上的群组信息等功能的中心化服务器,实现了对轻量级用户端的支持。The group transaction method, device and storage medium provided by many embodiments of the present invention register the group in the contract, freeze the assets of the group members in the contract as a guarantee for the group chain transaction, and perform settlement based on the chain transaction through the contract. The framework of the off-chain transaction group is constructed, and on the basis of this framework, a clearing mechanism is designed in which the group initiator signs each off-chain transaction in the group, and the group initiator and quit members clear the settlement mechanism. To solve the problem that any group member in the above framework is not online and cannot guarantee fair settlement, it realizes the safe and efficient off-chain transaction in the group composed of multiple users; in addition, it is configured to send on-chain transactions and push on-chain transactions. The centralized server with functions such as group information, realizes support for lightweight clients.
附图说明Description of the drawings
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, purposes, and advantages of the present application will become more apparent:
图1为本发明一实施例提供的一种群组交易方法的流程图。FIG. 1 is a flowchart of a group transaction method provided by an embodiment of the present invention.
图2为图1所示方法的一种优选实施方式的流程图。Fig. 2 is a flowchart of a preferred embodiment of the method shown in Fig. 1.
图3为图1所示方法的一种优选实施方式的流程图。Fig. 3 is a flowchart of a preferred embodiment of the method shown in Fig. 1.
图4为本发明一实施例提供的另一种群组交易方法的流程图。FIG. 4 is a flowchart of another method for group trading according to an embodiment of the present invention.
图5为图4所示方法的一种优选实施方式的流程图。Fig. 5 is a flowchart of a preferred embodiment of the method shown in Fig. 4.
图6为图4所示方法的一种优选实施方式的流程图。Fig. 6 is a flowchart of a preferred embodiment of the method shown in Fig. 4.
图7为本发明一实施例提供的又一种群组交易方法的流程图。FIG. 7 is a flowchart of yet another group transaction method provided by an embodiment of the present invention.
图8为图7所示方法的一种优选实施方式的流程图。FIG. 8 is a flowchart of a preferred embodiment of the method shown in FIG. 7.
图9为图7所示方法的一种优选实施方式的流程图。FIG. 9 is a flowchart of a preferred embodiment of the method shown in FIG. 7.
图10为本发明一实施例提供的再一种群组交易方法的流程图。FIG. 10 is a flowchart of still another group transaction method according to an embodiment of the present invention.
图11为图10所示方法的一种优选实施方式的流程图。FIG. 11 is a flowchart of a preferred embodiment of the method shown in FIG. 10.
图12为图10所示方法的一种优选实施方式的流程图。Fig. 12 is a flowchart of a preferred embodiment of the method shown in Fig. 10.
图13为本发明一实施例提供的一种设备的结构示意图。FIG. 13 is a schematic structural diagram of a device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与发明相关的部分。The application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described here are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for ease of description, only the parts related to the invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other if there is no conflict. Hereinafter, the application will be described in detail with reference to the drawings and in conjunction with the embodiments.
图1为本发明一实施例提供的一种群组交易方法的流程图。FIG. 1 is a flowchart of a group transaction method provided by an embodiment of the present invention.
如图1所示,在本实施例中,本发明提供一种适用于用户端的群组交易方法,包括:As shown in FIG. 1, in this embodiment, the present invention provides a group transaction method suitable for a user end, including:
S11:生成群组创建交易并发送给服务器,以供服务器:S11: Generate a group creation transaction and send it to the server for the server to:
将群组创建交易发送至区块链节点,以供通过第一合约执行以创建第一群组;Send the group creation transaction to the blockchain node for execution through the first contract to create the first group;
获取群组创建交易的执行结果并推送至已在服务器注册服务的第一群组的各成员的用户端;Obtain the execution result of the group creation transaction and push it to the client of each member of the first group that has registered for the service on the server;
S12:响应于在第一群组中存入若干资产,生成第一存款交易并发送给服务器,以供服务器:S12: In response to depositing several assets in the first group, generate a first deposit transaction and send it to the server for the server to:
将第一存款交易发送至区块链节点,以供通过第一合约执行以将当前用户的若干资产冻结在第一群组中;Send the first deposit transaction to the blockchain node for execution through the first contract to freeze several assets of the current user in the first group;
获取第一存款交易的执行结果并推送至各成员的用户端,以供分别在本地更新当前用户在第一群组的余额;Obtain the execution result of the first deposit transaction and push it to the user terminal of each member, so as to update the current user's balance in the first group locally;
S13:接收服务器推送的第二存款交易的执行结果以在本地更新相应用户在第一群组的余额;其中,第二存款交易由相应用户的用户端生成并发送至服务器,以供服务器发送至区块链节点,以供区块链节点通过第一合约执行;S13: Receive the execution result of the second deposit transaction pushed by the server to locally update the balance of the corresponding user in the first group; wherein the second deposit transaction is generated by the user terminal of the corresponding user and sent to the server for the server to send to Block chain node for the block chain node to execute through the first contract;
S14:接收服务器推送的第一链下交易,对第一链下交易进行签名,将签名后的第一链下交易返回给服务器,以供服务器推送给各成员的用户端以供存证并更新相应用户的余额;S14: Receive the first off-chain transaction pushed by the server, sign the first off-chain transaction, and return the signed first off-chain transaction to the server for the server to push to the client of each member for deposit and update The balance of the corresponding user;
S15:响应于在第一群组中进行转账,生成第二链下交易并发送给服务器以供推送给各成员的用户端以供存证并更新相应用户的余额。S15: In response to the transfer in the first group, a second off-chain transaction is generated and sent to the server for pushing to the user end of each member for depositing certificates and updating the balance of the corresponding user.
其中,第一链下交易和第二链下交易用于在第一群组的第一成员请求退出第一群组时作为第一合约进行资产清算的依据证明,该资产清算由当前用户代第一群组的其他成员与第一成员进行。Among them, the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group. The asset liquidation is performed by the current user on behalf of the The other members of a group proceed with the first member.
以下以用户甲乙丙丁通过配置在手机或平板等终端上的用户端进行若干局在游戏过程中需要多次进行游戏币交易的游戏为例,对上述方案进行示例性的阐述。In the following, a user A, B, C, D, and D through a user terminal configured on a mobile phone or a tablet to perform several rounds of games that require multiple transactions of game currency during the game is taken as an example to illustrate the above solution as an example.
在开局游戏前,各用户需要在服务器中注册群组服务,以便服务器向已注册的用户端推送信息。Before starting the game, each user needs to register for the group service in the server so that the server can push information to the registered users.
以用户甲作为群组发起人为例,在步骤S11中,响应于用户甲发起创建包括成员甲乙丙丁的第一群组,用户甲的用户端生成群组创建交易tx1并发送至服务器。其中,tx1可以包括群组名称、成员ID、成员地址、群组配置信息等任意一项或多项信息,还可以包括其它群组创建的相关信息或区块链上的第一合约所指定的其它信息。Taking user A as the group initiator as an example, in step S11, in response to user A initiating the creation of the first group including members A, B, C, D, the user end of user A generates a group creation transaction tx1 and sends it to the server. Among them, tx1 can include any one or more of information such as group name, member ID, member address, group configuration information, etc., and can also include related information created by other groups or specified by the first contract on the blockchain Other Information.
服务器接收tx1后,将tx1发送至区块链节点。After the server receives tx1, it sends tx1 to the blockchain node.
区块链节点接收、广播tx1,将tx1打包至区块中并通过第一合约执行tx1:若tx1执行成功,则为所创建的第一群组分配群组ID,并在合约中记录所创建的第一群组的群组ID、成员信息等信息。The blockchain node receives and broadcasts tx1, packs tx1 into the block and executes tx1 through the first contract: If tx1 is executed successfully, the first group created will be assigned a group ID, and the creation will be recorded in the contract The group ID, member information and other information of the first group.
服务器通过同步区块链数据获取到tx1的执行结果,将tx1的执行结果分别推送至第一群组的各成员甲乙丙丁的用户端。其中,若第一群组中存在未在服务器注册群组服务的成员,则服务器暂时无法对该成员进行推送,该成员的用户端可以在向服务器注册群组服务之后根据群组名称或群组ID等参数向服务器请求获取相关的信息。The server obtains the execution result of tx1 by synchronizing the blockchain data, and pushes the execution result of tx1 to the clients of each member of the first group. Among them, if there is a member in the first group who is not registered for the group service on the server, the server is temporarily unable to push the member, and the client of the member can register the group service with the server according to the group name or group Parameters such as ID request the server to obtain relevant information.
各成员甲乙丙丁的用户端收到服务器推送的tx1的执行结果后,在本地存储第一群组的相关信息,并且可以执行后续步骤。After the client of each member A, B, C, D receives the execution result of tx1 pushed by the server, the relevant information of the first group is stored locally, and the subsequent steps can be executed.
在步骤S12中,响应于用户甲在第一群组中存入100游戏币,用 户甲的用户端生成第一存款交易tx2并发送至服务器。In step S12, in response to the user A depositing 100 game coins in the first group, the user terminal of the user A generates a first deposit transaction tx2 and sends it to the server.
服务器接收tx2后,将tx2发送至区块链节点。After the server receives tx2, it sends tx2 to the blockchain node.
区块链节点接收、广播tx2,将tx2打包至区块中并通过第一合约执行tx2:若tx2执行成功,则将用户甲存入的100游戏币冻结在第一群组中,以供后续解冻清算。The blockchain node receives and broadcasts tx2, packs tx2 into the block and executes tx2 through the first contract: if tx2 is executed successfully, the 100 game coins deposited by user A will be frozen in the first group for subsequent follow-up Thaw and liquidate.
服务器通过同步区块链数据获取到tx2的执行结果,将tx2的执行结果分别推送至第一群组的各成员甲乙丙丁的用户端。The server obtains the execution result of tx2 by synchronizing the blockchain data, and pushes the execution result of tx2 to the clients of each member of the first group.
各成员甲乙丙丁的用户端收到服务器推送的tx2的执行结果后,在本地更新第一群组中用户甲的余额(游戏币+100)。After receiving the tx2 execution result pushed by the server, the user end of each member A, B, C, D updates the balance of user A in the first group locally (game currency + 100).
同理,响应于用户乙/丙/丁在第一群组中存入若干游戏币,用户乙/丙/丁的用户端生成第二存款交易tx3/tx4/tx5并发送至服务器。Similarly, in response to user B/C/D depositing a number of game coins in the first group, the user terminal of user B/C/D generates a second deposit transaction tx3/tx4/tx5 and sends it to the server.
服务器接收tx3/tx4/tx5后,将tx3/tx4/tx5发送至区块链节点。After the server receives tx3/tx4/tx5, it sends tx3/tx4/tx5 to the blockchain node.
区块链节点接收、广播tx3/tx4/tx5,将tx3/tx4/tx5打包至区块中并通过第一合约执行tx3/tx4/tx5:若tx3/tx4/tx5执行成功,则将用户乙/丙/丁存入的若干游戏币冻结在第一群组中,以供后续解冻清算。The blockchain node receives and broadcasts tx3/tx4/tx5, packs tx3/tx4/tx5 into the block and executes tx3/tx4/tx5 through the first contract: if tx3/tx4/tx5 is successfully executed, then user B/ Several game coins deposited by C/D are frozen in the first group for subsequent unfreezing and liquidation.
服务器通过同步区块链数据获取到tx3/tx4/tx5的执行结果,将tx3/tx4/tx5的执行结果分别推送至第一群组的各成员甲乙丙丁的用户端。The server obtains the execution result of tx3/tx4/tx5 by synchronizing the blockchain data, and pushes the execution result of tx3/tx4/tx5 to the clients of each member of the first group.
在步骤S13中,用户甲的用户端收到服务器推送的tx3/tx4/tx5的执行结果后,在本地更新第一群组中用户乙/丙/丁的余额(游戏币+若干)。乙丙丁的用户端同理。In step S13, after receiving the execution result of tx3/tx4/tx5 pushed by the server, the user end of user A locally updates the balance of user B/C/D in the first group (game currency + some). The same goes for the user end of E, C, D.
随着游戏进程的进展,当非群组发起人(第一群组中除用户甲之外的其它用户)需要向另一用户支付游戏币时,例如,用户乙需要向用户丙支付15个游戏币,用户乙的用户端生成用户乙签名的第一链下交易tx6,并将tx6发送给服务器。As the game progresses, when a non-group sponsor (users other than user A in the first group) needs to pay another user in game currency, for example, user B needs to pay user C for 15 games Currency, user B’s user terminal generates the first off-chain transaction tx6 signed by user B, and sends tx6 to the server.
服务器接收tx6后,将tx6推送给第一群组的发起人用户甲的用户端。After receiving tx6, the server pushes tx6 to the client of user A, the initiator of the first group.
在步骤S14中,用户甲的用户端接收tx6后,对tx6进行签名,并将用户甲签名后的tx6’返回给服务器。In step S14, after receiving tx6, the user terminal of user A signs tx6, and returns the tx6' signed by user A to the server.
服务器接收tx6’,将tx6’推送至第一群组的各成员甲乙丙丁的用 户端(也可以配置为只将tx6’推送给非发起人的成员乙丙丁的用户端)。The server receives tx6' and pushes tx6' to the user terminals of each member of the first group (it can also be configured to only push tx6' to the user terminals of the non-initiator members).
各用户端分别根据tx6’进行存证,并更新第一群组中相应用户的余额(用户乙的游戏币-15,用户丙的游戏币+15)。Each user terminal respectively deposits certificates according to tx6', and updates the balance of the corresponding user in the first group (user B's game currency-15, user C's game currency +15).
同样随着游戏进程的进展,当群组发起人(用户甲)需要向另一用户支付游戏币时,例如,用户甲需要向用户丁支付20个游戏币,在步骤S15中,用户甲的用户端生成用户甲签名的第二链下交易tx7,并将tx7发送给服务器。Also with the progress of the game process, when the group initiator (user A) needs to pay another user game currency, for example, user A needs to pay user D 20 game currency, in step S15, user A’s user The terminal generates the second off-chain transaction tx7 signed by User A, and sends tx7 to the server.
服务器接收tx7之后,将tx7推送至第一群组的各成员甲乙丙丁的用户端(同样也可以配置为只将tx7推送给非发起人的成员乙丙丁的用户端)。After receiving tx7, the server pushes tx7 to the client of each member of the first group (also can be configured to only push tx7 to the client of non-initiator members).
各用户端分别根据tx7进行存证,并更新第一群组中相应用户的余额(用户甲的游戏币-20,用户丁的游戏币+20)。Each user terminal respectively deposits certificates according to tx7, and updates the balance of the corresponding user in the first group (user A's game currency -20, user D's game currency + 20).
当一局游戏结束后,如第一群组解散,则各用户的用户端可以分别通过服务器提交各自存证的第一链下交易和第二链下交易以供第一合约进行清算;如第一群组暂不解散,则可以暂不清算,直至某一用户(非发起人用户甲,若发起人退出则群组解散)退出第一群组时,由该用户与发起人用户甲分别提交各自存证的第一链下交易和第二链下交易以供第一合约进行清算;此外,还可以将清算规则配置为本领域技术人员可以理解的其它不同规则,例如,为群组配置有效期并限时清算(可提前清算)等等。When a game is over, if the first group is disbanded, the client of each user can submit their own first-chain and second-chain transactions through the server for the settlement of the first contract; If a group is not disbanded temporarily, it may not be liquidated temporarily until a user (non-sponsor user A, if the initiator quits, the group will be dissolved) exits the first group, the user and the initiator user A will submit separately The first off-chain transaction and the second off-chain transaction of the respective certificates are for the first contract to be cleared; in addition, the clearing rules can also be configured to other different rules that can be understood by those skilled in the art, for example, the validity period is configured for the group And time-limited liquidation (can be liquidated in advance) and so on.
需要说明的是,在群组创建后,步骤S12-S15之间不存在固定顺序,其执行时序由具体场景和业务逻辑所决定。It should be noted that after the group is created, there is no fixed sequence between steps S12-S15, and the execution sequence is determined by specific scenarios and business logic.
以上以用户甲乙丙丁进行在线游戏为例,对图1所示的方法进行了示例性的阐述,在更多实施例中,本申请提供的方法还可以适用于不同场景、不同用户数量,可实现相同的技术效果。The above example takes users A, B, C, D as an example to illustrate the method shown in Figure 1. In more embodiments, the method provided in this application can also be applied to different scenarios and different numbers of users. The same technical effect.
图2为图1所示方法的一种优选实施方式的流程图。如图2所示,在一优选实施例中,上述方法还包括:Fig. 2 is a flowchart of a preferred embodiment of the method shown in Fig. 1. As shown in Figure 2, in a preferred embodiment, the above method further includes:
S16:接收服务器推送的退出群组请求交易的执行结果,判断是否需要提交证据:S16: Receive the execution result of the exit group request transaction pushed by the server, and determine whether evidence needs to be submitted:
是,则执行步骤S17:根据各第一链下交易和各第二链下交易生成第一证据提交交易并发送至服务器,以供将第一证据提交交易发送至区块链节点以供通过第一合约执行以判断是否修正第二用户通过退出群组请求交易所提交的第一清算证据。If yes, perform step S17: generate a first evidence submission transaction based on each first off-chain transaction and each second off-chain transaction and send it to the server for the first evidence submission transaction to be sent to the blockchain node for passing the first evidence submission transaction A contract is executed to determine whether to modify the first clearing evidence submitted by the second user by requesting the exchange by exiting the group.
其中,退出群组请求交易由第二用户的用户端响应于第二用户请求退出第一群组,根据与第二用户相关的链下交易所生成,并通过服务器发送至区块链节点以供通过第一合约执行。Wherein, the exit group request transaction is generated by the second user’s client in response to the second user’s request to exit the first group, generated according to the off-chain transaction related to the second user, and sent to the blockchain node through the server for Executed through the first contract.
同样以用户甲乙丙丁进行在线游戏为例,当一局游戏结束后,用户丙想要退出游戏,而用户甲乙丁想要继续进行游戏,则有:Also take the online game of user A, B, C, and D as an example. When a game is over, user C wants to quit the game, and user A, B, and D wants to continue the game, as follows:
响应于用户丙请求退出第一群组,用户丙的用户端根据与用户丙相关的链下交易(例如,用户乙向用户丙支付15游戏币、用户丙向用户丁支付10游戏币)生成退出群组请求交易tx8,将tx8发送至服务器。In response to user C’s request to log out of the first group, user C’s user terminal generates a logout based on off-chain transactions related to user C (for example, user B pays user C 15 game coins, and user C pays user D 10 game coins). The group requests transaction tx8 and sends tx8 to the server.
服务器接收tx8后,将tx8发送至区块链节点。After the server receives tx8, it sends tx8 to the blockchain node.
区块链节点接收、广播tx8,将tx8打包至区块中并通过第一合约执行tx8:若tx8执行成功,则更新第一群组(用户丙退出),并将tx8提交的第一清算证据(用户乙向用户丙支付15游戏币、用户丙向用户丁支付10游戏币)记录在区块链上,并根据预配置的等待期长度在等待期限内等待第一证据提交交易。The blockchain node receives and broadcasts tx8, packs tx8 into the block and executes tx8 through the first contract: if tx8 is executed successfully, update the first group (user C exits), and submit the first clearing evidence submitted by tx8 (User B pays 15 game coins to user C, user C pays 10 game coins to user D) is recorded on the blockchain and waits for the first evidence to submit the transaction within the waiting period according to the pre-configured waiting period length.
服务器通过同步区块链数据获取到tx8的执行结果,将tx8的执行结果分别推送至第一群组各成员甲乙丁和退出请求方用户丙的用户端。The server obtains the execution result of tx8 by synchronizing the blockchain data, and pushes the execution result of tx8 to the clients of each member A, B and D of the first group and user C of the withdrawal requesting party.
在步骤S16中,用户甲的用户端根据所存证的各第一链下交易和各第二链下交易验证tx8提交的第一清算证据是否无误(通常是验证用户丙是否隐瞒了部分或全部的链下支出):In step S16, user A’s client verifies whether the first clearing evidence submitted by tx8 is correct according to each first-chain off-chain transaction and each second-chain off-chain transaction stored in the certificate (usually to verify whether user C concealed part or all of the evidence) Off-chain expenditure):
第一清算证据无误,则无需提交证据;If the first liquidation evidence is correct, there is no need to submit evidence;
第一清算证据有误,则需要提交证据,执行步骤S17:根据所存证的各第一链下交易和各第二链下交易生成第一证据提交交易tx9并发送至服务器。If the first clearing evidence is wrong, the evidence needs to be submitted, and step S17 is executed: generating the first evidence submission transaction tx9 according to each first-chain off-chain transaction and each second-chain off-chain transaction stored in the certificate and sending it to the server.
服务器接收tx9后,将tx9发送至区块链节点。After the server receives tx9, it sends tx9 to the blockchain node.
区块链节点接收、广播tx9,将tx9打包至区块中并通过第一合约执行tx9(若tx9超出了上述的等待期限,则tx9执行失败):若tx9执行成功,则将tx9提交的清算证据记录到区块链上,并根据tx9提交的清算证据判断tx8提交的第一清算证据是否需要修正(也可以在清算时再判断)。The blockchain node receives and broadcasts tx9, packs tx9 into the block and executes tx9 through the first contract (if tx9 exceeds the above waiting period, tx9 execution fails): If tx9 is executed successfully, then tx9 is submitted for liquidation The evidence is recorded on the blockchain, and based on the clearing evidence submitted by tx9, it is judged whether the first clearing evidence submitted by tx8 needs to be amended (it can also be judged at the time of liquidation).
在度过上述等待期限后,第一合约可以自动进行清算,也可以暂不清算,等待清算双方(请求方用户丙与群组发起人用户甲)中的任一方通过服务器发送一笔请求交易来完成清算。After the above waiting period has passed, the first contract can be automatically cleared, or it can not be cleared temporarily, waiting for either of the two parties (the requesting party user C and the group initiator user A) to send a request transaction through the server Complete liquidation.
在用户丙与用户甲的清算中,为了保障用户甲尽到监督职责,由用户甲代其它用户进行清算。例如,对于tx6(用户乙向用户丙支付15个游戏币),清算时,由用户甲代用户乙进行清算,第一合约从用户甲冻结的100个游戏币中划转15个游戏币至用户丙的地址并解冻,后续用户甲与用户乙进行结算时可凭借tx6清算该15个游戏币;同理,对于tx6’(用户丙向用户丁支付10游戏币),第一合约从用户丙冻结的若干游戏币中划转10个游戏币至用户甲的地址(保持冻结),后续用户丁与用户甲进行结算时可凭借tx6’清算该10个游戏币。In the liquidation between User C and User A, in order to ensure that User A fulfills its supervisory duties, User A performs liquidation on behalf of other users. For example, for tx6 (user B pays 15 game coins to user C), during liquidation, user A will perform the liquidation on behalf of user B. The first contract transfers 15 game coins from the 100 game coins frozen by user A to the user The address of C is unfrozen, and subsequent user A and user B can use tx6 to clear the 15 game coins; similarly, for tx6' (user C pays 10 game coins to user D), the first contract is frozen from user C Transfer 10 game coins from several game coins to User A’s address (keep frozen). Subsequent User D and User A can settle the 10 game coins with tx6'.
图3为图1所示方法的一种优选实施方式的流程图。如图3所示,在一优选实施例中,上述方法还包括:Fig. 3 is a flowchart of a preferred embodiment of the method shown in Fig. 1. As shown in Figure 3, in a preferred embodiment, the above method further includes:
S18:响应于当前用户关闭第一通道,根据各第一链下交易和各第二链下交易生成提交第二清算证据的通道关闭请求交易并发送至服务器,以供:S18: In response to the current user closing the first channel, generate a channel closing request transaction for submitting the second clearing evidence according to each first-chain off-chain transaction and each second-chain off-chain transaction and send it to the server for:
将通道关闭请求交易发送至区块链节点以供通过第一合约执行以关闭第一通道,将第二清算证据记录到区块链上,以及,在等待期内等待第二证据提交交易;Send the channel closing request transaction to the blockchain node for execution through the first contract to close the first channel, record the second clearing evidence on the blockchain, and wait for the second evidence to submit the transaction during the waiting period;
从区块链获取通道关闭请求交易的执行结果并分别推送至各成员的用户端以供分别根据与各自用户相关的链下交易判断是否需要提交证据:Obtain the execution result of the channel closing request transaction from the blockchain and push it to the user end of each member to judge whether it is necessary to submit evidence according to the off-chain transaction related to the respective user:
是,则生成第二证据提交交易并发送至服务器,以供将第二证据提交交易发送至区块链节点以供通过第一合约执行以判断是否修正第二清算证据。If yes, the second evidence submission transaction is generated and sent to the server for sending the second evidence submission transaction to the blockchain node for execution through the first contract to determine whether to modify the second clearing evidence.
具体地,图3所示方法与图2所示方法的清算原理大致相同,区别在于,图3所示的方法中,当群组的发起人关闭通道时,无法通过某一用户代其他用户进行清算,而是通道内的所有用户同时进行监督和清算。Specifically, the clearing principle of the method shown in Figure 3 is roughly the same as that of the method shown in Figure 2, the difference is that in the method shown in Figure 3, when the initiator of the group closes the channel, it cannot be performed by a user on behalf of other users. Liquidation means that all users in the channel conduct supervision and liquidation at the same time.
在一优选实施例中,上述方法还包括:In a preferred embodiment, the above method further includes:
生成群组配置交易并发送至服务器,以供:Generate group configuration transactions and send them to the server for:
将群组配置交易发送至区块链节点以供通过第一合约执行以对第一通道进行配置;Send the group configuration transaction to the blockchain node for execution through the first contract to configure the first channel;
从区块链获取群组配置交易的执行结果并分别推送至各成员的用户端。Obtain the execution result of the group configuration transaction from the blockchain and push it to the client of each member.
其中,上述配置包括以下至少一项:群组成员数量上限配置,群组白名单配置,群组黑名单配置,退出群组后再次申请加入的间隔时间。Among them, the above configuration includes at least one of the following: configuration of the upper limit of the number of group members, configuration of the group whitelist, configuration of the group blacklist, and the time interval for re-applying to join after leaving the group.
上述各实施例通过在合约中注册群组、在合约中冻结群组成员的资产作为群组链下交易的保障、通过合约依据链下交易进行清算构建了链下交易群组的框架,并在此框架基础上设计了由群组发起人对群组中每笔链下交易进行签名、由群组发起人与退出的成员进行清算的清算机制以解决上述框架中任一群组成员不在线无法保障公平清算的问题,实现了多个用户所组成的群组中安全高效地进行链下交易;此外还通过配置了用于发送链上交易、推送链上的群组信息等功能的中心化服务器,实现了对轻量级用户端的支持。The above-mentioned embodiments construct the framework of the off-chain transaction group by registering the group in the contract, freezing the assets of the group members in the contract as the guarantee of the off-chain transaction of the group, and clearing the transaction based on the off-chain transaction through the contract. Based on this framework, a clearing mechanism is designed in which the group initiator signs each off-chain transaction in the group, and the group initiator and the withdrawn members perform liquidation to solve the problem that any group member in the above framework is not online and cannot guarantee fairness. The issue of clearing realizes safe and efficient off-chain transactions in groups composed of multiple users; in addition, it is realized by configuring a centralized server for sending on-chain transactions and pushing group information on the chain. Added support for lightweight client.
图4为本发明一实施例提供的另一种群组交易方法的流程图。图4所示的方法可配合图1所示的方法执行。FIG. 4 is a flowchart of another method for group trading according to an embodiment of the present invention. The method shown in FIG. 4 can be executed in conjunction with the method shown in FIG. 1.
如图4所示,在本实施例中,本发明提供另一种适用于用户端的群组交易方法,包括:As shown in FIG. 4, in this embodiment, the present invention provides another group transaction method suitable for the user end, including:
S21:接收服务器推送的第三存款交易的执行结果以在本地更新相应用户在第一群组的余额;其中,第三存款交易由相应用户的用户端响应于在第一群组中存入若干资产所生成并通过服务器发送至区块链节点,以供通过第一合约执行;S21: Receive the execution result of the third deposit transaction pushed by the server to locally update the balance of the corresponding user in the first group; wherein the third deposit transaction is responded to by the user terminal of the corresponding user in response to depositing several deposits in the first group The asset is generated and sent to the blockchain node through the server for execution through the first contract;
S22:响应于在第一群组中存入若干资产,生成第四存款交易并发 送给服务器,以供服务器:S22: In response to depositing several assets in the first group, generate a fourth deposit transaction and send it to the server for the server to:
将第四存款交易发送至区块链节点,以供通过第一合约执行以将当前用户的若干资产冻结在第一群组中;Send the fourth deposit transaction to the blockchain node for execution through the first contract to freeze several assets of the current user in the first group;
获取第四存款交易的执行结果并推送至已在服务器注册服务的第一群组的各成员的用户端,以供分别在本地更新当前用户在第一群组的余额;Obtain the execution result of the fourth deposit transaction and push it to the user terminal of each member of the first group that has registered for the service on the server, so as to locally update the current user's balance in the first group;
S23:响应于在第一群组中进行转账,生成第三链下交易并发送至服务器,以供服务器:S23: In response to the transfer in the first group, generate a third chain transaction and send it to the server for the server to:
将第三链下交易推送至创建第一通道的第一用户的第一用户端,以供第一用户端签名并返回给服务器;Push the third-chain off-chain transaction to the first user end of the first user who created the first channel for the first user end to sign and return to the server;
将签名后的第三链下交易推送给各成员的用户端以供存证并更新相应用户的余额;Push the signed third-chain off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user;
S24:接收服务器推送的第四链下交易以存证并更新第一用户的余额;其中,第四链下交易由第一用户端生成并通过服务器推送;S24: Receive the fourth off-chain transaction pushed by the server to deposit the certificate and update the balance of the first user; wherein, the fourth off-chain transaction is generated by the first user and pushed through the server;
S25:接收服务器推送的第五链下交易以存证并更新相应用户的余额;其中,第五链下交易由第一群组中除第一用户端和当前用户端之外的其它用户端生成并通过服务器发送至第一用户端进行签名,再通过服务器分别推送给各成员的用户端。S25: Receive the fifth-chain transaction pushed by the server to deposit the certificate and update the balance of the corresponding user; wherein the fifth-chain transaction is generated by other users in the first group except the first user terminal and the current user terminal It is sent to the first client through the server for signing, and then pushed to the client of each member through the server.
其中,第三链下交易、第四链下交易和第五链下交易用于在第一群组的第一成员请求退出第一群组时作为第一合约进行资产清算的依据证明,该资产清算由第一用户代第一群组的其他成员与第一成员进行。Among them, third-chain off-chain transactions, fourth-chain off-chain transactions, and fifth-chain off-chain transactions are used as proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group. The liquidation is performed by the first user on behalf of the other members of the first group and the first member.
优选地,上述方法还包括:接收服务器推送的群组创建交易的执行结果。其中,群组创建交易由第一用户端生成并通过服务器发送至区块链节点以供通过第一合约执行以创建第一群组。Preferably, the above method further includes: receiving the execution result of the group creation transaction pushed by the server. Wherein, the group creation transaction is generated by the first client and sent to the blockchain node through the server for execution through the first contract to create the first group.
优选地,上述方法还包括:响应于请求加入第一群组,生成加入群组请求交易并通过服务器发送至区块链节点以供通过第一合约执行。Preferably, the above method further includes: in response to the request to join the first group, generating a group joining request transaction and sending it to the blockchain node through the server for execution through the first contract.
图1所示的方法适用于群组发起人(例如上述示例中的用户甲)的用户端,而图4所示的方法适用于除群组发起人外的其它用户(例 如上述示例中的用户乙丙丁)的用户端,图4所示方法的群组交易原理可参考图1所示的方法,此处不再赘述。The method shown in Figure 1 is applicable to the user end of the group initiator (such as user A in the above example), while the method shown in Figure 4 is applicable to users other than the group initiator (such as the user in the above example). For the user terminal of E, C, D and D, the group transaction principle of the method shown in Fig. 4 can refer to the method shown in Fig. 1, which will not be repeated here.
图5为图4所示方法的一种优选实施方式的流程图。图5所示的方法可配合图2执行。Fig. 5 is a flowchart of a preferred embodiment of the method shown in Fig. 4. The method shown in FIG. 5 can be performed in conjunction with FIG. 2.
如图5所示,在一优选实施例中,上述方法还包括:As shown in Figure 5, in a preferred embodiment, the above method further includes:
S26:响应于当前用户请求退出第一群组,根据与当前用户相关的链下交易生成提交第一清算证据的第一退出群组请求交易并发送至服务器,以供:S26: In response to the current user's request to withdraw from the first group, generate the first group withdrawal request transaction that submits the first clearing evidence according to the off-chain transaction related to the current user and send it to the server for:
将第一退出群组请求交易发送至区块链节点以供通过第一合约执行;Send the first exit group request transaction to the blockchain node for execution through the first contract;
获取第一退出群组请求交易的执行结果并推送至第一用户端以供判断是否需要提供证据:Obtain the execution result of the first exit group request transaction and push it to the first client for judging whether it is necessary to provide evidence:
是,则生成第一证据提交交易并通过服务器发送至区块链节点以供通过第一合约执行以判断是否修正第一清算证据。If yes, the first evidence is generated to submit the transaction and sent to the blockchain node through the server for execution through the first contract to determine whether to modify the first clearing evidence.
图5所示方法的原理可参考图2所示的方法,此处不再赘述。For the principle of the method shown in FIG. 5, reference may be made to the method shown in FIG. 2, which will not be repeated here.
图6为图4所示方法的一种优选实施方式的流程图。图6所示的方法可配合图3执行。Fig. 6 is a flowchart of a preferred embodiment of the method shown in Fig. 4. The method shown in FIG. 6 can be executed in conjunction with FIG. 3.
如图6所示,在一优选实施例中,上述方法还包括:As shown in Figure 6, in a preferred embodiment, the above method further includes:
S27:接收服务器推送的通道关闭请求交易的执行结果,根据与当前用户相关的链下交易判断是否需要提交证据:S27: Receive the execution result of the channel closing request transaction pushed by the server, and judge whether it is necessary to submit evidence according to the off-chain transaction related to the current user:
是,则执行步骤S28:生成第二证据提交交易并发送至服务器,以供将第二证据提交交易发送至区块链节点以供通过第一合约执行以判断是否修正第二清算证据。If yes, perform step S28: generate a second evidence submission transaction and send it to the server for sending the second evidence submission transaction to the blockchain node for execution through the first contract to determine whether to modify the second clearing evidence.
其中,通道关闭请求交易由第一用户端响应于第一用户关闭第一通道生成并通过服务器发送至区块链节点以供通过第一合约执行。Wherein, the channel closing request transaction is generated by the first user terminal in response to the first user closing the first channel and sent to the blockchain node through the server for execution through the first contract.
图6所示方法的原理可参考图3所示的方法,此处不再赘述。The principle of the method shown in FIG. 6 can be referred to the method shown in FIG. 3, which will not be repeated here.
图7为本发明一实施例提供的又一种群组交易方法的流程图。图7所示的方法可配合图1、图4所示的方法执行。FIG. 7 is a flowchart of yet another group transaction method provided by an embodiment of the present invention. The method shown in FIG. 7 can be executed in conjunction with the methods shown in FIG. 1 and FIG. 4.
如图7所示,在本实施例中,本发明还提供一种适用于服务器的群组交易方法,包括:As shown in FIG. 7, in this embodiment, the present invention also provides a group transaction method suitable for a server, including:
S31:接收群组创建交易,将群组创建交易发送至区块链节点,以供通过第一合约执行以创建第一群组;其中,群组创建交易由第一用户端响应于第一用户创建群组所生成;S31: Receive the group creation transaction, and send the group creation transaction to the blockchain node for execution through the first contract to create the first group; wherein the group creation transaction is responded to by the first user terminal to the first user Generated by creating a group;
S32:从区块链获取群组创建交易的执行结果并推送至已在服务器注册服务的第一群组的各成员的用户端;S32: Obtain the execution result of the group creation transaction from the blockchain and push it to the client of each member of the first group that has registered the service on the server;
S33:接收存款交易,将存款交易发送至区块链节点,以供通过第一合约执行以将相应用户的若干资产冻结在第一群组中;其中,存款交易由相应用户的用户端响应于将若干资产存入第一群组所生成;S33: Receive the deposit transaction, and send the deposit transaction to the blockchain node for execution through the first contract to freeze several assets of the corresponding user in the first group; wherein the deposit transaction is responded to by the user terminal of the corresponding user Generated by depositing certain assets in the first group;
S34:从区块链获取存款交易的执行结果并推送至各成员的用户端,以供分别在本地更新相应用户在第一群组的余额;S34: Obtain the execution result of the deposit transaction from the blockchain and push it to the user terminal of each member, so as to update the balance of the corresponding user in the first group locally;
S35:接收第一链下交易,将第一链下交易推送给第一用户端以供签名并返回,将签名后的第一链下交易推送给各成员的用户端以供存证并更新相应用户的余额;其中,第一链下交易由第一群组中的第二用户端响应于在第一通道中进行交易所生成;S35: Receive the first off-chain transaction, push the first off-chain transaction to the first user terminal for signature and return, and push the signed first off-chain transaction to the user side of each member for the certificate and update the corresponding The user’s balance; where the first off-chain transaction is generated by the second user terminal in the first group in response to the transaction in the first channel;
S36:接收第二链下交易,将第二链下交易推送给各成员的用户端以供存证并更新相应用户的余额;其中,第二链下交易由第一用户端响应于在第一通道中进行交易所生成。S36: Receive the second off-chain transaction, push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is responded by the first user end to the first user end. Exchange generation in the channel.
其中,第一链下交易和第二链下交易用于在第一群组的第一成员请求退出第一群组时作为第一合约进行资产清算的依据证明,该资产清算由第一用户代第一群组的其他成员与第一成员进行。Among them, the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group, and the asset liquidation is performed on behalf of the first user. The other members of the first group proceed with the first member.
优选地,上述方法还包括:Preferably, the above method further includes:
接收第一用户端发送的群组配置交易,将群组配置交易发送至区块链节点以供通过第一合约执行以对第一通道进行配置;Receiving the group configuration transaction sent by the first client, and sending the group configuration transaction to the blockchain node for execution through the first contract to configure the first channel;
从区块链获取群组配置交易的执行结果并分别推送至各成员的用户端。Obtain the execution result of the group configuration transaction from the blockchain and push it to the client of each member.
其中,上述配置包括以下至少一项:群组成员数量上限配置,群组白名单配置,群组黑名单配置,退出群组后再次申请加入的间隔时间。Among them, the above configuration includes at least one of the following: configuration of the upper limit of the number of group members, configuration of the group whitelist, configuration of the group blacklist, and the time interval for re-applying after leaving the group.
优选地,上述方法还包括:Preferably, the above method further includes:
接收加入群组请求交易,将加入群组请求交易发送至区块链节点 以供通过第一合约执行;Receive the group joining request transaction, and send the group joining request transaction to the blockchain node for execution through the first contract;
从区块链获取加入群组请求交易的执行结果并分别推送至各成员的用户端。Obtain the execution result of the request transaction to join the group from the blockchain and push it to the client of each member.
其中,加入群组请求交易由第三用户端响应于第三用户请求加入第一群组所生成。Wherein, the group joining request transaction is generated by the third user terminal in response to the third user's request to join the first group.
图7所示方法的原理可参考图1、图4所示的方法,此处不再赘述。The principle of the method shown in FIG. 7 can be referred to the methods shown in FIG. 1 and FIG. 4, which will not be repeated here.
图8为图7所示方法的一种优选实施方式的流程图。图8所示的方法可配合图2、图5执行。FIG. 8 is a flowchart of a preferred embodiment of the method shown in FIG. 7. The method shown in FIG. 8 can be executed in conjunction with FIG. 2 and FIG. 5.
如图8所示,在一优选实施例中,上述方法还包括:As shown in Figure 8, in a preferred embodiment, the above method further includes:
S371:接收第二用户端发送的退出群组请求交易,将退出群组请求交易发送至区块链节点以供通过第一合约执行;S371: Receive the group exit request transaction sent by the second client, and send the exit group request transaction to the blockchain node for execution through the first contract;
S373:从区块链获取退出群组请求交易的执行结果并推送至第一用户端以供判断是否需要提交证据:是,则第一用户端根据各第一链下交易和各第二链下交易生成的第一证据提交交易;S373: Obtain the execution result of the exit group request transaction from the blockchain and push it to the first client terminal for judging whether evidence needs to be submitted: yes, then the first client terminal will follow each first-chain transaction and each second-chain transaction Submit the transaction as the first evidence generated by the transaction;
S375:响应于接收第一证据提交交易,将第一证据提交交易发送至区块链节点以供通过第一合约执行以判断是否修正退出群组请求交易所提交的第一清算证据。S375: In response to receiving the first evidence submission transaction, send the first evidence submission transaction to the blockchain node for execution through the first contract to determine whether to modify the first clearing evidence submitted by the exchange requesting to withdraw from the group.
图8所示方法的原理可参考图2、图5所示的方法,此处不再赘述。The principle of the method shown in FIG. 8 can refer to the methods shown in FIG. 2 and FIG. 5, which will not be repeated here.
图9为图7所示方法的一种优选实施方式的流程图。图9所示的方法可配合图3、图6所示的方法执行。FIG. 9 is a flowchart of a preferred embodiment of the method shown in FIG. 7. The method shown in FIG. 9 can be executed in conjunction with the methods shown in FIG. 3 and FIG. 6.
如图9所示,在一优选实施例中,上述方法还包括:As shown in Figure 9, in a preferred embodiment, the above method further includes:
S381:接收第一用户端发送的通道关闭请求交易,将通道关闭请求交易发送至区块链节点以供通过第一合约执行以关闭第一通道,将通道关闭请求交易所提交的第二清算证据记录到区块链上,以及,在等待期内等待第二证据提交交易;其中,通道关闭请求交易由第一用户端响应于第一用户关闭第一通道,根据各第一链下交易和各第二链下交易生成;S381: Receive the channel closing request transaction sent by the first client, send the channel closing request transaction to the blockchain node for execution through the first contract to close the first channel, and request the second clearing evidence submitted by the exchange to close the channel Record on the blockchain, and wait for the second evidence to submit the transaction during the waiting period; wherein, the channel closing request transaction is closed by the first user terminal in response to the first user to close the first channel according to each first off-chain transaction and each transaction. Generation of transactions under the second chain;
S383:从区块链获取通道关闭请求交易的执行结果并分别推送至 各成员的用户端以供分别根据与各自用户相关的链下交易判断是否需要提交证据:是,则生成第二证据提交交易;S383: Obtain the execution result of the channel closing request transaction from the blockchain and push it to the user end of each member to judge whether it is necessary to submit evidence according to the off-chain transaction related to the respective user: yes, then generate the second evidence to submit the transaction ;
S385:响应于接收第二证据提交交易,将第二证据提交交易发送至区块链节点以供通过第一合约执行以判断是否修正第二清算证据。S385: In response to receiving the second evidence submission transaction, send the second evidence submission transaction to the blockchain node for execution through the first contract to determine whether to modify the second clearing evidence.
图9所示方法的原理可参考图3、图6所示的方法,此处不再赘述。The principle of the method shown in FIG. 9 can refer to the methods shown in FIG. 3 and FIG. 6, which will not be repeated here.
图10为本发明一实施例提供的再一种群组交易方法的流程图。图10所示的方法可配合图1、图4、图7所示的方法执行。FIG. 10 is a flowchart of still another group transaction method according to an embodiment of the present invention. The method shown in FIG. 10 can be executed in conjunction with the methods shown in FIG. 1, FIG. 4, and FIG. 7.
如图10所示,在本实施例中,本发明还提供一种适用于区块链节点的群组交易方法,包括:As shown in FIG. 10, in this embodiment, the present invention also provides a group transaction method suitable for blockchain nodes, including:
S41:通过第一合约执行群组创建交易以创建第一群组,以供服务器从区块链获取群组创建交易的执行结果并推送至已在服务器注册服务的第一群组的各成员的用户端;其中,群组创建交易由第一用户端响应于第一用户创建群组所生成并通过服务器发送;S41: Perform the group creation transaction through the first contract to create the first group, so that the server can obtain the execution result of the group creation transaction from the blockchain and push it to each member of the first group that has registered for the service on the server User side; wherein, the group creation transaction is generated by the first user side in response to the first user to create the group and sent through the server;
S42:通过第一合约执行存款交易,将相应用户的若干资产冻结在第一群组中,以供服务器从区块链获取存款交易的执行结果并推送至各成员的用户端以供分别在本地更新相应用户在第一群组的余额;其中,存款交易由相应用户的用户端响应于将若干资产存入第一群组所生成并通过服务器发送;S42: The deposit transaction is executed through the first contract, and several assets of the corresponding user are frozen in the first group, so that the server can obtain the execution result of the deposit transaction from the blockchain and push it to the user terminal of each member for local localization. Update the balance of the corresponding user in the first group; wherein, the deposit transaction is generated by the user terminal of the corresponding user in response to depositing several assets into the first group and sent through the server;
上述服务器还用于:The above server is also used for:
接收第一链下交易,将第一链下交易推送给第一用户端以供签名并返回,将签名后的第一链下交易推送给各成员的用户端以供存证并更新相应用户的余额;其中,第一链下交易由第一群组中的第二用户端响应于在第一通道中进行交易所生成;Receive the first off-chain transaction, push the first off-chain transaction to the first user terminal for signature and return, and push the signed first off-chain transaction to the user side of each member to provide evidence and update the corresponding user’s Balance; where the first off-chain transaction is generated by the second user terminal in the first group in response to the transaction in the first channel;
接收第二链下交易,将第二链下交易推送给各成员的用户端以供存证并更新相应用户的余额;其中,第二链下交易由第一用户端响应于在第一通道中进行交易所生成。Receive the second off-chain transaction, push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is responded by the first user end in the first channel Perform exchange generation.
其中,第一链下交易和第二链下交易用于在第一群组的第一成员请求退出第一群组时作为第一合约进行资产清算的依据证明,该资产清算由第一用户代第一群组的其他成员与第一成员进行。Among them, the first off-chain transaction and the second off-chain transaction are used as the proof of the first contract for asset liquidation when the first member of the first group requests to withdraw from the first group, and the asset liquidation is performed on behalf of the first user. The other members of the first group proceed with the first member.
优选地,上述方法还包括:Preferably, the above method further includes:
通过第一合约执行群组配置交易,对第一通道进行配置,以供服务器从区块链获取群组配置交易的执行结果并分别推送至各成员的用户端。The group configuration transaction is executed through the first contract, and the first channel is configured for the server to obtain the execution result of the group configuration transaction from the blockchain and push it to the client of each member.
其中,群组配置交易由第一用户端生成并通过服务器发送,上述配置包括以下至少一项:群组成员数量上限配置,群组白名单配置,群组黑名单配置,退出群组后再次申请加入的间隔时间。Among them, the group configuration transaction is generated by the first client and sent through the server. The above configuration includes at least one of the following: configuration of the maximum number of group members, configuration of group whitelist, configuration of group blacklist, and reapply after exiting the group The time between joining.
优选地,上述方法还包括:Preferably, the above method further includes:
通过第一合约执行加入群组请求交易,以供服务器从区块链获取加入群组请求交易的执行结果并分别推送至各成员的用户端。The group request transaction is executed through the first contract, so that the server obtains the execution result of the group request transaction from the blockchain and pushes it to the user end of each member.
其中,加入群组请求交易由第三用户端响应于第三用户请求加入第一群组所生成并通过服务器发送。Wherein, the group joining request transaction is generated by the third user terminal in response to the third user's request to join the first group and sent through the server.
图10所示方法的原理可参考图1、图4、图7所示的方法,此处不再赘述。For the principle of the method shown in FIG. 10, reference may be made to the methods shown in FIG. 1, FIG. 4, and FIG. 7, which will not be repeated here.
图11为图10所示方法的一种优选实施方式的流程图。图11所示的方法可配合图2、图5、图8所示的方法执行。FIG. 11 is a flowchart of a preferred embodiment of the method shown in FIG. 10. The method shown in FIG. 11 can be executed in conjunction with the methods shown in FIG. 2, FIG. 5, and FIG. 8.
如图11所示,在一优选实施例中,上述方法还包括:As shown in FIG. 11, in a preferred embodiment, the above method further includes:
S43:通过第一合约执行退出群组请求交易,以供服务器从区块链获取退出群组请求交易的执行结果并推送至第一用户端以供判断是否需要提交证据:是,则第一用户端根据各第一链下交易和各第二链下交易生成的第一证据提交交易并通过服务器发送;其中,退出群组请求交易由第二用户端响应于第二用户退出第一群组,根据与第二用户相关的链下交易所生成并通过服务器发送;S43: Execute the group exit request transaction through the first contract, so that the server obtains the execution result of the exit group request transaction from the blockchain and pushes it to the first user terminal for judging whether evidence needs to be submitted: yes, then the first user The terminal submits the transaction according to the first evidence generated by each first-chain transaction and each second-chain transaction and sends it through the server; wherein, the exit group request transaction is made by the second user terminal in response to the second user exiting the first group, Generated according to the off-chain exchange related to the second user and sent through the server;
S44:通过第一合约执行第一证据提交交易,判断是否修正退出群组请求交易所提交的第一清算证据。S44: Execute the first evidence submission transaction through the first contract, and determine whether to modify the first clearing evidence submitted by the exchange for exiting the group.
图11所示方法的原理可参考图2、图5、图8所示的方法,此处不再赘述。For the principle of the method shown in FIG. 11, reference may be made to the methods shown in FIG. 2, FIG. 5, and FIG. 8, which will not be repeated here.
图12为图10所示方法的一种优选实施方式的流程图。图12所示的方法可配合图3、图6、图9所示的方法执行。Fig. 12 is a flowchart of a preferred embodiment of the method shown in Fig. 10. The method shown in FIG. 12 can be executed in conjunction with the methods shown in FIG. 3, FIG. 6, and FIG.
如图12所示,在一优选实施例中,上述方法还包括:As shown in FIG. 12, in a preferred embodiment, the above method further includes:
S45:通过第一合约执行通道关闭请求交易,关闭第一通道,将通道关闭请求交易所提交的第二清算证据记录到区块链上,以及,在等待期内等待第二证据提交交易,以供服务器从区块链获取通道关闭请求交易的执行结果并分别推送至各成员的用户端以供分别根据与各自用户相关的链下交易判断是否需要提交证据:是,则生成第二证据提交交易并通过服务器发送;其中,通道关闭请求交易由第一用户端响应于第一用户关闭第一通道,根据各第一链下交易和各第二链下交易生成并通过服务器发送;S45: Execute the channel closing request transaction through the first contract, close the first channel, record the second clearing evidence submitted by the channel closing request exchange on the blockchain, and wait for the second evidence to submit the transaction during the waiting period to For the server to obtain the execution result of the channel closing request transaction from the blockchain and push it to the user end of each member to judge whether it needs to submit evidence according to the off-chain transaction related to the respective user: yes, then generate the second evidence to submit the transaction And sent through the server; wherein, the channel closing request transaction is generated by the first user terminal in response to the first user to close the first channel, and generated and sent through the server according to each first chain transaction and each second chain transaction;
S46:通过第一合约执行第二证据提交交易以判断是否修正第二清算证据。S46: Perform the second evidence submission transaction through the first contract to determine whether to modify the second clearing evidence.
图12所示方法的原理可参考图3、图6、图9所示的方法,此处不再赘述。For the principle of the method shown in FIG. 12, reference may be made to the methods shown in FIG. 3, FIG. 6, and FIG. 9, which will not be repeated here.
图13为本发明一实施例提供的一种设备的结构示意图。FIG. 13 is a schematic structural diagram of a device provided by an embodiment of the present invention.
如图13所示,作为另一方面,本申请还提供了一种设备1300,包括一个或多个中央处理单元(CPU)1301,其可以根据存储在只读存储器(ROM)1302中的程序或者从存储部分1308加载到随机访问存储器(RAM)1303中的程序而执行各种适当的动作和处理。在RAM1303中,还存储有设备1300操作所需的各种程序和数据。CPU1301、ROM1302以及RAM1303通过总线1304彼此相连。输入/输出(I/O)接口1305也连接至总线1304。As shown in FIG. 13, as another aspect, the present application also provides a device 1300, including one or more central processing units (CPU) 1301, which can be based on a program stored in a read-only memory (ROM) 1302 or The program loaded from the storage portion 1308 into the random access memory (RAM) 1303 executes various appropriate actions and processing. In the RAM 1303, various programs and data required for the operation of the device 1300 are also stored. The CPU 1301, ROM 1302, and RAM 1303 are connected to each other through a bus 1304. An input/output (I/O) interface 1305 is also connected to the bus 1304.
以下部件连接至I/O接口1305:包括键盘、鼠标等的输入部分1306;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分1307;包括硬盘等的存储部分1308;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分1309。通信部分1309经由诸如因特网的网络执行通信处理。驱动器1310也根据需要连接至I/O接口1305。可拆卸介质1311,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1310上,以便于从其上读出的计算机程序根据需要被安装入存储部分1308。The following components are connected to the I/O interface 1305: input part 1306 including keyboard, mouse, etc.; output part 1307 including cathode ray tube (CRT), liquid crystal display (LCD), etc. and speakers, etc.; storage part 1308 including hard disk, etc. ; And a communication section 1309 including a network interface card such as a LAN card, a modem, and the like. The communication section 1309 performs communication processing via a network such as the Internet. The driver 1310 is also connected to the I/O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed, so that the computer program read from it is installed into the storage portion 1308 as needed.
特别地,根据本公开的实施例,上述任一实施例描述的方法可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程 序产品,其包括有形地包含在机器可读介质上的计算机程序,计算机程序包含用于执行上述任一方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1309从网络上被下载和安装,和/或从可拆卸介质1311被安装。In particular, according to the embodiments of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly embodied on a machine-readable medium, and the computer program includes program code for executing any of the foregoing methods. In such an embodiment, the computer program may be downloaded and installed from the network through the communication part 1309, and/or installed from the removable medium 1311.
作为又一方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例的装置中所包含的计算机可读存储介质;也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,该程序被一个或者一个以上的处理器用来执行描述于本申请提供的方法。As yet another aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium may be the computer-readable storage medium included in the device of the above-mentioned embodiment; The computer-readable storage medium in the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the methods described in this application.
附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这根据所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以通过执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以通过专用硬件与计算机指令的组合来实现。The flowcharts and block diagrams in the drawings illustrate the possible implementation of the system architecture, functions, and operations of the system, method, and computer program product according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the module, program segment, or part of code contains one or more for realizing the specified logical function Executable instructions. It should also be noted that, in some alternative implementations, the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two blocks shown in succession can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations Or it can be realized by a combination of dedicated hardware and computer instructions.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离本申请构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover the above technical features or technical solutions without departing from the concept of the application. Other technical solutions formed by arbitrarily combining the equivalent features. For example, the above-mentioned features and the technical features disclosed in this application (but not limited to) with similar functions are mutually replaced to form a technical solution.

Claims (21)

  1. 一种群组交易方法,其特征在于,所述方法适用于用户端,所述方法包括:A group transaction method, characterized in that the method is applicable to the user side, and the method includes:
    生成群组创建交易并发送给服务器,以供所述服务器:Generate a group creation transaction and send it to the server for the server to:
    将所述群组创建交易发送至区块链节点,以供通过第一合约执行以创建第一群组;Sending the group creation transaction to a blockchain node for execution through the first contract to create the first group;
    获取所述群组创建交易的执行结果并推送至已在所述服务器注册服务的所述第一群组的各成员的用户端;Acquiring the execution result of the group creation transaction and pushing it to the client terminal of each member of the first group that has registered for the service on the server;
    响应于在所述第一群组中存入若干资产,生成第一存款交易并发送给所述服务器,以供所述服务器:In response to depositing several assets in the first group, a first deposit transaction is generated and sent to the server for the server to:
    将所述第一存款交易发送至区块链节点,以供通过所述第一合约执行以将当前用户的所述若干资产冻结在所述第一群组中;Sending the first deposit transaction to a blockchain node for execution through the first contract to freeze the plurality of assets of the current user in the first group;
    获取所述第一存款交易的执行结果并推送至所述各成员的用户端,以供分别在本地更新所述当前用户在所述第一群组的余额;Acquiring the execution result of the first deposit transaction and pushing it to the user terminal of each member, so as to locally update the balance of the current user in the first group;
    接收所述服务器推送的第二存款交易的执行结果以在本地更新相应用户在所述第一群组的余额;其中,所述第二存款交易由相应用户的用户端生成并发送至所述服务器,以供所述服务器发送至区块链节点,以供所述区块链节点通过所述第一合约执行;Receive the execution result of the second deposit transaction pushed by the server to locally update the balance of the corresponding user in the first group; wherein, the second deposit transaction is generated by the user terminal of the corresponding user and sent to the server , For the server to send to the blockchain node for the blockchain node to execute through the first contract;
    接收所述服务器推送的第一链下交易,对所述第一链下交易进行签名,将签名后的第一链下交易返回给所述服务器,以供所述服务器推送给所述各成员的用户端以供存证并更新相应用户的余额;Receive the first off-chain transaction pushed by the server, sign the first off-chain transaction, and return the signed first off-chain transaction to the server for the server to push to the member’s The user terminal provides for deposit certificates and updates the balance of the corresponding user;
    响应于在所述第一群组中进行转账,生成第二链下交易并发送给所述服务器以供推送给所述各成员的用户端以供存证并更新相应用户的余额;In response to the transfer in the first group, a second off-chain transaction is generated and sent to the server for pushing to the user end of each member for depositing certificates and updating the balance of the corresponding user;
    其中,所述第一链下交易和所述第二链下交易用于在所述第一群组的第一成员请求退出所述第一群组时作为所述第一合约进行资产清算的依据证明,所述资产清算由当前用户代所述第一群组的其他成员与所述第一成员进行。Wherein, the first off-chain transaction and the second off-chain transaction are used as a basis for asset liquidation of the first contract when a first member of the first group requests to withdraw from the first group It is proved that the asset liquidation is performed by the current user on behalf of the other members of the first group and the first member.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    接收所述服务器推送的退出群组请求交易的执行结果,判断是否需要提交证据:Receive the execution result of the exit group request transaction pushed by the server, and determine whether evidence needs to be submitted:
    是,则根据各所述第一链下交易和各所述第二链下交易生成第一证据提交交易并发送至所述服务器,以供将所述第一证据提交交易发送至区块链节点以供通过所述第一合约执行以判断是否修正第二用户通过所述退出群组请求交易所提交的第一清算证据;If yes, a first evidence submission transaction is generated according to each of the first off-chain transactions and each of the second off-chain transactions and sent to the server for the first evidence submission transaction to be sent to the blockchain node For the execution of the first contract to determine whether to modify the first clearing evidence submitted by the second user through the exit group request exchange;
    其中,所述退出群组请求交易由所述第二用户的用户端响应于所述第二用户请求退出所述第一群组,根据与第二用户相关的链下交易所生成,并通过所述服务器发送至区块链节点以供通过所述第一合约执行。Wherein, the exit group request transaction is generated by the user terminal of the second user in response to the second user’s request to exit the first group based on an off-chain transaction related to the second user, and passed through all The server sends to the blockchain node for execution through the first contract.
  3. 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:
    响应于当前用户关闭所述第一通道,根据各所述第一链下交易和各所述第二链下交易生成提交第二清算证据的通道关闭请求交易并发送至所述服务器,以供:In response to the current user closing the first channel, a channel closing request transaction for submitting second clearing evidence is generated according to each of the first off-chain transactions and each of the second off-chain transactions and sent to the server for:
    将所述通道关闭请求交易发送至区块链节点以供通过所述第一合约执行以关闭所述第一通道,将所述第二清算证据记录到区块链上,以及,在等待期内等待第二证据提交交易;Send the channel closing request transaction to the blockchain node for execution through the first contract to close the first channel, record the second clearing evidence on the blockchain, and, during the waiting period Waiting for the second evidence to submit the transaction;
    从区块链获取所述通道关闭请求交易的执行结果并分别推送至所述各成员的用户端以供分别根据与各自用户相关的链下交易判断是否需要提交证据:Obtain the execution result of the channel closing request transaction from the blockchain and push it to the user terminal of each member to determine whether it is necessary to submit evidence according to the off-chain transaction related to the respective user:
    是,则生成第二证据提交交易并发送至所述服务器,以供将所述第二证据提交交易发送至区块链节点以供通过所述第一合约执行以判断是否修正所述第二清算证据。If yes, generate a second evidence submission transaction and send it to the server for sending the second evidence submission transaction to a blockchain node for execution through the first contract to determine whether to modify the second clearing evidence.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,还包括:The method according to any one of claims 1-3, further comprising:
    生成群组配置交易并发送至所述服务器,以供:Generate group configuration transactions and send them to the server for:
    将所述群组配置交易发送至区块链节点以供通过所述第一合约执行以对所述第一通道进行配置;Sending the group configuration transaction to a blockchain node for execution through the first contract to configure the first channel;
    从区块链获取所述群组配置交易的执行结果并分别推送至所述各成员的用户端;Obtain the execution result of the group configuration transaction from the blockchain and push it to the client of each member;
    其中,所述配置包括以下至少一项:群组成员数量上限配置,群组白名单配置,群组黑名单配置,退出群组后再次申请加入的间隔时间。Wherein, the configuration includes at least one of the following: configuration of the upper limit of the number of group members, configuration of the group whitelist, configuration of the group blacklist, and the interval time for re-applying to join after leaving the group.
  5. 一种群组交易方法,其特征在于,所述方法适用于用户端,所述方法包括:A group transaction method, characterized in that the method is applicable to the user side, and the method includes:
    接收服务器推送的第三存款交易的执行结果以在本地更新相应用户在第一群组的余额;其中,所述第三存款交易由相应用户的用户端响应于在所述第一群组中存入若干资产所生成并通过所述服务器发送至区块链节点,以供通过第一合约执行;The execution result of the third deposit transaction pushed by the server is received to locally update the balance of the corresponding user in the first group; wherein the third deposit transaction is responded to by the user terminal of the corresponding user in response to depositing in the first group Enter several assets generated and sent to the blockchain node through the server for execution through the first contract;
    响应于在所述第一群组中存入若干资产,生成第四存款交易并发送给所述服务器,以供所述服务器:In response to depositing several assets in the first group, a fourth deposit transaction is generated and sent to the server for the server to:
    将所述第四存款交易发送至区块链节点,以供通过所述第一合约执行以将当前用户的所述若干资产冻结在所述第一群组中;Sending the fourth deposit transaction to a blockchain node for execution through the first contract to freeze the plurality of assets of the current user in the first group;
    获取所述第四存款交易的执行结果并推送至已在所述服务器注册服务的所述第一群组的各成员的用户端,以供分别在本地更新所述当前用户在所述第一群组的余额;Obtain the execution result of the fourth deposit transaction and push it to the client terminal of each member of the first group that has registered for the service on the server, so as to update the current user’s status in the first group locally. The balance of the group;
    响应于在所述第一群组中进行转账,生成第三链下交易并发送至所述服务器,以供所述服务器:In response to the transfer in the first group, a third off-chain transaction is generated and sent to the server for the server to:
    将所述第三链下交易推送至创建所述第一通道的第一用户的第一用户端,以供所述第一用户端签名并返回给所述服务器;Pushing the third off-chain transaction to the first user end of the first user who created the first channel for the first user end to sign and return it to the server;
    将签名后的第三链下交易推送给所述各成员的用户端以供存证并更新相应用户的余额;Push the signed third-chain off-chain transaction to the user terminal of each member for deposit certificate and update the balance of the corresponding user;
    接收所述服务器推送的第四链下交易以存证并更新所述第一用户的余额;其中,所述第四链下交易由第一用户端生成并通过所述服务器推送;Receiving the fourth off-chain transaction pushed by the server to deposit a certificate and update the balance of the first user; wherein the fourth off-chain transaction is generated by the first user terminal and pushed through the server;
    接收所述服务器推送的第五链下交易以存证并更新相应用户的余额;其中,所述第五链下交易由所述第一群组中除所述第一用户端和 当前用户端之外的其它用户端生成并通过所述服务器发送至所述第一用户端进行签名,再通过所述服务器分别推送给所述各成员的用户端;Receive the fifth off-chain transaction pushed by the server to deposit the certificate and update the balance of the corresponding user; wherein, the fifth off-chain transaction is divided by the first user end and the current user end from the first group Generated by other client terminals outside and sent to the first client terminal through the server for signature, and then pushed to the client terminals of each member through the server;
    其中,所述第三链下交易、所述第四链下交易和所述第五链下交易用于在所述第一群组的第一成员请求退出所述第一群组时作为所述第一合约进行资产清算的依据证明,所述资产清算由所述第一用户代所述第一群组的其他成员与所述第一成员进行。Wherein, the third chain transaction, the fourth chain transaction, and the fifth chain transaction are used as the The proof of the basis for the asset liquidation of the first contract is that the asset liquidation is carried out by the first user on behalf of other members of the first group and the first member.
  6. 根据权利要求5所述的方法,其特征在于,还包括:The method according to claim 5, further comprising:
    响应于当前用户请求退出所述第一群组,根据与当前用户相关的链下交易生成提交第一清算证据的第一退出群组请求交易并发送至所述服务器,以供:In response to the current user's request to exit the first group, a first group exit request transaction submitting the first clearing evidence is generated and sent to the server according to the off-chain transaction related to the current user and sent to the server for:
    将所述第一退出群组请求交易发送至区块链节点以供通过所述第一合约执行;Sending the first group withdrawal request transaction to a blockchain node for execution through the first contract;
    获取所述第一退出群组请求交易的执行结果并推送至所述第一用户端以供判断是否需要提供证据:Obtain the execution result of the first exit group request transaction and push it to the first user terminal for determining whether it is necessary to provide evidence:
    是,则生成第一证据提交交易并通过所述服务器发送至区块链节点以供通过所述第一合约执行以判断是否修正所述第一清算证据。If yes, the first evidence is generated to submit the transaction and sent to the blockchain node through the server for execution through the first contract to determine whether to modify the first clearing evidence.
  7. 根据权利要求5所述的方法,其特征在于,还包括:The method according to claim 5, further comprising:
    接收所述服务器推送的通道关闭请求交易的执行结果,根据与当前用户相关的链下交易判断是否需要提交证据:Receive the execution result of the channel closing request transaction pushed by the server, and judge whether it is necessary to submit evidence according to the off-chain transaction related to the current user:
    是,则生成第二证据提交交易并发送至所述服务器,以供将所述第二证据提交交易发送至区块链节点以供通过所述第一合约执行以判断是否修正所述第二清算证据;If yes, generate a second evidence submission transaction and send it to the server for sending the second evidence submission transaction to a blockchain node for execution through the first contract to determine whether to modify the second clearing evidence;
    其中,所述通道关闭请求交易由所述第一用户端响应于所述第一用户关闭所述第一通道生成并通过所述服务器发送至区块链节点以供通过所述第一合约执行。Wherein, the channel closing request transaction is generated by the first client in response to the first user closing the first channel and sent to the blockchain node through the server for execution through the first contract.
  8. 根据权利要求5-7任一项所述的方法,其特征在于,还包括:The method according to any one of claims 5-7, further comprising:
    接收所述服务器推送的群组创建交易的执行结果;其中,所述群组创建交易由所述第一用户端生成并通过所述服务器发送至区块链节点以供通过所述第一合约执行以创建所述第一群组。Receive the execution result of the group creation transaction pushed by the server; wherein the group creation transaction is generated by the first client and sent to the blockchain node through the server for execution through the first contract To create the first group.
  9. 根据权利要求5-7任一项所述的方法,其特征在于,还包括:The method according to any one of claims 5-7, further comprising:
    响应于请求加入第一群组,生成加入群组请求交易并通过所述服务器发送至区块链节点以供通过所述第一合约执行。In response to the request to join the first group, a group joining request transaction is generated and sent to the blockchain node through the server for execution through the first contract.
  10. 一种群组交易方法,其特征在于,所述方法适用于服务器,所述方法包括:A group transaction method, characterized in that the method is applicable to a server, and the method includes:
    接收群组创建交易,将所述群组创建交易发送至区块链节点,以供通过第一合约执行以创建第一群组;其中,所述群组创建交易由第一用户端响应于第一用户创建群组所生成;A group creation transaction is received, and the group creation transaction is sent to a blockchain node for execution through the first contract to create the first group; wherein, the first user terminal responds to the first group by the group creation transaction. Generated by a user creating a group;
    从区块链获取所述群组创建交易的执行结果并推送至已在所述服务器注册服务的所述第一群组的各成员的用户端;Obtain the execution result of the group creation transaction from the blockchain and push it to the client terminal of each member of the first group that has registered for the service on the server;
    接收存款交易,将所述存款交易发送至区块链节点,以供通过所述第一合约执行以将相应用户的若干资产冻结在所述第一群组中;其中,所述存款交易由所述相应用户的用户端响应于将若干资产存入所述第一群组所生成;A deposit transaction is received, and the deposit transaction is sent to a blockchain node for execution through the first contract to freeze several assets of the corresponding user in the first group; wherein, the deposit transaction is executed by the company The user terminal of the corresponding user is generated in response to depositing a number of assets in the first group;
    从区块链获取所述存款交易的执行结果并推送至所述各成员的用户端,以供分别在本地更新所述相应用户在所述第一群组的余额;Obtain the execution result of the deposit transaction from the blockchain and push it to the user terminal of each member, so as to locally update the balance of the corresponding user in the first group;
    接收第一链下交易,将所述第一链下交易推送给所述第一用户端以供签名并返回,将签名后的第一链下交易推送给所述各成员的用户端以供存证并更新相应用户的余额;其中,所述第一链下交易由所述第一群组中的第二用户端响应于在所述第一通道中进行交易所生成;Receive the first off-chain transaction, push the first off-chain transaction to the first user terminal for signature and return, and push the signed first off-chain transaction to the user side of each member for storage Verify and update the balance of the corresponding user; wherein, the first off-chain transaction is generated by the second user terminal in the first group in response to the transaction in the first channel;
    接收第二链下交易,将所述第二链下交易推送给所述各成员的用户端以供存证并更新相应用户的余额;其中,所述第二链下交易由所述第一用户端响应于在所述第一通道中进行交易所生成;Receive a second off-chain transaction, push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is performed by the first user The terminal responds to the exchange generation in the first channel;
    其中,所述第一链下交易和所述第二链下交易用于在所述第一群组的第一成员请求退出所述第一群组时作为所述第一合约进行资产清 算的依据证明,所述资产清算由所述第一用户代所述第一群组的其他成员与所述第一成员进行。Wherein, the first off-chain transaction and the second off-chain transaction are used as a basis for asset liquidation of the first contract when a first member of the first group requests to withdraw from the first group It is proved that the asset liquidation is performed by the first user on behalf of the other members of the first group and the first member.
  11. 根据权利要求10所述的方法,其特征在于,还包括:The method according to claim 10, further comprising:
    接收第二用户端发送的退出群组请求交易,将所述退出群组请求交易发送至区块链节点以供通过所述第一合约执行;Receiving an exit group request transaction sent by a second user end, and sending the exit group request transaction to a blockchain node for execution through the first contract;
    从区块链获取所述退出群组请求交易的执行结果并推送至所述第一用户端以供判断是否需要提交证据:是,则所述第一用户端根据各所述第一链下交易和各所述第二链下交易生成的第一证据提交交易;Obtain the execution result of the exit group request transaction from the blockchain and push it to the first client terminal for judging whether it is necessary to submit evidence: yes, the first client terminal is based on each of the first off-chain transactions Submit a transaction with the first evidence generated by each of the second chain transactions;
    响应于接收所述第一证据提交交易,将所述第一证据提交交易发送至区块链节点以供通过所述第一合约执行以判断是否修正所述退出群组请求交易所提交的第一清算证据。In response to receiving the first evidence submission transaction, the first evidence submission transaction is sent to a blockchain node for execution through the first contract to determine whether to modify the first evidence submission transaction submitted by the exit group request transaction. Evidence of liquidation.
  12. 根据权利要求10所述的方法,其特征在于,还包括:The method according to claim 10, further comprising:
    接收所述第一用户端发送的通道关闭请求交易,将所述通道关闭请求交易发送至区块链节点以供通过所述第一合约执行以关闭所述第一通道,将所述通道关闭请求交易所提交的第二清算证据记录到区块链上,以及,在等待期内等待第二证据提交交易;其中,所述通道关闭请求交易由所述第一用户端响应于所述第一用户关闭所述第一通道,根据各所述第一链下交易和各所述第二链下交易生成;Receive the channel close request transaction sent by the first client, send the channel close request transaction to the blockchain node for execution through the first contract to close the first channel, and send the channel close request The second clearing evidence submitted by the exchange is recorded on the blockchain, and the second evidence is waited for during the waiting period to submit the transaction; wherein, the channel closing request transaction is responded to by the first user terminal in response to the first user Close the first channel, and generate according to each of the first off-chain transactions and each of the second off-chain transactions;
    从区块链获取所述通道关闭请求交易的执行结果并分别推送至所述各成员的用户端以供分别根据与各自用户相关的链下交易判断是否需要提交证据:是,则生成第二证据提交交易;Obtain the execution result of the channel closing request transaction from the blockchain and push it to the user terminal of each member to judge whether it is necessary to submit evidence according to the off-chain transaction related to the respective user: if yes, then generate the second evidence Submit the transaction;
    响应于接收所述第二证据提交交易,将所述第二证据提交交易发送至区块链节点以供通过所述第一合约执行以判断是否修正所述第二清算证据。In response to receiving the second evidence submission transaction, the second evidence submission transaction is sent to a blockchain node for execution through the first contract to determine whether to modify the second clearing evidence.
  13. 根据权利要求10-12任一项所述的方法,其特征在于,还包括:The method according to any one of claims 10-12, further comprising:
    接收所述第一用户端发送的群组配置交易,将所述群组配置交易 发送至区块链节点以供通过所述第一合约执行以对所述第一通道进行配置;Receiving a group configuration transaction sent by the first client, and sending the group configuration transaction to a blockchain node for execution through the first contract to configure the first channel;
    从区块链获取所述群组配置交易的执行结果并分别推送至所述各成员的用户端;Obtain the execution result of the group configuration transaction from the blockchain and push it to the client of each member;
    其中,所述配置包括以下至少一项:群组成员数量上限配置,群组白名单配置,群组黑名单配置,退出群组后再次申请加入的间隔时间。Wherein, the configuration includes at least one of the following: configuration of the upper limit of the number of group members, configuration of the group whitelist, configuration of the group blacklist, and the interval time for re-applying to join after leaving the group.
  14. 根据权利要求10-12任一项所述的方法,其特征在于,还包括:The method according to any one of claims 10-12, further comprising:
    接收加入群组请求交易,将所述加入群组请求交易发送至区块链节点以供通过所述第一合约执行;Receiving a group joining request transaction, and sending the group joining request transaction to a blockchain node for execution through the first contract;
    从区块链获取所述加入群组请求交易的执行结果并分别推送至所述各成员的用户端;Obtain the execution result of the group joining request transaction from the blockchain and push it to the client terminal of each member;
    其中,所述加入群组请求交易由第三用户端响应于第三用户请求加入所述第一群组所生成。Wherein, the group joining request transaction is generated by a third user terminal in response to a third user's request to join the first group.
  15. 一种群组交易方法,其特征在于,所述方法适用于区块链节点,所述方法包括:A group transaction method, characterized in that the method is suitable for blockchain nodes, and the method includes:
    通过第一合约执行群组创建交易以创建第一群组,以供服务器从区块链获取所述群组创建交易的执行结果并推送至已在所述服务器注册服务的所述第一群组的各成员的用户端;其中,所述群组创建交易由第一用户端响应于第一用户创建群组所生成并通过所述服务器发送;The group creation transaction is executed through the first contract to create the first group, so that the server can obtain the execution result of the group creation transaction from the blockchain and push it to the first group that has registered for the service on the server The user terminal of each member of the; wherein, the group creation transaction is generated by the first user terminal in response to the first user to create the group and sent through the server;
    通过所述第一合约执行存款交易,将相应用户的若干资产冻结在所述第一群组中,以供所述服务器从区块链获取所述存款交易的执行结果并推送至所述各成员的用户端以供分别在本地更新所述相应用户在所述第一群组的余额;其中,所述存款交易由所述相应用户的用户端响应于将若干资产存入所述第一群组所生成并通过所述服务器发送;The deposit transaction is executed through the first contract, and several assets of the corresponding user are frozen in the first group, so that the server can obtain the execution result of the deposit transaction from the blockchain and push it to the members The user terminal of the corresponding user is used to locally update the balance of the corresponding user in the first group; wherein, the user terminal of the corresponding user responds to depositing a number of assets into the first group for the deposit transaction Generated and sent through the server;
    所述服务器还用于:The server is also used for:
    接收第一链下交易,将所述第一链下交易推送给所述第一用户端以供签名并返回,将签名后的第一链下交易推送给所述各成员的用户端以供存证并更新相应用户的余额;其中,所述第一链下交易由所述第一群组中的第二用户端响应于在所述第一通道中进行交易所生成;Receive the first off-chain transaction, push the first off-chain transaction to the first user terminal for signature and return, and push the signed first off-chain transaction to the user side of each member for storage Verify and update the balance of the corresponding user; wherein, the first off-chain transaction is generated by the second user terminal in the first group in response to the transaction in the first channel;
    接收第二链下交易,将所述第二链下交易推送给所述各成员的用户端以供存证并更新相应用户的余额;其中,所述第二链下交易由所述第一用户端响应于在所述第一通道中进行交易所生成;Receive a second off-chain transaction, push the second off-chain transaction to the user end of each member for deposit certificate and update the balance of the corresponding user; wherein, the second off-chain transaction is performed by the first user The terminal responds to the exchange generation in the first channel;
    其中,所述第一链下交易和所述第二链下交易用于在所述第一群组的第一成员请求退出所述第一群组时作为所述第一合约进行资产清算的依据证明,所述资产清算由所述第一用户代所述第一群组的其他成员与所述第一成员进行。Wherein, the first off-chain transaction and the second off-chain transaction are used as a basis for asset liquidation of the first contract when a first member of the first group requests to withdraw from the first group It is proved that the asset liquidation is performed by the first user on behalf of the other members of the first group and the first member.
  16. 根据权利要求15所述的方法,其特征在于,还包括:The method according to claim 15, further comprising:
    通过所述第一合约执行退出群组请求交易,以供所述服务器从区块链获取所述退出群组请求交易的执行结果并推送至所述第一用户端以供判断是否需要提交证据:是,则所述第一用户端根据各所述第一链下交易和各所述第二链下交易生成的第一证据提交交易并通过所述服务器发送;其中,所述退出群组请求交易由第二用户端响应于第二用户退出所述第一群组,根据与第二用户相关的链下交易所生成并通过所述服务器发送;Execute the exit group request transaction through the first contract, so that the server obtains the execution result of the exit group request transaction from the blockchain and pushes it to the first client terminal for judging whether it is necessary to submit evidence: If yes, the first user terminal submits the transaction according to the first evidence generated by each of the first off-chain transactions and each of the second off-chain transactions and sends the transaction through the server; wherein, the exit group requests the transaction Generated by the second user terminal in response to the second user exiting the first group according to the off-chain exchange related to the second user and sent through the server;
    通过所述第一合约执行所述第一证据提交交易,判断是否修正所述退出群组请求交易所提交的第一清算证据。The first evidence submission transaction is executed through the first contract, and it is determined whether to modify the first clearing evidence submitted by the exchange group requesting to withdraw from the group.
  17. 根据权利要求15所述的方法,其特征在于,还包括:The method according to claim 15, further comprising:
    通过所述第一合约执行通道关闭请求交易,关闭所述第一通道,将所述通道关闭请求交易所提交的第二清算证据记录到区块链上,以及,在等待期内等待第二证据提交交易,以供所述服务器从区块链获取所述通道关闭请求交易的执行结果并分别推送至所述各成员的用户 端以供分别根据与各自用户相关的链下交易判断是否需要提交证据:是,则生成第二证据提交交易并通过所述服务器发送;其中,所述通道关闭请求交易由所述第一用户端响应于所述第一用户关闭所述第一通道,根据各所述第一链下交易和各所述第二链下交易生成并通过所述服务器发送;Executing the channel closing request transaction through the first contract, closing the first channel, recording the second clearing evidence submitted by the channel closing request exchange on the blockchain, and waiting for the second evidence during the waiting period Submit a transaction for the server to obtain the execution result of the channel closing request transaction from the blockchain and push it to the user end of each member for determining whether to submit evidence according to the off-chain transaction related to the respective user : Yes, then generate second evidence to submit the transaction and send it through the server; wherein, the channel closing request transaction is closed by the first user terminal in response to the first user to close the first channel according to each of the The first off-chain transaction and each of the second off-chain transactions are generated and sent through the server;
    通过所述第一合约执行所述第二证据提交交易以判断是否修正所述第二清算证据。The second evidence submission transaction is executed through the first contract to determine whether to modify the second clearing evidence.
  18. 根据权利要求15-17任一项所述的方法,其特征在于,还包括:The method according to any one of claims 15-17, further comprising:
    通过所述第一合约执行群组配置交易,对所述第一通道进行配置,以供所述服务器从区块链获取所述群组配置交易的执行结果并分别推送至所述各成员的用户端;The group configuration transaction is executed through the first contract, and the first channel is configured for the server to obtain the execution result of the group configuration transaction from the blockchain and push them to the users of the members respectively end;
    其中,所述群组配置交易由所述第一用户端生成并通过所述服务器发送,所述配置包括以下至少一项:群组成员数量上限配置,群组白名单配置,群组黑名单配置,退出群组后再次申请加入的间隔时间。Wherein, the group configuration transaction is generated by the first client and sent through the server, and the configuration includes at least one of the following: configuration of the maximum number of group members, configuration of the group whitelist, configuration of the group blacklist , The interval between re-applying after leaving the group.
  19. 根据权利要求15-17任一项所述的方法,其特征在于,还包括:The method according to any one of claims 15-17, further comprising:
    通过所述第一合约执行加入群组请求交易,以供服务器从区块链获取所述加入群组请求交易的执行结果并分别推送至所述各成员的用户端;Execute the group joining request transaction through the first contract, so that the server obtains the execution result of the group joining request transaction from the blockchain and pushes them to the client terminals of the members respectively;
    其中,所述加入群组请求交易由第三用户端响应于第三用户请求加入所述第一群组所生成并通过所述服务器发送。Wherein, the group joining request transaction is generated by a third user terminal in response to a third user's request to join the first group and sent through the server.
  20. 一种设备,其特征在于,所述设备包括:A device, characterized in that the device includes:
    一个或多个处理器;One or more processors;
    存储器,用于存储一个或多个程序,Memory, used to store one or more programs,
    当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1-19中任一项所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors are caused to execute the method according to any one of claims 1-19.
  21. 一种存储有计算机程序的存储介质,其特征在于,该程序被处理器执行时实现如权利要求1-19中任一项所述的方法。A storage medium storing a computer program, characterized in that, when the program is executed by a processor, the method according to any one of claims 1-19 is implemented.
PCT/CN2020/124475 2019-11-06 2020-10-28 Group transaction method and device, and storage medium WO2021088702A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911074050.3 2019-11-06
CN201911074050.3A CN110852748A (en) 2019-11-06 2019-11-06 Group transaction method, device and storage medium

Publications (1)

Publication Number Publication Date
WO2021088702A1 true WO2021088702A1 (en) 2021-05-14

Family

ID=69598606

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124475 WO2021088702A1 (en) 2019-11-06 2020-10-28 Group transaction method and device, and storage medium

Country Status (2)

Country Link
CN (1) CN110852748A (en)
WO (1) WO2021088702A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110852748A (en) * 2019-11-06 2020-02-28 杭州复杂美科技有限公司 Group transaction method, device and storage medium
CN112200575B (en) * 2020-05-28 2022-05-31 支付宝(杭州)信息技术有限公司 Node group creating method and node group-based transaction method in alliance chain network
CN112257107A (en) * 2020-10-23 2021-01-22 上海万向区块链股份公司 Block chain-based storage verification method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107911216A (en) * 2017-10-26 2018-04-13 矩阵元技术(深圳)有限公司 A kind of block chain transaction method for secret protection and system
US20190095879A1 (en) * 2017-09-26 2019-03-28 Cornell University Blockchain payment channels with trusted execution environments
CN109583868A (en) * 2018-10-17 2019-04-05 北京瑞卓喜投科技发展有限公司 Pay status channel network and its construction method and system, high frequency transaction system
CN110852748A (en) * 2019-11-06 2020-02-28 杭州复杂美科技有限公司 Group transaction method, device and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019035573A1 (en) * 2017-08-16 2019-02-21 김용태 Blockchain-based trading system and method therefor
CN109685489B (en) * 2018-12-28 2021-06-01 杭州云象网络技术有限公司 Cross-chain transaction method for assets between block chains
CN110378690B (en) * 2019-06-13 2022-05-27 北京航空航天大学 Transaction method and device based on anonymous secure payment channel

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190095879A1 (en) * 2017-09-26 2019-03-28 Cornell University Blockchain payment channels with trusted execution environments
CN107911216A (en) * 2017-10-26 2018-04-13 矩阵元技术(深圳)有限公司 A kind of block chain transaction method for secret protection and system
CN109583868A (en) * 2018-10-17 2019-04-05 北京瑞卓喜投科技发展有限公司 Pay status channel network and its construction method and system, high frequency transaction system
CN110852748A (en) * 2019-11-06 2020-02-28 杭州复杂美科技有限公司 Group transaction method, device and storage medium

Also Published As

Publication number Publication date
CN110852748A (en) 2020-02-28

Similar Documents

Publication Publication Date Title
WO2021088702A1 (en) Group transaction method and device, and storage medium
JP6798087B2 (en) Blockchain smart contract updates using decentralized decisions
KR102277998B1 (en) Electronic bill management method, apparatus and recording medium
JP7316392B2 (en) Methods and systems in which blockchain is realized
TWI690184B (en) Cross-blockchain authentication method and device, and electronic equipment
CN112492006B (en) Node management method and device based on block chain
Kaur et al. Scalability in blockchain: Challenges and solutions
Pang A new consensus protocol for blockchain interoperability architecture
CN109829718B (en) Block chain multi-level framework based on storage application scene and operation method thereof
US20190279210A1 (en) Infinitely scalable cryptocurrency system with fast, secure verification
WO2020005328A2 (en) Decentralized application platform for private key management
CN108665253A (en) A kind of data processing method, device, equipment and the storage medium of block chain network
CN109447605A (en) A kind of chain currency conversion method, apparatus, equipment and medium based on block chain
EP4318362A1 (en) Blockchain-based data processing method, apparatus and device, and storage medium
CN109508970A (en) Money transfer method and device based on block chain
CN110570270B (en) Credit contract processing method and device
KR20200031861A (en) A method of operating Crowdfunding system for game production based on Blockchain and a system for implementing the service environment
CN109995737A (en) The digital certificate management method and device of decentralization, node, system
JP2022544321A (en) Method and system for decentralized transaction communication protocol
CN112232883A (en) Service behavior incentive method and device based on block chain and storage medium
US20200402091A1 (en) Method for automatically providing cryptocurrency to recommender using propagation on sns
CN112950180A (en) Community certificate method and system based on alliance chain, electronic device and storage medium
CN110075510B (en) Card dealing method, game method, device and storage medium
Yang et al. Secure off-chain payment in consortium blockchain system
Negka et al. Blockchain state channels with compact states through the use of RSA accumulators

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20885420

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20885420

Country of ref document: EP

Kind code of ref document: A1