[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113850578B - Method, system, equipment and storage medium for value circulation on chain under DAG structure based on account chain and daemon chain - Google Patents

Method, system, equipment and storage medium for value circulation on chain under DAG structure based on account chain and daemon chain Download PDF

Info

Publication number
CN113850578B
CN113850578B CN202111136089.0A CN202111136089A CN113850578B CN 113850578 B CN113850578 B CN 113850578B CN 202111136089 A CN202111136089 A CN 202111136089A CN 113850578 B CN113850578 B CN 113850578B
Authority
CN
China
Prior art keywords
chain
daemon
account
block
deposit
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
CN202111136089.0A
Other languages
Chinese (zh)
Other versions
CN113850578A (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.)
Anhui Zhongke Lattice Technology Co ltd
Original Assignee
Anhui Zhongke Lattice Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Zhongke Lattice Technology Co ltd filed Critical Anhui Zhongke Lattice Technology Co ltd
Priority to CN202111136089.0A priority Critical patent/CN113850578B/en
Publication of CN113850578A publication Critical patent/CN113850578A/en
Application granted granted Critical
Publication of CN113850578B publication Critical patent/CN113850578B/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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Technology Law (AREA)
  • Marketing (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention also provides an on-chain value transfer method under the DAG structure based on the account chain and the daemon chain, which comprises the following steps: when the block of the daemon chain or the account chain is generated, firstly comparing the synchronous record number with the synchronous deposit number, and then updating the synchronous record number and the synchronous deposit number according to rules; and updating balance according to rules when the account chain block is generated. The invention also provides a value circulation system on the chain, which comprises an account information module, an account information updating module, a world state tree module and a world state tree information updating module. And an apparatus and a storage medium based on the streaming method. The intelligent contract transfer system and the intelligent contract transfer method effectively solve the intelligent contract transfer problem under the multi-chain parallel structure. And the account chain receives the transfer scene of the daemon chain reasonably, the node rewards on the daemon chain can be normally distributed to the corresponding node accounts, and the transaction commission can also be returned to the related accounts of the account chain.

Description

Method, system, equipment and storage medium for value circulation on chain under DAG structure based on account chain and daemon chain
Technical Field
The invention relates to the technical field of blockchains, in particular to an on-chain value streaming method under a DAG structure based on account chains and daemon chains, a system, equipment and a storage medium.
Background
The blockchain is a single chain composed of blocks (blocks) and can only be written in turn according to the out-of-Block time synchronization as if it were a single-core single-thread CPU.
The throughput of a blockchain is limited by the size of the block, and if the block is too small, many transactions cannot be packed into the block if the transaction amount is large. If the block is too large, the entire blockchain system will expand rapidly, and the average user will not be able to run the full node, which will create a centralization problem.
Later, some blockchain projects based on DAG topological structures appear, the projects attempt to apply the characteristics of the DAG to improve the defects of the traditional distributed ledger technique with the chained structure, a blockless concept is introduced, the relationship is directly confirmed and maintained by transactions, a packing link is omitted, and a new distributed ledger realization idea is brought.
The DAG is collectively called a directed acyclic graph. In a DAG, all nodes point in the same direction, so it is acyclic. No element can be referenced back to itself. It is a data structure that allows only unidirectional information flow.
In addition, in another patent of the present inventor, namely, a system and a method for DAG block chain structure based on account chain and daemon chain, a system for DAG block chain structure based on account chain and daemon chain is described, the system for DAG block chain structure based on account chain and daemon chain comprises: a sender account chain, a receiver account chain, and a daemon chain;
The sender account chain is used for creating a transaction sending block when a transaction needs to be initiated, carrying out private key signing on the transaction sending block to obtain a signature transaction sending block, and broadcasting the signature sending transaction block;
the receiver account chain is used for creating a transaction receiving block after the signature transaction sending block is witnessed in an account chain witness network, and a first block key is established between the transaction receiving block and the transaction sending block;
The sender account chain is further used for sending transfer transactions based on the transaction sending block;
The receiver account chain is further configured to receive the transfer transaction based on the transaction receiving block;
The daemon chain is used for acquiring the first current state information of the transaction sending block and the second current state information of the transaction receiving block, packaging the first current state information and the second current state information, and storing the packaged first current state information and the packaged second current state information so as to daemon the transfer transaction.
Optionally, the sender account chain is further configured to create a contract deployment block when a contract needs to be deployed, and issue a contract transaction through the contract deployment block;
The daemon chain is further used for performing contract deployment according to the contract deployment block;
The receiver account chain is further used for creating a contract execution block when the contract needs to be executed, creating a second block key between the contract deployment block and the contract execution block, and calling the contract transaction through the contract execution block;
The daemon chain is further used for executing the contract according to the contract executing block, acquiring third current state information of the contract deploying block and fourth current state information of the contract executing block, packaging the third current state information and the fourth current state information, and storing the packaged third current state information and the fourth current state information to complete a contract calling flow.
However, in the DAG-based method, there is no good method for how to realize the transfer of value on the chain under the multi-chain structure.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention aims to solve the problems and provide an on-chain value streaming method under a DAG structure based on account chains and daemon chains.
In order to achieve the above object, the technical scheme of the present invention is as follows:
The invention also provides a method for value circulation on the chain under the DAG structure based on the account chain and the daemon chain, when the daemon chain or the block of the account chain is generated, the method comprises the following procedures: s1, acquiring information to be compared; s2, comparing information; s3, updating the related information according to the rule.
Further, in step S1, the information to be compared includes a daemon chain record point and an account chain record point.
Further, the information to be compared in step S1 includes a daemon chain deposit and a daemon chain deposit received by the account chain.
Further, when the daemon chain generates a block, S1 includes the following procedures: s11, obtaining information to be compared in a previous generation daemon chain block; s12, obtaining information to be compared in the packed account chain blocks.
Further, when the account chain generates the block, S1 includes the following procedures: s13, obtaining information to be compared in the previous generation account block; s14, pointing to the latest daemon block on the account chain through a reference relation, and acquiring information to be compared in the latest daemon block.
In order to achieve the above purpose, the present invention further provides an on-chain value circulation system under the DAG structure based on the account chain and the daemon chain, which comprises an account information module, an account information update module, a world state tree module and a world state tree information update module.
Further, the account information module comprises a balance module, an account chain record point module and a daemon chain deposit module which is received by an account chain.
Further, the world state tree comprises a daemon chain record point module and a daemon chain deposit module.
In order to achieve the above object, the present invention further provides an on-chain value circulation device under a DAG structure based on an account chain and a daemon chain, which is characterized by comprising: the system comprises a memory, a processor and an on-chain value transfer program which is stored in the memory and can run on the processor and is based on an account chain and a daemon, wherein the on-chain value transfer program is configured with all or a certain flow for realizing an on-chain value transfer method under the account chain and daemon-based DAG structure.
In order to achieve the above object, the present invention further provides a storage medium, on which an on-chain value transfer program under a DAG structure based on an account chain and a daemon chain is stored, wherein the on-chain value transfer program under the DAG structure based on the account chain and the daemon chain implements all or a certain flow of an on-chain value transfer method under the DAG structure based on the account chain and the daemon chain when being executed.
By adopting the technical scheme, the intelligent contract transfer problem under the multi-chain parallel structure is effectively solved. And the account chain receives the transfer scene of the daemon chain reasonably, the node rewards on the daemon chain can be normally distributed to the corresponding node accounts, and the transaction commission can also be returned to the related accounts of the account chain.
Drawings
FIG. 1 is a flow chart of the transfer of account A to account B via a smart contract in accordance with the present invention.
FIG. 2 is a flow chart of account A and account C transferring accounts to account B via a smart contract (case Y).
FIG. 3 is a flow chart of account A and account C transferring accounts to account B via a smart contract (case W).
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Under the DAG schema structure of the multi-account chain and the single daemon chain, the intelligent contract can store the token, can transfer accounts, and supports account separation, and simultaneously transfers a plurality of accounts. But the intelligent contract only runs in the daemon chain, and the value on the chain needs to be transferred under the multi-chain structure, so that account chain transfer to the daemon chain, and the maintenance chain transfer to the account chain, the commission fee and commission fee return generated in the transaction process and the like are realized, and the value on the chain under the multi-chain parallel structure is ensured to flow.
Example 1: the invention relates to a value circulation method on a chain under a DAG structure based on an account chain and a daemon chain, wherein the account chain is independently counted by each account, a single transaction is taken as a single block, and a chain structure is formed according to a sequence, which is called an account chain. Each account forms a chain of accounts. The account chain block mainly comprises a sending transaction block, a receiving transaction block, a contract deployment block and a contract execution block. The first block on each account chain is a transaction receiving block, and the creation of the account chain is completed by receiving the first transmitted transaction of other accounts to the account.
The transaction block or the contract deployment block on the account chain mainly comprises a header, a body and other information, wherein the header mainly comprises the information of transaction types, receivers, senders, hash of a father block, transaction amount and the like; the body mainly contains information such as balance, the received daemon chain deposit of the account chain, account chain record points and the like.
The reference relation generated by the sending transaction and the receiving transaction between account chains is called a Block key, and the account chains are mutually linked through the Block key (Block Bond) to form a DAG structure, and the DAG structure is similar to a lattice model, and is also called an account lattice.
The account chain mainly comprises common nodes, witness nodes and the like. The common node is a node for implementing transaction in the account chain and is mainly responsible for generating various transaction blocks in the account chain; the witness node is a full node in the account chain and is composed of authoritative trusted nodes, the functions of block verification, block witness, block uplink, block broadcasting, block storage and the like are completed, the operation of the witness node is supervised by other nodes, and if illegal behaviors occur, punishments such as witness authority, deposit deduction and the like can be received.
The common nodes in the daemon chain generate daemon blocks through the package account chain transaction blocks to form the daemon chain. The daemon block mainly comprises information such as a header, a body and the like, wherein the header mainly comprises information such as world state tree hash, difficulty, block number, father block hash and the like; body is mainly information such as an anchored transaction block.
When the daemon block on the daemon chain is generated, the latest transaction block of the account chain of the current epoch is packaged, and a quotation relationship exists between the latest transaction block and the block on the account chain. When the account blocks on the account chain are generated, the latest daemon blocks on the account chain are pointed through the reference relation so as to acquire the current state and complete witness of the blocks. The reference relationship between the daemon block and the transaction block of the account chain is called a crosslink. The daemon chain mainly witnesses the current account lattice state, and simultaneously the account chain records daemon blocks, and the daemon blocks are mutually crosslinked through crosslinking bonds (Cross-link Bond) to form a final stable lattice structure.
The daemon chain mainly comprises two node types, namely a consensus node and a witness node. The consensus node is responsible for generating blocks in the daemon chain, mainly packing the latest transaction blocks of the account chain; the witness node is a full node in the daemon chain and consists of authoritative trusted nodes, and the functions of block verification, block witness, block uplink, block broadcasting, block storage and the like are completed.
World state is a mapping of account addresses to account states, which are data held by a tree, i.e., a state tree. It is a global state that is updated continuously as transactions are performed, including state information for accounts, transaction blocks, daemons, smart contracts, synchronization points, daemon chain deposits that the account chain has received, and so on. If a balance of an account or the current state of an intelligent contract is required, a world state tree is queried to obtain specific state information of the account. The world state tree is stored in the daemon block and is continuously updated as the daemon block is generated.
The on-chain value flow is mainly between the daemon chain and the account chain. The value circulation scene on the chain comprises intelligent contract transfer, and further comprises the handling fees required by intelligent contract operation, block rewards packed by nodes, the remaining handling fees of contract operation and the like.
For the realization of value circulation on the chain, the invention stores the record point of the daemon chain and the deposit of the daemon chain of each account in the world state tree. The daemon chain record point (DaemonRecord, abbreviated DRecord, below) is initially 0, indicating the number of times the account state is synchronized with the account chain in the daemon chain. The daemon chain deposit (DaemonDeposit, abbreviated DDeposit, infra) is the amount that the recipient account should receive in the world state of the daemon block. The daemon chain deposit (DaemonDeposit) source may be a packaged incentive for the node, may be an intelligent contract transfer amount, may be a contract running excess commission, etc.
The invention also stores account chain record points (AccountRecord, abbreviated ARecord, below) and daemon chain deposits (AccountReceivedDeposit, abbreviated ADeposit, below) that the account chain has received in the body of the account block. The account chain record point is initially 0, and the account chain record point is the same as the daemon chain record point, and indicates the number of times that the account state is synchronized with the daemon chain. The daemon chain deposit that the account chain has received is the daemon chain deposit amount for the corresponding account in the world state tree of the daemon block that the account chain has synchronized.
Furthermore, the invention provides a rule for comparing and updating the related information, thereby realizing the value circulation between the account chain and the daemon chain. It should be noted that, this rule is not only one of the following, and a person skilled in the art may set other rules by himself as required to achieve the technical purpose.
When the daemon chain node packages the account chain block to generate the daemon block, firstly, the information of the previous generation daemon chain block is obtained, the daemon chain record point and the daemon chain deposit in the world state tree are inquired, and compared with the account chain record point and the daemon chain deposit received by the account chain in the account chain block body, whether the daemon chain deposit (DaemonDeposit) is consistent with the daemon chain deposit (AccountReceivedDeposit) received by the account chain or not is judged, and whether the daemon chain record point (DaemonRecord) is consistent with the account chain record point (AccountRecord) or not is judged. The following situations will be included:
Case 1: if both are consistent and neither the daemon chain deposit nor the account chain received daemon chain deposit is 0, then the daemon chain is to clear the daemon chain deposit (DaemonDeposit) and the daemon chain record point (DaemonRecord) +1, indicating that the daemon chain deposit (DaemonDeposit) has been transferred to the account chain;
case 2: if the two are consistent and the daemon chain deposit received by the account chain are both 0, the fact that no other transaction generates the daemon chain deposit after the last synchronization is finished is indicated, at the moment, the daemon chain record point is unchanged, and the daemon chain deposit is added with the numerical value of the new transaction;
Case 3: when the record points of the daemon chain are consistent with the record points of the account chain, but the deposit is different, the state that the daemon chain and the account chain are not synchronized yet is indicated, at the moment, the deposit of the daemon chain is accumulated, namely the record points of the daemon chain are unchanged, and the deposit of the daemon chain adds the numerical value of the new transaction to the original value;
case 4: when the record point of the daemon chain is inconsistent with the record point of the account chain, the record point of the daemon chain is only larger than the record point of the account chain, which indicates that the daemon chain is in a certain account chain block before packaging, the situation 1 appears, the record point of the daemon chain is updated, and the new transaction amount is required to be accumulated into the deposit of the daemon chain at the moment, namely the record point of the daemon chain is unchanged, and the deposit of the daemon chain is added with the value of the new transaction on the original value;
Case 5: if the contract execution block of the account chain is the contract execution block, the account party receiving the transfer does not have the account chain record point of the account and the daemon chain deposit information received by the account chain, and at the moment, the daemon chain record point and the account chain record point are not required to be compared, and only the value of the new transaction is required to be added to the original value of the daemon chain deposit.
It should be noted that the above cases are only examples, and the actual situations may exceed the above examples, or those skilled in the art may make other definitions and changes to the judgment cases or rules in actual needs.
When the account chain generates the block, information of the previous generation account block is acquired, including Balance (Balance) and account chain record points, the daemon chain deposit received by the account chain, and the like. And the latest daemon block on the account chain is pointed by the quotation relation, the world state tree in the daemon block is inquired, and then the account chain record point of the previous generation account block and the daemon chain deposit received by the account chain are compared with the daemon chain record point and the daemon chain deposit of the quotation daemon block, and the following situations are included:
Case a: when the record points of the two are consistent, but the received daemon chain deposit of the account chain is different from the daemon chain deposit, the state of the account is not synchronized between the daemon chain and the account chain, and the deposit is increased due to new transaction, when the daemon chain deposit is received by the account chain, the Balance (Balance) of the account chain is updated to be the original value + the difference between the daemon chain deposit and the daemon chain deposit received by the account chain, and the daemon chain deposit received by the account chain is updated to be consistent with the daemon chain deposit;
Case b: when the record points of the daemon chain and the account chain are inconsistent, if the daemon chain deposit (DaemonDeposit) is not 0, which indicates that the account chain has not started to receive the amount of money in the contract after the last synchronization is completed and a new transaction causes the daemon chain deposit to change, the daemon chain deposit received by the account chain directly receives the daemon chain deposit, namely the daemon chain deposit received by the account chain (AccountReceivedDeposit) is updated to be consistent with the daemon chain deposit (DaemonDeposit), the account chain Balance (Balance) is updated to be the original value+the daemon chain deposit, and the record point of the account chain is updated to the record point of the daemon chain;
Case c: when the record points of the daemon chain and the account chain are inconsistent, if the record point of the daemon chain is 0, the record point of the account chain and the record point of the daemon chain received by the account chain are updated to be consistent with the daemon chain.
It should be noted that the above cases are only examples, and the actual situations may exceed the above examples, or those skilled in the art may make other definitions and changes to the judgment cases or rules in actual needs.
In this way, the on-chain value transfer between the account chain and the daemon chain is completed.
The account chain Balance (Balance) represents the amount that the account currently holds and can be spent, and is calculated from the account chain record point, the deposit of the daemon chain received by the account chain, the amount that the transaction needs to send and the transaction handling fee. Updating the balance of the account chain, namely firstly comparing the record point of the daemon chain with the record point of the account chain, synchronizing the daemon chain deposit with the daemon chain deposit received by the account chain, subtracting the amount required to be transmitted by the transaction, and subtracting the consumption of the commission fee, thereby finally obtaining the balance of the account chain.
In addition, in the value circulation process of contract transfer, two value circulation may be generated by deployment or operation of an intelligent contract on the daemon chain, a packing cost of a node is paid to the daemon chain packing node, and a remaining handling cost is returned to the contract creator.
The following describes the related flow in detail with reference to fig. 1 and 2.
As shown in fig. 1, starting from generation 0 (Epoch 0), the daemon chain starts the daemon chain by the creation block (G), the account chain initializing account block information: account a (R1 block) -Balance (Balance) 200, account chain record point (ARecord) 0, account chain received daemon chain deposit (ADeposit) 0;
Account B (R2 block) -Balance (Balance) 100, account chain record point (ARecord) 0, account chain received daemon chain deposit (ADeposit) 0;
account C (R3 block) -Balance (Balance) 200, account chain record point (ARecord) 0, account chain received daemon chain deposit (ADeposit) 0;
First generation (Epoch 1) daemon block state: account A-daemon chain record point (DRecord) is 0, daemon chain deposit (DDeposit) is 0;
Account B-daemon chain record point (DRecord) is 0, daemon chain deposit (DDeposit) is 0;
Account C-daemon chain record point (DRecord) is 0, daemon chain deposit (DDeposit) is 0;
When the account A needs to transfer a money to the account B through the intelligent contract, the account A can call an intelligent contract which is deployed on a daemon chain to generate a contract execution block (E1), and when the account chain generates the contract execution block (E1), the information of the previous generation account block (R1) is acquired, the Balance (Balance) is 200, an account chain record point (ARecord) is 0, and the daemon chain deposit (ADeposit) received by the account chain is 0. And the latest daemon block (namely, the Epoch1 daemon block) on the account chain is pointed by a quotation relation, the world state tree in the daemon block is queried, the daemon chain record point (DRecord) of the daemon block is obtained to be 0, the daemon chain deposit (DDeposit) is 0, then the daemon chain deposit received by the account chain according to the account chain record point and the account chain of the previous generation account block is compared with the daemon chain record point and the daemon chain deposit of the quotation daemon block, the daemon chain deposit is 0 at the moment, the updating is not needed, the balance is still 200, and then the amount to be transferred to a contract address, namely, the transaction amount (Send) 100 and the estimated commission amount (Fee) 10 are subtracted, and the balance is updated to 90. The account chain block will contain the final relevant information: transaction amount (Send) 100, estimated commission amount (Fee) 10, account chain Balance (Balance) 90, account chain record point (ARecord) 0, and guard chain deposit (ADeposit) 0 that the account chain has received. The account chain nodes are then packaged and witnessed for chaining.
The contract execution block (E1) is packaged by the daemon link points to generate a second generation (Epoch 2) daemon block, when the daemon link nodes are packaged, the information of the previous generation daemon block (namely the Epoch1 daemon block) is acquired, the daemon link record point (DRecord) of the account A in the world state tree is queried to be 0, the daemon link deposit (DDeposit) is 0, and the daemon link record point (ARcord) of the account A in the contract execution block (E1) and the daemon link deposit (ADeposit) received by the account chain are compared, and are both 0, at the moment (Epoch 2), the world state in the daemon block containing the transaction is stored with the latest relevant account information, namely the state of the daemon block account A is updated as follows: the record point (DRecord) of the daemon chain is still 0, and the deposit (Deposit) of the daemon chain is added with the commission fee return 5 of the transaction; because the account B is a contract execution block, the account B for receiving the transfer does not need to compare record point information, and only the daemon chain deposit of the account B needs to be directly updated, namely the state of the account B is updated as follows: the guard chain record point (DRecord) is 0, and the guard chain deposit (DDeposit) is added with the current transaction receipt amount 100.
When the daemon block of the generation 2 (Epoch 2) is uplink, the account A and the account B update the account state of the daemon block synchronously when a new transaction occurs to generate a new account chain block. When the account chain A and the account chain B synchronize the information of the daemon blocks on the daemon chains, the balance of the account chain is updated according to the record points of the account chain on the previous generation of the account chain block and the record points of the daemon chain and the daemon chain deposit corresponding to the account of the world state tree in the latest daemon block which is referred by the comparison of the received deposit of the daemon chain, so that the value circulation related in the contract transfer process is completed.
The specific updating process is as follows: when the account a generates a new account chain block (S1), in the latest (i.e. Epoch 2) daemon block referenced, the daemon chain record point (DRecord) =0, the daemon chain deposit (DDeposit) =5, and the account information in the last account chain block (E1) on the own account chain is compared: balance (Balance) is 90, account chain record point (ARecord) is 0, and daemon chain deposit (ADeposit) received by account chain is 0. At the moment, the record points are the same, the deposit is different, and the received daemon chain deposit (ADeposit) of the account chain is updated to the daemon chain deposit (DDeposit) in the daemon block, namely 5; the account chain Record point (Record) remains unchanged, the Balance (Balance) is updated to the original Balance 90 plus the guard chain deposit value 5 in the guard block, and the value minus the guard chain deposit value 0 received by the account chain on the previous account chain block is 95.
When the account B generates a new account chain block (S2), in the latest (i.e. Epoch 2) daemon block referenced, the daemon chain record point (DRecord) =0, the daemon chain deposit (DDeposit) =100, and the account information in the last account chain block (R2) on the own account chain is compared: balance (Balance) is 100, account chain record point (ARecord) is 0, and the daemon chain deposit (ADeposit) received by the account chain is 0. At the moment, the record points are the same, the deposit is different, and the received daemon chain deposit (ADeposit) of the account chain is updated to be the daemon chain deposit (DDeposit) in the daemon block, namely 100; the account chain Record point (Record) is kept unchanged, the Balance (Balance) is updated to be the original Balance 100 plus the guard chain deposit value 100 in the guard block, and the value minus the guard chain deposit value 0 received by the account chain on the previous account chain block is 200..
And then entering into the 3 rd generation (Epoch 3), and when a new daemon block is generated, inquiring the world state tree of the 2 nd generation (Epoch 2) daemon block, obtaining the daemon chain record point and the daemon chain deposit, and comparing the account chain record point on the account chain block with the daemon chain deposit received by the account chain. At this time, the daemon chain Record point (DRecord) and the account chain Record point (ARecord) of the account A are both 0, and the daemon chain deposit (ADeposit) and the daemon chain deposit (DDeposit) received by the account chain are both 5, so that the daemon chain Record point (Record) is updated to be the original value +1, and the daemon chain deposit (Deposit) is updated to be 0; the daemon chain entry point (DRecord) and the account chain entry point (ARecord) of account B are both 0, and the daemon chain deposit (ADeposit) and the daemon chain deposit (DDeposit) that the account chain has received are both 100, so the daemon chain entry point (Record) is updated to the original value +1, and the daemon chain deposit (Deposit) is updated to 0.
After the 3 rd generation (Epoch 3) daemon block is uplink, the account chains A and B generate new account chain blocks (S4 and S3), when the daemon block is referenced, the account state on the account chain is updated to be consistent with the daemon block, and the updating process is not repeated here.
The above is the case shown in fig. 1.
Also as shown in fig. 2: before entering passage 3 (Epoch 3), account C also transfers account B with 100 money via the smart contract, such that the daemon block of passage 3 (Epoch 3) packages the contract execution block (E2) of account C for the uplink.
When the daemon block of the 3 rd generation (Epoch 3) is generated, the world state tree of the daemon block of the 2 nd generation (Epoch 2) is queried, the daemon chain record point and the daemon chain deposit are obtained, and the account chain record point and the account chain deposit on the account chain block are compared.
At this time, the daemon chain Record point (DRecord) and the account chain Record point (ARecord) of the account A are both 0, and the daemon chain deposit (ADeposit) and the daemon chain deposit (DDeposit) received by the account chain are both 5, so that the daemon chain Record point (Record) is updated to be the original value +1, and the daemon chain deposit (Deposit) is updated to be 0;
account B is divided into two cases, case W (fig. 3): the daemon chain firstly packages the S2 block, at the moment, the daemon chain Record point (DRecord) and the account chain Record point (ARecord) of the account B are both 0, and the daemon chain deposit (ADeposit) and the daemon chain deposit (DDeposit) received by the account chain are both 100, so that the daemon chain Record point (Record) is updated to be the original value +1, the daemon chain deposit (Deposit) is updated to be 0, then packages the E2 block, at the moment, the daemon chain Record point of the account B is updated to be 1, and the daemon chain deposit is updated to be 0, so that when the E2 block is packaged, the daemon chain Record point of the account B is unchanged, and the daemon chain deposit is updated to be the original value plus the amount received by a new transaction, namely 100; case Y (as in fig. 2): the daemon chain firstly packages the E2 block, at the moment, the information such as the account chain record point of the account B is not existed, the daemon chain record point (DRecord) of the account B is unchanged and is still 0, the daemon chain record point (DDeposit) is updated to be the original value of 100+the current transaction amount (Send) 100=200, then packages the S2 block, at the moment, the daemon chain record point is 0, the daemon chain record point is 200, the comparison S2 block account chain record point (ARecord) is 0, the daemon chain record (ADeposit) received by the account chain is 100, the record points are the same, but the daemon chain record point is larger than the daemon chain record received by the account chain, the daemon chain record point (DRecord) is not updated and is still 0, the daemon chain record point (DDeposit) accumulates the current transaction amount, and the daemon chain record point is still 200 because the S2 block does not display the transaction amount.
The status update of account C is the same and is not repeated here.
After the daemon block of the 3 rd generation (Epoch 3) is uplink, if a new transaction occurs to the account chain, the new account chain block (S3, S4, S5) is generated by packing, and the state of the account chain and the daemon chain is continuously synchronized.
When the block S3 is generated, the latest daemon block D3 referenced is compared with the previous generation account chain block S1, the daemon chain record point (DRecord) is 1, the account chain record point (ARecord) is 0, the daemon chain deposit (DDeposit) is 0, the record points are inconsistent, the account chain record point (ARecord) needs to be updated to 1, and the daemon chain deposit (ADeposit) received by the account chain is updated to 0.
When the block S4 is generated, as shown in fig. 2, the latest daemon block D3 referenced is compared with the previous generation of account chain block S2, the daemon chain record point (DRecord) is 0, the account chain record point (ARecord) is 0, the daemon chain deposit (DDeposit) is 200, the account chain received frontal daemon chain deposit (ADeposit) is 100, at this time, the account chain B needs to receive the daemon chain deposit, that is, the account chain record point is unchanged, still is 0, the daemon chain deposit received by the account chain is updated to 200, the balance update is the difference between the original 200+ daemon chain deposit (that is 200) and the daemon chain deposit received by the account chain (that is 100) is 100=300; the above is the case shown in fig. 2 (i.e., D3 is generated as in case Y). If the D3 block is generated according to the case M, as shown in fig. 3, at this time, the D3 account B daemon chain record point (DRecord) is 1, the daemon chain deposit (DDeposit) is 100, the account chain record point (ARecord) of S2 is 0, the daemon chain deposit (ADeposit) received by the account chain is 100, the record points are inconsistent, the daemon chain deposit is not 0, the account chain record point is updated to be consistent with the daemon chain record point, that is, updated to be 1, the daemon chain deposit received by the account chain is updated to be consistent with the daemon chain deposit, that is, updated to be 100, and the balance is updated to be the original value 200+daemon chain deposit 100=300.
When the S5 block is generated, the latest daemon block D3 referenced is compared with the previous generation account chain block E2, the daemon chain record point (DRecord) is 0, the account chain record point (ARecord) is 0, the daemon chain deposit (DDeposit) is 5, the account chain received frontier daemon chain deposit (ADeposit) is 0, at this time, the account chain C needs to receive the daemon chain deposit, i.e. the account chain record point is unchanged, still is 0, the daemon chain deposit received by the account chain is updated to 5, and the balance is updated to be the difference between the original value 90+daemon chain deposit (i.e. 5) and the daemon chain deposit received by the account chain (i.e. 0) by 5=95.
And then the 4 th generation (Epoch 4) daemon block packages and uploads the account chain blocks, the subsequent account chain blocks are continuously generated and are compared with the daemon blocks for updating, the amount in the daemon chain can be continuously updated through the comparison and is transferred to the account chain, and the circulation of the value on the chain is successfully realized.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the object of the present invention, which is not limited herein.
Example 2: in addition, the embodiment of the invention also provides an on-chain value circulation system based on the account chain and the daemon chain under the DAG structure.
The on-chain value circulation system under the DAG structure based on the account chain and the daemon chain comprises an account information module, an account information updating module, a world state tree module and a world state tree information updating module.
Further, the account information module comprises a balance module, an account chain record point module and a daemon chain deposit module which is received by an account chain; the world state tree comprises a daemon chain record point module and a daemon chain deposit module.
The account information updating module compares the information of the account chain record point module, the daemon chain deposit module received by the account chain and the daemon chain deposit module according to the established rule, and updates the information of the balance module, the account chain record point module and the daemon chain deposit module received by the account chain;
the world state tree information updating module compares the information of the daemon chain record point module, the account chain record point module, the daemon chain deposit module and the daemon chain deposit module received by the account chain according to the established rule, and updates the information of the daemon chain record point module and the daemon chain deposit module.
The predetermined rule may be a rule in the method described in embodiment 1 of the present invention, or may be another rule formulated by a person skilled in the art to achieve the predetermined object.
In addition, in actual deployment, the modules can be deployed in different spatial areas or devices and systems separately. Those skilled in the art will appreciate the respective functions of each module that may be deployed or used separately to use the module in different devices, methods, systems.
The above modules include relationships indicating that the upper module includes the lower module, and do not indicate that the upper module is configured only by the lower module. In practice, the upper layer modules may include many other lower layer modules, which may be added as desired by those skilled in the art.
In addition, the present embodiment is merely a basic description of the value circulation system in the present invention, and technical details that are not described in detail in this embodiment may refer to the method provided in any embodiment of the present invention, which is not described herein again.
Example 3: it will be apparent to those skilled in the art that the system and method of the above embodiments may be implemented by software plus a necessary general purpose hardware platform, but may also be implemented by hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. Read Only Memory)/RAM, magnetic disk, optical disk) and including several instructions for causing a terminal device (which may be a mobile phone, a computer, a node packaging device, or a network device, etc.) to perform the method according to the embodiments of the present invention.
Therefore, the present invention also provides an on-chain value circulation device under a DAG structure based on an account chain and a daemon chain, comprising: the system comprises a memory, a processor and an on-chain value transfer program which is stored in the memory and can run on the processor and is based on an account chain and a daemon, wherein the on-chain value transfer program is configured with an on-chain value transfer method which is based on the account chain and the daemon and is under the DAG structure.
In addition, the invention also provides a storage medium, wherein the storage medium is stored with an on-chain value circulation program under the DAG structure based on the account chain and the daemon chain.
Since, in a real situation, when a device or a program is deployed, the execution of a certain program may be to perform all steps, or may be to perform only a certain step, and implement all steps by cooperation of a plurality of programs,
Therefore, the on-chain value transfer program under the DAG structure based on the account chain and the daemon chain realizes all or a certain flow in the on-chain value transfer method under the DAG structure based on the account chain and the daemon chain when being executed.
The foregoing description of the preferred embodiments of the present invention should not be taken as limiting the scope of the invention, but rather should be understood to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention as defined by the following description and drawings.

Claims (6)

1. A value flow method on the chain under the DAG structure based on account chain and daemon chain, characterized by that, daemon block will pack the latest transaction block of the current epoch when generating, there is quotation relation with the block on the account chain, the account block on the account chain will point to the latest daemon block on the account chain through quotation relation when generating;
when the block of the daemon chain or the account chain is generated, the method comprises the following steps:
s1, acquiring information to be compared; the information to be compared comprises a daemon chain record point and an account chain record point, daemon chain deposit and daemon chain deposit received by the account chain;
S2, comparing information;
s3, updating the related information according to the rule.
2. The method for value streaming on a chain under a DAG structure based on account chains and daemon chains according to claim 1, wherein when the daemon chains generate blocks, S1 comprises the following procedures:
S11, obtaining information to be compared in a previous generation daemon chain block;
S12, obtaining information to be compared in the packed account chain blocks.
3. The method for value streaming on the chain under the DAG structure based on the account chain and the daemon chain according to claim 1, wherein when the account chain generates the block, S1 comprises the following procedures:
s13, obtaining information to be compared in the previous generation account block;
S14, pointing to the latest daemon block on the account chain through a reference relation, and acquiring information to be compared in the latest daemon block.
4. The on-chain value streaming system under the DAG structure based on the account chain and the daemon chain is characterized by comprising an account information module, an account information updating module, a world state tree module and a world state tree information updating module;
The account information module comprises a balance module, an account chain record point module and a daemon chain deposit module of which the account chain is received;
the world state tree module comprises a daemon chain record point module and a daemon chain deposit module;
When the daemon blocks are generated, reference relations exist between the daemon blocks and the blocks on the account chain, and when the account blocks on the account chain are generated, the latest daemon blocks on the account chain are pointed through the reference relations.
5. An account chain and daemon chain based value-on-chain streaming device under a DAG structure, comprising: memory, a processor and an on-chain value transfer program under an account chain and daemon based DAG structure stored on the memory and executable on the processor, the on-chain value transfer program under an account chain and daemon based DAG structure configured to implement the on-chain value transfer method under an account chain and daemon based DAG structure as claimed in any one of claims 1 to 3.
6. A storage medium, wherein the storage medium has stored thereon an on-chain value transfer program under an account chain and daemon-based DAG structure, which when executed implements the on-chain value transfer method under an account chain and daemon-based DAG structure according to any one of claims 1 to 3.
CN202111136089.0A 2021-09-27 2021-09-27 Method, system, equipment and storage medium for value circulation on chain under DAG structure based on account chain and daemon chain Active CN113850578B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111136089.0A CN113850578B (en) 2021-09-27 2021-09-27 Method, system, equipment and storage medium for value circulation on chain under DAG structure based on account chain and daemon chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111136089.0A CN113850578B (en) 2021-09-27 2021-09-27 Method, system, equipment and storage medium for value circulation on chain under DAG structure based on account chain and daemon chain

Publications (2)

Publication Number Publication Date
CN113850578A CN113850578A (en) 2021-12-28
CN113850578B true CN113850578B (en) 2024-09-10

Family

ID=78979985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111136089.0A Active CN113850578B (en) 2021-09-27 2021-09-27 Method, system, equipment and storage medium for value circulation on chain under DAG structure based on account chain and daemon chain

Country Status (1)

Country Link
CN (1) CN113850578B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12026685B2 (en) 2017-04-21 2024-07-02 Blockdaemon Inc. Method and apparatus for blockchain management

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109544129B (en) * 2018-10-26 2021-04-27 创新先进技术有限公司 Block chain transaction method and device and electronic equipment
US20200143372A1 (en) * 2018-11-02 2020-05-07 Vite Labs Limited Methods for decentralized digital asset transfer and smart contract state transition
CN111861459A (en) * 2019-04-28 2020-10-30 常州一仙智能科技有限公司 Iota account book optimization system and method based on DPoS consensus algorithm
CN110321511B (en) * 2019-05-22 2024-05-28 平安科技(深圳)有限公司 Knowledge sharing incentive method, device, equipment and storage medium
CN110390524B (en) * 2019-07-31 2021-10-26 中国工商银行股份有限公司 Method and device for processing job data in block chain, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113850578A (en) 2021-12-28

Similar Documents

Publication Publication Date Title
CN112686671B (en) Intelligent contract deployment method, device, equipment and medium based on block chain
CN111818185B (en) Method and device for starting intelligent contract, electronic equipment and storage medium
CN110189121B (en) Data processing method and device, block chain client and block chain link point
CN111767097B (en) Method and device for calling intelligent contract, electronic equipment and storage medium
CN110187831B (en) Block data storage system and method of block chain alliance chain
CN109756566B (en) Block chain based data storage method, related equipment and storage medium
CN114266665B (en) Contract multi-main chain crossing method, equipment and storage medium
CN114283010B (en) Multi-main-chain crossing method based on multi-main-chain two-layer network state tree
CN112600664A (en) Delayed transaction generation method, delayed transaction execution device and storage medium
WO2022206438A1 (en) Method and apparatus for providing cross-chain message
CN113850578B (en) Method, system, equipment and storage medium for value circulation on chain under DAG structure based on account chain and daemon chain
CN109492049A (en) Data processing, block generation and synchronous method for block chain network
Dubois et al. The weakest failure detector for eventual consistency
CN113469815A (en) Data management method and device
CN111275553A (en) Data storage method of block chain and block chain system
CN105592029B (en) The synchronous method and server of virtual resource transfer operation state
CN110458541B (en) Object replacement method and device based on block chain
CN114119224B (en) Smart contract non-incremental sorting execution method, system, device and storage medium based on DAG structure of account chain and guardian chain
CN113592652B (en) Delay transaction method, computer device and storage medium
CN113077258A (en) Block chain-based evidence storing method and device and electronic equipment
CN110321250A (en) A kind of disaster recovery method and device for application
CN114119223B (en) Smart contract incremental sorting execution method, system, device and storage medium based on DAG structure of account chain and guardian chain
CN111161069A (en) Block chain system
CN112950378B (en) Method and device for executing intelligent contract in block chain
CN112732164A (en) Cross-node data group management method, device and medium

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