WO2020133069A1 - 区块链的数据处理方法和装置 - Google Patents

区块链的数据处理方法和装置 Download PDF

Info

Publication number
WO2020133069A1
WO2020133069A1 PCT/CN2018/124368 CN2018124368W WO2020133069A1 WO 2020133069 A1 WO2020133069 A1 WO 2020133069A1 CN 2018124368 W CN2018124368 W CN 2018124368W WO 2020133069 A1 WO2020133069 A1 WO 2020133069A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
data
smart contract
blockchain
output data
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.)
Ceased
Application number
PCT/CN2018/124368
Other languages
English (en)
French (fr)
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.)
Hefei DappWorks Technology Co Ltd
Original Assignee
Hefei DappWorks 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 Hefei DappWorks Technology Co Ltd filed Critical Hefei DappWorks Technology Co Ltd
Priority to US17/418,589 priority Critical patent/US20220067033A1/en
Priority to EP18944745.1A priority patent/EP3905165A4/en
Priority to PCT/CN2018/124368 priority patent/WO2020133069A1/zh
Publication of WO2020133069A1 publication Critical patent/WO2020133069A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • G06Q20/3678Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes e-cash details, e.g. blinded, divisible or detecting double spending
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/02Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Definitions

  • the present disclosure relates to the field of Internet technology, and more particularly, to a data processing method and device for blockchain.
  • Blockchain is a distributed accounting technology. Because the blockchain is decentralized and cannot be tampered with, the code itself is widely trusted because of its advantages of guaranteeing trust and no need for third-party trust guarantee.
  • the smart contract in the blockchain technology is the best use of the blockchain's code trust advantages.
  • the smart contract is to write and save the contract terms in the blockchain by using computer language. When a predetermined condition is triggered, the smart contract automatically executes the corresponding contract terms.
  • UTXO stands for Unspent Transaction Output, that is, unspent transaction output, which was created by Satoshi Nakamoto.
  • the calculation method of the user's balance is the sum of all the UTXOs owned by the user.
  • the UTXO system of Bitcoin is closer to the cash in our daily life than the account system in the current electronic banking system.
  • Each UTXO is like a banknote in a wallet. Since there is no account in the UTXO system, the system has the advantage of being more decentralized than the account system, and more in line with the actual use of cash in reality.
  • the present disclosure provides an improved blockchain data processing method and device.
  • One aspect of the present disclosure provides a blockchain data processing method adapted to the blockchain's unspent transaction output system.
  • the method is applied to blockchain nodes and includes: receiving first transaction data sent by a client
  • the first transaction data includes transaction input data and transaction output data.
  • the transaction output data of the first transaction data includes: a category identifier, a transaction amount, a recipient address, and additional information, wherein the category identifier is used to characterize whether the first transaction data is associated with a smart contract, and the additional information is used in the first
  • a transaction data is associated with a smart contract, it characterizes the information required for the operation of the smart contract.
  • the blockchain node and other blockchain nodes will pass the consensus verification to store the first transaction data in the blockchain, and the transaction output data based on the first transaction data will be corresponding
  • the state of the smart contract is stored in the corresponding local database.
  • the category identifier indicates that the first transaction data is associated with the smart contract, the transaction amount is a first value, and the first value is greater than Zero, the recipient address is the address of the smart contract, and the additional information includes the code of the smart contract.
  • the above and other blockchain nodes store the first transaction data in the blockchain through consensus verification, and based on the transaction output data of the first transaction data, store the corresponding smart contract status in their respective local databases including: Pack the first transaction data to a new block and send it to other blockchain nodes, so that each blockchain node initializes the smart contract based on the additional information when the new block is added to the blockchain after consensus verification To store the initialized state in the corresponding local database.
  • the above method further includes: after initializing the smart contract based on the additional information, constructing initial change data, the transaction input data of the initial change data is the transaction of the first transaction data Input data, the receiver address of the transaction output data of the initial change data is the address of the client, the transaction amount of the transaction output data of the initial change data is the initial change value, and the initial change value is equal to The balance of the actual transaction amount of the transaction input data minus the first value.
  • the initial change data is sent to other blockchain nodes, so that each blockchain node stores the initial change data in the blockchain after consensus verification.
  • the category identifier indicates that the first transaction data is associated with the smart contract
  • the transaction amount is a second value
  • the receiver address is The address of the smart contract
  • the additional information includes execution instructions of the smart contract
  • the above and other blockchain nodes undergo consensus verification to store the first transaction data in the blockchain and output based on the transaction
  • the data storage of the corresponding smart contract status in their respective local databases includes: packaging the first transaction data into a new block and sending it to other blockchain nodes, so that each blockchain node will pass the consensus verification
  • the smart contract is run based on the additional information, and the state after the run is stored in the corresponding local database.
  • the above method further includes: after running the smart contract based on the additional information, constructing second transaction data, the second transaction data includes transaction input data and transaction output data, and the transaction of the second transaction data
  • the input data is the transaction output data of the first transaction data
  • the second transaction data includes the first transaction output data
  • the receiver address of the first transaction output data of the second transaction data is the address of the node
  • the first of the second transaction data The transaction amount of the transaction output data is the third value.
  • the second transaction data further includes second transaction output data
  • the receiver address of the second transaction output data of the second transaction data is the address indicated by the result of running the smart contract
  • the second transaction The transaction amount of the second transaction output data of the data is a fourth value
  • the fourth value represents the amount indicated by the result of running the smart contract.
  • the second transaction data further includes third transaction output data
  • the receiver address of the third transaction output data of the second transaction data is the address of the client
  • the transaction of the third transaction output data of the second transaction data The amount is the fifth value, which is equal to the balance of the second value minus the third value and the fourth value.
  • the above initializing the smart contract based on the additional information includes: initializing the smart contract using a virtual machine based on the code of the smart contract; and/or, running the based on the additional information
  • the smart contract includes: using a virtual machine to run the smart contract based on an execution instruction of the smart contract.
  • the category identification and the recipient address occupy the same area in the data structure of the transaction output data; or, the category identification and the recipient address are in the transaction output data
  • the data structure occupies different areas.
  • the device is applied to a blockchain node and includes a receiving module and a management module.
  • the receiving module is used to receive the first transaction data sent by the client, where the first transaction data includes transaction input data and transaction output data.
  • the transaction output data of the first transaction data includes: a category identifier, a transaction amount, a recipient address, and additional information, wherein the category identifier is used to characterize whether the first transaction data is associated with a smart contract, and the additional information is used to When the first transaction data is associated with a smart contract, it characterizes information required for the operation of the smart contract.
  • the management module is used to store the first transaction data in the blockchain through consensus verification with other blockchain nodes when the first transaction data is associated with a smart contract, and store the corresponding data based on the transaction output data The state of the smart contract is stored in the corresponding local database.
  • the category identifier indicates that the first transaction data is associated with a smart contract
  • the transaction amount is a first value
  • the first The value is greater than zero
  • the receiver address is the address of the smart contract
  • the additional information includes the code of the smart contract.
  • the management module and other blockchain nodes store the first transaction data in the blockchain after consensus verification, and store the corresponding smart contract status in their respective local databases based on the transaction output data. It is used to package the first transaction data to a new block and send it to other blockchain nodes, so that each blockchain node is initialized based on the additional information when the new block is added to the blockchain after consensus verification
  • the smart contract stores the initialized state in the corresponding local database.
  • the above device further includes an initial change module for constructing initial change data after initializing the smart contract based on the additional information, and the transaction input data of the initial change data is the The transaction input data of the first transaction data, the receiver address of the transaction output data of the initial change data is the address of the client, and the transaction amount of the transaction output data of the initial change data is the initial change value.
  • the initial change value is equal to the actual transaction amount of the transaction input data minus the first value; the initial change data is sent to other blockchain nodes, so that each blockchain node will undergo consensus verification
  • the initial change data is stored in the blockchain.
  • the category identifier indicates that the first transaction data is associated with a smart contract
  • the transaction amount is a second value
  • the receiver The address is the address of the smart contract
  • the additional information includes an execution instruction of the smart contract.
  • the management module and other blockchain nodes store the first transaction data in the blockchain after consensus verification, and store the corresponding smart contract status in their respective local databases based on the transaction output data. It is used to package the first transaction data to a new block and send it to other blockchain nodes, so that each blockchain node runs on the additional information when the new block is added to the blockchain after consensus verification
  • the smart contract stores the running state in the corresponding local database.
  • the above device further includes an auxiliary management module for constructing second transaction data after running the smart contract based on the additional information, the second transaction data including transaction input data and transaction output data ,
  • the transaction input data of the second transaction data is the transaction output data of the first transaction data
  • the second transaction data includes the first transaction output data
  • the receiver address of the first transaction output data of the second transaction data For the address of this node, the transaction amount of the first transaction output data of the second transaction data is the third value; send the second transaction data to other blockchain nodes so that each blockchain node will pass the consensus verification
  • the second transaction data is stored in the blockchain.
  • the second transaction data further includes second transaction output data.
  • the address of the receiver of the second transaction output data of the second transaction data is the address indicated by the result of running the smart contract.
  • the transaction amount of the second transaction output data of the second transaction data is a fourth value, and the fourth value represents the amount indicated by the result of running the smart contract.
  • the second transaction data further includes third transaction output data
  • the receiver address of the third transaction output data of the second transaction data is the address of the client
  • the transaction of the third transaction output data of the second transaction data The amount is a fifth value, which is equal to the balance of the second value minus the third value and the fourth value.
  • the management module initializing the smart contract based on the additional information includes: the management module is used to initialize the smart contract using a virtual machine based on the code of the smart contract; and/or, the management module is based on the
  • the additional information for running the smart contract includes: a management module for running the smart contract using a virtual machine based on an execution instruction of the smart contract.
  • the category identification and the recipient address occupy the same area in the data structure of the transaction output data; or, the category identification and the recipient address are in the transaction output data
  • the data structure occupies different areas.
  • Another aspect of the present disclosure provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • the processor executes the program, the method described above is implemented .
  • Another aspect of the present disclosure provides a computer-readable storage medium having executable instructions stored thereon, which when executed by a processor causes the processor to perform the method as described above.
  • Another aspect of the present disclosure provides a computer program that includes computer-executable instructions that, when executed, are used to implement the method described above.
  • the problem that the existing UTXO system cannot support smart contracts can be at least partially solved/mitigated/suppressed/even avoided.
  • the transaction output data of the first transaction data is added The category identifier used to characterize whether the first transaction data is associated with the smart contract and the additional information used to characterize the information required for the operation of the smart contract associated with the first transaction data, so that it can adapt to the transaction data related to the smart contract, Moreover, while each blockchain node stores the first transaction data in the blockchain, the state of the corresponding smart contract is recorded locally, which can support smart contracts of various degrees of complexity.
  • FIG. 1 schematically shows an exemplary system architecture of a data processing method and apparatus to which a blockchain can be applied according to an embodiment of the present disclosure
  • FIG. 2 schematically shows a flowchart of a data processing method of a blockchain according to an embodiment of the present disclosure
  • 3A schematically shows a data structure of transaction output data of first transaction data according to an embodiment of the present disclosure
  • 3B schematically shows the data structure of transaction input data and transaction output data of the second transaction data according to an embodiment of the present disclosure
  • FIG. 4 schematically shows a block diagram of a data processing apparatus of a blockchain according to an embodiment of the present disclosure
  • FIG. 5 schematically shows a block diagram of a data processing apparatus of a blockchain according to another embodiment of the present disclosure.
  • FIG. 6 schematically shows a block diagram of a computer device suitable for implementing a data processing method of a blockchain according to an embodiment of the present disclosure.
  • At least one of A, B, and C When using an expression similar to “at least one of A, B, and C,” etc., generally speaking, it should be interpreted according to the meaning generally understood by those skilled in the art (for example, “having A, B, and C" "At least one of the systems” shall include, but is not limited to, systems with A alone, B alone, C alone, A and B, A and C, B and C, and/or systems with A, B, C, etc. ).
  • the embodiments of the present disclosure provide a data processing method and device of a blockchain.
  • This method is suitable for the unspent transaction output (UTXO) system of the blockchain.
  • This method is applied to blockchain nodes, including the transaction data receiving process and transaction data management process.
  • the first transaction data is received, and the first transaction data includes transaction input data and transaction output data.
  • the transaction output data also includes a category identifier used to characterize whether the first transaction data is associated with a smart contract and additional information used to characterize the information required for the operation of the smart contract. Then enter the transaction data management process, and after consensus verification with other blockchain nodes, store the first transaction data in the blockchain and record the corresponding smart contract status locally.
  • FIG. 1 schematically shows an exemplary system architecture 100 of a data processing method and apparatus to which a blockchain can be applied according to an embodiment of the present disclosure.
  • FIG. 1 is only an example of a system architecture to which the embodiments of the present disclosure can be applied to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used for other Equipment, system, environment or scene.
  • the system architecture 100 may include multiple electronic devices (101-107).
  • the electronic device (101-107) may be a personal computer (PC), a web server, a database server, or the like.
  • Each of the electronic devices (101-107) may have the same or different computing capabilities.
  • each electronic device can communicate with each other to form a blockchain network, and each electronic device serves as a blockchain node in the blockchain network, and each blockchain node maintains the same blockchain Database (hereinafter collectively referred to as "blockchain").
  • each blockchain node can communicate with different service providers and/or client computing devices (such as servers/server clusters, terminal devices, etc.), that is, as service providers and/or For the blockchain nodes corresponding to the clients, each service provider and/or client can perform operations such as reading and writing data in the blockchain through the corresponding blockchain nodes.
  • FIG. 1 is only schematic. According to the implementation needs, there can be any number of electronic devices.
  • the data processing method of the blockchain provided by the embodiments of the present disclosure can be run in the electronic device shown in FIG. 1.
  • FIG. 2 schematically shows a flowchart of a data processing method of a blockchain according to an embodiment of the present disclosure.
  • this method is suitable for the unspent transaction output (UTXO) system of the blockchain.
  • This method is executed by the blockchain node, and the blockchain data provided by the present disclosure is explained from the blockchain node side. Process.
  • the method includes in operation S201, receiving first transaction data sent by a client, the first transaction data includes transaction input data and transaction output data, and the transaction output data includes: category identification, transaction amount, recipient address and additional information.
  • the UTXO system is a bookkeeping mode of the blockchain network.
  • the characteristics of this bookkeeping mode are: each transaction will spend the output of the previous transaction and generate new output, which may be In the future, through transaction consumption, all unspent transactions are saved in each fully synchronized node, the user’s wallet tracks the list of unspent transactions associated with all addresses owned by the user, and the wallet balance is calculated as these The sum of unspent transactions.
  • the first transaction data uses the data structure of the UTXO system, including transaction input data and transaction output data.
  • the transaction input data includes the actual transaction amount issued by the client, and the transaction output data excludes the data structure of the existing UTXO system.
  • the necessary transaction amount and recipient address it also includes a category identifier and additional information, where the category identifier is used to indicate whether the first transaction data is associated with the smart contract, and the additional information is used to associate the first transaction data with the smart contract Time characterizes the information required for the operation of the smart contract associated with the first transaction data.
  • each blockchain node passes the consensus verification to store the first transaction data in the blockchain, and On the one hand, based on the additional information in the transaction output data of the first transaction data, the respective states of the smart contracts associated with the first transaction data are saved locally.
  • the method shown in FIG. 2 improves the data structure of the UTXO system, and adds a category identifier used to characterize whether the first transaction data is associated with a smart contract and used to characterize the
  • the additional information of the information required for the operation of the smart contract associated with a transaction data so that it can adapt to the transaction data related to the smart contract, and each blockchain node stores the first transaction data in the blockchain while recording the corresponding locally
  • the state of the smart contract can support smart contracts of various degrees of complexity, solving the problem that the existing UTXO system cannot support smart contracts.
  • the category identifier and the receiver address occupy the same area in the data structure of the transaction output data; or, the category identifier and the The recipient address occupies different areas in the data structure of the transaction output data. It can be configured as needed, and is not limited here.
  • the first transaction data is transaction data for issuing a smart contract.
  • the category identifier in the transaction output data of the first transaction data indicates that the first transaction data is associated with the smart contract, and the first transaction data
  • the transaction amount in the transaction output data is the first value, the first value is a value greater than zero, the receiver address in the transaction output data of the first transaction data is the address of the smart contract, and the transaction output of the first transaction data
  • the additional information in the data includes the code of the smart contract associated with the first transaction data, that is, the code of the smart contract that you want to issue.
  • the above operation S202 and other blockchain nodes pass the consensus verification to store the first transaction data in the blockchain, and based on the transaction output data of the first transaction data, store the corresponding smart contract status in their respective local databases including :
  • this node is a blockmaker node
  • the first transaction data is packaged into a new block and sent to other blockchain nodes, so that each blockchain node will add the new block to the blockchain through consensus verification
  • Based on the additional information in the transaction output data of the first transaction data initialize the smart contract and store the initialized state in the corresponding local database
  • the node is not the blocker node, receive the new Block, the new block is packed with the first transaction data, and it is initialized with additional information in the transaction output data based on the first transaction data when the new block is added to the blockchain through consensus verification with other blockchain nodes
  • the smart contract stores the initialized state in the corresponding local database.
  • the client when the client wants to publish a smart contract, it constructs the first transaction data containing the transaction output data, records the first transaction data in the category identification of the transaction output data, and associates the smart contract with the smart contract as the transaction receiver , Record the address of the smart contract in the address of the recipient of the transaction output data, record the code of the smart contract in the additional information of the transaction output data, and record the first value greater than zero in the transaction amount of the transaction output data.
  • the client sends the first transaction data to the blockchain node.
  • the blocker node packs the first transaction data into a new block, it initializes the corresponding smart contract and saves the initialized state in the local database.
  • the smart contract When the full node synchronizes the blockchain, when receiving the new block created by the blocker node, the smart contract will also be initialized during the block verification phase and the initialized state will be saved in the respective local database.
  • This process deploys the code of the smart contract to the blockchain on the one hand, and uses the non-tampering modification of the blockchain to ensure that the subsequent smart contracts can perform operations accurately and in accordance with the pre-agreed rules.
  • the state of the smart contract is initialized Recorded locally on the blockchain node, you can record the change status of the smart contract without recording the smart contract status on the blockchain like the existing account/balance system, which greatly saves the blockchain transmission bandwidth and storage space .
  • each blockchain node initializes the smart contract based on the additional information includes: using a virtual machine to initialize the smart contract based on the code of the smart contract.
  • the initial change data needs to be constructed for change. Specifically, the method shown in FIG.
  • the transaction input data of the initial change data is the transaction input data of the first transaction data
  • the transaction amount actually sent by the client regarding the first transaction data is called the actual transaction amount.
  • the receiver address of the transaction output data of the initial change data is the address of the client that sent the first transaction data
  • the transaction amount of the transaction output data of the initial change data is the initial change value
  • the initial change value is equal to The balance of the actual transaction amount sent by the client minus the first value.
  • This embodiment realizes that the transaction amount will be refunded and supplemented when the smart contract is released, and then the initial change data is sent to other blockchain nodes, so that each blockchain node will store the initial change data after consensus verification Into the blockchain to record the event of initial change in the blockchain.
  • the trigger execution process of the smart contract can also be performed.
  • the first transaction data is the transaction data that triggered the smart contract
  • the category identifier in the transaction output data of the first transaction data indicates that the first transaction data is associated with the smart contract
  • the transaction amount in the transaction output data of the first transaction data is the second value
  • the transaction amount in the transaction output data of the first transaction data is the second value
  • the transaction amount in the transaction output data of the first transaction data is the second value
  • the address of the receiver is the address of the smart contract
  • the additional information in the transaction output data of the first transaction data includes the execution instruction of the smart contract.
  • the above operation S202 and other blockchain nodes undergo consensus verification to store the first transaction data in the blockchain, and based on the transaction output data, store the corresponding smart contract status in their respective local databases including :
  • this node is a blocker node
  • the first transaction data is packaged into a new block and sent to other blockchain nodes, so that each blockchain node will join the new block through consensus verification
  • the smart contract is run, and the running state is stored in the corresponding local database
  • the node is not a blocker node, the new block sent by the blocker node is received,
  • the first transaction data is packaged in the new block, and the smart contract is run based on the additional information when the new block is added to the blockchain after consensus verification with other blockchain nodes. Stored in their respective local databases.
  • a client when a client wants to issue an instruction to a smart contract deployed in a blockchain, it constructs first transaction data including transaction output data, and records the first transaction data associated with the smart contract in the category identifier of the transaction output data , Use the smart contract as the transaction receiver, record the address of the smart contract in the address of the receiver of the transaction output data, record the execution instruction of the smart contract in the additional information of the transaction output data, and record in the transaction amount of the transaction output data The second value required for smart contract operation.
  • the client sends the first transaction data to the blockchain node.
  • the blocker node packs the first transaction data into a new block, it runs the smart contract and saves the running state in the local database.
  • the full node When the full node synchronizes the blockchain, when it receives the new block created by the blocker node, it will also run the smart contract during the block verification phase and save the running state in its local database. This process records the running status of the smart contract after executing each task on the blockchain node, which can support Turing's complete smart contract, and does not need to record the smart contract status on the blockchain like the existing account/balance system , Which greatly saves the blockchain transmission bandwidth and storage space.
  • each blockchain node running the smart contract based on the additional information includes: using a virtual machine to run the smart contract based on an execution instruction of the smart contract.
  • the initial change data needs to be constructed for change. Specifically, the method shown in FIG.
  • the transaction input data of the initial change data is the transaction input data of the first transaction data
  • the transaction amount actually sent by the client regarding the first transaction data is called the actual transaction amount.
  • the receiver address of the transaction output data of the initial change data is the address of the client that sent the first transaction data
  • the transaction amount of the transaction output data of the initial change data is the initial change value
  • the initial change value is equal to The balance of the actual transaction amount sent by the client minus the second value.
  • This embodiment realizes that the amount of the transaction will be refunded more and less when triggering the execution of the smart contract, and then the initial change data is sent to other blockchain nodes, so that each blockchain node will pass the initial change data after consensus verification Deposit in the blockchain to record the event of initial change in the blockchain.
  • the method shown in FIG. 2 further includes: after running the smart contract based on the additional information, constructing second transaction data, the second transaction data including transaction input Data and transaction output data, the transaction input data of the second transaction data is the transaction output data of the first transaction data, and the transaction output data of the second transaction data includes the first transaction output data, when the local node In the case of a blocker node, the receiver address of the first transaction output data is the address of the node. When the node is not a blocker node, the receiver address of the first transaction output data is the address of the blocker node , The transaction amount of the first transaction output data is the third value.
  • the second transaction data is sent to other blockchain nodes, so that each blockchain node passes the consensus verification to store the second transaction data in the blockchain.
  • the first transaction output data in the second transaction data represents the processing fee paid to the blocker node running the smart contract to incentivize the blocker node to ensure the smooth and orderly transaction management based on the UTXO system .
  • the above-mentioned second transaction data in addition to the output data representing the processing fee to the blockmaker node, also includes second transaction output data, and the recipient address of the second transaction output data
  • the transaction amount of the second transaction output data is a fourth value
  • the fourth value represents the amount indicated by the result after running the smart contract.
  • the second transaction output data in the second transaction data represents the address indicated by the result of running the smart contract according to the smart contract instruction, for example, it may be that a part of the transaction amount is stored in the smart contract, or it may be a part of the transaction
  • the amount is sent to the address of the other client indicated by the execution result of the instruction, etc., which is determined according to the pre-agreed content of the smart contract, and is not limited here to meet the needs of the client who sends the first transaction data to run the smart contract.
  • the above-mentioned second transaction data in addition to the processing fee indicated to the blockmaker node and the fee required for the normal operation of the smart contract, also includes third transaction output data.
  • the receiver address of the third transaction output data is the address of the client, and the transaction amount of the third transaction output data is a fifth value, and the fifth value is equal to the balance of the second value minus the third value and the fourth value.
  • the third transaction output data in the second transaction data indicates that the transaction output corresponding to the change to the client is generated after the smart contract is run, and the transaction amount of the first transaction data sent on the client exceeds the handling fee and operation The fees required for the results will be changed to the client to ensure that the transaction is conducted fairly.
  • FIG. 2 The method shown in FIG. 2 will be further described below with reference to FIGS. 3A to 3B in combination with specific embodiments.
  • FIG. 3A schematically shows a data structure of transaction output data of first transaction data according to an embodiment of the present disclosure.
  • the transaction output data of the first transaction data adopts the data structure of the improved UTXO system
  • the left side is the existing transaction output data (Txout') represented by the data structure of the UTXO system
  • the right side provides the disclosure
  • the publicKeyHash item is used to indicate the recipient address
  • the value item is used to indicate the transaction amount.
  • the original publicKeyHash data format is modified.
  • the prefix n is added to the data to indicate this It is a common address.
  • the prefix s is added to the data to indicate that this is the smart contract address
  • the prefix n/s is the category ID indicating whether the first transaction data is associated with the smart contract
  • add an additional smart contract/operation item which represents additional information, used to store smart contract code or smart contract execution instructions issued by the client.
  • the first transaction data in the embodiments of the present disclosure may be transaction data that is used to store and identify smart contracts.
  • the client When the client releases smart contract A, it constructs a first transaction data, the first transaction data includes transaction input data and transaction output data, the transaction input data includes the transaction amount actually issued by the client, and the transaction output data Txout includes: the transaction amount
  • the (Value) item is 0.0001
  • the receiver address (n/s+PubKeyHash) item uses the character string beginning with s as the transaction receiver, to indicate that this address is a smart contract address, and fill in the additional information (smart contract/operation) item Enter the code of smart contract A (smart contract).
  • the client sends the first transaction data to the blockchain node. While packing the first transaction data into the block, it needs to use a virtual machine to run smart contract A and save the initialized state in its own Computer database. When the remaining full nodes synchronize the blockchain, when receiving this block, they will also run smart contract A during the block verification phase and save the initialized state in their own computer database.
  • the actual transaction amount in the transaction input data of the first transaction data is greater than the transaction amount in the transaction input data, it is further constructed to generate initial change data, and the recipient address of the output change data is the one that sent the first transaction data
  • the address of the client, the transaction amount of the output change data is equal to the actual transaction amount minus 0.0001 balance.
  • a first transaction data is constructed, the first transaction data includes transaction input data and transaction output data, and the transaction input data includes the transaction amount actually issued by the client terminal, and the transaction output
  • the data Txout includes: the transaction amount (Value) item is the transaction amount required to run the smart contract A, in which the receiver address (n/s+PubKeyHash) item is filled in the address of the smart contract A (s+PubKeyHash) to be executed, in The additional information (smart contract/operation) is filled with the operation (operation) to be executed.
  • the client sends the first transaction data to the blockchain node.
  • the blocker node packages the transaction into the block, it uses the corresponding smart contract A to run the execution instruction and update the state of the locally saved smart contract A.
  • the remaining full nodes synchronize the blockchain, when receiving this block, they will also run smart contract instructions and update their local smart contract A status during the block verification phase.
  • the actual transaction amount in the transaction input data of the first transaction data is greater than the transaction amount in the transaction input data, it is further constructed to generate initial change data, and the recipient address of the output change data is the one that sent the first transaction data
  • the address of the client, the transaction amount of the output change data is equal to the actual transaction amount minus the value of the transaction value (Value).
  • FIG. 3B schematically shows the data structure of transaction input data and transaction output data of the second transaction data according to an embodiment of the present disclosure.
  • second transaction data is constructed, the second transaction data includes transaction input data and transaction output data, and the transaction input data of the second transaction data is as shown in FIG. 3A
  • the transaction output data Txout of the first transaction data shown on the right in the middle, and the transaction output data of the second transaction data include the first transaction output data Txout1, the second transaction output data Txout2, and the third transaction output data Txout3.
  • the receiver address n+PubKeyHash of the first transaction output data Txout1 is the address of the blockmaker node, and the transaction value value1 represents the processing fee issued to the blockmaker node.
  • the receiver address s+PubKeyHash of the second transaction output data Txout2 is the address of the smart contract A, and the transaction amount value2 represents the transaction amount stored in the smart contract.
  • the block builder splits Txout into three payments.
  • the first payment is used to charge the smart contract A, which is owned by the block builder.
  • the second payment is to store the payment in the smart contract as shown in the smart contract execution instruction or to the address of the execution result of the instruction.
  • the third amount is the excess amount, which will be returned to the client.
  • the embodiments of the present disclosure have the following beneficial effects: first, the Turing complete smart contract function under the UTXO system is realized; second, there is no need to record the state of the smart contract on the blockchain, which greatly saves Blockchain transmission bandwidth and storage space.
  • FIG. 4 schematically shows a block diagram of a data processing apparatus of a blockchain according to an embodiment of the present disclosure.
  • the blockchain data processing device 400 is adapted to the blockchain unspent transaction output system.
  • the blockchain data processing device 400 is applied to blockchain nodes, including a receiving module 410 and a management module 420 .
  • the receiving module 410 is configured to receive first transaction data sent by the client, where the first transaction data includes transaction input data and transaction output data.
  • the transaction output data includes: a category identifier, a transaction amount, a recipient address, and additional information, wherein the category identifier is used to characterize whether the first transaction data is associated with a smart contract, and the additional information is used in the When the first transaction data is associated with a smart contract, it characterizes the information required for the operation of the smart contract.
  • the management module 420 is used to store the first transaction data into the blockchain after consensus verification with other blockchain nodes when the first transaction data is associated with a smart contract, and based on the transaction output data, the corresponding The smart contract status is stored in the corresponding local database.
  • the category identifier and the receiver address occupy the same area in the data structure of the transaction output data; or, the category identifier and the receiver address are in the data structure of the transaction output data Occupy different areas.
  • the category identifier indicates that the first transaction data is associated with a smart contract, and the transaction amount is a first value, the The first value is greater than zero, the receiver address is the address of the smart contract, and the additional information includes the code of the smart contract.
  • the management module 420 and the other blockchain nodes pass the consensus verification to store the first transaction data in the blockchain, and based on the transaction output data, store the corresponding smart contract status in their respective local databases including: management
  • the module 420 is used to package the first transaction data to a new block and send it to other blockchain nodes, so that each blockchain node undergoes consensus verification to add the new block to the blockchain based on the additional
  • the information initializes the smart contract and stores the initialized state in the corresponding local database.
  • the category identifier indicates that the first transaction data is associated with the smart contract, and the transaction amount is a second value.
  • the receiver address is the address of the smart contract, and the additional information includes an execution instruction of the smart contract.
  • the management module 420 and the other blockchain nodes pass the consensus verification to store the first transaction data in the blockchain, and based on the transaction output data, store the corresponding smart contract status in their respective local databases including: management
  • management The module 420 is used to package the first transaction data to a new block and send it to other blockchain nodes, so that each blockchain node undergoes consensus verification to add the new block to the blockchain based on the additional
  • the information runs the smart contract, and stores the running state in the corresponding local database.
  • the management module 420 initializing the smart contract based on the additional information includes: the management module 420 is configured to initialize the smart contract using a virtual machine based on the code of the smart contract. And/or, the management module 420 running the smart contract based on the additional information includes: the management module 420 is configured to run the smart contract using a virtual machine based on an execution instruction of the smart contract.
  • FIG. 5 schematically shows a block diagram of a data processing device of a blockchain according to another embodiment of the present disclosure.
  • the blockchain data processing device 500 is applied to blockchain nodes, including a receiving module 410, a management module 420, an initial change module 430, and an auxiliary management module 440.
  • the receiving module 410 and the management module 420 have been described above, and the repeated parts will not be repeated.
  • the initial change module 430 is configured to construct initial change data after initializing the smart contract and/or running the smart contract based on the additional information, and the transaction input data of the initial change data is the first transaction
  • the transaction input data of the data, the receiver address of the transaction output data of the initial change data is the address of the client, the transaction amount of the transaction output data of the initial change data is the initial change value, and the initial change
  • the zero value is equal to the actual transaction amount of the transaction input data minus the first value and/or the second value; the initial change data is sent to other blockchain nodes so that each blockchain After the consensus verification, the node stores the initial change data in the blockchain.
  • the auxiliary management module 440 is configured to construct second transaction data after running the smart contract based on the additional information, the second transaction data includes transaction input data and transaction output data, and transaction input data of the second transaction data Is the transaction output data of the first transaction data, the second transaction data includes the first transaction output data, the receiver address of the first transaction output data is the address of the node, and the first transaction output data
  • the transaction amount is the third value; the second transaction data is sent to other blockchain nodes, so that each blockchain node passes the consensus verification to store the second transaction data in the blockchain.
  • the second transaction data further includes second transaction output data
  • the receiver address of the second transaction output data is the address indicated by the result of running the smart contract
  • the transaction amount of the second transaction output data is a fourth value
  • the fourth value represents the amount indicated by the result of running the smart contract.
  • the second transaction data further includes third transaction output data
  • the receiver address of the second transaction output data is the address of the client
  • the transaction amount is a fifth value, which is equal to the balance of the second value minus the third value and the fourth value.
  • modules, sub-modules, units, sub-units may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into multiple modules.
  • any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be at least partially implemented as hardware circuits, such as field programmable gate array (FPGA), programmable logic array (PLA), The system on chip, the system on the substrate, the system on the package, the application specific integrated circuit (ASIC), or can be implemented by any other reasonable way of hardware or firmware that integrates or packages the circuit, or by software, hardware, and firmware Any one of these implementations or any appropriate combination of any of them.
  • FPGA field programmable gate array
  • PLA programmable logic array
  • ASIC application specific integrated circuit
  • one or more of the modules, submodules, units, and subunits according to the embodiments of the present disclosure may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
  • any of the receiving module 410, the management module 420, the initial change module 430, and the auxiliary management module 440 may be combined and implemented in one module, or any one of the modules may be split into multiple modules. Alternatively, at least part of functions of one or more of these modules may be combined with at least part of functions of other modules and implemented in one module.
  • At least one of the receiving module 410, the management module 420, the initial change module 430, and the auxiliary management module 440 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), Programmable logic array (PLA), system-on-chip, system on substrate, system on package, application specific integrated circuit (ASIC), or any other reasonable way to integrate or package the circuit, such as hardware or firmware, Or it can be implemented in any one of the three implementation modes of software, hardware and firmware, or in any appropriate combination of any several of them.
  • FPGA field programmable gate array
  • PLA Programmable logic array
  • ASIC application specific integrated circuit
  • At least one of the receiving module 410, the management module 420, the initial change module 430, and the auxiliary management module 440 may be at least partially implemented as a computer program module, and when the computer program module is executed, it may perform a corresponding function .
  • FIG. 6 schematically shows a block diagram of a computer device suitable for implementing the method described above according to an embodiment of the present disclosure.
  • the computer device shown in FIG. 6 is only an example, and should not bring any limitation to the functions and use scope of the embodiments of the present disclosure.
  • the computer device 600 includes a processor 601 that can be loaded into a random access memory (RAM) 603 according to a program stored in a read-only memory (ROM) 602 or from a storage section 608 Program to perform various appropriate actions and processing.
  • the processor 601 may include, for example, a general-purpose microprocessor (eg, CPU), an instruction set processor and/or related chipset, and/or a dedicated microprocessor (eg, application specific integrated circuit (ASIC)), and so on.
  • the processor 601 may also include on-board memory for caching purposes.
  • the processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiments of the present disclosure.
  • the processor 601, ROM 602, and RAM 603 are connected to each other through a bus 604.
  • the processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing programs in the ROM 602 and/or the RAM 603. It should be noted that the program may also be stored in one or more memories other than ROM 602 and RAM 603.
  • the processor 601 may also execute various operations of the method flow according to the embodiments of the present disclosure by executing programs stored in the one or more memories.
  • the device 600 may further include an input/output (I/O) interface 605, and the input/output (I/O) interface 605 is also connected to the bus 604.
  • the device 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, etc.; including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker
  • An output section 607 such as; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc.
  • the communication section 609 performs communication processing via a network such as the Internet.
  • the driver 610 is also connected to the I/O interface 605 as needed.
  • a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed on the drive 610 as necessary, so that a computer program read therefrom is installed into the storage section 608 as necessary.
  • the method flow according to the embodiment of the present disclosure may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product that includes a computer program carried on a computer-readable medium, the computer program containing program code for performing the method shown in the flowchart.
  • the computer program may be downloaded and installed from the network through the communication section 609, and/or installed from the removable medium 611.
  • the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed.
  • the above-described systems, devices, devices, modules, units, etc. may be implemented by computer program modules.
  • the present disclosure also provides a computer-readable storage medium.
  • the computer-readable storage medium may be included in the device/apparatus/system described in the above embodiments; or may exist alone without being assembled into the device/ Device/system.
  • the above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to an embodiment of the present disclosure is implemented.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, but is not limited to, a portable computer disk, a hard disk, a random access memory (RAM), and a read-only memory (ROM) , Erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable storage medium may include one or more memories other than the ROM 602 and/or RAM 603 and/or ROM 602 and RAM 603 described above.
  • each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more for implementing a specified logical function Executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks represented in succession may actually be executed in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram or flowchart, and a combination of blocks in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be used It is realized by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

一种区块链的数据处理方法,适配于区块链的未花费交易输出体系,应用于区块链节点,包括:接收客户端发送的第一交易数据,第一交易数据包括交易输入数据和交易输出数据;所述交易输出数据包括:类别标识、交易数额、接收方地址和附加信息(S201);当第一交易数据与智能合约关联时,与其他区块链节点经过共识验证将第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中(S202)。还提供了一种区块链的数据处理装置、计算机设备和计算机可读存储介质。

Description

区块链的数据处理方法和装置 技术领域
本公开涉及互联网技术领域,更具体地,涉及一种区块链的数据处理方法和装置。
背景技术
区块链是一种分布式记账技术。由于区块链具有去中心化,不可篡改,代码本身保证信任、无需第三方信任担保的优点而得到广泛重视。而区块链技术中的智能合约更是将区块链的代码信任优点发挥的淋漓尽致。智能合约是将合同条款通过使用计算机语言编写并保存于区块链中,当一个预先设定的条件被触发时,智能合约自动执行相应的合同条款。
UTXO全称Unspent Transaction Output,即未花费交易输出,它是由中本聪创造。在比特币的账本体系中,并没有账户或者余额,它有的只是UTXO。用户余额的计算方法是把该用户所拥有的UTXO全部加起来的总额。比特币的UTXO体系比当前电子银行系统中的账户体系更贴近我们日常生活中的现金,一个个UTXO如同钱包中的一张张钞票。由于UTXO体系不存在账户,该体系比账户体系具备更加地去中心化,更符合现实中现金实际使用方式的优点。
然而,由于当前的智能合约系统,如以太坊和eos,都是基于账户体系创建,无法与UTXO体系兼容。并且由于UTXO体系是一种无状态模型,无法将智能合约运行中产生的状态进行存储。
发明内容
有鉴于此,本公开提供了一种改进的区块链的数据处理方法和装置。
本公开的一个方面提供了一种区块链的数据处理方法,适配于区块链的未花费交易输出体系,该方法应用于区块链节点,包括:接收客户端发送的第一交易数据,第一交易数据包括交易输入数据和交易输出数据。第一交易数据的交易输出数据包括:类别标识、交易数额、接收方地址和附加信息,其中,所述类别标识用于表征第一交易数据是否与智能合约关联,所述附加信息用于在第一交易数据与智能合约关联时表征该智能合约运行所需的信息。当第一交易数据与智能合约关联时,本区块链节点与其他区块链节点经过共识验证将第一 交易数据存入区块链中,并基于第一交易数据的交易输出数据将相应的智能合约状态存入各自对应的本地数据库中。
根据本公开的实施例,当第一交易数据为发布智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第一数值,所述第一数值大于零,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的代码。上述与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于第一交易数据的交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:将第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息初始化所述智能合约,将初始化后的状态存入各自对应的本地数据库中。
根据本公开的实施例,上述方法还包括:在基于所述附加信息初始化所述智能合约之后,构造初始找零数据,所述初始找零数据的交易输入数据为所述第一交易数据的交易输入数据,所述初始找零数据的交易输出数据的接收方地址为所述客户端的地址,所述初始找零数据的交易输出数据的交易数额为初始找零数值,所述初始找零数值等于所述交易输入数据的实际交易数额减去所述第一数值后的余额。将所述初始找零数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述初始找零数据存入区块链中。
根据本公开的实施例,当第一交易数据为触发智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第二数值,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的执行指令;上述与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息运行所述智能合约,将运行后的状态存入各自对应的本地数据库中。
根据本公开的实施例,上述方法还包括:在基于所述附加信息运行所述智能合约之后,构造第二交易数据,第二交易数据包括交易输入数据和交易输出数据,第二交易数据的交易输入数据为第一交易数据的交易输出数据,第二交易数据包括第一交易输出数据,第二交易数据的第一交易输出数据的接收方地址为本节点的地址,第二交易数据的第一交易输出数据的交易数额为第三数值。 将第二交易数据发送至其他区块链节点,使得各区块链节点经过共识验证将第二交易数据存入区块链中。
根据本公开的实施例,第二交易数据还包括第二交易输出数据,第二交易数据的第二交易输出数据的接收方地址为运行所述智能合约后的结果所指示的地址,第二交易数据的第二交易输出数据的交易数额为第四数值,所述第四数值表征运行所述智能合约后的结果所指示的数额。
根据本公开的实施例,第二交易数据还包括第三交易输出数据,第二交易数据的第三交易输出数据的接收方地址为客户端的地址,第二交易数据的第三交易输出数据的交易数额为第五数值,该第五数值等于第二数值减去第三数值和第四数值后的余额。
根据本公开的实施例,上述基于所述附加信息初始化所述智能合约包括:基于所述智能合约的代码使用虚拟机初始化所述智能合约;并且/或者,所述基于所述附加信息运行所述智能合约包括:基于所述智能合约的执行指令使用虚拟机运行所述智能合约。
根据本公开的实施例,所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据同一区域;或者,所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据不同的区域。
本公开的另一个方面提供了一种区块链的数据处理装置,适配于区块链的未花费交易输出体系,所述装置应用于区块链节点,包括:接收模块和管理模块。接收模块用于接收客户端发送的第一交易数据,所述第一交易数据包括交易输入数据和交易输出数据。第一交易数据的交易输出数据包括:类别标识、交易数额、接收方地址和附加信息,其中,所述类别标识用于表征所述第一交易数据是否与智能合约关联,所述附加信息用于在所述第一交易数据与智能合约关联时表征所述智能合约运行所需的信息。管理模块用于当所述第一交易数据与智能合约关联时,与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中。
根据本公开的实施例,当所述第一交易数据为发布智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第一数值,所述第一数值大于零,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的代码。管理模块与其他区块链节点经过共识验证将所述第 一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:管理模块用于将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息初始化所述智能合约,将初始化后的状态存入各自对应的本地数据库中。
根据本公开的实施例,上述装置还包括初始找零模块,用于在基于所述附加信息初始化所述智能合约之后,构造初始找零数据,所述初始找零数据的交易输入数据为所述第一交易数据的交易输入数据,所述初始找零数据的交易输出数据的接收方地址为所述客户端的地址,所述初始找零数据的交易输出数据的交易数额为初始找零数值,所述初始找零数值等于所述交易输入数据的实际交易数额减去所述第一数值后的余额;将所述初始找零数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述初始找零数据存入区块链中。
根据本公开的实施例,当所述第一交易数据为触发智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第二数值,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的执行指令。管理模块与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:管理模块用于将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息运行所述智能合约,将运行后的状态存入各自对应的本地数据库中。
根据本公开的实施例,上述装置还包括辅助管理模块,用于在基于所述附加信息运行所述智能合约之后,构造第二交易数据,所述第二交易数据包括交易输入数据和交易输出数据,所述第二交易数据的交易输入数据为所述第一交易数据的交易输出数据,所述第二交易数据包括第一交易输出数据,第二交易数据的第一交易输出数据的接收方地址为本节点的地址,第二交易数据的第一交易输出数据的交易数额为第三数值;将所述第二交易数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述第二交易数据存入区块链中。
根据本公开的实施例,所述第二交易数据还包括第二交易输出数据,第二交易数据的第二交易输出数据的接收方地址为运行所述智能合约后的结果所指 示的地址,第二交易数据的第二交易输出数据的交易数额为第四数值,所述第四数值表征运行所述智能合约后的结果所指示的数额。
根据本公开的实施例,第二交易数据还包括第三交易输出数据,第二交易数据的第三交易输出数据的接收方地址为客户端的地址,第二交易数据的第三交易输出数据的交易数额为第五数值,所述第五数值等于第二数值减去第三数值和第四数值后的余额。
根据本公开的实施例,管理模块基于所述附加信息初始化所述智能合约包括:管理模块用于基于所述智能合约的代码使用虚拟机初始化所述智能合约;并且/或者,管理模块基于所述附加信息运行所述智能合约包括:管理模块用于基于所述智能合约的执行指令使用虚拟机运行所述智能合约。
根据本公开的实施例,所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据同一区域;或者,所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据不同的区域。
本公开的另一个方面提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如上所述的方法。
本公开的另一个方面提供了一种计算机可读存储介质,其上存储有可执行指令,该指令被处理器执行时使处理器执行如上所述的方法。
本公开的另一方面提供了一种计算机程序,所述计算机程序包括计算机可执行指令,所述指令在被执行时用于实现如上所述的方法。
根据本公开的实施例,可以至少部分地解决/减轻/抑制/甚至避免现有UTXO体系无法支持智能合约的问题,通过改进UTXO体系的数据结构,在第一交易数据的交易输出数据中增加了用于表征第一交易数据是否与智能合约关联的类别标识以及用于表征该与第一交易数据关联的智能合约运行所需的信息的附加信息,使之能够适应与智能合约相关的交易数据,且在各区块链节点将第一交易数据存入区块链的同时在本地记录相应的智能合约的状态,能够支持各种复杂程度的智能合约。
附图说明
通过以下参照附图对本公开实施例的描述,本公开的上述以及其他目的、特征和优点将更为清楚,在附图中:
图1示意性示出了根据本公开实施例的可以应用区块链的数据处理方法和装置的示例性系统架构;
图2示意性示出了根据本公开的实施例的区块链的数据处理方法的流程图;
图3A示意性示出了根据本公开的实施例的第一交易数据的交易输出数据的数据结构;
图3B示意性示出了根据本公开的实施例的第二交易数据的交易输入数据和交易输出数据的数据结构;
图4示意性示出了根据本公开的实施例的区块链的数据处理装置的框图;
图5示意性示出了根据本公开的另一实施例的区块链的数据处理装置的框图;以及
图6示意性示出了根据本公开实施例的适于实现区块链的数据处理方法的计算机设备的框图。
具体实施方式
以下,将参照附图来描述本公开的实施例。但是应该理解,这些描述只是示例性的,而并非要限制本公开的范围。在下面的详细描述中,为便于解释,阐述了许多具体的细节以提供对本公开实施例的全面理解。然而,明显地,一个或多个实施例在没有这些具体细节的情况下也可以被实施。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本公开的概念。
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本公开。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。
在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。在使用类似于“A、B或C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B 或C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。本领域技术人员还应理解,实质上任意表示两个或更多可选项目的转折连词和/或短语,无论是在说明书、权利要求书还是附图中,都应被理解为给出了包括这些项目之一、这些项目任一方、或两个项目的可能性。例如,短语“A或B”应当被理解为包括“A”或“B”、或“A和B”的可能性。
本公开的实施例提供了一种区块链的数据处理方法和装置。该方法适配于区块链的未花费交易输出(UTXO,Unspent Transaction Output)体系,该方法应用于区块链节点,包括交易数据接收过程和交易数据管理过程。在交易数据接收过程中,接收第一交易数据,第一交易数据包括交易输入数据和交易输出数据。交易输出数据除现有的交易数额和接收方地址之外,还包括用于表征所述第一交易数据是否与智能合约关联的类别标识以及用于表征智能合约运行所需的信息的附加信息。然后进入交易数据管理过程,与其他区块链节点经过共识验证将所述第一交易数据存入区块链中并在各自本地记录相应的智能合约状态。
图1示意性示出了根据本公开实施例的可以应用区块链的数据处理方法和装置的示例性系统架构100。需要注意的是,图1所示仅为可以应用本公开实施例的系统架构的示例,以帮助本领域技术人员理解本公开的技术内容,但并不意味着本公开实施例不可以用于其他设备、系统、环境或场景。
如图1所示,根据该实施例的系统架构100可以包括多个电子设备(101~107)。电子设备(101~107)可以是个人电脑(personal computer,PC)、网络服务器、数据库服务器等。电子设备(101~107)中的每一个电子设备可以具有相同或不同的计算能力。
作为一种实施方式,多个电子设备之间可以相互通信,构成区块链网络,每个电子设备作为该区块链网络中的一个区块链节点,各区块链节点维护相同的区块链数据库(下文中统称为“区块链”)。此外,在系统架构100中,各区块链节点分别可以与不同的服务提供方和/或客户端的计算设备(如服务器/服务器集群、终端设备等)通信,即分别作为各服务提供方和/或客户端对应的区块链节点,每个服务提供方和/或客户端可以通过相应的区块链节点在区块链中进行数据的读写等操作。
应该理解,图1中的电子设备的数目仅仅是示意性的。根据实现需要,可以具有任意数目的电子设备。
本公开实施例提供的区块链的数据处理方法可以运行于图1所示的电子设备中。
图2示意性示出了根据本公开的实施例的区块链的数据处理方法的流程图。
如图2所示,该方法适配于区块链的未花费交易输出(UTXO)体系,该方法由区块链节点执行,从区块链节点侧说明本公开所提供的区块链的数据处理过程。
该方法包括在操作S201,接收客户端发送的第一交易数据,所述第一交易数据包括交易输入数据和交易输出数据,所述交易输出数据包括:类别标识、交易数额、接收方地址和附加信息。
需要说明的是,UTXO体系是区块链网络的一种记账模式,该记账模式的特点是:每笔交易都会花费先前交易的产出,并产生新的产出,这些产出可能会在未来通过交易消耗,所有未花费的交易都保存在每个完全同步的节点中,用户的钱包跟踪与用户拥有的所有地址相关联的未花费的交易的列表,并且钱包的余额被计算为这些未花费的交易的总和。
本操作中,第一交易数据采用UTXO体系的数据结构,包括交易输入数据和交易输出数据,交易输入数据中包括客户端实际发出的交易数额,而交易输出数据中除了现有UTXO体系的数据结构中必需的交易数额和接收方地址之外,还包括类别标识和附加信息,其中,类别标识用于表征第一交易数据是否与智能合约关联,附加信息用于在第一交易数据与智能合约关联时表征该与第一交易数据关联的智能合约运行所需的信息。
然后,在操作S202,当第一交易数据与智能合约关联时,与其他区块链节点经过共识验证将第一交易数据存入区块链中,并基于第一交易数据的交易输出数据将相应的智能合约状态存入各自对应的本地数据库中。
本操作中,在第一交易数据的交易输出数据中的类别标识表明第一交易数据与智能合约相关联时,各区块链节点一方面经过共识验证将第一交易数据存入区块链,另一方面还基于第一交易数据的交易输出数据中的附加信息将与第一交易数据相关联的的智能合约的相应状态各自保存于本地。
可见,图2所示的方法改进了UTXO体系的数据结构,在第一交易数据的交易输出数据中增加了用于表征第一交易数据是否与智能合约关联的类别标识以及用于表征该与第一交易数据关联的智能合约运行所需的信息的附加信息,使之能够适应与智能合约相关的交易数据,且在各区块链节点将第一交易数据 存入区块链的同时在本地记录相应的智能合约的状态,能够支持各种复杂程度的智能合约,解决了现有UTXO体系无法支持智能合约的问题。
在本公开的一个实施例中,在改进了UTXO体系的数据结构中,类别标识和所述接收方地址在所述交易输出数据的数据结构中占据同一区域;或者,所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据不同的区域。可以根据需要进行配置,在此不做限定。
在本公开的一个实施例中,第一交易数据为发布智能合约的交易数据,此时,第一交易数据的交易输出数据中的类别标识表征第一交易数据与智能合约关联,第一交易数据的交易输出数据中的交易数额为第一数值,第一数值为大于零的数值,第一交易数据的交易输出数据中的接收方地址为所述智能合约的地址,第一交易数据的交易输出数据中的附加信息包括与第一交易数据相关联的智能合约的代码,也就是想要发布的智能合约的代码。
则上述操作S202与其他区块链节点经过共识验证将第一交易数据存入区块链中,并基于第一交易数据的交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:当本节点是造块者节点时,将第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将该新的区块加入区块链时基于第一交易数据的交易输出数据中的附加信息初始化智能合约,将初始化后的状态存入各自对应的本地数据库中;当本节点不是造块者节点时,接收造块者节点发送的新的区块,该新的区块中打包有第一交易数据,与其他各区块链节点经过共识验证将该新的区块加入区块链时基于第一交易数据的交易输出数据中的附加信息初始化智能合约,将初始化后的状态存入各自对应的本地数据库中。
依据本实施例,客户端想要发布智能合约时,构造包含交易输出数据的第一交易数据,在交易输出数据的类别标识中记录第一交易数据与智能合约关联,将智能合约作为交易接收方,在交易输出数据的接收方地址中记录该智能合约的地址,在交易输出数据的附加信息中记录该智能合约的代码,在交易输出数据的交易数额中记录大于零的第一数值。客户端将第一交易数据发送至区块链节点,造块者节点在打包该第一交易数据到新的区块中时,初始化相应智能合约并将初始化后的状态保存在本地数据库中,其他全节点在同步区块链时,当收到造块者节点创建的该新的区块时,在区块验证阶段也会初始化该智能合约并将初始化后的状态保存在各自的本地数据库中。该过程一方面将智能合约的 代码部署至区块链中,利用区块链的不可篡改性保证后续智能合约可以按照预先约定的规则准确无误地执行操作,另一方面将智能合约初始化后的状态记录在区块链节点本地,既可以记录智能合约的变化状态又无需像现有的账户/余额体系那样将智能合约状态记录在区块链上,极大地节省了区块链传输带宽和存储空间。
其中可选地,上述各区块链节点基于附加信息初始化所述智能合约包括:基于所述智能合约的代码使用虚拟机初始化所述智能合约。
进一步地,作为一个可选的实施例,在客户端发出第一交易数据后,由于UTXO体系中交易数据的输入是账户中未花费的之前的交易输出,如同钱包中的一张张钞票,其面额是确定的,不能随意更改,因此很容易出现交易输入与交易输出的交易数额不相同的情形,如果第一交易数据的交易输出数据中的交易数额与交易输入数据中的实际交易数据不相符时,需要构造初始找零数据进行找零。具体地,图2所示的方法还包括:在基于所述附加信息初始化所述智能合约之后,构造初始找零数据,所述初始找零数据的交易输入数据为第一交易数据的交易输入数据,第一交易数据的交易输入数据中包括客户端关于第一交易数据实际发出的交易数额,称之为实际交易数额。所述初始找零数据的交易输出数据的接收方地址为发出第一交易数据的客户端的地址,所述初始找零数据的交易输出数据的交易数额为初始找零数值,该初始找零数值等于该客户端发出的实际交易数额减去所述第一数值后的余额。本实施例实现了在发布智能合约时交易数额的多退少补,然后将所述初始找零数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述初始找零数据存入区块链中,以在区块链中记录初始找零这一事件。
在本公开的另一个实施例中,在智能合约已经按照上述实施例在区块链中部署之后,还可以进行智能合约的触发执行过程,此时,第一交易数据为触发智能合约的交易数据,第一交易数据的交易输出数据中的类别标识表征第一交易数据与智能合约关联,第一交易数据的交易输出数据中的交易数额为第二数值,第一交易数据的交易输出数据中的接收方地址为所述智能合约的地址,第一交易数据的交易输出数据中的附加信息包括智能合约的执行指令。
则上述上述操作S202与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:当本节点是造块者节点时,将所述第一交易数据打包至 新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息运行所述智能合约,将运行后的状态存入各自对应的本地数据库中;当本节点不是造块者节点时,接收造块者节点发送的新的区块,该新的区块中打包有第一交易数据,与其他各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息运行所述智能合约,将运行后的状态存入各自对应的本地数据库中。
依据本实施例,客户端想要向区块链中部署的智能合约发布指令时,构造包含交易输出数据的第一交易数据,在交易输出数据的类别标识中记录第一交易数据与智能合约关联,将智能合约作为交易接收方,在交易输出数据的接收方地址中记录该智能合约的地址,在交易输出数据的附加信息中记录该智能合约的执行指令,在交易输出数据的交易数额中记录智能合约运行所需的第二数值。客户端将第一交易数据发送至区块链节点,造块者节点在打包该第一交易数据到新的区块中时,运行该智能合约并将运行后的状态保存在本地数据库中,其他全节点在同步区块链时,当收到造块者节点创建的该新的区块时,在区块验证阶段也会运行该智能合约并将运行后的状态保存在各自的本地数据库中。该过程将智能合约执行各任务后的运行状态记录在区块链节点本地,能够支持图灵完备的智能合约,且无需像现有的账户/余额体系那样将智能合约状态记录在区块链上,极大地节省了区块链传输带宽和存储空间。
其中可选地,上述各区块链节点基于所述附加信息运行所述智能合约包括:基于所述智能合约的执行指令使用虚拟机运行所述智能合约。
进一步地,作为一个可选的实施例,在客户端发出第一交易数据后,由于UTXO体系中交易数据的输入是账户中未花费的之前的交易输出,如同钱包中的一张张钞票,其面额是确定的,不能随意更改,因此很容易出现交易输入与交易输出的交易数额不相同的情形,如果第一交易数据的交易输出数据中的交易数额与交易输入数据中的实际交易数据不相符时,需要构造初始找零数据进行找零。具体地,图2所示的方法还包括:在基于所述附加信息运行所述智能合约之后,构造初始找零数据,所述初始找零数据的交易输入数据为第一交易数据的交易输入数据,第一交易数据的交易输入数据中包括客户端关于第一交易数据实际发出的交易数额,称之为实际交易数额。所述初始找零数据的交易输出数据的接收方地址为发出第一交易数据的客户端的地址,所述初始找零数据的交易输出数据的交易数额为初始找零数值,该初始找零数值等于该客户端 发出的实际交易数额减去所述第二数值后的余额。本实施例实现了在触发执行智能合约时交易数额的多退少补,然后将所述初始找零数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述初始找零数据存入区块链中,以在区块链中记录初始找零这一事件。
以及,进一步地,作为一个可选的实施例,图2所示的方法还包括:在基于所述附加信息运行所述智能合约之后,构造第二交易数据,所述第二交易数据包括交易输入数据和交易输出数据,所述第二交易数据的交易输入数据为所述第一交易数据的交易输出数据,所述第二交易数据的交易输出数据包括第一交易输出数据,当本节点为造块者节点时,所述第一交易输出数据的接收方地址为本节点的地址,当本节点不是造块者节点时,所述第一交易输出数据的接收方地址为造块者节点的地址,所述第一交易输出数据的交易数额为第三数值。将所述第二交易数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述第二交易数据存入区块链中。
可以看出,第二交易数据中的第一交易输出数据表示向运行智能合约的造块者节点发放的手续费,以对造块者节点进行激励,保证基于UTXO体系的交易管理顺利有序进行。
此外,在本公开的一个实施例中,除表示给造块者节点的手续费的输出数据之外,上述第二交易数据还包括第二交易输出数据,该第二交易输出数据的接收方地址为运行所述智能合约后的结果所指示的地址,该第二交易输出数据的交易数额为第四数值,所述第四数值表征运行所述智能合约后的结果所指示的数额。
可以看出,第二交易数据中的第二交易输出数据表示按照智能合约指令运行智能合约后的结果所指示的地址,例如可以是将一部分交易数额存储于智能合约中,或者可以是将一部分交易数额发给指令执行结果所指示的其他客户端的地址等等,根据智能合约预先约定的内容而定,在此不做限定,以满足发送第一交易数据的客户端运行智能合约的需求。
此外,在本公开的另一个实施例中,除表示给造块者节点的手续费以及智能合约正常运行所需的费用之外,上述第二交易数据还包括第三交易输出数据,所述第三交易输出数据的接收方地址为客户端的地址,所述第三交易输出数据的交易数额为第五数值,所述第五数值等于第二数值减去第三数值和第四数值后的余额。
可以看出,第二交易数据中的第三交易输出数据表示在运行智能合约后生成对应于向客户端找零的交易输出,在客户端发出的第一交易数据的交易数额超过手续费以及运行结果所需的费用后向客户端找零,确保交易公平进行。
下面参考图3A~图3B,结合具体实施例对图2所示的方法做进一步说明。
图3A示意性示出了根据本公开的实施例的第一交易数据的交易输出数据的数据结构。
如图3A所示,第一交易数据的交易输出数据采用了改进的UTXO体系的数据结构,左边为现有的以UTXO体系的数据结构表示的交易输出数据(Txout’),右边为本公开提供的第一交易数据的交易输出数据(Txout)。
可以看到,在现有的比特币区块链的交易输出数据Txout’的数据结构中,publicKeyHash项用于指示接收方地址,value项用于指示交易数额。而在本公开改进的第一交易数据的交易输出数据Txout的数据结构中,修改原有的publicKeyHash的数据格式,当第一交易数据与智能合约无关时,在该数据前加前缀n以表示此为普通地址,当第一交易数据与智能合约关联时,在该数据前加前缀s以表示此为智能合约地址,该前缀n/s即为表示第一交易数据与智能合约是否关联的类别标识,并且在该Txout数据结构中,增加一个额外的smart contract/operation项,该项表示附加信息,用于存储智能合约代码或是客户端发出的智能合约执行指令。
基于上述改进的Txout数据结构,本公开实施例中的第一交易数据可以是支持用于存储与识别智能合约的交易数据。
当客户端发布智能合约A时,构造一个第一交易数据,该第一交易数据包括交易输入数据和交易输出数据,交易输入数据包括客户端实际发出的交易数额,交易输出数据Txout包括:交易数额(Value)项为0.0001,接收方地址(n/s+PubKeyHash)项使用s开头的字符串作为交易接收方,以表示此地址为智能合约地址,在附加信息(smart contract/operation)项中填入智能合约A的代码(smart contract)。
客户端将第一交易数据发送至区块链节点,造块者节点在打包该第一交易数据到区块中的同时,需使用虚拟机运行智能合约A并将初始化后的状态保存在自己的计算机数据库中。其余全节点在同步区块链时,当收到此区块时,在区块验证阶段也会运行智能合约A并将初始化后的状态保存在自己的计算机数据库中。
此外,如果第一交易数据的交易输入数据中的实际交易金额大于交易输入数据中的交易数额时,进一步构造生成初始找零数据,该输出找零数据的接收方地址为发出第一交易数据的客户端的地址,该输出找零数据的交易数额等于实际交易数额减去0.0001后得到的余额。
进一步地,当客户端向智能合约A发送执行指令时,构造一个第一交易数据,该第一交易数据包括交易输入数据和交易输出数据,交易输入数据包括客户端实际发出的交易数额,交易输出数据Txout包括:交易数额(Value)项为运行智能合约A所需交易数额,其中接收方地址(n/s+PubKeyHash)项填入所需执行的智能合约A的地址(s+PubKeyHash),在附加信息(smart contract/operation)项中填入所需执行的指令(operation)。
客户端将第一交易数据发送至区块链节点,造块者节点在打包该交易到区块中时,使用相应的智能合约A运行执行指令并更新本地保存的智能合约A的状态。其余全节点在同步区块链时,当收到此区块时,在区块验证阶段也会运行智能合约指令并更新自己本地的智能合约A的状态。
此外,如果第一交易数据的交易输入数据中的实际交易金额大于交易输入数据中的交易数额时,进一步构造生成初始找零数据,该输出找零数据的接收方地址为发出第一交易数据的客户端的地址,该输出找零数据的交易数额等于实际交易数额减去交易数额(Value)项的数值后得到的余额。
图3B示意性示出了根据本公开的实施例的第二交易数据的交易输入数据和交易输出数据的数据结构。
如图3B所示,在基于所述附加信息运行所述智能合约之后,构造第二交易数据,第二交易数据包括交易输入数据和交易输出数据,第二交易数据的交易输入数据为如图3A中右边所示的第一交易数据的交易输出数据Txout,第二交易数据的交易输出数据包括第一交易输出数据Txout1、第二交易输出数据Txout2和第三交易输出数据Txout3。
第一交易输出数据Txout1的接收方地址n+PubKeyHash为造块者节点的地址,交易数额value1表示向造块者节点发放的手续费。
第二交易输出数据Txout2的接收方地址s+PubKeyHash为智能合约A的地址,交易数额value2表示在智能合约中存储的交易数额。
第三交易输出数据Txout3的接收方地址n+PubKeyHash为客户端的地址,交易数额value3表示向客户端找零的数额,value3=value-value1-value2。
可以看到,在执行智能合约A后,造块者将Txout拆分为三个款项。第一个款项作为运行智能合约A所需收取的费用,从而归造块者所有。第二个款项为按智能合约执行指令所示,将款项存储于智能合约中,或是发给指令执行结果的地址。第三个款项为多余的金额,该金额将被退回给客户端。
基于上述分析可知,本公开实施例具有以下有益效果:第一,实现了在UTXO体系下图灵完备的智能合约功能;第二,无需将智能合约状态记录在区块链上,极大地节省了区块链传输带宽与存储空间。
图4示意性示出了根据本公开的实施例的区块链的数据处理装置的框图。
如图4所示,区块链的数据处理装置400适配于区块链的未花费交易输出体系,区块链的数据处理装置400应用于区块链节点,包括接收模块410和管理模块420。
接收模块410用于接收客户端发送的第一交易数据,所述第一交易数据包括交易输入数据和交易输出数据。所述交易输出数据包括:类别标识、交易数额、接收方地址和附加信息,其中,所述类别标识用于表征所述第一交易数据是否与智能合约关联,所述附加信息用于在所述第一交易数据与智能合约关联时表征所述智能合约运行所需的信息。
管理模块420用于当所述第一交易数据与智能合约关联时,与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中。
其中可选地,所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据同一区域;或者,所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据不同的区域。
在本公开的一个实施例中,当所述第一交易数据为发布智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第一数值,所述第一数值大于零,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的代码。管理模块420与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:管理模块420用于将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息初始化所述智能合约,将初始化后的状态存入各自对应的本地数据库中。
在本公开的另一个实施例中,当所述第一交易数据为触发智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第二数值,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的执行指令。管理模块420与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:管理模块420用于将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息运行所述智能合约,将运行后的状态存入各自对应的本地数据库中。
具体地,作为一个可选的实施例,管理模块420基于所述附加信息初始化所述智能合约包括:管理模块420用于基于所述智能合约的代码使用虚拟机初始化所述智能合约。并且/或者,管理模块420基于所述附加信息运行所述智能合约包括:管理模块420用于基于所述智能合约的执行指令使用虚拟机运行所述智能合约。
图5示意性示出了根据本公开的另一实施例的区块链的数据处理装置的框图。
如图5所示,区块链的数据处理装置500应用于区块链节点,包括接收模块410、管理模块420、初始找零模块430、和辅助管理模块440。
其中接收模块410和管理模块420在上文中已经说明,重复的部分不再赘述。
初始找零模块430用于在基于所述附加信息初始化所述智能合约和/或运行所述智能合约之后,构造初始找零数据,所述初始找零数据的交易输入数据为所述第一交易数据的交易输入数据,所述初始找零数据的交易输出数据的接收方地址为所述客户端的地址,所述初始找零数据的交易输出数据的交易数额为初始找零数值,所述初始找零数值等于所述交易输入数据的实际交易数额减去所述第一数值和/或所述第二数值后的余额;将所述初始找零数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述初始找零数据存入区块链中。
辅助管理模块440用于在基于所述附加信息运行所述智能合约之后,构造第二交易数据,所述第二交易数据包括交易输入数据和交易输出数据,所述第二交易数据的交易输入数据为所述第一交易数据的交易输出数据,所述第二交易数据包括第一交易输出数据,所述第一交易输出数据的接收方地址为本节点 的地址,所述第一交易输出数据的交易数额为第三数值;将所述第二交易数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述第二交易数据存入区块链中。
进一步地,作为一个可选的实施例,所述第二交易数据还包括第二交易输出数据,所述第二交易输出数据的接收方地址为运行所述智能合约后的结果所指示的地址,所述第二交易输出数据的交易数额为第四数值,所述第四数值表征运行所述智能合约后的结果所指示的数额。
进一步地,作为另一个可选的实施例,所述第二交易数据还包括第三交易输出数据,所述第二交易输出数据的接收方地址为客户端的地址,所述第二交易输出数据的交易数额为第五数值,所述第五数值等于第二数值减去第三数值和第四数值后的余额。
需要说明的是,装置部分实施例中各模块/单元/子单元等的实施方式、解决的技术问题、实现的功能、以及达到的技术效果分别与方法部分实施例中各对应的步骤的实施方式、解决的技术问题、实现的功能、以及达到的技术效果相同或类似,在此不再赘述。
根据本公开的实施例的模块、子模块、单元、子单元中的任意多个、或其中任意多个的至少部分功能可以在一个模块中实现。根据本公开实施例的模块、子模块、单元、子单元中的任意一个或多个可以被拆分成多个模块来实现。根据本公开实施例的模块、子模块、单元、子单元中的任意一个或多个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式的硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,根据本公开实施例的模块、子模块、单元、子单元中的一个或多个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。
例如,接收模块410、管理模块420、初始找零模块430、和辅助管理模块440中的任意多个可以合并在一个模块中实现,或者其中的任意一个模块可以被拆分成多个模块。或者,这些模块中的一个或多个模块的至少部分功能可以与其他模块的至少部分功能相结合,并在一个模块中实现。根据本公开的实施例,接收模块410、管理模块420、初始找零模块430、和辅助管理模块440中的至 少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,接收模块410、管理模块420、初始找零模块430、和辅助管理模块440中的至少一个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。
图6示意性示出了根据本公开实施例的适于实现上文描述的方法的计算机设备的框图。图6示出的计算机设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图6所示,根据本公开实施例的计算机设备600包括处理器601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储部分608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。处理器601例如可以包括通用微处理器(例如CPU)、指令集处理器和/或相关芯片组和/或专用微处理器(例如,专用集成电路(ASIC)),等等。处理器601还可以包括用于缓存用途的板载存储器。处理器601可以包括用于执行根据本公开实施例的方法流程的不同动作的单一处理单元或者是多个处理单元。
在RAM 603中,存储有设备600操作所需的各种程序和数据。处理器601、ROM 602以及RAM 603通过总线604彼此相连。处理器601通过执行ROM 602和/或RAM 603中的程序来执行根据本公开实施例的方法流程的各种操作。需要注意,所述程序也可以存储在除ROM 602和RAM 603以外的一个或多个存储器中。处理器601也可以通过执行存储在所述一个或多个存储器中的程序来执行根据本公开实施例的方法流程的各种操作。
根据本公开的实施例,设备600还可以包括输入/输出(I/O)接口605,输入/输出(I/O)接口605也连接至总线604。设备600还可以包括连接至I/O接口605的以下部件中的一项或多项:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的 计算机程序根据需要被安装入存储部分608。
根据本公开的实施例,根据本公开实施例的方法流程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被处理器601执行时,执行本公开实施例的系统中限定的上述功能。根据本公开的实施例,上文描述的系统、设备、装置、模块、单元等可以通过计算机程序模块来实现。
本公开还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中描述的设备/装置/系统中所包含的;也可以是单独存在,而未装配入该设备/装置/系统中。上述计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被执行时,实现根据本公开实施例的方法。
根据本公开的实施例,计算机可读存储介质可以是非易失性的计算机可读存储介质,例如可以包括但不限于:便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。例如,根据本公开的实施例,计算机可读存储介质可以包括上文描述的ROM 602和/或RAM 603和/或ROM 602和RAM 603以外的一个或多个存储器。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。本领域技术人员可以理解,本公开的各个实 施例和/或权利要求中记载的特征可以进行多种组合和/或结合,即使这样的组合或结合没有明确记载于本公开中。特别地,在不脱离本公开精神和教导的情况下,本公开的各个实施例和/或权利要求中记载的特征可以进行多种组合和/或结合。所有这些组合和/或结合均落入本公开的范围。
以上对本公开的实施例进行了描述。但是,这些实施例仅仅是为了说明的目的,而并非为了限制本公开的范围。尽管在以上分别描述了各实施例,但是这并不意味着各个实施例中的措施不能有利地结合使用。本公开的范围由所附权利要求及其等同物限定。不脱离本公开的范围,本领域技术人员可以做出多种替代和修改,这些替代和修改都应落在本公开的范围之内。

Claims (20)

  1. 一种区块链的数据处理方法,适配于区块链的未花费交易输出体系,所述方法应用于区块链节点,包括:
    接收客户端发送的第一交易数据,所述第一交易数据包括交易输入数据和交易输出数据;
    所述交易输出数据包括:类别标识、交易数额、接收方地址和附加信息,其中,所述类别标识用于表征所述第一交易数据是否与智能合约关联,所述附加信息用于在所述第一交易数据与智能合约关联时表征所述智能合约运行所需的信息;
    当所述第一交易数据与智能合约关联时,与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中。
  2. 根据权利要求1所述的方法,其中:
    当所述第一交易数据为发布智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第一数值,所述第一数值大于零,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的代码;
    所述与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:
    将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息初始化所述智能合约,将初始化后的状态存入各自对应的本地数据库中。
  3. 根据权利要求2所述的方法,还包括:
    在基于所述附加信息初始化所述智能合约之后,构造初始找零数据,所述初始找零数据的交易输入数据为所述第一交易数据的交易输入数据,所述初始找零数据的交易输出数据的接收方地址为所述客户端的地址,所述初始找零数据的交易输出数据的交易数额为初始找零数值,所述初始找零数值等于所述交易输入数据的实际交易数额减去所述第一数值后的余额;
    将所述初始找零数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述初始找零数据存入区块链中。
  4. 根据权利要求1或2所述的方法,其中:
    当所述第一交易数据为触发智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第二数值,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的执行指令;
    所述与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:
    将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息运行所述智能合约,将运行后的状态存入各自对应的本地数据库中。
  5. 根据权利要求4所述的方法,还包括:
    在基于所述附加信息运行所述智能合约之后,构造第二交易数据,所述第二交易数据包括交易输入数据和交易输出数据,所述第二交易数据的交易输入数据为所述第一交易数据的交易输出数据,所述第二交易数据包括第一交易输出数据,所述第一交易输出数据的接收方地址为本节点的地址,所述第一交易输出数据的交易数额为第三数值;
    将所述第二交易数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述第二交易数据存入区块链中。
  6. 根据权利要求5所述的方法,其中,所述第二交易数据还包括第二交易输出数据,所述第二交易输出数据的接收方地址为运行所述智能合约后的结果所指示的地址,所述第二交易输出数据的交易数额为第四数值,所述第四数值表征运行所述智能合约后的结果所指示的数额。
  7. 根据权利要求6所述的方法,其中,所述第二交易数据还包括第三交易输出数据,所述第三交易输出数据的接收方地址为客户端的地址,所述第三交易输出数据的交易数额为第五数值,所述第五数值等于第二数值减去第三数值和第四数值后的余额。
  8. 根据权利要求4所述的方法,其中:
    所述基于所述附加信息初始化所述智能合约包括:基于所述智能合约的代码使用虚拟机初始化所述智能合约;并且/或者
    所述基于所述附加信息运行所述智能合约包括:基于所述智能合约的执行指令使用虚拟机运行所述智能合约。
  9. 根据权利要求1所述的方法,其中:
    所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据同一区域;或者
    所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据不同的区域。
  10. 一种区块链的数据处理装置,适配于区块链的未花费交易输出体系,所述装置应用于区块链节点,包括:
    接收模块,用于接收客户端发送的第一交易数据,所述第一交易数据包括交易输入数据和交易输出数据;所述交易输出数据包括:类别标识、交易数额、接收方地址和附加信息,其中,所述类别标识用于表征所述第一交易数据是否与智能合约关联,所述附加信息用于在所述第一交易数据与智能合约关联时表征所述智能合约运行所需的信息;
    管理模块,用于当所述第一交易数据与智能合约关联时,与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中。
  11. 根据权利要求10所述的装置,其中:
    当所述第一交易数据为发布智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第一数值,所述第一数值大于零,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的代码;
    所述管理模块与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:
    所述管理模块,用于将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息初始化所述智能合约,将初始化后的状态存入各自对应的本地数据库中。
  12. 根据权利要求11所述的装置,还包括:
    初始找零模块,用于在基于所述附加信息初始化所述智能合约之后,构造初始找零数据,所述初始找零数据的交易输入数据为所述第一交易数据的交易输入数据,所述初始找零数据的交易输出数据的接收方地址为所述客户端的地址,所述初始找零数据的交易输出数据的交易数额为初始找零数值,所述初始找零数值等于所述交易输入数据的实际交易数额减去所述第一数值后的余额;将所述初始找零数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述初始找零数据存入区块链中。
  13. 根据权利要求10或11所述的装置,其中:
    当所述第一交易数据为触发智能合约的交易数据时,所述类别标识表征第一交易数据与智能合约关联,所述交易数额为第二数值,所述接收方地址为所述智能合约的地址,所述附加信息包括所述智能合约的执行指令;
    所述管理模块与其他区块链节点经过共识验证将所述第一交易数据存入区块链中,并基于所述交易输出数据将相应的智能合约状态存入各自对应的本地数据库中包括:
    所述管理模块,用于将所述第一交易数据打包至新的区块并发送至其他区块链节点,使得各区块链节点经过共识验证将所述新的区块加入区块链时基于所述附加信息运行所述智能合约,将运行后的状态存入各自对应的本地数据库中。
  14. 根据权利要求13所述的装置,还包括:
    辅助管理模块,用于在基于所述附加信息运行所述智能合约之后,构造第二交易数据,所述第二交易数据包括交易输入数据和交易输出数据,所述第二交易数据的交易输入数据为所述第一交易数据的交易输出数据,所述第二交易数据包括第一交易输出数据,所述第一交易输出数据的接收方地址为本节点的地址,所述第一交易输出数据的交易数额为第三数值;将所述第二交易数据发送至其他区块链节点,使得各区块链节点经过共识验证将所述第二交易数据存入区块链中。
  15. 根据权利要求14所述的装置,其中,所述第二交易数据还包括第二交易输出数据,所述第二交易输出数据的接收方地址为运行所述智能合约后的结果所指示的地址,所述第二交易输出数据的交易数额为第四数值,所述第四数值表征运行所述智能合约后的结果所指示的数额。
  16. 根据权利要求15所述的装置,其中,所述第二交易数据还包括第三交易输出数据,所述第三交易输出数据的接收方地址为客户端的地址,所述第三交易输出数据的交易数额为第五数值,所述第五数值等于第二数值减去第三数值和第四数值后的余额。
  17. 根据权利要求13所述的装置,其中:
    所述管理模块基于所述附加信息初始化所述智能合约包括:所述管理模块,用于基于所述智能合约的代码使用虚拟机初始化所述智能合约;并且/或者
    所述管理模块基于所述附加信息运行所述智能合约包括:所述管理模块,用于基于所述智能合约的执行指令使用虚拟机运行所述智能合约。
  18. 根据权利要求10所述的装置,其中:
    所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据同一区域;或者
    所述类别标识和所述接收方地址在所述交易输出数据的数据结构中占据不同的区域。
  19. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时,实现如权利要求1~9中任一项所述的区块链的数据处理方法。
  20. 一种计算机可读存储介质,其上存储有可执行指令,该指令被处理器执行时使处理器执行如权利要求1~9中任一项所述的区块链的数据处理方法。
PCT/CN2018/124368 2018-12-27 2018-12-27 区块链的数据处理方法和装置 Ceased WO2020133069A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US17/418,589 US20220067033A1 (en) 2018-12-27 2018-12-27 Method and apparatus for processing data for a blockchain
EP18944745.1A EP3905165A4 (en) 2018-12-27 2018-12-27 DATA PROCESSING METHOD AND APPARATUS FOR A CHAIN OF BLOCKS
PCT/CN2018/124368 WO2020133069A1 (zh) 2018-12-27 2018-12-27 区块链的数据处理方法和装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/124368 WO2020133069A1 (zh) 2018-12-27 2018-12-27 区块链的数据处理方法和装置

Publications (1)

Publication Number Publication Date
WO2020133069A1 true WO2020133069A1 (zh) 2020-07-02

Family

ID=71129407

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/124368 Ceased WO2020133069A1 (zh) 2018-12-27 2018-12-27 区块链的数据处理方法和装置

Country Status (3)

Country Link
US (1) US20220067033A1 (zh)
EP (1) EP3905165A4 (zh)
WO (1) WO2020133069A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491983A (zh) * 2020-11-13 2021-03-12 南方科技大学 基于区块链的智能合约调度方法、装置、设备及存储介质
CN113590611A (zh) * 2021-06-29 2021-11-02 杭州复杂美科技有限公司 区块执行方法、计算机设备和存储介质
CN116137008A (zh) * 2021-11-17 2023-05-19 本田技研工业株式会社 契约管理系统以及契约管理方法
CN119071224A (zh) * 2024-07-05 2024-12-03 浙江大学 一种DeFi项目方智能合约地址的聚类方法、设备和介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102812723B1 (ko) * 2019-05-13 2025-05-26 삼성전자주식회사 블록체인에 저장된 푸시 메시지를 수신하는 전자 장치 및 방법
CN114186646A (zh) * 2022-02-15 2022-03-15 国网区块链科技(北京)有限公司 区块链异常交易识别方法及装置、存储介质及电子设备
US12256017B2 (en) 2022-11-18 2025-03-18 T-Mobile Usa, Inc. Techniques for correcting anomalous activity caused by smart contracts

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180181768A1 (en) * 2016-12-28 2018-06-28 Bull Sas System and method for the creation and management of decentralized authorizations for connected objects
CN108647966A (zh) * 2018-05-09 2018-10-12 深圳市融讯科技有限公司 一种基于区块链的数据交互方法及装置
CN108960797A (zh) * 2018-07-18 2018-12-07 百度在线网络技术(北京)有限公司 区块生成及验证方法、装置、设备和存储介质
CN109034814A (zh) * 2018-09-14 2018-12-18 百度在线网络技术(北京)有限公司 基于以太坊虚拟机的智能合约处理方法和装置
CN109040029A (zh) * 2018-07-13 2018-12-18 上海点融信息科技有限责任公司 在区块链中执行事务的方法和装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IL278834B2 (en) * 2016-02-23 2023-09-01 Nchain Holdings Ltd Automatic registration and management method for smart contracts based on 'block chain'
US20180123779A1 (en) * 2016-11-01 2018-05-03 Jiangang Zhang Flexible Blockchain Smart-Contract Deployment
GB201715423D0 (en) * 2017-09-22 2017-11-08 Nchain Holdings Ltd Computer-implemented system and method
WO2019109003A1 (en) * 2017-11-30 2019-06-06 Visa International Service Association Blockchain system for confidential and anonymous smart contracts

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180181768A1 (en) * 2016-12-28 2018-06-28 Bull Sas System and method for the creation and management of decentralized authorizations for connected objects
CN108647966A (zh) * 2018-05-09 2018-10-12 深圳市融讯科技有限公司 一种基于区块链的数据交互方法及装置
CN109040029A (zh) * 2018-07-13 2018-12-18 上海点融信息科技有限责任公司 在区块链中执行事务的方法和装置
CN108960797A (zh) * 2018-07-18 2018-12-07 百度在线网络技术(北京)有限公司 区块生成及验证方法、装置、设备和存储介质
CN109034814A (zh) * 2018-09-14 2018-12-18 百度在线网络技术(北京)有限公司 基于以太坊虚拟机的智能合约处理方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3905165A4 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491983A (zh) * 2020-11-13 2021-03-12 南方科技大学 基于区块链的智能合约调度方法、装置、设备及存储介质
CN113590611A (zh) * 2021-06-29 2021-11-02 杭州复杂美科技有限公司 区块执行方法、计算机设备和存储介质
CN113590611B (zh) * 2021-06-29 2023-11-24 杭州复杂美科技有限公司 区块执行方法、计算机设备和存储介质
CN116137008A (zh) * 2021-11-17 2023-05-19 本田技研工业株式会社 契约管理系统以及契约管理方法
CN119071224A (zh) * 2024-07-05 2024-12-03 浙江大学 一种DeFi项目方智能合约地址的聚类方法、设备和介质

