CN111273897A - Block chain resource consumption method and device, storage medium and electronic equipment - Google Patents
Block chain resource consumption method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN111273897A CN111273897A CN202010069145.2A CN202010069145A CN111273897A CN 111273897 A CN111273897 A CN 111273897A CN 202010069145 A CN202010069145 A CN 202010069145A CN 111273897 A CN111273897 A CN 111273897A
- Authority
- CN
- China
- Prior art keywords
- transaction
- information
- resource
- consumable
- contract
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Abstract
The invention discloses a block chain resource consumption method, which comprises the following steps: an information acquisition step: acquiring transaction resource consumable limiting information and transaction basic information; and (3) merging steps: merging the transaction resource consumable limiting information and the transaction basic information to obtain transaction information; a sending step: and sending the transaction information, wherein the transaction information is used for indicating the block chain node to call a corresponding contract according to the transaction resource consumable limiting information. The method increases the consumption limit information of transaction resources to limit the use of digital currency, so that the transaction is safer; the problem that in the prior art, when the intelligent contract is executed, if the specified function is not found or the function is not specified at all, the fallback function is called easily to be hacked is solved, and the safety of the account is improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for consuming block chain resources, a storage medium, and an electronic device.
Background
The invention is applied to the field of intelligent contracts of block chains, and currently, the mainstream intelligent contract platforms are Ether houses and EOS platforms. Smart contracts are computer programs that run on a copyable, shared ledger that can process information, receive, store and send value. Smart contracts allow trusted transactions to be conducted without third parties. These transactions are traceable and irreversible.
The intelligent contracts of the EtherFang platform are introduced as follows:
overview
An ethernet house virtual machine (EVM) is the running environment for intelligent contracts in an ethernet house. It is not only sandboxed, but in fact it is completely isolated, i.e., code running inside the EVM cannot reach the network, file system, or other processes. Even smart contracts have limited contact with other smart contracts.
Account
There are two types of accounts in the etherhouse, which share the same address space. External accounts, this type of account being controlled by a public-private key pair (human). A contract account, the type of account being controlled by code stored in the account.
The address of the external account is determined by the public key and the address of the contract account is determined at the time of creation of the contract (this address is calculated from the address of the contract creator and the number of transactions sent by this address, also called "nonce")
The contract account stores the code and the external account does not, except in this regard, both types of accounts are the same for the EVM.
There is one persistent store per account in the form of a key-value. Wherein both the key and value are 256 bits in length and are called storage.
Additionally, each account has an Ethernet balance (in units of "Wei") that can be changed by sending it a transaction with Ethernet money.
Trading
A transaction is a message sent from one account to another (possibly the same account or a zero account, see below). The transaction may contain binary data (payload) and an ethernet currency.
If the target account contains code, the code will execute and the payload is the input data.
If the target account is a zero account (account address is 0), the transaction will create a new contract. As noted above, this contract address is not a zero address, but is calculated from the address of the contract creator and the number of transactions issued by that address (referred to as nonces). The payload that creates the contract transaction is executed as EVM bytecode. The output of the execution is permanently stored as contract code. This means that you do not need to send the contract the real contract code, but a code that can return the real code, in order to create a contract.
The intelligent contract for EOS is introduced as follows: (EOS Intelligent contracts are almost as conceptual as Ether Fang and will not be repeated here)
Intelligent contracts are based on Webassembly (WASM) technology, which strikes a good balance between performance and cross-platform compatibility, by compiling the original code into bytecode, so that the code can be executed in the WASM virtual machines (or interpreters) of various platforms. The technology is supported by apple, google and other scientific and technological profound, and is known as the next generation of internet front-end technology. The current WebAssembly technology supports C/C + + language, develops JavaScript interface, and is supported by almost all mainstream browsers such as Chrome, Edge, Safari, Firefox and the like.
Because of the use of WebAssembly, the current EOS intelligent contract only supports C/C + + language, and the simple intelligent contract is composed of 3 files: the hpp file,. cpp file,. abi file. Where hpp is a C + + header file that is typically used to define classes and their member variables and member functions. cpp is a C + + file and is used for realizing member functions declared in hpp and realizing the service logic of the intelligent contract. The abi (application Binary interface) file is a Binary interface file, the file format is similar to JSON, and the file is used for defining a data interface of the intelligent contract and the EOS system.
In the existing solutions, the ether house and EOS mechanisms are almost all using a hook function (hook) to receive the digital money transferred by the user and simultaneously perform the actions of function processing after the transfer, such as sending other digital money, returning part of the digital money, rejecting the service, etc.
In the Etherhouse solution, if a function indicates that payable represents that transfers can be received. The concrete refinement is as follows:
there are three ways:
transfer while deploying contracts
Method for calling contract provision
Transferring money directly to contract address
By default, an Etherhouse's smart contract is to reject transfers from any address, how can the contract support receiving transfers?
1. Deployment transfer
When contract development is carried out, if the contract is directly transferred to the contract when being deployed, only a payable modifier needs to be added to the constructor.
Example (c):
2. executing a contract transfer
Executing the contract transfer, adding payable modifiers to the method that you need to support the transfer function
Example (c):
3. direct transfer of money
Direct transfer is supported by means of a backup function (fallback function), and only payable modifiers need to be added to the backup function
Example (c):
the intelligent contract details for EOS are as follows:
io applications are programmed around event (aka operations) in response to user operations. For example, a user may transmit a token to other users. The event may be processed and possibly rejected by the sender, recipient and the monetary application itself. As an application developer, you can decide which actions the user can take and which handlers can or must be invoked to respond to these events.
Entry point
Io applications have applications that are largely similar to those in legacy applications:
the application gives the parameter code and operations that uniquely identify each event in the system. For example, code may be a currency contract and action may be a transfer. This event (code) may be passed to a plurality of contracts including the sender and the receiver. How to handle such events is determined by your application.
init is another entry point called immediately after the code is loaded. This is where you should perform a state initialization once.
Example application input handler
Generally, you should use your entry handler to dispatch events to a function that implements most of the logical functionality, and the function may choose to reject events that the contract cannot or is unwilling to accept.
Attention is paid to
In defining entry points, they need to be placed in the extra "C" code block so that C + + name modifications do not apply to the function.
The first prior art technique creates many security problems, such as The DAO attack event in etherhouses. The principle of intelligent contract fallback function exploit is as follows:
when a smart contract executes, if no specified function is found, or no function at all is specified (e.g., send ether), then the fallback function is called.
We look at the difference between addr. Both send an ethernet token to an address, except that the gaslimit of the two calls is not the same. send () is based on 0gas (equivalent to call. gas (0). value ()), while call. value () () is based on all the gas that currently remains.
So when you send the ether over addr. call. value () (), without specifying which function, the fallback function is called, and accompanied by all the gas that remains currently.
From this point, the hacker can construct a recursive call through the fallback function until the trailer has completed all the coins.
function(){address addr=0x6c8f2a135f6ed072de4503bd7c4999a1a17f824b;if(COUNT<100){addr.call(“withdrawBalance”);COUNT++;}}
In this fallback code, the windowbalance function is called recursively when the counter is less than 100. In this case:
sender, call, value (amounttowithdraww) () will be called 100 times, taking 100 x 10ether away.
Simply, call value () has a hole that can be constructed by a hacker until the trailer has transferred all the coins.
Second, the prior art has no way to send multiple (two or more) digital currencies in a single transaction. Assuming that there are two digital currencies a and B in the chain, in an ethernet house, if account 1 wants to transfer 10 a and 5B simultaneously to account 2, two transactions must be sent. In some game scenarios, the two kinds of digital currency are received at the same time to continue the game, and the existing design must use a more complex implementation mode.
Disclosure of Invention
Objects of the invention
The invention aims to provide a method, a device, a storage medium and an electronic device for consuming blockchain resources so as to solve the problem of insecurity of blockchain transactions in the prior art.
(II) technical scheme
To solve the above problem, a first aspect of the present invention provides a method for consuming blockchain resources, including: an information acquisition step: acquiring transaction resource consumable limiting information and transaction basic information; and (3) merging steps: merging the transaction resource consumable limiting information and the transaction basic information to obtain transaction information, and sending the transaction information: and sending the transaction information, wherein the transaction information is used for indicating the block chain node to call a corresponding contract according to the transaction resource consumable limiting information.
Further, when the transaction resource is plural; the obtaining step specifically comprises: acquiring consumable limiting information and transaction basic information of each transaction resource in a plurality of transaction resources; the merging step specifically comprises: and combining the consumable limiting information of each transaction resource in the transaction resources with the basic transaction information to obtain transaction information.
Further, the transaction resource consumable limiting information includes: the transaction resource may consume a maximum value and/or a transaction resource category.
According to another aspect of the present invention, there is provided a block link point transaction method, including: acquiring transaction information, wherein the transaction information comprises: transaction resource consumable restriction information; and calling a corresponding contract according to the transaction resource consumable limiting information.
Further, still include: checking whether the transaction information is in expectation; executing the contract and checking whether the resource consumption of the transaction information exceeds the consumable limit information; when the resource consumption does not exceed the consumable limit information and the contract execution is normal, updating the execution result onto the blockchain.
Further, still include: and when the resource consumption exceeds the consumable limiting information and/or the contract execution is abnormal, restoring the original state of the block chain.
According to still another aspect of the present invention, there is provided a block chain resource consuming apparatus, comprising: the information acquisition module is used for acquiring the consumable transaction resource limit information and the transaction basic information; the merging module is used for merging the transaction resource consumable limiting information and the transaction basic information to obtain transaction information, and the sending module is used for sending the transaction information which is used for indicating the block chain node to call a corresponding contract according to the transaction resource consumable limiting information.
Further, when the transaction resource is plural; the information acquisition module acquires consumable limit information and transaction basic information of each transaction resource in a plurality of transaction resources; the merging module merges the consumable limiting information of each transaction resource in the transaction resources with the transaction basic information to obtain transaction information.
Further, the transaction resource consumable limiting information includes: the transaction resource may consume a maximum value and/or a transaction resource category.
According to still another aspect of the present invention, there is provided a block link point transaction executing apparatus, including: an acquisition module, configured to acquire transaction information, where the transaction information includes: transaction resource consumable restriction information; and the calling module is used for calling a corresponding contract according to the transaction resource consumable limiting information.
Further, still include: the transaction information checking module is used for checking whether the transaction information is in accordance with expectations; a consumable limit checking module for executing the contract and checking whether resource consumption of the transaction information exceeds consumable limit information; and the updating module is used for updating the execution result to the block chain when the resource consumption does not exceed the consumable limiting information and the contract execution is normal.
Further, still include: and the restoration module is used for restoring the original state of the block chain when the resource consumption exceeds the consumable limiting information and/or the contract execution is abnormal.
According to a further aspect of the present invention, there is provided a computer storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of the method of any one of the above-described aspects.
According to a further aspect of the present invention, there is provided an electronic device comprising a memory, a display, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of the above aspects when executing the program.
According to a further aspect of the present invention, there is provided a computer storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of the method of any one of the above-described aspects.
According to a further aspect of the present invention, there is provided an electronic device comprising a memory, a display, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of the above aspects when executing the program.
(III) advantageous effects
The technical scheme of the invention has the following beneficial technical effects:
the block chain resource consumption method and the block chain resource consumption device increase the consumable limit information of transaction resources to limit the use of digital currency, so that the use is safer; the method and the device avoid the problem that the hacker attack is easy to attack when the specified function is not found or the function is not specified at all when the intelligent contract is executed in the prior art, and improve the safety of the account.
Drawings
FIG. 1 is a flowchart of a method for consuming blockchain resources according to a first embodiment of the present invention;
fig. 2 is a flowchart of a method for consuming blockchain resources according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings in conjunction with the following detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present invention. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present invention.
It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
In a first aspect of the embodiments of the present invention, a method for consuming block chain resources is provided, including:
an information acquisition step: acquiring transaction resource consumable limiting information and transaction basic information;
and (3) merging steps: merging the transaction resource consumable limiting information and the transaction basic information to obtain transaction information;
a sending step: and sending transaction information, wherein the transaction information is used for indicating the block link points to call corresponding contracts according to the transaction resource consumable limiting information.
Optionally, when the transaction resource is multiple; the acquisition steps are specifically as follows: acquiring consumable limiting information and transaction basic information of each transaction resource in a plurality of transaction resources; the merging step specifically comprises: and combining the consumable limiting information of each transaction resource in the transaction resources with the basic transaction information to obtain transaction information.
Optionally, the transaction resource consumable limiting information includes: the transaction resource may consume a maximum value and/or a transaction resource category.
In one embodiment, as shown in fig. 2, a method for consuming blockchain resources is provided, which forms specific codes, when a user needs to send a digital currency, the user needs to construct a Transaction (Transaction), and the data structure of the blockchain Transaction is as follows:
where the Actions indicate the contract, contract method, and parameters that the transaction is specifically to invoke. The Data structure of Action is as follows, Contract indicates the called Contract, ActionName indicates the called Contract method, and Data is parameter information.
Other parts of the transaction are basically similar to the common blockchain transaction structure, such as common signature, Gas, blockchain representation, ChainId, etc. Compared with other transactions, the AmountLimit field is innovatively added and is used for indicating the maximum resource allowed to be consumed by the transaction. The data structure for AmountLimit is shown below:
where Token represents the name of the digital currency that can be consumed and Value represents the amount of the digital currency that can be consumed. AmountLimit is an array that indicates that the use of multiple digital currencies may be restricted at the same time. Digital currency not contained in this field indicates that no consumption is required. Wherein Token also supports wildcards, if Token is "+", it indicates all digital currencies, and if Value is "unlimited", it represents that the consumption upper limit is infinite, but the consumption amount cannot exceed the total amount owned by the account when actually executed.
The design records each currency sent on the chain, and calls a transfer method corresponding to the currency according to the currency name specified in the Amount limit, and other schemes have no system information, each currency has own contract to execute transfer, and as one-time action of one transaction of the block chain can only call one specific method of one contract, no method is available for transferring multiple currencies at one time. However, in the scheme, the money transfer is initiated by the called contract and finally executed by the system, so that the money transfer of a plurality of currencies can be called for many times in one contract calling.
After the user constructs the transaction to be sent, the user needs to sign the transaction by using the private key of the user, the transaction can be sent to any available node in the chain after the signature is successful, the node receiving the transaction broadcasts the transaction to other nodes in the whole chain, and the node with the block is provided with the node for determining whether to package the transaction.
The block-out node firstly checks whether a transaction signature, account information, chain information and the like are in accordance with expectations, then searches contract address information needing to be executed, executes a contract method, and simultaneously checks whether an execution result meets the limit of AmountLimit, namely whether the use number of the limit is exceeded or not during execution, if the execution result does not exceed the limit and the contract is normally executed, the execution result is updated to the block chain, otherwise, the contract is failed to execute, and the original state of the block chain is recovered.
The code refers to the mechanism of AmountLimit, and sets the upper limit of digital currency which can be consumed by the transaction when the user sends the transaction, thereby preventing the safety problem of a fallback function and realizing the method for sending a plurality of digital currencies in one transaction.
The above embodiment designs the resource consumption model of the AmountLimit, and provides a wildcard mechanism to support the limitation of resource consumption more flexibly. Compared with other design modes, the method is safer and more efficient, and supports more application scenes. Protection points: resource consumption is controlled by adding a limit of resource consumption in a transaction, and a limit part uses an array to execute simultaneous consumption of a plurality of tokens simultaneously, so that various scenes are supported by using more flexible integration.
The method is safer, and the original technical scheme uses a hook function to process the user account transfer, thereby causing many potential safety problems. The new technical scheme has no hook function, and Amount Limit is added to limit the use of digital currency during function calling, so that the method is safer; moreover, the method can support the simultaneous transfer of a plurality of digital currencies, the original technical scheme can only transfer one digital currency at a time, and the new technical scheme can support the simultaneous consumption of a plurality of digital currencies in a manner of consuming the digital currencies in the contract by limiting the use of the plurality of digital currencies; when the consumption amount of the digital currency is uncertain, the scheme is more friendly, in some scenes, the amount of the digital currency to be consumed can be determined only when a contract is executed, the original technical scheme needs a user to send the maximum value expected to be used to the contract, the contract refunds redundant digital currency to the user according to the calculated actual consumption amount, and the settlement mode is neither safe nor friendly. The new proposal can not transfer the contracts in advance, adds the limitation of digital currency when sending the contracts, and calculates and determines the actual consumption of all the contracts.
In another aspect of the embodiments of the present invention, a method for performing a transaction at a block link point is provided, including: acquiring transaction information, wherein the transaction information comprises: transaction resource consumable restriction information; and calling a corresponding contract according to the transaction resource consumable limiting information.
Optionally, the method further includes: checking whether the transaction information is in expectation; executing the contract and checking whether the resource consumption of the transaction information exceeds the consumable limit information; when the resource consumption does not exceed the consumable limit information and the contract execution is normal, the execution result is updated to the block chain.
Optionally, the method further includes: when the resource consumption exceeds the consumable limit information and/or the contract execution is abnormal, the original state of the block chain is restored.
In another aspect of the embodiments of the present invention, there is provided a block chain resource consumption apparatus, including: the information acquisition module is used for acquiring the consumable transaction resource limit information and the transaction basic information; the system comprises a merging module used for merging the transaction resource consumable limiting information and the transaction basic information to obtain transaction information, and a sending module used for sending the transaction information, wherein the transaction information is used for indicating the block link nodes to call corresponding contracts according to the transaction resource consumable limiting information.
Optionally, when the transaction resource is multiple; the information acquisition module acquires consumable limit information and transaction basic information of each transaction resource in a plurality of transaction resources; the merging module merges the consumable limiting information of each transaction resource in the transaction resources with the basic transaction information to obtain the transaction information.
Optionally, the transaction resource consumable limiting information includes: the transaction resource may consume a maximum value and/or a transaction resource category.
In another aspect of the embodiments of the present invention, there is provided a block link point transaction execution device, including: the acquisition module is used for acquiring transaction information, and the transaction information comprises: transaction resource consumable restriction information; and the calling module is used for calling a corresponding contract according to the transaction resource consumable limiting information.
Optionally, the method further includes: the transaction information checking module is used for checking whether the transaction information is in accordance with expectations; a consumable limit checking module for executing the contract and checking whether the resource consumption of the transaction information exceeds the consumable limit information; and the updating module is used for updating the execution result to the block chain when the resource consumption does not exceed the consumable limiting information and the contract execution is normal.
Optionally, the method further includes: and the restoration module is used for restoring the original state of the block chain when the resource consumption exceeds the consumable limit information and/or the contract execution is abnormal.
In a further aspect of the embodiments of the present invention, a computer storage medium is provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned methods.
In another aspect of the embodiments of the present invention, an electronic device is provided, which includes a memory, a display, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the processor implements the steps of any one of the above-mentioned methods.
In a further aspect of the embodiments of the present invention, a computer storage medium is provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned methods.
In another aspect of the embodiments of the present invention, an electronic device is provided, which includes a memory, a display, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the processor implements the steps of any one of the above-mentioned methods.
The invention aims to protect a block chain resource consumption method, which comprises the following steps: an information acquisition step: acquiring transaction resource consumable limiting information and transaction basic information; and (3) merging steps: merging the transaction resource consumable limiting information and the transaction basic information to obtain transaction information, and sending the transaction information: and sending the transaction information, wherein the transaction information is used for indicating the block chain node to call a corresponding contract according to the transaction resource consumable limiting information. The method increases the consumption limit information of transaction resources to limit the use of digital currency, so that the transaction is safer; the problem that in the prior art, when the intelligent contract is executed, if the specified function is not found or the function is not specified at all, the fallback function is called easily to be hacked is solved, and the safety of the account is improved.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explaining the principles of the invention and are not to be construed as limiting the invention. Therefore, any modification, equivalent replacement, improvement and the like made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. Further, it is intended that the appended claims cover all such variations and modifications as fall within the scope and boundaries of the appended claims or the equivalents of such scope and boundaries.
Claims (16)
1. A method for block chain resource consumption, comprising:
an information acquisition step: acquiring transaction resource consumable limiting information and transaction basic information;
and (3) merging steps: merging the transaction resource consumable limiting information and the transaction basic information to obtain transaction information;
a sending step: and sending the transaction information, wherein the transaction information is used for indicating the block chain node to call a corresponding contract according to the transaction resource consumable limiting information.
2. The method of claim 1, wherein when the transaction resource is multiple;
the obtaining step specifically comprises: acquiring consumable limiting information and transaction basic information of each transaction resource in a plurality of transaction resources;
the merging step specifically comprises: and combining the consumable limiting information of each transaction resource in the transaction resources with the basic transaction information to obtain transaction information.
3. The blockchain resource consumption method according to claim 1 or 2, wherein the transaction resource consumable restriction information includes:
the transaction resource may consume a maximum value and/or a transaction resource category.
4. A method for performing transactions at block nodes, comprising:
acquiring transaction information, wherein the transaction information comprises: transaction resource consumable restriction information;
and calling a corresponding contract according to the transaction resource consumable limiting information.
5. The method of performing transactions according to claim 4, further comprising:
checking whether the transaction information is in expectation;
executing the contract and checking whether the resource consumption of the transaction information exceeds the consumable limit information;
when the resource consumption does not exceed the consumable limit information and the contract execution is normal, updating the execution result onto the blockchain.
6. The method of block-linked point transactions according to claim 5, further comprising:
and when the resource consumption exceeds the consumable limiting information and/or the contract execution is abnormal, restoring the original state of the block chain.
7. A device for consuming blockchain resources, comprising:
the information acquisition module is used for acquiring the consumable transaction resource limit information and the transaction basic information;
a merging module for merging the transaction resource consumable limiting information and the transaction basic information to obtain transaction information,
and the sending module is used for sending the transaction information, and the transaction information is used for indicating the block chain node to call a corresponding contract according to the transaction resource consumable limiting information.
8. The blockchain resource consuming device of claim 7, wherein when the transaction resource is plural;
the information acquisition module acquires consumable limit information and transaction basic information of each transaction resource in a plurality of transaction resources;
the merging module merges the consumable limiting information of each transaction resource in the transaction resources with the transaction basic information to obtain transaction information.
9. The blockchain resource consuming device according to claim 7 or 8, wherein the transaction resource consumable restriction information includes:
the transaction resource may consume a maximum value and/or a transaction resource category.
10. A block-linked point transaction device, comprising:
an acquisition module, configured to acquire transaction information, where the transaction information includes: transaction resource consumable restriction information;
and the calling module is used for calling a corresponding contract according to the transaction resource consumable limiting information.
11. The block-linked point transaction apparatus of claim 10, further comprising:
the transaction information checking module is used for checking whether the transaction information is in accordance with expectations;
a consumable limit checking module for executing the contract and checking whether resource consumption of the transaction information exceeds consumable limit information;
and the updating module is used for updating the execution result to the block chain when the resource consumption does not exceed the consumable limiting information and the contract execution is normal.
12. The block-linked point transaction apparatus of claim 11, further comprising:
and the restoration module is used for restoring the original state of the block chain when the resource consumption exceeds the consumable limiting information and/or the contract execution is abnormal.
13. A computer storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method according to any one of claims 1-3.
14. An electronic device comprising a memory, a display, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 1-3 when executing the program.
15. A computer storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method according to any one of claims 4-6.
16. An electronic device comprising a memory, a display, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 4 to 6 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010069145.2A CN111273897A (en) | 2020-01-21 | 2020-01-21 | Block chain resource consumption method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010069145.2A CN111273897A (en) | 2020-01-21 | 2020-01-21 | Block chain resource consumption method and device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111273897A true CN111273897A (en) | 2020-06-12 |
Family
ID=70999073
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010069145.2A Pending CN111273897A (en) | 2020-01-21 | 2020-01-21 | Block chain resource consumption method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111273897A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116235199A (en) * | 2021-05-14 | 2023-06-06 | 高盛公司有限责任公司 | Blockchain for joint declaration of tokens |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107038242A (en) * | 2017-04-24 | 2017-08-11 | 杭州趣链科技有限公司 | It is a kind of towards the global intelligent contract business datum analytic method of block chain |
CN108846651A (en) * | 2018-05-28 | 2018-11-20 | 数字乾元科技有限公司 | Virtual credit card method of commerce and system based on digital cash |
CN109325039A (en) * | 2018-06-07 | 2019-02-12 | 海南新软软件有限公司 | A kind of block chain browser and block chain information browsing method |
WO2019067863A1 (en) * | 2017-09-28 | 2019-04-04 | Silvio Micali | Message-credentialed blockchains |
CN109583863A (en) * | 2019-01-21 | 2019-04-05 | 深圳市祥云万维科技有限公司 | A kind of block chain resource transaction network and method of commerce |
CN110443704A (en) * | 2019-06-28 | 2019-11-12 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus of across chain transmission resource |
-
2020
- 2020-01-21 CN CN202010069145.2A patent/CN111273897A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107038242A (en) * | 2017-04-24 | 2017-08-11 | 杭州趣链科技有限公司 | It is a kind of towards the global intelligent contract business datum analytic method of block chain |
WO2019067863A1 (en) * | 2017-09-28 | 2019-04-04 | Silvio Micali | Message-credentialed blockchains |
CN108846651A (en) * | 2018-05-28 | 2018-11-20 | 数字乾元科技有限公司 | Virtual credit card method of commerce and system based on digital cash |
CN109325039A (en) * | 2018-06-07 | 2019-02-12 | 海南新软软件有限公司 | A kind of block chain browser and block chain information browsing method |
CN109583863A (en) * | 2019-01-21 | 2019-04-05 | 深圳市祥云万维科技有限公司 | A kind of block chain resource transaction network and method of commerce |
CN110443704A (en) * | 2019-06-28 | 2019-11-12 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus of across chain transmission resource |
Non-Patent Citations (1)
Title |
---|
工程师周亮: "基于区块链ERC1155标准的意义概述", pages 1 - 7, Retrieved from the Internet <URL:《https://www.elecfans.com/blockchain/894522.html》> * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116235199A (en) * | 2021-05-14 | 2023-06-06 | 高盛公司有限责任公司 | Blockchain for joint declaration of tokens |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110163590B (en) | Payment withholding method and device based on block chain, electronic equipment and storage medium | |
CN110147990B (en) | Payment withholding subscription method and device based on block chain and electronic equipment | |
CN109154885B (en) | Business process execution on a blockchain platform | |
CN110706114B (en) | Block chain-based default asset processing method and device and electronic equipment | |
CN108876380B (en) | Transaction method and system based on centralized settlement and block chain deposit certificate | |
US10942756B2 (en) | System and method for executing different types of blockchain contracts | |
US20200177572A1 (en) | Sending cross-chain authenticatable messages | |
JP2019536153A (en) | Smart contract processing method and apparatus | |
JP2023100981A (en) | Control flow in block chain script | |
CN110162470B (en) | Block chain testing method and device | |
US20200193428A1 (en) | Blockchain-based payment withholding and agreement signing method, apparatus, and electronic device | |
CN111079101B (en) | Method and device for obtaining evidence of infringement based on block chain, electronic equipment and storage medium | |
WO2017148278A1 (en) | Service implementation method, apparatus and system based on fix protocol | |
CN110400217B (en) | Rule change processing method and device for intelligent contract | |
CN111818185B (en) | Method and device for starting intelligent contract, electronic equipment and storage medium | |
CN111639125A (en) | Resource circulation method and device based on block chain | |
CN110135993B (en) | Method, equipment and storage medium for adapting UTXO model to intelligent contract account model | |
Demir et al. | Security smells in smart contracts | |
CN110263580B (en) | Data processing method and device based on block chain and block chain link points | |
WO2018100371A1 (en) | Secure processing of electronic transactions by a decentralized, distributed ledger system | |
Li et al. | Protect your smart contract against unfair payment | |
CN111273897A (en) | Block chain resource consumption method and device, storage medium and electronic equipment | |
US11368554B2 (en) | Systems and methods for regulating service behavior | |
CN113034137A (en) | Data processing method and device based on block chain and related equipment | |
CN110610423B (en) | Processing method for supporting stateful contract and stateless contract for block chain intelligent contract platform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |