CN112419059B - Efficient digital legal coin transaction method based on account model - Google Patents

Efficient digital legal coin transaction method based on account model Download PDF

Info

Publication number
CN112419059B
CN112419059B CN202011302822.7A CN202011302822A CN112419059B CN 112419059 B CN112419059 B CN 112419059B CN 202011302822 A CN202011302822 A CN 202011302822A CN 112419059 B CN112419059 B CN 112419059B
Authority
CN
China
Prior art keywords
transaction
asset
block
tree
cmb
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
CN202011302822.7A
Other languages
Chinese (zh)
Other versions
CN112419059A (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.)
Sun Yat Sen University
Original Assignee
Sun Yat Sen University
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 Sun Yat Sen University filed Critical Sun Yat Sen University
Priority to CN202011302822.7A priority Critical patent/CN112419059B/en
Publication of CN112419059A publication Critical patent/CN112419059A/en
Application granted granted Critical
Publication of CN112419059B publication Critical patent/CN112419059B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • 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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention relates to the technical field of blockchain finance, in particular to an efficient digital asset transaction method based on an account model. Aiming at the existing AFCoin technical framework, a blockchain forest and endorsement node selection method is introduced, a receipt processing process is integrated, the complete implementation steps of the framework are provided, and the framework is applied to the field of digital asset transaction, so that an efficient digital asset transaction method based on an account model is obtained. Under the semantic framework of AFCoin, a blockchain forest is a plurality of blockchain structures maintained by a central row, and different commercial banks have different blockchains but are uniformly issued by the central row; the endorsement node selection method is used for ensuring that a commercial bank cannot select a specific commercial bank responsible for endorsing and preventing the problem of cheating between commercial banks. When the central office is considered as the issuer of the digital asset, the commercial bank is considered as the underwriter of the digital asset, and the user is considered as the holder of the digital asset, an efficient digital asset transaction method is achieved.

Description

