CN107909440B - Transaction synchronous clearing method and system for distributed general ledger system - Google Patents

Transaction synchronous clearing method and system for distributed general ledger system Download PDF

Info

Publication number
CN107909440B
CN107909440B CN201711161950.2A CN201711161950A CN107909440B CN 107909440 B CN107909440 B CN 107909440B CN 201711161950 A CN201711161950 A CN 201711161950A CN 107909440 B CN107909440 B CN 107909440B
Authority
CN
China
Prior art keywords
transaction
input
seller
output
buyer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711161950.2A
Other languages
Chinese (zh)
Other versions
CN107909440A (en
Inventor
商建祥
王继武
张国华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201711161950.2A priority Critical patent/CN107909440B/en
Publication of CN107909440A publication Critical patent/CN107909440A/en
Application granted granted Critical
Publication of CN107909440B publication Critical patent/CN107909440B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0609Buyer or seller confidence or verification
    • 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/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification

Landscapes

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

Abstract

The application provides a transaction synchronous clearing method and a transaction synchronous clearing system for a distributed general ledger system, wherein the method comprises the following steps: the seller terminal initiates a sale transaction to the distributed general ledger system, wherein the sale transaction comprises a first input and a first output; the distributed general ledger system verifies whether the sale transaction is legal according to the first input, and if the sale transaction is verified to be legal, the sale transaction is recorded; the buyer terminal acquires a sale transaction from the distributed general ledger system and initiates a purchase transaction to the distributed general ledger system according to the sale transaction in the deadline, wherein the purchase transaction comprises a second input, a third input, a seller output and a buyer output; and the distributed general ledger system verifies whether the purchase transaction is legal or not according to the second input and the third input, and if the purchase transaction is verified to be legal, the purchase transaction is recorded. The method and the device can eliminate transaction risks, reduce transaction cost and expand application scenes of the distributed general ledger system.

Description

Transaction synchronous clearing method and system for distributed general ledger system
Technical Field
The application belongs to the field of distributed general ledger systems, and particularly relates to a transaction synchronous clearing method and system for a distributed general ledger system.
Background
With the development of information technology, the trend of digitalization of assets is more and more common, and the digital assets comprise digital currency, digital bills, digital equity, digital property rights and the like which can be used for trading. The existing transaction method comprises the following steps:
1) the digital assets are hosted at the exchange, which has full control over the digital assets, depending on being centralized with the exchange. This approach has the disadvantage that if the exchange is attacked or the operator is fraudulent, the digital asset may be "stolen".
2) The asset transaction is carried out by adopting a distributed general ledger transaction system, but a third party is required to intervene in the transaction process, the transaction fund of a buyer is generally frozen by the third party, and after the digital asset passes the house, the third party and the buyer jointly authorize the transaction fund to be paid to a seller. This approach still has the drawback of relying on third parties and the funds cannot be cleared in real time. Relying on third parties not only increases the cost and risk to the transaction, but also makes many business scenarios prohibitive in terms of promotion due to the trust that third parties are unavailable.
Disclosure of Invention
The method and the device are used for solving the problems that in the prior art, the counter credit cannot be guaranteed in direct transaction, and when a third party is used for transaction, an authoritative third party is scarce and the transaction cost is high.
In order to solve the above technical problem, a technical solution of the present application is to provide a method for transaction synchronization clearing of a distributed general ledger system, including:
the seller terminal initiates a selling transaction to the distributed general ledger system, wherein the selling transaction comprises a first input and a first output, the first input comprises seller output and seller ownership transfer certification information which are recorded in the referenced distributed general ledger system, and the first output comprises sold digital assets and ownership transfer conditions with deadline and transaction price;
the distributed general ledger system verifies whether the sale transaction is legal according to the first input, and if the sale transaction is verified to be legal, the sale transaction is recorded;
the method comprises the steps that a buyer terminal acquires a selling transaction from a distributed general ledger system and initiates a purchasing transaction to the distributed general ledger system according to the selling transaction at the deadline, wherein the purchasing transaction comprises a second input, a third input, a seller output and a buyer output, the second input comprises a quoted first output and buyer ownership transfer certification information, the third input comprises the buyer output and the buyer ownership transfer certification information which are recorded in the quoted distributed general ledger system, the seller output comprises transaction price and seller ownership transfer conditions, and the buyer output comprises a sold digital asset and buyer ownership transfer conditions;
and the distributed general ledger system verifies whether the purchase transaction is legal or not according to the second input and the third input, and if the purchase transaction is verified to be legal, the purchase transaction is recorded. In another technical solution of the present application, a system for transaction synchronization clearing of a distributed general ledger system is further provided, including: the system comprises a seller terminal, a buyer terminal and a distributed general ledger system based on a block chain, wherein the distributed general ledger system comprises a plurality of working nodes; the seller terminal and the buyer terminal are respectively in communication connection with the working node;
the seller terminal is used for initiating a selling transaction to the distributed general ledger system, wherein the selling transaction comprises a first input and a first output, the first input comprises seller output and seller ownership transfer certification information which are recorded in the referenced distributed general ledger system, and the first output comprises digital assets to be sold and ownership transfer conditions with expiration time and transaction price;
the distributed general ledger system is used for verifying whether the selling transaction is legal or not according to the first input, and recording the selling transaction if the selling transaction is verified to be legal;
the buyer terminal is used for acquiring a sale transaction from the distributed general ledger system and initiating a purchase transaction to the distributed general ledger system according to the sale transaction at the deadline, wherein the purchase transaction comprises a second input, a third input, a seller output and a buyer output, the second input comprises a quoted first output and buyer ownership transfer certification information, the third input comprises the buyer output and the buyer ownership transfer certification information which are recorded in the quoted distributed general ledger system, the seller output comprises transaction price matching and seller ownership transfer conditions, and the buyer output comprises a sold digital asset and buyer ownership transfer conditions;
the distributed general ledger system is also used for verifying whether the purchase transaction is legal or not according to the second input and the third input, and recording the purchase transaction if the purchase transaction is verified to be legal.
The transaction synchronous clearing method and the transaction synchronous clearing system for the distributed general ledger system can achieve the following technical effects. 1. Eliminating the risk of the transaction: because the property and the money ownership or the property and the property ownership are synchronously transferred, the credit risk does not exist in the transaction process; 2. the transaction cost is low: in the transaction process, third party intervention is not needed for fund freezing, guarantee, signature, arbitration and the like, so that the transaction cost is greatly reduced. 3. Expanding the application scene of the distributed general ledger system: the current distributed general ledger system can not realize 'money payment on one hand and delivery on one hand', often needs to introduce an authoritative third party to build a transaction system, and due to scarcity of the authoritative third party, the threshold for building the transaction system is invisibly improved, so that the application scene is limited, the application can build the distributed general ledger system under the condition without the third party, and the application scene is greatly expanded.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a distributed ledger system transaction synchronization clearing method according to an embodiment of the present application;
FIG. 2 is a flow diagram of a distributed ledger system transaction synchronization clearance method according to another embodiment of the present application;
FIG. 3 is a flow diagram of a distributed ledger system validating a sale transaction according to one embodiment of the present application;
FIG. 4 is a flow diagram of a distributed ledger system validating a purchase transaction according to one embodiment of the present application;
FIG. 5 is a flow diagram of a distributed ledger system verifying an undo transaction according to one embodiment of the present application;
fig. 6 is a block diagram of a distributed ledger system transaction synchronization clearance system according to an embodiment of the present application.
Detailed Description
In order to make the technical features and effects of the invention more obvious, the technical solution of the invention is further described below with reference to the accompanying drawings, the invention can also be described or implemented by other different specific examples, and any equivalent changes made by those skilled in the art within the scope of the claims are within the scope of the invention.
In the description herein, reference to the term "an embodiment," "a particular embodiment," "for example," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. The sequence of steps involved in the embodiments is for illustrative purposes to illustrate the implementation of the present application, and the sequence of steps is not limited and can be adjusted as needed.
As shown in fig. 1, fig. 1 is a flowchart of a transaction synchronization clearing method of a distributed general ledger system according to an embodiment of the present application. The method and the device can eliminate transaction risks, reduce transaction cost and expand application scenes of the distributed general ledger system. Specifically, the distributed general ledger transaction synchronous clearing method comprises the following steps:
step 101, a seller terminal initiates a selling transaction to a distributed general ledger system, wherein the selling transaction comprises a first input and a first output, the first input comprises seller output and seller ownership transfer certification information which are recorded in the referenced distributed general ledger system, and the first output comprises sold digital assets and ownership transfer conditions with deadline and transaction price; in detail, the seller output referenced in the first input includes: the seller-owned digital assets and the seller ownership transfer conditions, and the referenced seller outputs the digital assets owned by the seller, namely the digital assets sold in the sale transaction;
102, the distributed general ledger system verifies whether the selling transaction is legal according to the first input, and if the selling transaction is verified to be legal, the selling transaction is recorded;
103, the buyer terminal acquires a sale transaction from the distributed general ledger system, the buyer can balance whether to accept the sale transaction after acquiring the sale transaction, and if the sale transaction is accepted, the buyer initiates a purchase transaction to the distributed general ledger system according to the expiration time of the sale transaction, wherein the purchase transaction comprises a second input, a third input, a seller output and a buyer output, the second input comprises a quoted first output and buyer ownership transfer certification information, the third input comprises the buyer output and buyer ownership transfer certification information which are recorded in the quoted distributed general ledger system, the seller output comprises transaction price and seller ownership transfer conditions, and the buyer output comprises a sold digital asset and buyer ownership transfer conditions; in detail, the buyer output referenced in the third input includes: the digital assets owned by the buyer and the transfer conditions of the ownership of the buyer, the referenced digital assets owned by the seller in the output of the buyer are the digital assets sold in the sale transaction;
and step 104, the distributed general ledger system verifies whether the purchase transaction is legal according to the second input and the third input, and if the purchase transaction is verified to be legal, the purchase transaction is recorded.
After step 104, the transfer of the assets of both transaction parties is completed, i.e. the digital assets sold by the seller are transferred to the buyer, and the transaction price given by the buyer is transferred to the seller.
The types of digital assets for trading, which are referred to in this embodiment, include, but are not limited to, digital currency, digital tickets, digital equity, digital property, and other assets available for trading, and the digital assets for trading, which are referred to in this embodiment, belong to different types of digital assets.
In particular embodiments, the distributed ledger system may also receive a funding transaction to inject an asset, the funding transaction being a special transaction with a null transaction input.
The embodiment can realize synchronous transfer of ownership of digital assets of both transaction parties in the distributed general ledger system, namely 'money delivery by one hand and delivery by one hand', and does not need to introduce a third party for guarantee, authorization or signature in the whole transaction process. Because the 'one-hand money delivery and one-hand delivery' are realized, the credit problem of a trading opponent is not needed to be worried about, and the trading risk is greatly reduced; the transaction process is completely carried out by a third party, so that the transaction cost can be reduced; meanwhile, the problem that the transaction cannot be conducted due to scarcity of the authoritative third party can be solved, and the application scene of the distributed general ledger system is greatly expanded. Further, the present embodiment also enables the synchronous exchange of digital assets, i.e., "barter", such as the trading of digital tickets with digital equities.
In an embodiment of the present application, as shown in fig. 2, the transaction synchronization clearing method of the distributed general ledger system further includes:
step 105, if the distributed general ledger system does not receive the purchase transaction initiated by the buyer terminal before the deadline time, the seller terminal initiates a revocation transaction to the distributed general ledger system after the deadline time, wherein the revocation transaction comprises a fourth input and a seller output, the fourth input comprises the quoted first output and seller ownership transfer certification information, and the seller output comprises the sold digital asset and seller ownership transfer conditions;
and 106, the distributed general ledger system verifies the revocation transaction according to the fourth input, and if the revocation transaction verification is legal, the revocation transaction is recorded.
By the embodiment, the seller can be guaranteed to receive the sold digital assets back for the next transaction when the buyer does not accept the sale transaction.
In an embodiment of the present application, the seller ownership transfer certification information includes: a private key signature that matches the seller's public key. The buyer ownership transfer certification information includes: a private key signature that matches the buyer's public key. Ownership transfer conditions with deadlines and trade consideration include: providing a private key signature matching the buyer public key before the deadline, and the buyer transaction output being a transaction price; or provide a private key signature that matches the seller's public key after the expiration time. The seller ownership transfer condition includes: a private key signature is provided that matches the seller's public key. The buyer ownership transfer condition includes: a private key signature is provided that matches the buyer's public key.
In the specific implementation, the ownership transfer condition with the deadline and the transaction price, the seller ownership transfer condition and the buyer ownership transfer condition are realized by the locking script. The seller ownership transfer certification information and the buyer ownership transfer certification information are implemented by an unlocking script.
The unlock script and the lock script employ a stack-based execution language of an inverse wave-blue representation. The following operation codes are set:
DUP: copying a stack top element;
HASH 160: HASH is carried out on the top of the stack twice, SHA-256 is firstly used, and then RIPEMD-160 is used;
EQUALVERIFY: if the two input numbers are equal, the execution is continued, otherwise, 0 is returned, and the transaction is marked invalid;
CHECKSIG: the signature used for the transaction must be a valid signature of the hash value and the public key, if true, 1 is returned, otherwise 0 is returned;
IF: if the stack top element is not 0, the statement will be executed;
ELSE: IF the previous IF or ELSE was not executed, the statement will be executed;
ENDIF: terminate IF, ELSE block;
greaterthn: if the second item is larger than the stack top item, outputting 1, otherwise outputting 0;
OUT 1: take output 1 of the usage transaction;
OUT1 HASH: taking the hash value of output 1 of the use transaction;
BLOCKIME: take a timestamp of the block where the transaction was used.
Assuming that seller is a and buyer is B, the following constants may be set in the description:
< pubk _ A >: a public key;
< pubk _ B >: b public key;
< pubkhash _ A >: the public key of A is subjected to HASH160 operation;
< pubkhash _ B >: the public key of B carries out HASH160 operation result;
< sig _ a >: the hash value of the transaction is signed by using a private key of A to obtain a result;
< sig _ B >: the hash value of the transaction is signed by using a private key of B to obtain a result;
< Txout1 >: the transaction output set by the transaction initiator;
< Txout1hash >: the transaction initiator sets a transaction output hash value;
< Txtime >: the transaction execution time limit.
As shown in fig. 3, in an embodiment of the present application, the process of the distributed ledger system verifying whether the sale transaction is legal according to the first input includes:
step 301, judging whether the seller output referenced in the first input is referenced by other transactions, if not, executing step 302, and if so, verifying that the selling transaction is illegal;
step 302, executing an unlocking script corresponding to the first input, for example, if the locking script is < sig _ a > < pubk _ a >, executing step 303 if the unlocking script fails to report an error in the executing process, and verifying that the sale transaction is illegal if the unlocking script reports an error in the executing process;
step 303, executing the locking script corresponding to the seller output referred in the first input, for example, the unlocking script is DUP HASH160< pubkhush _ a > equal value trade checksum ig, if the execution result of the locking script is true, verifying that the sale transaction is legal, and if the execution result of the locking script is false, verifying that the sale transaction is illegal.
As shown in fig. 4, in an embodiment of the present application, the process of the distributed ledger system verifying whether the purchase transaction is legal according to the second input and the third input includes:
step 401, determining whether the first output referenced in the second input is referenced by other transactions, if not, executing step 402, and if so, verifying that the purchase transaction is illegal;
step 402, executing an unlocking script corresponding to the second input, for example, the unlocking script corresponding to the second input is < sig _ B > < pubk _ B >, B is a buyer, if the unlocking script does not report an error in the execution process, executing step 403, and if the unlocking script reports an error in the execution process, verifying that the purchase transaction is illegal;
step 403, executing a lock script corresponding to the first output, for example, the lock script corresponding to the first output is BLOCKTIME < Txtime > GREATERTHAN IF DUP HASH160< pubkhush _ a > equal value version CHECKSIG ELSE OUT1< Txout1> equal value version DUP HASH160< pubkhush _ B > equal value version CHECKSIG ENDIF;
step 401', determining whether the buyer output referenced in the third input is referenced by other transactions, if not, executing step 402', and if so, verifying that the purchase transaction is illegal;
step 402', executing an unlocking script corresponding to the third input, for example, the unlocking script corresponding to the third input is < sig _ B > < pubk _ B >, B is a buyer, if the unlocking script does not report an error in the execution process, executing step 403', if the unlocking script does not report an error in the execution process, verifying that the purchase transaction is illegal;
step 403', executing the locking script corresponding to the buyer output referred to in the third input, for example, the locking script corresponding to the referred buyer output is DUP HASH160< pubkhush _ B > equal virtual check sig;
if the execution results of the locking scripts of steps 403 and 403 'are both true, the purchase transaction is verified to be legitimate, and if one of the execution results of the locking scripts of steps 403 and 403' is false, the purchase transaction is verified to be illegitimate.
As shown in fig. 5, in an embodiment of the application, the process of the distributed general ledger system verifying whether the cancelled transaction is legal according to the fourth input includes:
step 501, judging whether the first output referenced in the fourth input is referenced by other transactions, if not, executing step 502, and if so, verifying that the withdrawn transaction is illegal;
step 502, executing an unlocking script corresponding to the fourth input, for example, the unlocking script is < sig _ a > < pubk _ a >, if the unlocking script does not report an error in the execution process, executing step 503, and if the decoding script reports an error in the execution process, verifying that the transaction is not cancelled;
step 503, executing the first output corresponding locking script, if the execution result of the locking script is true, verifying that the transaction revocation is legal, and if the execution result of the locking script is false, verifying that the transaction revocation is illegal.
To more clearly illustrate the technical solution of the present application, a detailed description is given below with an embodiment, assuming that before the transaction starts, the owner a owns the digital asset a, the owner B owns the digital currency B, and there are two transactions in the distributed ledger system, and the output is not cited:
transaction X:
inputting: (ii) a;
output 1:
asset information: a digital asset a;
ownership transfer conditions: a private key signature matching the public key of a is provided. The corresponding locking script is: DUP HASH160< pubkhush _ A > EQUALVERIFY CHECKSK IG.
Transaction Y:
inputting: (ii) a;
output 1:
asset information: a digital currency b;
ownership transfer conditions: providing a private key signature that matches the public key of B. The corresponding locking script is: DUP HASH160< pubkhush _ B > EQUALVERIFY CHECKSK IG.
The execution steps of the transaction synchronous clearing method of the distributed general ledger system comprise:
1) a initiates a transaction 1 (sale transaction) to the distributed general ledger system, the transaction 1 is used for transferring the digital assets a held by the transaction to B, setting transfer conditions and requiring B to complete the transaction before expiration and pay the transaction price (namely, digital currency B), and the transaction 1 is represented as follows:
transaction 1:
input 1 (first input):
inputting a reference: output 1 of transaction X;
ownership transfer proof: and (4) carrying out signature on a private key matched with the public key of the A. The corresponding unlocking script is as follows: < sig _ A >
<pubk_A>;
Output 1 (first output):
asset information: a digital asset a;
ownership transfer conditions: before specifying < Txtime >, a private key signature is provided that matches the public key of B,
and output 1 of the transfer ownership transaction (seller output) is the designated content, with the value < Txout1 >; or at
After < Txtime >, a private key signature matching the public key of a is provided. The corresponding locking script is:
BLOCKTIME<Txtime>GREATERTHAN IF DUP HASH160<pubkhash_A>
EQUALVERIFY CHECKSIG ELSE OUT1<Txout1>EQUALVERIFY DUP HASH160<pubkhash_B>EQUALVERIFY CHECKSIG ENDIF。
where < Txtime > is the last transaction time set by a, before which B can initiate a purchase transaction to complete the asset exchange, after which time a can redeem the digital asset a; < Txout1> is the transaction output 1 set by a, the value of output 1 must be the value in the purchase transaction initiated by B, the contents of the transaction output is the price of the transaction, and the digital currency B is transferred to the name a.
Alternatively, < Txout1> in the ownership transfer condition herein may be its HASH value, with the advantage of reducing the length of the transaction and keeping the transaction offer secret until the transaction is not completed, and with the disadvantage of requiring the offer to be provided with the counterparty (i.e., buyer) online. The specific ownership transfer conditions are as follows: before specifying < Txtime >, a private key signature matching the public key of B is provided, and the seller of the transfer ownership transaction outputs as the specified content, the post-hash value is < Txout1hash >; or after < Txtime > a private key signature matching the public key of a is provided. The corresponding locking script is: BLOCKTIME < Txtime > GREATERTHAN IF DUP HASH160< pubkhashA > EQUALVERIFY CHECKSIG ELSE OUT1HASH < Txout1HASH > EQUALVERIFY DUP HASH160< pubkhashB > EQUALVERIFY CHECKSIG ENDIF.
Where < Txtime > is the last transaction time set by a, before which B can initiate a purchase transaction to complete the asset exchange, after which time a can redeem the digital asset a; < Txout1hash > is the hash value of the transaction output 1 set by a, the hash value of the output 1 in the transaction 2 initiated by B must be the value, the content of the transaction output is the price of the transaction, and the digital currency B is transferred to the name of a.
Alternatively, the operation code OUT1 is not limited to taking the output 1 of the usage transaction, and the operation codes OUT2, OUT3 … … may be defined to take the output 2, output 3 … … of the usage transaction.
2) The distributed general ledger system receives the transaction 1, verifies the transaction 1, and records the transaction 1 if the transaction 1 is legal.
3) And B, the transaction 1 is confirmed through the distributed general ledger system.
4) B trades off whether transaction 1 is accepted.
5) If B decides to accept transaction 1, B initiates transaction 2 (purchase transaction) to the distributed general ledger system before the deadline, the distributed general ledger system verifies transaction 2, and if the verification is legal, transaction 2 is recorded. Completing the transfer of the digital asset a to B, synchronously transferring the digital currency B of the deal price to a, and the deal 2 is expressed as follows:
transaction 2:
input 1 (second input):
inputting a reference: output 1 of transaction 1;
ownership transfer proof: and C, carrying out matched private key signature with the public key of B. The corresponding unlocking script is as follows: < sig _ B >
<pubk_B>;
Input Y (third input):
inputting a reference: output 1 of transaction Y;
ownership transfer proof: and C, carrying out matched private key signature with the public key of B. The corresponding unlocking script is as follows: < sig _ B >
<pubk_B>;
Output 1 (seller output):
asset information: a digital currency b;
ownership transfer conditions: a private key signature matching the public key of a is provided. The corresponding locking script is: DUP HASH160< pubkhush _ A > EQUALVERIFY CHECKSK IG;
output 2 (buyer output):
asset information: a digital asset a;
ownership transfer conditions: providing a private key signature that matches the public key of B. The corresponding locking script is: DUP HASH160< pubkhush _ B > EQUALVERIFY CHECKSK IG.
As described above, after transaction 2 is completed, A owns digital currency B, B owns digital asset a, and the synchronous transfer of ownership of asset and currency is completed.
6) And if the step 5) is not successfully executed after the expiration of the deadline time, initiating a transaction 3 (a cancel transaction) to the distributed general ledger system to transfer the digital asset a back to the distributed general ledger system. Transaction 3 is represented as follows:
transaction 3:
input 1 (fourth input):
inputting a reference: output 1 of transaction 1;
ownership transfer proof: and (4) carrying out signature on a private key matched with the public key of the A. The corresponding unlocking script is as follows: < sig _ A >
<pubk_A>;
Output 1 (seller output):
asset information: a digital asset a;
ownership transfer conditions: a private key signature matching the public key of a is provided. The corresponding locking script is: DUP
HASH160<pubkhash_A>EQUALVERIFY CHECKSIG。
As shown above, after transaction 3 is completed, a re-owns the digital asset a and the transaction is cancelled.
As shown in fig. 6, fig. 6 is a structural diagram of a transaction synchronization clearing system of a distributed general ledger system according to an embodiment of the present application. Therefore, the implementation of the system can refer to the implementation of the above method, and repeated details are not repeated.
Specifically, the transaction synchronization clearing system of the distributed general ledger system comprises:
the system comprises a seller terminal 601, a buyer terminal 602 and a block chain-based distributed general ledger system 603, wherein the distributed general ledger system 603 comprises a plurality of working nodes; the seller terminal 601 and the buyer terminal 602 are respectively connected with the working node in communication. Each working node is in a different organizational scope, e.g. a server for a different bank, a server for a different exchange, etc.
The seller terminal 601 is configured to initiate a sale transaction to the distributed general ledger system 603, where the sale transaction includes a first input and a first output, where the first input includes seller output and seller ownership transfer certification information that has been recorded in the referenced distributed general ledger system, and the first output includes digital assets for sale, ownership transfer conditions with expiration time and transaction price;
the distributed general ledger system 603 is used for verifying whether the selling transaction is legal according to the first input, and if the selling transaction is verified to be legal, the selling transaction is recorded;
the buyer terminal 602 is configured to obtain a sale transaction from the distributed general ledger system 603, and initiate a purchase transaction to the distributed general ledger system 603 according to the sale transaction at an expiration time, where the purchase transaction includes a second input, a third input, a seller output, and a buyer output, the second input includes a quoted first output and buyer ownership transfer certification information, the third input includes the buyer output and buyer ownership transfer certification information recorded in the quoted distributed general ledger system, the seller output includes transaction price and seller ownership transfer conditions, and the buyer output includes a sold digital asset and buyer ownership transfer conditions;
the distributed ledger system 603 is further configured to verify whether the purchase transaction is legitimate according to the second input and the third input, and record the purchase transaction if the purchase transaction is verified to be legitimate.
The process of the distributed general ledger system verifying the sale transaction and the purchase transaction is described in the foregoing embodiments, and will not be described herein.
In an embodiment of the present application, if the distributed general ledger system 603 does not receive the purchase transaction initiated by the buyer terminal 602 before the deadline, the seller terminal 601 is further configured to initiate a revocation transaction to the distributed general ledger system 603 after the deadline, where the revocation transaction includes a fourth input and a seller output, the fourth input includes the quoted first output and seller ownership transfer certification information, and the seller output includes the sold digital asset and the seller ownership transfer condition;
the distributed ledger system 603 is further configured to verify the revocation transaction according to the fourth input, and record the revocation transaction if the revocation transaction is verified to be legitimate.
The transaction synchronous clearing method and the transaction synchronous clearing system for the distributed general ledger system can achieve the following technical effects. 1. Eliminating the risk of the transaction: because the property and the money ownership or the property and the property ownership are synchronously transferred, the credit risk does not exist in the transaction process; 2. the transaction cost is low: in the transaction process, third party intervention is not needed for fund freezing, guarantee, signature, arbitration and the like, so that the transaction cost is greatly reduced. 3. Expanding the application scene of the distributed general ledger system: the current distributed general ledger system can not realize 'money payment on one hand and delivery on one hand', often needs to introduce an authoritative third party to build a transaction system, and due to scarcity of the authoritative third party, the threshold for building the transaction system is invisibly improved, so that the application scene is limited, the application can build the distributed general ledger system under the condition without the third party, and the application scene is greatly expanded.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the purpose of illustrating the present invention, and any person skilled in the art can modify and change the above embodiments without departing from the spirit and scope of the present invention. Therefore, the scope of the claims should be accorded the full scope of the claims.

Claims (10)

1. A transaction synchronous clearing method for a distributed general ledger system is characterized in that user output is recorded in the distributed general ledger system, the user output comprises digital assets owned by users and ownership transfer conditions, and the method comprises the following steps:
the seller terminal initiates a selling transaction to the distributed general ledger system, wherein the selling transaction comprises a first input and a first output, the first input comprises seller output and seller ownership transfer certification information which are recorded in the referenced distributed general ledger system, and the first output comprises sold digital assets and ownership transfer conditions with deadline and transaction price;
the distributed general ledger system verifies whether the sale transaction is legal according to the first input, and if the sale transaction is verified to be legal, the sale transaction is recorded;
the method comprises the steps that a buyer terminal acquires a selling transaction from a distributed general ledger system and initiates a purchasing transaction to the distributed general ledger system according to the selling transaction at the deadline, wherein the purchasing transaction comprises a second input, a third input, a seller output and a buyer output, the second input comprises a quoted first output and buyer ownership transfer certification information, the third input comprises the buyer output and the buyer ownership transfer certification information which are recorded in the quoted distributed general ledger system, the seller output comprises transaction price and seller ownership transfer conditions, and the buyer output comprises a sold digital asset and buyer ownership transfer conditions;
and the distributed general ledger system verifies whether the purchase transaction is legal according to the second input and the third input, and if the purchase transaction is verified to be legal, the purchase transaction is recorded so as to transfer the digital assets sold by the seller to the buyer and transfer the transaction price given by the buyer to the seller.
2. The method of claim 1, wherein the seller output referenced in the first input comprises: the digital assets owned by the seller and the ownership transfer conditions of the seller;
the buyer output referenced in the third input includes: digital assets owned by the buyer and buyer ownership transfer conditions.
3. The method of claim 2, wherein if the distributed ledger system does not receive a purchase transaction initiated by a buyer terminal by the deadline time, the seller terminal initiates a revocation transaction to the distributed ledger system after the deadline time, wherein the revocation transaction includes a fourth input and a seller output, the fourth input includes the referenced first output and seller ownership transfer certification information, and the seller output includes the sold digital asset and seller ownership transfer conditions;
and the distributed general ledger system verifies the canceling transaction according to the fourth input, and if the canceling transaction is verified to be legal, the canceling transaction is recorded.
4. The method of claim 3, wherein the seller ownership transfer attestation information comprises: private key signature matching with seller public key;
the buyer ownership transfer certification information includes: a private key signature matched with the public key of the buyer;
the ownership transfer condition with deadline and trade consideration comprises: providing a private key signature matching the buyer public key before the deadline, and the buyer transaction output being a transaction price; or providing a private key signature matching the seller's public key after a deadline;
the seller ownership transfer condition includes: providing a private key signature matching the seller's public key;
the buyer ownership transfer condition includes: a private key signature is provided that matches the buyer's public key.
5. The method of claim 3, wherein the ownership transfer conditions with deadlines and trade consideration, the seller ownership transfer conditions, and the buyer ownership transfer conditions are implemented with lock scripts;
the seller ownership transfer certification information and the buyer ownership transfer certification information are realized by an unlocking script.
6. The method of claim 5, wherein the process of the distributed ledger system verifying from the first input whether the sale transaction is legitimate comprises:
judging whether the seller output quoted in the first input is quoted by other transactions, if not, executing an unlocking script corresponding to the first input, if the unlocking script is not wrongly reported in the executing process, executing a locking script corresponding to the seller output quoted in the first input, and if the executing result of the locking script is true, verifying that the selling transaction is legal.
7. The method of claim 5, wherein the process of the distributed ledger system verifying whether the purchase transaction is legitimate based on the second input and the third input comprises:
judging whether a first output quoted in a second input is quoted by other transactions, if not, executing an unlocking script corresponding to the second input, and if the unlocking script is not wrongly reported in the executing process, executing a locking script corresponding to the first output;
judging whether the buyer output referred in the third input is referred by other transactions, if not, executing an unlocking script corresponding to the third input, and if the unlocking script is not wrongly reported in the executing process, executing a locking script corresponding to the buyer output referred in the third input;
and if the execution results of the locking scripts are true, verifying that the selling transaction is legal.
8. The method of claim 5, wherein the process of the distributed ledger system verifying that the reversal transaction is legitimate based on the fourth input comprises:
and judging whether the first output quoted in the fourth input is quoted by other transactions, if not, executing an unlocking script corresponding to the fourth input, if the unlocking script is not wrongly reported in the executing process, executing a locking script corresponding to the first output, and if the executing result of the locking script is true, verifying that the withdrawn transaction is legal.
9. A transaction synchronization liquidation system of a distributed general ledger system, wherein a user output is recorded in the distributed general ledger system, the user output includes digital assets owned by a user and ownership transfer conditions, the system comprises: the system comprises a seller terminal, a buyer terminal and a distributed general ledger system based on a block chain, wherein the distributed general ledger system comprises a plurality of working nodes; the seller terminal and the buyer terminal are respectively in communication connection with the working node;
the seller terminal is used for initiating a selling transaction to the distributed general ledger system, wherein the selling transaction comprises a first input and a first output, the first input comprises seller output and seller ownership transfer certification information which are recorded in the referenced distributed general ledger system, and the first output comprises digital assets to be sold and ownership transfer conditions with expiration time and transaction price;
the distributed general ledger system is used for verifying whether the selling transaction is legal or not according to the first input, and recording the selling transaction if the selling transaction is verified to be legal;
the buyer terminal is used for acquiring a sale transaction from the distributed general ledger system and initiating a purchase transaction to the distributed general ledger system according to the sale transaction at the deadline, wherein the purchase transaction comprises a second input, a third input, a seller output and a buyer output, the second input comprises a quoted first output and buyer ownership transfer certification information, the third input comprises the buyer output and the buyer ownership transfer certification information which are recorded in the quoted distributed general ledger system, the seller output comprises transaction price matching and seller ownership transfer conditions, and the buyer output comprises a sold digital asset and buyer ownership transfer conditions;
the distributed general ledger system is also used for verifying whether the purchase transaction is legal or not according to the second input and the third input, and if the purchase transaction is verified to be legal, the purchase transaction is recorded so as to transfer the digital assets sold by the seller to the buyer and transfer the transaction price given by the buyer to the seller.
10. The system of claim 9, wherein the seller terminal is further configured to initiate a revocation transaction to the distributed ledger system after the expiration time if the distributed ledger system has not received a purchase transaction initiated by a buyer terminal by the expiration time, wherein a revocation transaction includes a fourth input and a seller output, the fourth input includes the referenced first output and seller ownership transfer certification information, and the seller output includes the digital asset for sale and seller ownership transfer conditions;
the distributed general ledger system is also used for verifying the revocation transaction according to the fourth input, and recording the revocation transaction if the revocation transaction is verified to be legal.
CN201711161950.2A 2017-11-21 2017-11-21 Transaction synchronous clearing method and system for distributed general ledger system Active CN107909440B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711161950.2A CN107909440B (en) 2017-11-21 2017-11-21 Transaction synchronous clearing method and system for distributed general ledger system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711161950.2A CN107909440B (en) 2017-11-21 2017-11-21 Transaction synchronous clearing method and system for distributed general ledger system