Also Published As

Publication number Publication date
US20220067033A1 (en) 2022-03-03
EP3905165A1 (en) 2021-11-03
EP3905165A4 (en) 2022-08-10

Similar Documents

Publication Publication Date Title
US11042876B2 (en) Transaction method and system based on centralized settlement and blockchain deposit certificates
WO2020133069A1 (zh) 区块链的数据处理方法和装置
CN112883109B (zh) 基于区块链的数字商品交易方法和装置
US11556924B2 (en) Blockchain-based payment withholding and agreement signing method, apparatus, and electronic device
US20210049608A1 (en) Transaction method and system based on centralized clearing and blockchain record keeping
CN111476667B (zh) 基于区块链的原创作品交易方法及装置和电子设备
US20210049595A1 (en) Transaction method and system based on centralized settlement and block chain storage
JP2022003547A (ja) スマートコントラクトへ、確認済みで、監査可能で且つ不変の入力を提供する方法及びシステム
AU2019209559A1 (en) Fund flow method and apparatus, and electronic device
BR112019011800A2 (pt) Método para o processamento das transferências de ativos, aparelho para o processamento de transferências de ativos e dispositivo eletrônico
US10733583B2 (en) Blockchain-based withholding operations
CN111292028B (zh) 库存信息处理方法及系统、计算机系统和可读存储介质
CN111966503B (zh) 智能合约账户的存储空间管理方法和装置
US20200175588A1 (en) Blockchain-based payment
CN113553378A (zh) 一种区块链数据的删除方法和装置
US10789628B2 (en) Blockchain-based bill number allocation method, apparatus and electronic device
US11250438B2 (en) Blockchain-based reimbursement splitting
CN114780564A (zh) 数据处理方法、数据处理装置、电子设备和存储介质
CN114119243B (zh) 基于区块链的池融资管理方法、装置、介质和电子设备
CN112766854B (zh) 基于区块链的数字商品交易方法和装置
US20220028538A1 (en) Metric-based digital feed performance model
US20240231961A1 (en) Event fanning platform for streaming network event data to consumer applications
CN115311087A (zh) 基于区块链的交易处理方法及装置、处理器和电子设备
HK40041085A (zh) 智能合约账户的存储空间管理方法和装置
HK40041085B (zh) 智能合约账户的存储空间管理方法和装置

Legal Events

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

Ref document number: 18944745

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2018944745

Country of ref document: EP

Effective date: 20210727