Efficient digital legal coin transaction method based on account model
Technical Field
The invention relates to the technical field of blockchain finance, in particular to an efficient digital legal coin transaction method based on an account model.
Background
In recent years, the research of a digital legal coin system is actively carried out by the property issuers of the central office of China and the European and American countries, and the digital legal coin is popularized and applied on trial. The English center of 2016 first issued the digital French coin prototype system RSCOIN, which stimulated the global governments' research interest in digital French coins. The swedish row 2018 initiates the blockchain digital law coin project e-Krona (electronic kron) and starts the test at month 3 of 2020. Since 2014, the central row established a specialized team to study digital tokens and was officially approved by the national institutes for digital token development in 2019. By 4 months 2020, the central line digital law coin DCEP has started internal tests at commercial banks in several cities. Digital juggles also fall into the category of new digital assets. Digital tokens are often highly efficient and manageable, but privacy protection is often not easily achieved.
At present, some papers appear, and it is suggested to use the underlying technology of the password digital currency to perfect the defect of the digital legal coin system on the privacy protection of users, and meanwhile, the characteristics of the manageability and high efficiency of the legal coin system are maintained, for example, the paper "afcoi: A Framework for Digital Fiat Currency of Central Banks Based on Account Model" published by Tian et al in 2018, and a set of legal coin framework based on a binary system architecture of "the central office-commercial bank" is provided, and the technical system of the ethernet is referred to, so that the balance of efficiency, privacy and supervision is realized. The frame has a block chain maintained in a central row designed therein, simplifying receipt processing. However, the design makes the running efficiency limited by the running speed of a blockchain, which is unfavorable for parallelization; meanwhile, the receipt processing is also missing in the subsequent verification link, and the system is difficult to realize; finally, no specific method is provided for the selection of endorsement nodes, and further improvement is required.
Disclosure of Invention
The invention provides an efficient digital legal coin transaction method based on an account model, which can realize effective supervision.
In order to solve the technical problems, the invention adopts the following technical scheme: an efficient digital method coin transaction method based on an account model comprises an asset issuer CB, asset underwriters CMB1, …, CMBnb and users DU1, …, DUnu, wherein nb and nu are arbitrary natural numbers, and the values of nb and nu can be dynamically changed along with the operation of a blockchain system; asset underwriters CMB1, …, CMBnb have public and private key pairs (bpk, bsk 1), …, (bpknb, bsknb), respectively. The users DU1, …, DUnu can register true identities in different asset underwriters to meet the supervision requirements of a financial system, meanwhile, the users respectively have public and private key pairs (upk 1, usk 1), …, (upknu, usknu), and the public keys of the users further generate account addresses of the users; the user's digital asset transaction includes the steps of:
s1, creating and submitting a transaction: user DUi obtains the account address of user DUj, sets the value v of the digital asset to generate an unsigned transaction Tx', and generates a transaction signature SigTx through the private key uski of user DUi, sending the signed transaction Tx to the asset underwriter CMBs, where,/>
S2, processing transaction: the asset contractor CMBs receive the transaction Tx from the user DUi, verify whether the transaction Tx satisfies the transaction condition, process the transaction Tx satisfying the transaction condition, and output a transaction receipt Recpt;
s3, transaction uplink: the asset underwriter CMBs will transact Tx1,hash value of Txn, transaction receipt Recpt1,/and transaction receipt Recpt1>The hash value of Recptn is packed to form an unsigned and unsigned block Blk ', a block signature SigBlk' is generated through a private key bsks of CMBs and assembled with the block Blk 'to obtain an unsigned block Blk', then endorsement signatures are generated by asset contractors CMBp and CMBq responsible for endorsement, and the block Blk carrying the endorsement signatures and transaction Tx1 are submitted>Txn and receipt Recpt1, < ->Recptn to asset issuer CB, which verifies the validity of block Blk and issues valid blocks onto the blockchain Chains of CMBs in the blockchain forest, wherein>N is a natural number. A step of
In the invention, aiming at the existing AFCoin technical framework, a blockchain forest and endorsement node selection method is introduced, a receipt processing process is integrated, the complete implementation steps of the framework are provided, and the framework is applied to the field of digital asset transaction, so that an efficient digital legal coin transaction method based on an account model is obtained. Under the semantic framework of AFCoin, a blockchain forest is a plurality of blockchain structures maintained by a central row, and different commercial banks have different blockchains but are uniformly issued by the central row; the endorsement node selection method is used for ensuring that a commercial bank cannot select a specific commercial bank responsible for endorsing and preventing the problem of cheating between commercial banks. When the central office is considered as the issuer of the digital asset, the commercial bank is considered as the underwriter of the digital asset, and the user is considered as the holder of the digital asset, an efficient method of trading the digital asset is achieved.
The invention aims to design an efficient digital legal coin transaction method based on an account model. Based on the account model, the system realized by the method is shown, the user experience is similar to that of an Ethernet, the account address generated by public and private key pairs and public keys is provided, meanwhile, the hash value is disclosed according to the AFCoin framework, the thought of transaction contents is kept secret, the transaction privacy of the user can be protected through the public account book, and supervision can be realized through the private account book.
Further, the step S1 specifically includes:
s11, the user DUi assembles an unsigned transaction Tx' according to the value v of the digital asset, the transaction serial number Noncei of the user DUi, the account address Addrj of the user DUj and the transaction generation time t;
s12, updating the transaction serial number of a local client of the user DUi to be Noncei+1;
s13, generating a digital signature SigTx for the transaction Tx 'according to a private key uski held by a user DUi, and assembling the digital signature SigTx and the unsigned transaction Tx' to obtain the transaction Tx;
s14. Submit transaction Tx to the asset contractor CMBs of the user DUi.
Further, the step S2 includes:
s21, receiving transaction Tx by the asset contractor CMBs, and analyzing the value v of the digital asset, the transaction serial number Noncei of the user DUi, the account address Addrj of the user DUj, the transaction generation time t and the digital signature SigTx;
s22, the asset underwriter CMBs acquire the digital signature SigTx of the transaction Tx, calculate the account address Addri of the user DUi, verify whether the account addresses Addri and Addrj are registered in the asset underwriter CMBs, and reject the transaction of the unregistered account;
s23, acquiring account balance Bali of the on-chain transaction serial numbers Noncei', DUi of the user DUi and account balance Balj of the user DUj from the blockchain state of the asset underwriter CMBs, verifying the transaction execution condition of the transaction Tx, and rejecting the transaction which does not meet the transaction execution condition;
s24, calculating new state values of the user DUi and the user DUj by the asset contractor CMBs;
s25. The asset underwriter CMBs computes a Hash value htx=hash of the transaction Tx (addrj|noncei|v|t|sigtx);
s26, generating unsigned transaction receipts Recpt1 'and Recpt2' for the user DUi and the user DUj respectively according to the hash value HTx of the transaction Tx, the new account balance after transaction and the transaction execution time t2;
s27, respectively generating digital signatures SigRecpt1 and SigRecpt2 for the unsigned transaction receipts Recpt1 'and Recpt2' according to a private key bsks held by the asset underwriter CMBs;
s28, assembling the digital signatures SigRecpt1 and SigRecpt2 and the unsigned transaction receipts Recpt1 'and Recpt2' to obtain transaction receipts Recpt1 and Recpt2;
s29. The asset contractor CMBs submit the key names and the front and back values of the transaction Tx, the transaction receipts Recpt1 and Recpt2, and the status related to the transaction upload queue, and inform the user DUi that the transaction has been processed and is waiting for upload.
Further, calculating new state values for user DUi and user DUj includes: user DUi new on-chain transaction sequence number Noncei "=noncei+1, user DUi new account balance Bali '=bali-v, and user DUj new account balance balij' =balij+v, and updating the new state value into the blockchain state of the asset underwriter CMBs;
further, the transaction execution conditions include: whether the transaction serial number Noncei of the transaction Tx is greater than or equal to the on-chain transaction serial number Noncei' of the user DUi, whether the transaction initiation time t is timeout, whether the account address Addrj of the user DUj exists, and whether the account balance Bali of the user DUi is greater than or equal to the value v of the digital asset.
Further, the step S3 specifically includes:
s31, collecting transaction Tx1, …, txn, transaction receipts Recpt1, …, recptn and key names and front and back values of states related to each transaction by the asset contractor CMBs, and arranging the transactions according to the execution time sequence of the transactions;
s32, the asset contractor CMBs respectively form a transaction tree and a receipt tree according to the transaction Tx1, …, txn and transaction receipts Recpt1, … and Recptn through an MPT tree algorithm, and calculate a hash value HTxTrie of the tree root of the transaction tree and a hash value HRecptTrie of the tree root of the receipt tree;
s33, acquiring a state tree stateTrie 'of a last block of the asset underwriter CMBs by the asset underwriter CMBs, updating the state tree stateTrie' by a state tree updating algorithm according to key names and front and back values of states related to transactions Tx1, … and Txn, generating a verifiable state tree by a verifiable state tree generating method to obtain a new state tree stateTrie and a verifiable state tree stateTriev, and calculating to obtain a hash value HStateTrie of a tree root of the state tree stateTrie;
s34, the asset underwriter CMBs inquire the block header of the last block from the block chain of the asset underwriter CMBs, and calculate the hash value HBlkPrev of the block header of the last block;
s35, the asset contractor CMBs assemble to obtain an unsigned and unscrambled block Blk' according to the hash value HBlkPrev of the block head of the last block, the hash value HTxTrie of the tree root of the transaction tree, the hash value HRecptTrie of the tree root of the receipt tree, the hash value HStateTrie of the tree root of the state tree StateTrie and the block generation time t 3;
s36, generating a digital signature SigBlk 'for the unsigned and unsigned block Blk' according to a private key bsks held by an asset underwriter CMBs, and assembling the unsigned and unsigned block Blk 'with the digital signature SigBlk' to obtain an unsigned block Blk '';
s37, the asset underwriter CMBs calculates a block head hash value HBlkPrev of the previous block, and calculates the corresponding asset underwriters CMBp and CMBq responsible for endorsements of the block Blk' by selecting an endorsement asset underwriter according to the hash value HBlkPrev;
s38, the asset contractor CMBs sends the block Blk '', the transaction Tx1, …, txn, the transaction receipts Recpt1, …, the key name and the front and back values of the state related to each transaction and the verifiable state tree StateTriev of the last block of the asset contractor CMBs to the corresponding asset contractor CMBp and CMBq responsible for endorsement of the block Blk '', the asset contractor CMBp and CMBq verify the validity of the transaction and transaction receipts in the block and the block, and after the block verification is passed, the asset contractor CMBp and CMBq respectively issue and send back endorsement signatures SigEndorse1 and SigEndorse2;
s39, constructing a new block Blk by the asset contractor CMBs according to the block Blk' and endorsement signatures SigEndorse1 and SigEndorse2;
s310, the asset contractor CMBs sends the information of the new blocks such as the transaction Tx1, …, txn, the transaction receipts Recpt1, …, recptn, the key name and the final value of the state related to each transaction, and the block Blk, etc., to the asset issuer CB;
s311 the asset issuer CB receives the information of the new block Blk, verifies the validity of said block Blk and updates the valid block into the blockchain Chains of the asset underwriter CMBs.
Further, the generating the state verification tree in step S33 specifically includes:
s331, inputting key names and front and back values of states related to the state tree stateTrie' and the transactions Tx1, … and Txn, merging states of the same key name, enabling the front value to be a back value of a state tree of a previous block, and enabling the back value to be a value formed after execution of the current transaction Tx1, … and Txn is completed;
s332, traversing all the related states, marking the node of each state and the father node in the state tree stateTrie' until the father node is marked or the father node is the root node;
s333, traversing the state tree stateTrie' from the root node to the depth, and continuing traversing the node downwards when the node is a branch node and is not marked, otherwise adding the key and the hash value of the node into the array, and finally obtaining the verifiable state tree stateTriev consisting of the key and the hash value of the marked node.
Further, the step of selecting the endorsement asset underwriter by the CMBs in step S37 specifically includes:
s371, inputting a block header hash value HBlkPrev of the previous block and a set { CMB1, …, CMBnb };
s372, using a pseudo-random number generation algorithm, taking a block head hash value HBlkPrev of a previous block as a random number seed to generate a number r, calculating index=r% nb+1, continuously executing the pseudo-random number generation algorithm when the index is the same as S to generate new numbers r and index, otherwise, obtaining a first asset underwriting party index p responsible for endorsement;
s373, continuing to execute the pseudo random number generation algorithm of the step S372, and obtaining a second asset underwriting party subscript q responsible for endorsement according to the same process, wherein
Further, the method for verifying the validity of the transaction and the transaction receipt in the block and the block by the asset contractor CMBp and CMBq in the step S38 specifically includes the following steps:
s381, inquiring the block head of the last block of the asset underwriter CMBs, calculating the block head hash value HBlkPrev' of the last block, and extracting the hash value of the tree root of the state tree in the block head of the last block, and marking the hash value as HStateTriePrev;
s382, according to the verifiable state tree, forming a state tree (StateTrie ') of the last block through an MPT tree algorithm, calculating a tree root hash value (HStateTriePrev') of the state tree of the last block, and verifying whether the HStateTriePrev is consistent with the HStateTrieTriev ', and if the HStateTrieTriev is inconsistent with the HStateTrieTriev', invalidating the block;
s383, according to the transaction Tx1, …, txn and the transaction receipts Recpt1, …, recptn, respectively forming a transaction tree and a receipt tree by an MPT tree algorithm, and calculating to obtain a hash value HTxTrie 'of the tree root of the transaction tree and a hash value HRecptTrie' of the tree root of the receipt tree;
s384, extracting a hash value HBlkPrev of a block head of a previous block, a hash value HTxTrie of a tree root of a current block transaction tree, a hash value HTxTrie of a tree root of a receipt tree and a hash value HStateTrie of a tree root of a state tree from the block Blk ', and verifying whether the HBlkPrev is consistent with HBlkPrev', whether the HTxTrie is consistent with HTxTrie 'and whether the HRecptTrie is consistent with HRecptTrie', wherein the block is invalid if any group of data is inconsistent;
s385, according to the state tree StateTrie ', the steps of calculating and checking B3 to B6 are carried out on the transactions Tx1, … and Txn to obtain a new state tree StateTrie, a tree root hash value HStateTrie ' is calculated, whether the HStateTrie is consistent with the HStateTrie ' or not is verified, and if the HStateTrie is inconsistent, the block is invalid.
Further, the method for verifying the validity of the block Blk by the asset issuer CB in step S311 specifically includes:
s3111, inquiring a block head of a block above the asset underwriter CMBs, and calculating a hash value HBlkPrev of the block head of the previous block;
s3112, according to the transaction Tx1, …, txn and the transaction receipt Recpt1, …, the Recptn respectively form a transaction tree and a receipt tree through an MPT tree algorithm, and a hash value HTxTrie 'of the tree root of the transaction tree and a hash value HRecptTrie' of the tree root of the receipt tree are obtained through calculation;
s3113 extracting the hash value HBlkPrev of the block head of the last block, the hash value HTxTrie of the tree root of the current block transaction tree, the hash value HTxTrie of the tree root of the receipt tree, the hash value HStateTrie of the tree root of the status tree, the digital signature SigBlk, the endorsement signatures SigEndorse1 and SigEndorse2 from the block Blk, verifying whether HBlkPrev is consistent with HBlkPrev ', whether HTxTrie is consistent with HTxTrie ', whether HRecptTrie is consistent with HRecptTrie ' and whether the public key restored by the digital signature SigBlk is consistent with bpks, and if one group of data is inconsistent, the block is invalid;
s3114 inputting a block head hash value HBlkPrev of a previous block and a set { CMB1, …, CMBnb } of a current asset contractor, executing a sub-step of selecting an endorsement asset contractor in step S37, obtaining public keys bpkp and bpkq of the selected endorsement asset contractor, respectively restoring the public keys bpkp ' and bpkq ' through endorsement signatures SigEndorse1 and SigEndorse2, verifying whether bpkp is consistent with bpkp ', verifying whether bpkq is inconsistent with bpkq ', if one group of data is inconsistent with bpkq ', invalidating the endorsement signature, otherwise, verifying that the endorsement signatures SigEndorse1 and SigEndorse2 are invalid, if any endorsement signature is invalid, continuing execution; otherwise, confirming that the block Blk is valid, and stopping checking;
s3115 when the endorsement signature is invalid, step S385 is executed to check whether the transaction and the transaction receipt of the current block are legal, if so, the block is invalid if not, according to the key name and the value of the state modified by each transaction, calculating the hash value HStateTrie 'of the tree root, and verifying whether the HStateTrie is consistent with the HStateTrie'.
Compared with the prior art, the beneficial effects are that: the invention provides an efficient digital legal coin transaction method based on an account model, which is based on an AFCoin frame, introduces a blockchain forest and a random selection method, integrates a receipt processing link, realizes parallel processing of blockchains of a plurality of asset contractors, perfects the AFCoin technical frame, and takes transaction of users in the individual asset contractors as an example, and shows the efficient digital legal coin transaction method based on the account model. The content of the present invention can be extended with technical details of the present invention with reference to the technical framework of AFCoin when dealing with user transactions involving multiple asset contractors.
Drawings
FIG. 1 is a schematic flow chart of the method of the present invention.
Detailed Description
Example 1
In the embodiment, an ECDSA algorithm is adopted as a digital signature algorithm, an elliptic curve is secp256k1, an SHA-256 algorithm is adopted as a safe hash function, a wallet address of a user is generated by adopting an Ethernet wallet address generation algorithm, and an HMAC-DRBG algorithm in NIST SP800-90 is adopted as a pseudo random number generation algorithm.
Let us set asset issuer CB, asset underwriter CMB 1 ,…,CMB nb And blockchain user DU 1 ,…,DU nu Assuming that nb=7 and nu=10000, and that the values of nb and nu can be dynamically changed with the operation of the system, public and private key pairs of all entity institutions are generated by the key generation algorithm of ECDSA, and the asset contractor CMB 1 ,…,CMB nb Respectively having public and private key pairs (bpk) 1 ,bsk 1 ),…,(bpk nb ,bsk nb ),DU 1 ,…,DU nu CMB belonging to the same asset underwriter s And respectively possess public and private key pairs (upk) 1 ,usk 1 ),…,(upk nu ,usk nu )。
Mainly comprises the following implementation steps:
step 1, creating and submitting a transaction: at any time t, DU 1 Through DU 2 Transaction parameters such as account address, value of digital asset v=100, etc. to generate unsigned transaction Tx' and pass DU 1 Is a private key usk of (2) 1 Generating a transaction signature Sig Tx Transmitting signed transaction Tx to asset underwriter CMB 4 Comprising the following substeps:
S11. DU 1 according to v=100, DU 1 Transaction sequence number Nonce of (a) 1 =12345、DU 2 Account address Addr of (2) 2 And transaction generation time t, assembling to obtain unsigned transaction Tx' =t Addr 2 ||v|| Nonce 1 Wherein "||" indicates that the bit string concatenates, each field should be converted into a bit string before assembly;
s12, update DU 1 Transaction sequence number Nonce for local client 1 =12345+1=12346;
S13. According to DU 1 Held ECDSA private key usk 1 Generating a digital signature Sig for said transaction Tx' by means of ECDSA algorithm Tx The digital signature Sig Tx Assembling with the unsigned transaction Tx 'to obtain a transaction tx=tx' |sig Tx
S14. DU 1 To the asset underwriter CMB to which it belongs 4 The transaction Tx is submitted.
Step 2, processing transaction: asset underwriter CMB 4 Receiving from DU 1 Verifying whether the transaction Tx meets the transaction condition, executing the transaction Tx meeting the transaction requirement, and outputting a transaction receipt Recpt, comprising the sub-steps of:
s21 asset underwriter CMB 4 Receiving a transaction Tx, parsing tx=t|addr 2 ||v|| Nonce 1 ||Sig Tx Transaction time t, user DU 2 Account address Addr of (2) 2 Value v of digital asset, user DU 1 Transaction sequence number Nonce of (a) 1 And digital signature Sig Tx
S22 asset underwriter CMB 4 Acquiring a digital signature Sig of the transaction Tx Tx Computing user DU 1 Account address Addr of (2) 1 Verifying the account address Addr 1 And Addr 2 Whether or not the asset underwriter CMB is already in the asset underwriter 4 Registering and rejecting transactions of unregistered accounts;
s23 from asset contractor CMB 4 Acquisition of user DU in blockchain state 1 Is a link transaction sequence number Nonce of (c) 1 ' account balance Bal 1 And user DU 2 Account balance Bal 2 Verifying a transaction execution condition of the transaction Tx, and rejecting a transaction that does not meet the transaction execution condition, the transaction execution condition including: transaction sequence number Nonce of the transaction Tx 1 Whether or not it is greater than or equal to the DU 1 Transaction sequence number Nonce of (a) 1 ' whether the transaction initiation time t is overtime or not, user DU 2 Account address Addr of (2) 2 Whether or not there is a subscriber DU 1 Account balance Bal 1 Whether greater than or equal to a value v of the digital asset;
s24, asset underwriter CMB 4 Computing user DU 1 And DU 2 New state values, comprising: DU (data Unit) 1 New on-chain transaction sequence number Nonce 1 ''= Nonce 1 +1、DU 1 New account balance Bal 1 '=Bal 1 V and DU 2 New account balance Bal 2 '=Bal 2 +v. And recording said new status value to said asset contractor CMB 4 Is in the blockchain state;
s25 asset underwriter CMB 4 Calculating a hash value H of the transaction Tx by SHA-256 algorithm Tx =SHA-256(Addr 2 ||Nonce 1 ||v||t||Sig Tx );
S26, according to the hash value H of the transaction Tx Tx New account balance after transactionAmount and transaction execution time t 2 Respectively user DU 1 And user DU 2 Generating unsigned transaction receipt Recpt 1 ' and Recpt 2 ';
S26, according to the asset underwriter CMB 4 Held ECDSA private key bsk 4 Recpt for the unsigned transaction receipt by ECDSA algorithm 1 ' and Recpt 2 ' separately generating digital signatures Sig Recpt1 Sum Sig Recpt2
S27, the digital signature Sig Recpt1 With Sig Recpt2 And said unsigned transaction receipt Recpt 1 ' and Recpt 2 ' assembled to obtain transaction receipt Recpt 1 And Recpt 2
S28, asset underwriter CMB 4 Submitting the transaction Tx, a transaction receipt Recpt 1 And Recpt 2 And key name and front and back values of the state related to each transaction to the transaction uplink queue, and informing DU 1 The transaction is processed and awaits a chaining.
Step 3, transaction uplink: asset underwriter CMB 4 Will trade Tx 1 ,,Tx n Hash value of (2) and transaction receipt Recpt 1 ,,Recpt n Is packed to form an unsigned block Blk' by CMB 4 Is a private key bsk of (b) 4 Generating a block signature Sig Blk And assembled with the block Blk 'to obtain an un-endorsed block Blk', which is then processed by the asset contractor CMB responsible for endorsing p And CMB q Generating endorsement signature and submitting block Blk carrying endorsement signature and transaction Tx 1 ,/>,Tx n And receipt Recpt 1 ,/>,Recpt n To the asset issuer CB of the vehicle,asset issuer CB verifies the validity of block Blk and issues a valid block to CMB in a blockchain forest 4 Chain of blocks (Chain) 4 Upper part of which is->N=100, the specific steps include:
s31 asset underwriter CMB 4 Collecting transaction Tx 1 ,…,Tx 100 Transaction receipt Recpt 1 ,…,Recpt 100 And the key name and the front and back values of the state related to each transaction, wherein the transactions are arranged according to the execution time sequence of the transactions;
s32 asset underwriter CMB 4 According to transaction Tx 1 ,…,Tx 100 And transaction receipt Recpt 1 ,…,Recpt 100 Forming a transaction tree and a receipt tree respectively through an MPT tree algorithm, and calculating to obtain a hash value H of the tree root of the transaction tree through an SHA-256 algorithm TxTrie And the hash value H of the root of the receipt tree RecptTrie
S33 asset underwriter CMB 4 Acquiring the asset underwriter CMB 4 State tree of the last block of (2) according to the transaction Tx 1 ,…,Tx 100 The key name and the front and back values of the related state, the state tree stateTrie' is updated by a state tree updating algorithm, a verifiable state tree is generated by a verifiable state tree generating method, and a new state tree stateTrie and a verifiable state tree stateTrie are obtained v The hash value H of the tree root of the state tree stateTrie is obtained through calculation of SHA-256 algorithm StateTrie The method comprises the steps of carrying out a first treatment on the surface of the The specific steps of generating the verifiable state tree are as follows:
s331 input State Tree' and transaction Tx 1 ,…,Tx 100 Combining the key names and the front and back values of all the related states, combining the states of the same key name, enabling the front value to be the back value of the state tree of the previous block, and enabling the back value to be the current transaction Tx 1 ,…,Tx 100 A value formed after execution is completed;
s332, traversing all the related states, marking the node of each state and the father node in the state tree stateTrie' until the father node is marked or the father node is the root node;
s333, traversing the state tree stateTrie' from the root node to the depth, and continuing traversing the node downwards when the node is a branch node and is not marked, otherwise adding the key and hash value of the node into the array, and finally obtaining the verifiable state tree stateTrie composed of the key and hash value of the marked node v
S34 asset underwriter CMB 4 From the asset contractor CMB 4 The block head of the last block is queried in the block chain of the block, and the hash value H of the block head of the last block is calculated through the SHA-256 algorithm BlkPrev
S35 asset underwriter CMB 4 According to the hash value H of the block head of the previous block BlkPrev Hash value H of the root of the transaction tree TxTrie Hash value H of the root of the receipt tree RecptTrie Hash value H of the tree root of the state tree StateTrie StateTrie And block generation time t 3 Assembling to obtain a block Blk' which is not signed and endorsed;
s36, according to the asset underwriter CMB 4 The held private key bsk 4 The asset underwriter CMB 4 Generating a digital signature Sig for said unsigned and unscrambled block Blk Blk' And the unsigned and unscrambled block Blk' is combined with a digital signature Sig Blk' Assembling to obtain an unordered block Blk';
s37 asset underwriter CMB 4 Calculating the block head hash value H of the last block by SHA-256 algorithm BlkPrev And based on the hash value H BlkPrev And calculating to obtain an endorsed asset underwriting party CMB corresponding to the block Blk' by selecting an endorsed asset underwriting party p And CMB q Wherein p and q are natural numbers,,/>,/>the specific steps for selecting an endorsement asset underwriter are as follows:
s371, inputting the hash value H of the block head of the previous block BlkPrev And the set of current asset contractors { CMB 1 ,…,CMB 7 };
S372, using HMAC-DRBG pseudo random number generation algorithm to hash the block header of the previous block to H BlkPrev As a random number seed, generating a number r=123, calculating index=r% nb+1=123%7+1=5, and when index and s continue to execute the pseudo-random number generation algorithm, generating new numbers r and index, otherwise, obtaining a first asset underwriting party subscript p=5 responsible for endorsement;
s373. Continuing the pseudo random number generation algorithm of step S372, according to the same procedure, obtaining r=456, calculating index=2, obtaining the second asset underwriting party subscript q=2, which is responsible for endorsements, wherein
S38 asset underwriter CMB 4 The block Blk' is processed to deal with Tx 1 ,…,Tx 100 Transaction receipt Recpt 1 ,…,Recpt 100 Key name and front-to-back value and the asset underwriter CMB for the status involved in each transaction 4 Is related to the last block v The asset contractor CMB responsible for endorsements, sent to the block Blk ", corresponding thereto 5 And CMB 2 The asset underwriter CMB 5 And CMB 2 Verifying the validity of the block and the transaction receipt in the block, and the block verifying the validity of the transaction receipt, wherein the asset underwriter CMB 5 And CMB 2 Respectively send and send back endorsement signature Sig Endorse1 Sum Sig Endorse2 Wherein CMB 5 And CMB 2 The specific steps of verifying the validity of the transaction and the transaction receipt in the block are as follows:
s381 query asset underwriter CMB 4 The block head of the previous block is calculated by SHA-256 algorithm BlkPrev' And extracting the previous regionThe hash value of the tree root of the state tree in the block header is denoted as H StateTriePrev
S382 based on the verifiable State Tree v The state tree stateTrie' of the last block is formed by MPT tree algorithm, and the tree root hash value H of the state tree of the last block is calculated by SHA-256 algorithm StateTriePrev' And verify H StateTriePrev Whether or not to match H StateTriePrev' If the block is inconsistent, the block is invalid;
s383 according to transaction Tx 1 ,…,Tx 100 And transaction receipt Recpt 1 ,…,Recpt 100 Forming a transaction tree and a receipt tree respectively through an MPT tree algorithm, and calculating to obtain a hash value H of the tree root of the transaction tree through an SHA-256 algorithm TxTrie' And the hash value H of the root of the receipt tree RecptTrie' ;
S384, extracting the hash value H of the block header of the previous block from the block Blk' BlkPrev Hash value H of tree root of current block transaction tree TxTrie Hash value H of the root of a receipt tree TxTrie And hash value H of tree root of state tree StateTrie Verify H BlkPrev Whether or not to match H BlkPrev' Is consistent with H TxTrie Whether or not to match H TxTrie' Coincidence and H RecptTrie Whether or not to match H RecptTrie' If any group of data is inconsistent, the block is invalid;
s385, according to the status tree StateTrie', the transaction Tx 1 ,…,Tx 100 Performing the calculation and checking steps of S23 to S26 to obtain a new state tree stateTrie, and calculating the root hash value H by the SHA-256 algorithm StateTrie' And verify H StateTrie Whether or not to match H StateTrie' And if the block is inconsistent, the block is invalid.
S39 asset underwriter CMB 4 Signature Sig from the block Blk' and endorsement Endorse1 With Sig Endorse2 Constructing a new block Blk;
s310, asset underwriter CMB s Will trade Tx 1 ,…,Tx 100 Transaction receipt Recpt 1 ,…,Recpt 100 Each of the followingThe key name and the final value of the state related to the pen transaction and the information of the new blocks such as the block Blk are sent to an asset issuer CB;
s311, the asset issuer CB receives the information of the new block Blk, verifies the validity of said block Blk, and updates the valid block to the asset contractor CMB 4 Chain of blocks (Chain) 4 Wherein the specific steps of CB verifying the validity of said block Blk are as follows:
s3111 query asset underwriter CMB 4 The block head of the previous block is calculated by SHA-256 algorithm to obtain the hash value H of the block head of the previous block BlkPrev
S3112 according to transaction Tx 1 ,…,Tx 100 And transaction receipt Recpt 1 ,…,Recpt 100 Forming a transaction tree and a receipt tree respectively through an MPT tree algorithm, and calculating to obtain a hash value H of the tree root of the transaction tree through an SHA-256 algorithm TxTrie' And the hash value H of the root of the receipt tree RecptTrie' ;
S3113 extracting the hash value H of the block header of the previous block from the block Blk BlkPrev Hash value H of tree root of current block transaction tree TxTrie Hash value H of the root of a receipt tree TxTrie Hash value H of tree root of state tree StateTrie Digital signature Sig Blk Endorsement signature Sig Endorse1 Sum Sig Endorse2 Verify H BlkPrev Whether or not to match H BlkPrev' Is consistent with H TxTrie Whether or not to match H TxTrie' Is consistent with H RecptTrie Whether or not to match H RecptTrie' Agreement and passing of digital signature Sig Blk Whether or not the restored public key is matched with bpk s If the data of one group is inconsistent, the block is invalid;
s3114 inputting the hash value H of the block header of the previous block BlkPrev And the set of current asset contractors { CMB 1 ,…,CMB 7 Executing the substep of selecting an endorsement asset underwriter in step S37, obtaining the public key bpk of the selected endorsement asset underwriter 2 And bpk 5 Signature Sig by endorsement Endorse1 Sum Sig Endorse2 Separately recovering public keysbpk 2' And bpk 5' And verify bpk 2 Whether or not to sum bpk 2' Concordance bpk 5 Whether or not to sum bpk 5' If one group of data is inconsistent, the endorsement signature is invalid, otherwise, the endorsement signature Sig is verified Endorse1 Sum Sig Endorse2 If any endorsement signature verifies errors, the endorsement signature is invalid and the execution is continued; otherwise, confirming that the block Blk is valid, and stopping checking;
s3115 when endorsement signature is invalid, executing step S385 to check whether transaction and receipt of current block are legal, if so, calculating root hash value H by SHA-256 algorithm according to key name and value of modified state of each transaction StateTrie' And verify H StateTrie Whether or not to match H StateTrie' And if the block is inconsistent, the block is invalid.
Example 2
Embodiment 2 is similar to the rest of embodiment 1 except that the blockchain system employs a hash_drbg, SHA-3, DSA, SM4, SM2, etc. different pseudo-random number generation algorithm, hash algorithm, and digital signature algorithm.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the invention, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the invention.
It is to be understood that the above examples of the present invention are provided by way of illustration only and not by way of limitation of the embodiments of the present invention. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the invention are desired to be protected by the following claims.

Claims (10)

1. Efficient account modelA digital law coin transaction method is characterized by comprising an asset issuer CB and an asset underwriter CMB 1 ,…,CMB nb User DU 1 ,…,DU nu Where nb and nu are arbitrary natural numbers and the values of nb and nu can be dynamically changed as the blockchain system operates; asset underwriter CMB 1 ,…,CMB nb Respectively having public and private key pairs (bpk) 1 ,bsk 1 ),…,(bpk nb ,bsk nb ) The method comprises the steps of carrying out a first treatment on the surface of the User DU 1 ,…,DU nu The true identity can be registered in different asset underwriters to meet the regulatory requirements of the financial system, while the users respectively possess public and private key pairs (upk) 1 ,usk 1 ),…,(upk nu ,usk nu ) The public key of the user further generates an account address of the user; the user's digital asset transaction includes the steps of:
s1, creating and submitting a transaction: user DU i Acquisition of user DU j Setting the value v of the digital asset to generate an unsigned transaction Tx' and pass through the user DU i Is a private key usk of (2) i Generating a transaction signature Sig Tx Transmitting signed transaction Tx to asset underwriter CMB s Wherein,/>
S2, processing transaction: asset underwriter CMB s Receiving DU from user i Verifying whether the transaction Tx meets the transaction condition, processing the transaction Tx meeting the transaction condition, and outputting a transaction receipt Recpt;
s3, transaction uplink: asset underwriter CMB s Will trade Tx 1 ,,Tx n Hash value of (2) and transaction receipt Recpt 1 ,/>,Recpt n Is packed to form an unsigned block Blk' by CMB s Is a private key bsk of (b) s Generating a block signature Sig Blk And the block Blk ' is assembled to obtain an un-endorsed block Blk ', and then the endorsed block Blk ' is taken charge of the endorsed asset contractor CMB p And CMB q Generating endorsement signature and submitting block Blk carrying endorsement signature and transaction Tx 1 ,/>,Tx n And receipt Recpt 1 ,/>,Recpt n To the asset issuer CB, the asset issuer CB verifies the validity of the block Blk and issues a valid block to block chain forest CMB s Chain of blocks (Chain) s Upper part of which is->N is a natural number.
2. The efficient digital money transaction method based on account model according to claim 1, wherein the step S1 specifically includes:
s11 user DU i According to the value v of the digital asset, user DU i Transaction sequence number Nonce of (a) i User DU j Account address Addr of (2) j And transaction generation time t, assembling to obtain unsigned transaction Tx';
s12, updating user DU i The transaction serial number of the local client is Nonce i +1;
S13, according to user DU i The held private key usk i Generating a digital signature Sig for a transaction Tx Tx Digital signature Sig Tx Assembling with unsigned transaction Tx' to obtain transaction Tx;
s14. DU to user i Asset underwriter CMB of (1) s The transaction Tx is submitted.
3. The efficient digital money transaction method based on account model according to claim 2, wherein the step S2 body includes:
s21 asset underwriter CMB s Receiving transaction Tx, resolving value v of digital asset, user DU i Transaction sequence number Nonce of (a) i User DU j Account address Addr of (2) j Transaction generation time t and digital signature Sig Tx
S22 asset underwriter CMB s Acquiring a digital signature Sig of the transaction Tx Tx Computing user DU i Account address Addr of (2) i Verifying the account address Addr i And Addr j Whether or not the asset underwriter CMB is already in the asset underwriter s Registering and rejecting transactions of unregistered accounts;
s23 from asset contractor CMB s Acquisition of user DU in blockchain state i Is a link transaction sequence number Nonce of (c) i '、DU i Account balance Bal i And user DU j Account balance Bal j Verifying the transaction execution conditions of the transaction Tx and rejecting the transaction which does not meet the transaction execution conditions;
s24, asset underwriter CMB s Computing user DU i And user DU j A new state value;
s25 asset underwriter CMB s Calculating hash value H of transaction Tx Tx =Hash(Addr j ||Nonce i ||v||t||Sig Tx );
S26, according to the hash value H of the transaction Tx Tx New account balance after transaction and transaction execution time t 2 Respectively user DU i And user DU j Generating unsigned transaction receipt Recpt 1 ' and Recpt 2 ';
S27, according to the asset underwriter CMB s The held private key bsk s Recpt for the unsigned transaction receipt 1 ' and Recpt 2 ' separately generating digital signatures Sig Recpt1 Sum Sig Recpt2
S28, the digital signature Sig Recpt1 With Sig Recpt2 And said unsigned transaction receipt Recpt 1 ' and Recpt 2 ' assembled to obtain transaction receipt Recpt 1 And Recpt 2
S29 asset underwriter CMB s Submitting the transaction Tx, a transaction receipt Recpt 1 And Recpt 2 Key name and front and back values of the state related to the transaction are sent to a transaction uplink queue, and a user DU is notified i The transaction is processed and awaits a chaining.
4. An efficient digital money transaction method based on account model according to claim 3, characterized in that user DU is calculated i And user DU j New state values, comprising: user DU i New on-chain transaction sequence number Nonce i ''=Nonce i +1, user DU i New account balance Bal i '=Bal i V and subscriber DU j New account balance Bal j '=Bal j +v and updating the new state value to the asset contractor CMB s Is in the blockchain state.
5. A method of efficient digital money transaction based on an account model as in claim 3 wherein the transaction execution conditions include: transaction sequence number Nonce of the transaction Tx i Whether or not the user DU is greater than or equal to i Is a link transaction sequence number Nonce of (c) i ' whether the transaction initiation time t is overtime or not, user DU j Account address Addr of (2) j Whether or not there is the user DU i Account balance Bal i Whether greater than or equal to the value v of the digital asset.
6. The efficient digital money transaction method according to claim 3, wherein the step S3 specifically includes:
s31 asset underwriter CMB s Collecting transaction Tx 1 ,…,Tx n Transaction receipt Recpt 1 ,…,Recpt n And the key name and the front and back values of the state related to each transaction according to the followingThe transaction execution time sequence is arranged;
s32 asset underwriter CMB s According to transaction Tx 1 ,…,Tx n And transaction receipt Recpt 1 ,…,Recpt n Forming a transaction tree and a receipt tree respectively by MPT tree algorithm, and calculating to obtain the hash value H of the tree root of the transaction tree TxTrie And the hash value H of the root of the receipt tree RecptTrie
S33 asset underwriter CMB s Acquiring the asset underwriter CMB s State tree of the last block of (2) according to transaction Tx 1 ,…,Tx n The key name and the front and back values of the related state, the state tree stateTrie' is updated by a state tree updating algorithm, a verifiable state tree is generated by a verifiable state tree generating method, and a new state tree stateTrie and a verifiable state tree stateTrie are obtained v Calculating to obtain the hash value H of the tree root of the state tree stateTrie StateTrie
S34 asset underwriter CMB s From the asset contractor CMB s Querying the block head of the previous block in the block chain, and calculating the hash value H of the block head of the previous block BlkPrev
S35 asset underwriter CMB s According to the hash value H of the block head of the previous block BlkPrev Hash value H of the root of the transaction tree TxTrie Hash value H of the root of the receipt tree RecptTrie Hash value H of the tree root of the state tree StateTrie StateTrie And block generation time t 3 Assembling to obtain a block Blk' which is not signed and endorsed;
s36, according to the asset underwriter CMB s The held private key bsk s The asset underwriter CMB s Generating a digital signature Sig for said unsigned and unscrambled block Blk Blk' And the unsigned and unscrambled block Blk' is combined with a digital signature Sig Blk' Assembling to obtain an unordered block Blk';
s37 asset underwriter CMB s Calculating the block head hash value H of the previous block BlkPrev And based on the hash value H BlkPrev And calculating to obtain an endorsed asset underwriting party CMB corresponding to the block Blk' by selecting an endorsed asset underwriting party p And CMB q
S38 asset underwriter CMB s The block Blk' is processed to deal with Tx 1 ,…,Tx n Transaction receipt Recpt 1 ,…,Recpt n Key name and front-to-back value and the asset underwriter CMB for the status involved in each transaction s Is related to the last block v The asset contractor CMB responsible for endorsements, sent to the block Blk ", corresponding thereto p And CMB q The asset underwriter CMB p And CMB q Verifying the validity of the block and the transaction receipt in the block, and the block verifying the validity of the transaction receipt, wherein the asset underwriter CMB p And CMB q Respectively send and send back endorsement signature Sig Endorse1 Sum Sig Endorse2
S39 asset underwriter CMB s Signature Sig from the block Blk' and endorsement Endorse1 With Sig Endorse2 Constructing a new block Blk;
s310 asset underwriter CMB s Will trade Tx 1 ,…,Tx n Transaction receipt Recpt 1 ,…,Recpt n The key name and the final value of the state related to each transaction and the information of the new block Blk are sent to an asset issuer CB;
s311, the asset issuer CB receives the information of the new block Blk, verifies the validity of said block Blk, and updates the valid block to the asset contractor CMB s Chain of blocks (Chain) s Is a kind of medium.
7. The efficient digital money transaction method based on account model according to claim 6, wherein the generating of the verification tree in step S33 specifically includes:
s331 input State Tree' and transaction Tx 1 ,…,Tx n Combining the key names and the front and back values of all the related states, combining the states of the same key name, enabling the front value to be the back value of the state tree of the previous block, and enabling the back value to be the back value of the state tree of the previous blockThe value is the current transaction Tx 1 ,…,Tx n A value formed after execution is completed;
s332, traversing all the related states, marking the node of each state and the father node in the state tree stateTrie' until the father node is marked or the father node is the root node;
s333, traversing the state tree stateTrie' from the root node to the depth, and continuing traversing the node downwards when the node is a branch node and is not marked, otherwise adding the key and hash value of the node into the array, and finally obtaining the verifiable state tree stateTrie composed of the key and hash value of the marked node v
8. The efficient digital money transaction method according to claim 6, wherein the CMB in step S37 s The step of selecting an endorsement asset underwriter specifically includes:
s371, inputting a block header hash value HBlkPrev of the previous block and a set { CMB1, …, CMBnb };
s372, using pseudo-random number generation algorithm to hash the block header of the previous block to H BlkPrev As a random number seed, generating a number r, calculating index=r% nb+1, continuously executing the pseudo-random number generation algorithm when the index is the same as s, generating a new number r and index, otherwise, obtaining a first asset underwriting party index p responsible for endorsement;
s373, continuing to execute the pseudo random number generation algorithm of the step S372, and obtaining a second asset underwriting party subscript q responsible for endorsement according to the same process, wherein
9. The efficient digital money transaction method according to claim 6, wherein the asset contractor CMB in step S38 p And CMB q A method of verifying validity of transactions and transaction receipts in blocks, comprising the steps of:
s381 query asset underwriter CMB s Calculating the hash value H of the block head of the previous block BlkPrev' Extracting the hash value of the tree root of the state tree in the previous block head, and marking the hash value as H StateTriePrev
S382 based on the verifiable State Tree v The tree root hash value H of the state tree of the last block is calculated by constructing the state tree StateTrie' of the last block through an MPT tree algorithm StateTriePrev' And verify H StateTriePrev Whether or not to match H StateTriePrev' If the block is inconsistent, the block is invalid;
s383 according to transaction Tx 1 ,…,Tx n And transaction receipt Recpt 1 ,…,Recpt n Forming a transaction tree and a receipt tree respectively by MPT tree algorithm, and calculating to obtain the hash value H of the tree root of the transaction tree TxTrie' And the hash value H of the root of the receipt tree RecptTrie'
S384, extracting the hash value H of the block header of the previous block from the block Blk' BlkPrev Hash value H of tree root of current block transaction tree TxTrie Hash value H of the root of a receipt tree TxTrie And hash value H of tree root of state tree StateTrie Verify H BlkPrev Whether or not to match H BlkPrev' Is consistent with H TxTrie Whether or not to match H TxTrie' Coincidence and H RecptTrie Whether or not to match H RecptTrie' If any group of data is inconsistent, the block is invalid;
s385, according to the status tree StateTrie', the transaction Tx 1 ,…,Tx n Performing the steps of B3 to B6 to obtain a new state tree stateTrie, and calculating a root hash value H StateTrie' And verify H StateTrie Whether or not to match H StateTrie' And if the block is inconsistent, the block is invalid.
10. The efficient digital money transaction method according to claim 6, wherein the method for verifying the validity of the block Blk by the asset issuer CB in step S311 specifically comprises:
s3111 query asset underwriter CMB s The block head of the previous block calculates the hash value H of the block head of the previous block BlkPrev
S3112 according to transaction Tx 1 ,…,Tx n And transaction receipt Recpt 1 ,…,Recpt n Forming a transaction tree and a receipt tree respectively through an MPT tree algorithm, and calculating to obtain a hash value H of the tree root of the transaction tree TxTrie' And the hash value H of the root of the receipt tree RecptTrie'
S3113 extracting the hash value H of the block header of the previous block from the block Blk BlkPrev Hash value H of tree root of current block transaction tree TxTrie Hash value H of the root of a receipt tree TxTrie Hash value H of tree root of state tree StateTrie Digital signature Sig Blk Endorsement signature Sig Endorse1 Sum Sig Endorse2 Verify H BlkPrev Whether or not to match H BlkPrev' Is consistent with H TxTrie Whether or not to match H TxTrie' Is consistent with H RecptTrie Whether or not to match H RecptTrie' Agreement and passing of digital signature Sig Blk Whether or not the restored public key is matched with bpk s If the data of one group is inconsistent, the block is invalid;
s3114 inputting the hash value H of the header of the previous block BlkPrev And the set of current asset contractors { CMB 1 ,…,CMB nb Executing the substep of selecting an endorsement asset underwriter in step S37, obtaining the public key bpk of the selected endorsement asset underwriter p And bpk q Signature Sig by endorsement Endorse1 Sum Sig Endorse2 Respectively restoring the public keys bpk p' And bpk q' And verify bpk p Whether or not to sum bpk p' Concordance bpk q Whether or not to sum bpk q' If one group of data is inconsistent, the endorsement signature is invalid, otherwise, the endorsement signature Sig is verified Endorse1 Sum Sig Endorse2 If any endorsement signature verifies errors, the endorsement signature is invalid and the execution is continued; otherwise, confirming that the block Blk is valid, and stopping checking;
s3115 when the endorsement signature is invalid, step S385 is executed to check whether the transaction and receipt of the current block are legal, and if so, a new state tree StateTrie is calculated based on the key name and value of the state modified by each transaction, and the hash value H of the tree root is calculated StateTrie' And verify H StateTrie Whether or not to match H StateTrie' And if the block is inconsistent, the block is invalid.
CN202011302822.7A 2020-11-19 2020-11-19 Efficient digital legal coin transaction method based on account model Active CN112419059B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011302822.7A CN112419059B (en) 2020-11-19 2020-11-19 Efficient digital legal coin transaction method based on account model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011302822.7A CN112419059B (en) 2020-11-19 2020-11-19 Efficient digital legal coin transaction method based on account model

Publications (2)

Publication Number Publication Date
CN112419059A CN112419059A (en) 2021-02-26
CN112419059B true CN112419059B (en) 2023-07-21

Family

ID=74773058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011302822.7A Active CN112419059B (en) 2020-11-19 2020-11-19 Efficient digital legal coin transaction method based on account model

Country Status (1)

Country Link
CN (1) CN112419059B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108282474A (en) * 2018-01-18 2018-07-13 山东大学 The maintaining method of digital asset trade identity based on block chain
CN110838064A (en) * 2019-10-12 2020-02-25 华中科技大学 Method and system for realizing asset tracing based on Fabric Block Link platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101841566B1 (en) * 2016-10-11 2018-05-04 주식회사 코인플러그 Method for issuing, using, refunding, settling and revocating electric voucher using updated status of balance database by respective blocks in blockchain, and server using the same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108282474A (en) * 2018-01-18 2018-07-13 山东大学 The maintaining method of digital asset trade identity based on block chain
CN110838064A (en) * 2019-10-12 2020-02-25 华中科技大学 Method and system for realizing asset tracing based on Fabric Block Link platform

Also Published As

Publication number Publication date
CN112419059A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
US20240095728A1 (en) Blockchain system for confidential and anonymous smart contracts
US20220084013A1 (en) Identity management, smart contract generator, and blockchain mediating system, and related methods
CN110419055B (en) Blockchain data protection based on account ticket model with zero knowledge proof
CN108805564B (en) Payment settlement method and system based on block chain
US20220094674A1 (en) Techniques For Secure Blockchain Management
CN109074562B (en) Combined data transmission control method and system based on block chain
KR102050129B1 (en) Block chain supporting multiple one-way functions used for verification of blocks
CN110730963B (en) System and method for information protection
CN109544129B (en) Block chain transaction method and device and electronic equipment
CN110520881A (en) Method and system for secure data record distribution using blockchains
CN110135964A (en) A kind of financial accounting method based on block chain technology
JP2015515032A (en) Electronic check-based payment system and method for issuing, transferring, paying and verifying electronic checks
US20220067717A1 (en) Blockchain system that includes bank nodes each having separate ledgers for identity, digital currency and other functions, and operation method thereof
Garg Blockchain for real world applications
CN111062717B (en) Data transfer processing method, device and computer readable storage medium
Liu et al. An efficient strategy to eliminate malleability of bitcoin transaction
CN112288415B (en) Currency age mechanism implementation method for UTXO architecture
CN112419059B (en) Efficient digital legal coin transaction method based on account model
KR20210117731A (en) The blockchain-based transaction history confirmation system
CN110298156A (en) Resource acquiring method, device, equipment and storage medium based on In vivo detection
EP3952207A1 (en) Secure transfer of data units using sharded blockchain
Rasheed et al. Blockchain mobile wallet with secure offline transactions
US20210049567A1 (en) Universal payment channels
CN110535664A (en) Data processing method, device, server and storage medium based on block chain
Mwale Modelling the dynamics of the bitcoin blockchain

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