Publications (2)

Publication Number Publication Date
CN107909440A CN107909440A (en) 2018-04-13
CN107909440B true CN107909440B (en) 2022-03-25

Family

ID=61846732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711161950.2A Active CN107909440B (en) 2017-11-21 2017-11-21 Transaction synchronous clearing method and system for distributed general ledger system

Country Status (1)

Country Link
CN (1) CN107909440B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110555696B (en) * 2018-05-31 2023-01-31 本无链科技(深圳)有限公司 Asset issuing method, system and device based on block chain guarantee
CN109242686A (en) * 2018-08-31 2019-01-18 深圳付贝科技有限公司 Transaction Recall voluntarily method digs mine machine and block catenary system
CN109359980A (en) * 2018-10-22 2019-02-19 成都凡特客科技有限公司 A kind of enterprise's equity online trading platform based on block chain technology
CN109658240A (en) * 2018-11-20 2019-04-19 深圳变设龙信息科技有限公司 A kind of data trade method, apparatus and terminal device based on block chain
CN109741169A (en) * 2018-12-14 2019-05-10 深圳壹账通智能科技有限公司 Liquidation method, system, computer equipment based on distributed account book

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105427104A (en) * 2015-12-08 2016-03-23 布比(北京)网络技术有限公司 Method and method for handling digital assets by means of distributed general ledger
CN106504094B (en) * 2016-11-25 2021-06-15 中国银行股份有限公司 Transaction matching method and system of distributed general ledger system based on block chain technology

Also Published As

Publication number Publication date
CN107909440A (en) 2018-04-13

Similar Documents

Publication Publication Date Title
CN106504094B (en) Transaction matching method and system of distributed general ledger system based on block chain technology
CN107909440B (en) Transaction synchronous clearing method and system for distributed general ledger system
JP7112690B2 (en) Digital Wealth Management for Decentralized Transaction Consensus Network
Asgaonkar et al. Solving the buyer and seller’s dilemma: A dual-deposit escrow smart contract for provably cheat-proof delivery and payment for a digital good without a trusted mediator
CN109154885B (en) Business process execution on a blockchain platform
CN108885761B (en) Method for secure point-to-point communication on a blockchain
US20220327529A1 (en) Advanced Transactional Protocols And Ecosystem For Smart Contract Authoring And Deployment
CN111144862A (en) Method, device, equipment and storage medium for realizing digital currency double-off-line payment
CN110192216B (en) Computer-implemented method and system
US20150302401A1 (en) Distributed crypto currency unauthorized transfer monitoring system
US20230087360A1 (en) Stake pool of a system digital asset-backed data interaction system
WO2017163220A1 (en) Methods and Systems for Recording Multiple Transactions on a Blockchain
CN110612547A (en) System and method for information protection
JP2017515252A (en) An apparatus, system, or method that facilitates the transfer of value between parties with low or no confidence
US20200160328A1 (en) Lightweight blockchain supported transaction platform with digital bill optimizations and denominations
CN116158053A (en) Offline interaction system and method
Eze et al. A triplicate smart contract model using blockchain technology
US11449938B2 (en) Methods and systems for tracking unspent transaction output (UTXO) tokens in a distributed ledger technology-based network
EP3867852A1 (en) Computer-implemented method and system for digital signing of transactions
KR100968941B1 (en) Finance trade system using a otp
US11880836B1 (en) Gated control for blockchain units
KR102003731B1 (en) System and method for protecting crypto currency using virtual machine
US20230351387A1 (en) Information processing system, device, and method
WO2024076387A1 (en) Gated control for blockchain units
CN115660679A (en) Hash locking based decentralized secure transaction method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant