CN108694575A - Verification method of transferring accounts, device and storage medium based on block chain - Google Patents
Verification method of transferring accounts, device and storage medium based on block chain Download PDFInfo
- Publication number
- CN108694575A CN108694575A CN201810611101.0A CN201810611101A CN108694575A CN 108694575 A CN108694575 A CN 108694575A CN 201810611101 A CN201810611101 A CN 201810611101A CN 108694575 A CN108694575 A CN 108694575A
- Authority
- CN
- China
- Prior art keywords
- transaction
- token
- contract
- block chain
- verification
- 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
- 238000012795 verification Methods 0.000 title claims abstract description 144
- 238000000034 method Methods 0.000 title claims abstract description 47
- RTZKZFJDLAIYFH-UHFFFAOYSA-N Diethyl ether Chemical compound CCOCC RTZKZFJDLAIYFH-UHFFFAOYSA-N 0.000 claims abstract description 141
- 238000012546 transfer Methods 0.000 claims abstract description 68
- 241000208340 Araliaceae Species 0.000 claims 2
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 claims 2
- 235000003140 Panax quinquefolius Nutrition 0.000 claims 2
- 235000008434 ginseng Nutrition 0.000 claims 2
- 230000008859 change Effects 0.000 description 11
- 238000012545 processing Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 230000000977 initiatory effect Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 125000001033 ether group Chemical group 0.000 description 3
- 238000005194 fractionation Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000032696 parturition Effects 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000008676 import Effects 0.000 description 1
- 230000002045 lasting effect Effects 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- 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
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/08—Payment architectures
- G06Q20/10—Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
-
- 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
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
-
- 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
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Economics (AREA)
- Development Economics (AREA)
- Computer Security & Cryptography (AREA)
- Marketing (AREA)
- Technology Law (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention discloses a kind of verification methods of transferring accounts based on block chain, include the following steps:It is being broadcasted in executing block chain network when the transaction in block transaction queue of knowing together, is judging the type of currently performed transaction;When the type of the transaction of execution is UTXO transaction and when being transfer operation, relevant information is read from database;Based on the relevant information, the transaction is verified, wherein, when in the relevant information including the contract address of the Token carries merchandised and used, based on the contract address parameter incoming with the transaction, it builds new ether mill to merchandise and execute, service logic verification is carried out to the transaction for being based on the contract.The invention also discloses a kind of, and transferring accounts based on block chain verifies device and computer readable storage medium.The present invention realizes the self-defined service logic verification to money transfer transactions in block chain network, improves the scalability of money transfer transactions in block chain network.
Description
Technical field
The present invention relates to block chain financial technology field more particularly to a kind of verification method of transferring accounts, dresses based on block chain
It sets and computer readable storage medium.
Background technology
Ether mill is represented as second generation block chain, and account model is the basis in ether mill.Account model can be understood as
One state machine based on transaction, state machine read a series of input, are then converted into a new shape according to these inputs
State.Account status machine is initially to create generation state (there are no the states that any transaction generates in network at this time).When a series of transaction
After being performed, this wound generation state will convert to most final state.At any time, this most final state all represents the current state of account.
For example, there are following two money transfer transactions in the network of ether mill:Account A transfers accounts 10 unit of value to account B, account
Family B transfers accounts 20 unit of value to account C, and the logic for execution of merchandising is first to add 10 value lists to the remaining sum of account B by trading order
The position unit of value that subtracts 20 again.In account model, in source account when being transferred accounts to whereabouts account, directly from this account
Number of transferring accounts is reduced in remaining sum, but can not determine reduced number all/which previous transaction be derived partly from, which has
Preposition consumption condition, to which the service logic before can not being transferred accounts verifies.
Invention content
The verification method of transferring accounts that the main purpose of the present invention is to provide a kind of based on block chain, device and computer-readable
Storage medium, it is intended to which the technology for solving the verification of the service logic before money transfer transactions can not be transferred accounts in existing block chain network is asked
Topic.
To achieve the above object, the present invention provides a kind of verification method of transferring accounts based on block chain, described to be based on block chain
Verification method of transferring accounts include the following steps:
It is being broadcasted in executing block chain network when the transaction in block transaction queue of knowing together, is judging currently performed friendship
Easy type;
When the type of the transaction of execution is UTXO transaction and when being transfer operation, relevant information is read from database;
Based on the relevant information, the transaction is verified, wherein when including the friendship in the relevant information
When the contract address of the Token carries easily used, based on the contract address parameter incoming with the transaction, build it is new with
Too mill is merchandised and is executed, and service logic verification is carried out to the transaction for being based on the contract.
Optionally, further include after being verified to the transaction based on the relevant information described:
When being verified, transfer operation is executed, new UTXO data are generated;
The UTXO data are stored in the database, the UTXO data include:New Token;
Wherein, it when generating new Token, judges whether there is and generates new contract address or the incoming parameter of merchandising
In whether include contract address, if so, using the contract address as the contract of the newly-generated Token carries of merchandising
Location is written in the database.
Optionally, the incoming parameter of the transaction includes:Call for service logic verification contract function interface with
And verify relevant parameter with service logic is carried out;
It is described to include with the relevant parameter of progress service logic verification:Consume the transaction correspond to Token account, and/or
The transaction is consumed to correspond to the number of Token, and/or consume the time that the transaction corresponds to Token..
Optionally, when the transaction generates new Token, the incoming parameter of the transaction further includes:It calls for giving birth to
Relevant parameter is verified at the function interface of the contract of new contract address and service logic corresponding with new Token;
The service logic corresponding with new Token verifies relevant parameter:Allow to consume newly-generated Token
Account list, and/or allow the amount of money upper limit for consuming newly-generated Token, and/or allow to consume newly-generated Token's
Time limit.
Optionally, the relevant information further includes:The merchandise corresponding ownership information of Token used, the friendship
The number of easy token ready for use;
Described to be based on the relevant information, carrying out verification to the transaction includes:
Based on the corresponding ownership information of Token merchandised and used, verify whether the Token used that merchandises belongs to
In legal account;
The amount of money of number and this transaction based on the transaction token ready for use, it is ready for use to verify the transaction
Whether the number summation of token is equal to the number summation of this Token to be generated that merchandises
Further, to achieve the above object, described the present invention also provides a kind of verification method of transferring accounts based on block chain
Verification method of transferring accounts based on block chain includes:
It is being broadcasted in executing block chain network when the transaction in block transaction queue of knowing together, is judging currently performed friendship
Easy type;
When the type of the transaction of execution is UTXO transaction and is operated to coin, operation of coining is executed, new UTXO is generated
Data;
The UTXO data are stored in database, the UTXO data include:New Token;
Wherein, it when generating new Token, judges whether there is and generates new contract address or the incoming parameter of merchandising
In whether include contract address, if so, using the contract address as the contract of the newly-generated Token carries of merchandising
Location is written in the database, for when the new Token, contract is corresponded to by the contract call by location for subsequent consumption
Transaction to consuming the new Token carries out service logic verification.
Optionally, the incoming parameter of the transaction includes:Call the function interface of the contract for generating new contract address
And service logic corresponding with new Token verifies relevant parameter;
The service logic corresponding with new Token verifies relevant parameter:Allow to consume newly-generated Token
Account list, and/or allow the amount of money upper limit for consuming newly-generated Token, and/or allow to consume newly-generated Token's
Time limit.
Further, to achieve the above object, the present invention also provides a kind of, and transferring accounts based on block chain verifies device, described
Transferring accounts based on block chain verifies device:
Judgment module is sentenced for being broadcasted in executing block chain network when the transaction in block transaction queue of knowing together
The type of disconnected currently performed transaction;
Read module, for when the type of the transaction of execution is UTXO transaction and when being transfer operation, being read from database
Take relevant information;
Authentication module verifies the transaction for being based on the relevant information;
The authentication module is additionally operable to:When the conjunction in the relevant information including the Token carries merchandised and used
About address when, based on the contract address parameter incoming with the transaction, build new ether mill and merchandise and execute, for base
Service logic verification is carried out to the transaction in the contract.
Optionally, the verification device of transferring accounts based on block chain further includes:
Generation module, for when being verified, executing transfer operation, generating new UTXO data;By the UTXO numbers
According to being stored in the database, the UTXO data include:New Token;
Wherein, the generation module is additionally operable to:When generating new Token, judges whether there is and generate new contract address
Or in the incoming parameter of the transaction whether include contract address, if so, newborn using the contract address as the transaction
At the contract addresses of Token carries be written in the database.
Optionally, the incoming parameter of the transaction includes:Call for service logic verification contract function interface with
And verify relevant parameter with service logic is carried out;
It is described to include with the relevant parameter of progress service logic verification:Consume the transaction correspond to Token account, and/or
The transaction is consumed to correspond to the number of Token, and/or consume the time that the transaction corresponds to Token..
Optionally, when the transaction generates new Token, the incoming parameter of the transaction further includes:It calls for giving birth to
Relevant parameter is verified at the function interface of the contract of new contract address and service logic corresponding with new Token;
The service logic corresponding with new Token verifies relevant parameter:Allow to consume newly-generated Token
Account list, and/or allow the amount of money upper limit for consuming newly-generated Token, and/or allow to consume newly-generated Token's
Time limit.
Optionally, the relevant information further includes:The merchandise corresponding ownership information of Token used, the friendship
The number of easy token ready for use;
The authentication module is additionally operable to:
Based on the corresponding ownership information of Token merchandised and used, verify whether the Token used that merchandises belongs to
In legal account;
The amount of money of number and this transaction based on the transaction token ready for use, it is ready for use to verify the transaction
Whether the number summation of token is equal to the number summation of this Token to be generated that merchandises.
Further, to achieve the above object, the present invention also provides a kind of computer readable storage medium, the computers
The proving program of transferring accounts based on block chain is stored on readable storage medium storing program for executing, the proving program of transferring accounts based on block chain is located
Reason device execute when realize it is as described in any one of the above embodiments based on block chain transfer accounts verification method the step of.
The present invention is the Token with specific amount by the remaining sum for splitting account model on ether mill, after fractionation
Token is the operation object transferred accounts, and includes that the transaction of Token is merchandised for UTXO.After the Splitting Logic of Token,
What UTXO process of exchange tracked is the transfer of the ownership of each Token, rather than the state change of account, Token can be bright
Really record its source and its transaction limits condition, and when Token is used by consumption in money transfer transactions next time also can basis
Transaction limits condition carries out a variety of verification forms including service logic verification, transfers accounts to improve in block chain network
The scalability of transaction.
Description of the drawings
Fig. 1 is the transformational relation schematic diagram of UTXO transaction and logical card based on UTXO models in the present invention;
Fig. 2 is that the present invention is based on the flow diagrams of the verification method first embodiment of transferring accounts of block chain;
Fig. 3 is that the present invention is based on the flow diagrams of the verification method second embodiment of transferring accounts of block chain;
Fig. 4 is that the present invention is based on the flow diagrams of the verification method 3rd embodiment of transferring accounts of block chain;
Fig. 5 is the high-level schematic functional block diagram of the verification device first embodiment of transferring accounts the present invention is based on block chain;
Fig. 6 is the high-level schematic functional block diagram of the verification device second embodiment of transferring accounts the present invention is based on block chain.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific implementation mode
It should be appreciated that described herein, specific examples are only used to explain the present invention, is not intended to limit the present invention.
For ease of more fully understanding the present invention, the technical term involved in the present invention is illustrated below.
(1) UTXO merchandises
Representative of the bit coin as first generation block chain, the UTXO proposed in bit coin (Unspent Transaction
Outputs, the transaction output not spent), it is the base unit that transaction generates with transaction verification on block chain.UTXO model needs
Each value (showing as each piece of encryption digital cash) has specific ownership, (has spent or has not spent in two states
One of take), what the input of each New Transaction was necessary for certain transaction does not spend output.10 unit of value are transferred accounts to B with an A
Transaction for, UTXO model manipulations are:For value of import unit 10 labeled as having used, output one is new-create to belong to B's
Unit of value 10.
(1)Token
Token is translated into logical card, is the base unit that UTXO merchandises in the present invention, and it is (just whole to indicate specific number value
Number), it is the document of title of value.The value for having spent and not yet having spent uses Token Unify legislations.One Token
Whether spend and has been marked by corresponding field in Token.
(2)UTXOTx
UTXOTx is the data name that UTXO merchandises in the present invention, and record is turned between source Token and whereabouts Token
Relationship is changed, which Token description UTXO transaction has used and generated which Token.Source Token in transaction is
Token through cost, whereabouts Token can be used for spending next time.
Relationship between Token and UTXOTx is illustrated in fig. 1 shown below, two part Input of dotted line in figure connection and
Output belongs to a Token, this Token is generated in a upper UTXOTx, and is used in next UTXOTx,
Arrow inside UTXOTx describes the transformational relation of Token.
(3) UTXO trade agreements
Life cycle based on Token, Token include creating and having consumed two states, therefore the UTXO in the present invention
Transaction includes that Token coins two kinds of type of transaction of transaction and Token money transfer transactions.
The field that ether mill trade agreement uses at present includes:Nonce (random number), gasPrice (gas prices),
GasLimit (the gas upper limits), to (whereabouts of transferring accounts account address), value (number of transferring accounts), data (transaction incidental information).
The UTXO transaction of the present invention is multiplexed the field of original ether mill transaction, but is adjusted to the computation rule of data fields
It is whole.The data fields of original ether mill transaction are with ABI (Application Binary Interface, Application Binary Interface)
Coding form specify will be called intelligent contract function interface and call function when incoming parameter list, and in this hair
In bright UTXO transaction, data is Json formats, and content includes UTXO type of transaction (or that coins transfers accounts) and input Token row
Table (default in transaction of coining) and output Token lists, particular content are as follows:
(1)utxotype:UTXO type of transaction, int, it is necessary to which (1 generates operation to field for Token, and 2 be Token consumption behaviour
Make)
(2)txin:Transaction input list, array (array maximum is limited to 1000), including following field:
tokenkey:Transfer accounts the Token used, string, it is necessary to field (addresses Token)
callfuncandparams:The function and parameter, string, Optional Field being passed to needed for business check logic (are deposited
It is used when verifying contract address, general contract and example contract are required to)
exefuncandparams:The function and parameter being passed to needed for execution business check logic, string, Optional Field
(being used when there is verification contract address, only limit general contract needs)
desdetail:The modified remarks of Token, string, Optional Field
(3)txout:Transaction output listing, array (array maximum is limited to 1000), including following field:
checktype:Ownership verifies type, string, it is necessary to field (optional P2PK and P2PKH)
to:It transfers accounts object, string, it is necessary to which (if checktype is P2PK, this field is account address to field;If
Checktype is P2PKH, this field is the cryptographic Hash of account address)
value:It transfers accounts number, string, it is necessary to field (limitation number is positive integer)
initcontract:Template contract address, string, Optional Field (match) with initfuncandparams
initfuncandparams:Call the function being passed to needed for template contract and parameter, string, Optional Field
(after ABI serializings as a result, being matched with initcontract)
validationcontract:Contract address, string are verified, Optional Field (if there is no this address, then makes
It is generated with initcontract and initfuncandparams)
ordetail:The new remarks for creating Token, Optional Field.
Transaction in the network of ether mill is submitted to local ether mill node or is broadcast in network after peer node, each node
Method (RLP is encoded or Json codings) used in parsing data, judges that the type of its transaction is original Account Type transaction
Or UTXO type transactions are located by the transaction of corresponding two class of processing logic pair respectively respectively after judging type of transaction
Reason.
(2) ether mill transaction (Account Type transaction)
Ether mill is represented as second generation block chain, and account model is the basis in ether mill.Account model can be understood as
One state machine based on transaction, state machine read a series of input, are then converted into a new shape according to these inputs
State.Account status machine is initially to create generation state (there are no the states that any transaction generates in network at this time).When a series of transaction
After being performed, this wound generation state will convert to most final state.At any time, this most final state all represents the current state of account.
By taking an A transfers accounts 10 unit of value to the transaction of B as an example, account model manipulation is:A account balances reduce 10 unit of value, B accounts
Family remaining sum increases by 10 unit of value.
Of the invention for ease of understanding, lower mask body is illustrated by the transaction of ether mill of Account Type transaction.
In the present invention, the transaction in block chain network both may be UTXO transaction, it is also possible to be ether mill transaction (account
Type transactions), and different types of trading processing logic is different.
(1) UTXO trading processings logic
Before being illustrated to the process flow that UTXO merchandises, first data caused by UTXO transaction are illustrated.
For Dynamic data exchange caused by the UTXO transaction that the present invention describes in ether mill data, it is lasting to be carried out using LevelDb
Change storage.Storage scheme used key and value when emphasis is described different types of data persistent storage.
1)Token
Token is the base unit of value of the invention of transferring accounts, but TokenBase (Token are divided into persistent storage
Base Field) and TokenExt (Token Extended Field) two parts stored.
TokenBase has recorded information (in the subsequent transaction Filed that the Token is just fixed up from creating
Field will not be changed), TokenExt has recorded change informations of the Token before and after transfer procedure.The overall data knot of Token
Structure is defined as follows shown in table 1.
Table 1
The TokenBase of each Token only stores portion, but TokenExt can store more parts of (corresponding record different phases
Information).When Token is consumed, the state of Token changes, and a new TokenExt progress is generated persistently by corresponding
Change storage, original TokenExt records when the Token is created will not be changed.
In logic, TokenExt can be changed, but be stored, and LevelDb records TokenExt, and an increasing does not change will not
Subtract.
Token (TokenBase+TokenExt) read-write rules are as follows:
When Token to LevelDb a) is written, the value of each field of key and Token of Token need to be provided.
For the key of TokenBase, key and Token it is consistent (content of key be " sources the Token ether mill merchandise
The index that Hash, the Token are generated in source ether mill is merchandised "), the content of value is to six fields in TokenBase
RLP (Recursive Length Prefix, recursion length prefix) coding result.For TokenExt, the content of key is
The content of " block that the key_ of Token generates the TokenExt is high ", value is to two field RLP coding knots in TokenExt
Fruit.
When b) reading Token, the key and block high parameter of Token need to be passed to.
For TokenBase, the key of Token is directly used to be searched as index.For TokenExt, block is used
It is searched as index after the key of high parameter splicing Token.
2)UTXOTx
UTXOTx has recorded the Token key lists of transaction source and transaction whereabouts Token during a money transfer transactions
Key lists.The data structure definition of UTXOTx is as shown in table 2 below.
Table 2
One ether mill money transfer transactions generates portion UTXOTx data, and logic and storage go up the data and only increase that do not change will not
Subtract.The key of UTXOTx is that the content of the transaction of ether the mill Hash, value that generate the UTXOTx data are in UTXOTx data
Two list field RLP coding results.
3)Vault
Vault records all Token lists for belonging to an account, can record the data of multiple accounts.The data knot of Vault
Structure is defined as follows shown in table 3.
Table 3
Portion Vault data will be generated when creating a Token, transfer accounts the Token when do not generate new Vault data.Logic
And the upper Vault data of storage only increase and do not change and will not subtract.The key of Vault is owner information Hash, with owner
The generation order of information (the generally Hash of account) and the Token in affiliated account is related, and the content of value is pair
The RLP coding results of Token key fields in Vault data.
4)ExtTokenIdx
ExtTokenIdx is stored in the form of array and is generated (the corresponding one or more of different conditions under same Token
TokenExt is recorded) when the ether mill exchange in block height, for obtaining in " specified block relative superiority or inferiority " LevelDb " newest "
Block when TokenExt is written is high.Token only creates and consumes two states, therefore the high number of block of ExtTokenIdx at present
Group maximum number is 2, and wherein subscript 0 indicates that the establishment block of the Token is high, and subscript 1 indicates that the consumption block of the Token is high.
The key of key and Token of ExtTokenIdx is consistent, and the content of value is to the high array RLP coding results of block.
Logically, the data of ExtTokenIdx, which only increase, does not change, but stores, and new TokenExt will when LevelDb is written
ExtTokenIdx is rewritten, an array element is increased.
When Token is read in outside, the key and block high parameter of Token need to be passed to (it is high that block height defaults to current block chain block).
For " generating should in the key (key is described as " block that the key_ of Token generates the TokenExt is high ") of TokenExt
The block of TokenExt is high ", acquisition modes are:It is high that ExtTokenIdx blocks are traversed from back to front according to the incoming block high parameter in outside
It is high (default value 0) as block to find out the array element that first is less than incoming parameter value for content in array.
The acquisition modes citing of " block for generating the TokenExt is high ":Assuming that the ExtTokenIdx of a Token is [10,
25](indicating that the Token is generated in block high 10, consumed in block high 25), 0 (this is returned when the incoming block high parameter in outside is 2
When the Token not yet create), block high parameter be 11 when return 10 (Token has been created but has not been consumed at this time), block senior staff officer
10 (Token has been created but do not consumed at this time) are returned when number is 25, and 25 (Token at this time are returned when block high parameter is 26
It is consumed).
The UTXO transaction data stored in content and database below based on above-mentioned UTXO transaction, to UTXO in the present invention
Trading processing logic illustrates.
In one embodiment, the process flow of UTXO money transfer transactions includes:
(1) relevant information is read from database;
In the present embodiment, to realize the verification for merchandising to UTXO, need to read phase from the database that storage UTXO merchandises
Close information.For example, the input parameter tokenkey based on UTXO transaction, reads the corresponding ownership letters of Token that transaction uses
Breath;Based on the Token in database, the number for the token ready for use that merchandises is read.
(2) it is based on the relevant information, UTXO transaction is verified, the type of the verification includes:Ownership is verified
It is verified with Accounting equation;
Ownership is verified:Based on the corresponding ownership information of Token that transaction uses, the Token that verification transaction uses is
It is no to belong to legal account, if so, ownership is verified;
Accounting equation is verified:The amount of money of number and this transaction based on the token ready for use that merchandises, verification, which is merchandised, to be waited making
Whether the number summation of token is equal to the number summation of this Token to be generated that merchandises, if so, Accounting equation is tested
Card passes through.
Optionally, if the Token that transaction uses is mounted with service logic verification contract namely the verification of TokenBase is closed
About address field has value, then also needs to carry out service logic verification to transaction.
Service logic is verified:Service logic based on the Token carries used of merchandising verifies the address of contract, transaction is passed to
Parameter, build new Account Type transaction (such as the transaction of ether mill) and execute, transaction is carried out for being based on verification contract
Service logic is verified, wherein it is self-defined that progress can be actually needed according to business in service logic.Disappear for example, service logic specifies
Take the transaction and correspond to the constraintss such as account, consumption time, the spending amount of Token, then needs incoming corresponding with constraints
Parameter, the transaction could be consumed and correspond to Token, for example incoming meet the number such as account, time, spending amount of constraints
Value, then allow to consume the transaction and correspond to Token, does not otherwise allow.
For example, account A initiates a money transfer transactions to account B, which needs to consume a Token, and the Token carries
There is verification contract, and the verification contract of the Token carries specifies account, consumption time, the spending amount etc. for consuming the Token
Constraints, if then the incoming parameter of this money transfer transactions meets institute's Prescribed Properties of the Token, service logic verification is logical
It crosses, allows to consume the Token.
(3) when all be verified, new UTXO data is generated and are stored in the database, the UTXO data packets
It includes:New Token and data information associated with Token.
In the present embodiment, when all be verified, corresponding new UTXO is generated based on the output parameter that UTXO merchandises
Data, including:New Token and data information associated with Token, for example generate a new Vault data, generate one
The modification of the relationships content such as owner's information, Token states in part new UTXOTx data and Token.
Optionally, it when generating new Token, judges whether there is and generates the incoming parameter in new contract address or the transaction
In whether include contract address, if so, using the contract address of the contract address Token carry newly-generated as the transaction
It being written in database, when for consuming the new Token next time, by the corresponding contract in contract address, transaction being carried out
Service logic is verified.
(2) ether mill money transfer transactions handle logic
Account Type transaction is executed by ether mill virtual machine.Ether mill virtual machine (Ethereum Virtual
Machine, EVM), it is a kind of virtual machine based on storehouse, for executing ether mill intelligence contract, ether mill is handed over to realize
The easily processing logic of (Account Type transaction).
The present invention provides a kind of verification method of transferring accounts based on block chain.
It is that the present invention is based on the flow diagrams of the verification method first embodiment of transferring accounts of block chain with reference to Fig. 2, Fig. 2.This
In embodiment, the verification method of transferring accounts based on block chain includes the following steps:
Step S110, broadcasted in executing ether mill network when the transaction in block transaction queue of knowing together, judge to work as
The type of the transaction of preceding execution.
From the basic handling flow of money transfer transactions in block chain:When the untreated transaction in block chain network reaches one
When fixed number amount, each transaction is packaged according to processing sequence and is broadcast to block chain network by some node in block chain network
In, so that each node is handled and known together to transaction in block chain network.
In the present embodiment, different types of transaction, corresponding processing logic.Therefore, when executing transaction, first judge current
The type of the transaction of execution.The type merchandised in the block transaction queue to be known together broadcasted in block chain is except merchandising it in ether mill
Outside, further include having UTXO transaction.The transaction of ether mill is the transaction based on account model, and UTXO transaction is based on UTXO model
It merchandises and can concurrently be executed when meeting certain condition.The type of transaction can be judged by the coding form of transaction, than
Data data in merchandising such as ether mill are encoded using RLP, and the data data in UTXO transaction are encoded using Json.Inhomogeneity
The transaction of type, corresponding processing logic are different.
Step S120 reads phase when the type of the transaction of execution is UTXO transaction and when being transfer operation from database
Close information;
In the present embodiment, to realize the verification for merchandising to UTXO, need to read phase from the database that storage UTXO merchandises
Close information.For example, the input parameter tokenkey based on UTXO transaction, reads the corresponding ownership letters of Token that transaction uses
Breath;The number of this token ready for use that merchandises.
Step S130 is based on the relevant information, is verified to the transaction;
Optionally, the relevant information includes:The merchandise corresponding ownership information of Token used, the transaction
The number of token ready for use;
Ownership is verified:Based on the corresponding ownership information of Token that transaction uses, the Token that verification transaction uses is
It is no to belong to legal account, if so, ownership is verified;
Accounting equation is verified:Amount of money of number and this transaction based on transaction token ready for use, described in verification
Merchandise token ready for use number summation whether be equal to this Token to be generated that merchandises number summation, if so, meeting
Meter equation is verified.
Optionally, if the Token that uses of transaction is mounted with verification contract, the also verification contract address field of even Token
There is value, then also needs to carry out service logic verification to transaction.
Service logic verification implementation process include:
(1) parameter that the address based on the verification contract is passed to the transaction, builds new ether mill transaction;
Optionally, the parameter includes:Calling verifies the function interface of contract and further includes consuming the transaction to correspond to
It the account of Token, and/or consumes the transaction and corresponds to the number of Token, and/or consume the time that the transaction corresponds to Token;
For example, account A initiates a money transfer transactions to account B, which needs to consume a Token, and the Token carries
There is verification contract, and the verification contract of the Token carries specifies account, consumption time, the spending amount etc. for consuming the Token
Constraints, if then the incoming parameter of this money transfer transactions meets institute's Prescribed Properties of the Token, service logic verification is logical
It crosses, allows to consume the Token.
(2) the ether mill transaction for executing structure tests transaction progress service logic for being based on the verification contract
Card.
In the present embodiment, due to the transaction that the ether mill transaction of structure is ether mill type, it is therefore desirable to create EVM objects
To execute the newly-built ether mill transaction.Simultaneously as realize service logic verification build ether mill transaction be not with
True money transfer transactions too in the network of mill, thus the receipt after ether mill transaction and ether mill transaction execution does not charge to area
In block chain.
The present embodiment is the Token with specific amount by the remaining sum for splitting account model on ether mill, after fractionation
Token be the operation object transferred accounts, and include the transaction of Token and merchandise for UTXO.After the Splitting Logic of Token,
What UTXO process of exchange tracked is the transfer of the ownership of each Token, rather than the state change of account, Token can be bright
Really record its source and its transaction limits condition, and when Token is used by consumption in money transfer transactions next time also can basis
Transaction limits condition carries out a variety of verification forms including service logic verification, transfers accounts to improve in block chain network
The scalability of transaction.
It is that the present invention is based on the flow diagrams of the verification method second embodiment of transferring accounts of block chain with reference to Fig. 3, Fig. 3.This
In embodiment, after above-mentioned steps S130, further include:
Step S140 executes transfer operation, generates new UTXO data when being verified;
The UTXO data are stored in the database by step S150, and the UTXO data include:New Token;
Wherein, it when generating new Token, judges whether there is and generates new contract address or the incoming parameter of merchandising
In whether include contract address, if so, using the contract address as the contract of the newly-generated Token carries of merchandising
Location is written in the database.
In the present embodiment, when all be verified, corresponding new UTXO is generated based on the output parameter that UTXO merchandises
Data, including:New Token and data information associated with Token, for example generate a new Vault data, generate one
The modification of the relationships content such as owner's information, Token states in part new UTXOTx data and Token.
In the present embodiment, carry contract address may be selected in newly-generated Token, when for consuming the Token next time into
Industry business logic checking.
In the present embodiment, the source mode of the contract address of Token institutes carry has following two:
(1) while generating Token, contract address of the contract address as the Token institutes carry is generated;
Optionally, when transaction generates new Token, the incoming parameter of the transaction further includes:It calls new for generating
The function interface of the contract of contract address and service logic corresponding with new Token verify relevant parameter;
The service logic corresponding with new Token verifies relevant parameter:Allow to consume newly-generated Token
Account list, and/or allow the amount of money upper limit for consuming newly-generated Token, and/or allow to consume newly-generated Token's
Time limit.
In the method, by calling the function interface and above-mentioned parameter of template contract, new ether mill transaction is built, is executed
The ether mill is merchandised, for generate the template contract example contract address, tested containing service logic in the example contract
Data record needed for card and relevant operation interface, also i.e. using example contract address as the contract address of the Token institutes carry.
(2) when initiating to merchandise, it is passed to contract address of the contract address as the Token institutes carry.
For ease of further understanding the present invention, the transfer procedure of the present invention is illustrated below.
Assuming that account A has Token1 (carry verification and about M), Token2 (non-carry verification contract), account B has
Token3 (carry verification and about P), account C have Token4 (carry verification and about Q).
(1) account A transfers accounts to account B, and consumption Token1 (belonging to account A) generates new token1 (belonging to account B)
Under this situation, in money transfer transactions implementation procedure, the verification of Token1 carries and about M is called to patrol transaction carry out business
Volume verification, for example whether verification account A allows to transfer accounts to account B, whether transfer amounts are more than the amount of money upper limit of setting, when transferring accounts
Between whether transferring accounts in the time limit in permission.
Under this situation, the new token1 that money transfer transactions generate can select carry to verify contract, can also select not carry
Verify contract, wherein the verification contract of token1 carries is either the verification of Token1 carries and about M, can also be carry
New verification contract, can also be verification and about M and the new verification contract of carry.
Under this situation, the verification contract of newly generated Token carries original Token, it is ensured that each Token continues to continue to use original
The business verifying logic of Token.
(2) account A transfers accounts to account B, consumption Token2 (belonging to account A), and generating new token2, (small change Token belongs to
In account A), new token3 (belonging to account B)
Under this situation, in money transfer transactions implementation procedure, since the non-carries of Token2 verify contract, because without carrying out industry
Business logic checking.
Under this situation, new token2, token3 that money transfer transactions generate can select carry to verify contract, can also select
Carry does not verify contract, wherein the verification contract of token2, token3 carry either the verification of Token1 carries and about M,
It can also be the new verification contract of carry, can also be verification and about M and the new verification contract of carry.
(3) account B transfers accounts to account C, and consumption token1 (belonging to account B) generates new token4 (belonging to account C),
Wherein, token1 is mounted with verification and about M, the new verification and about H of Token1;
Under this situation, in money transfer transactions implementation procedure, the verification of calling token1 carries and about M, H are to carry out business of merchandising
Logic checking, for example whether verification account B allows to transfer accounts to account C, whether transfer amounts are more than the amount of money upper limit of setting, transfer accounts
Time whether transferring accounts in the time limit in permission.
Under this situation, the new token4 that money transfer transactions generate can select carry to verify contract, can also select not carry
Verify contract, wherein the verification contract of token4 carries is either the verification of the Token1 of token1 carries and about M, also may be used
With the verification for being carry and about H, can also be the new verification contract of carry, or can also be carry verification and about M, H and
New verification contract.
Under this situation, newly generated Token carries verification contract either original Token verification contract, can also
It is the verification contract that this merchandises newly-generated, thereby may be ensured that the diversity of Token carry contracts, promotes service logic verification
Flexibility and variability.
It is that the present invention is based on the flow diagrams of the verification method 3rd embodiment of transferring accounts of block chain with reference to Fig. 4, Fig. 4.This
In embodiment, the verification method of transferring accounts based on block chain further includes:
Step S210 executes operation of coining, generates when the type of the transaction of execution is UTXO transaction and is operated to coin
New UTXO data;
The UTXO data are stored in the database by step S220, and the UTXO data include:New Token;
Wherein, it when generating new Token, judges whether there is and generates new contract address or the incoming parameter of merchandising
In whether include contract address, if so, using the contract address as the contract of the newly-generated Token carries of merchandising
Location is written in the database.
In the present embodiment, during generation of coining new Token, for ease of being carried out when the subsequent consumption new Token
Service logic verifies, and therefore, it is necessary to the Token carry contracts addresses to coin newly-generated.Wherein, the contract of Token institutes carry
The source mode of address has following two:
(1) while generating Token, contract address of the contract address as the Token institutes carry is generated;(2) exist
When initiating transaction, it is passed to contract address of the contract address as the Token institutes carry.
The first source mode more than lower mask body is stated to be illustrated.
For example, before sending UTXO transaction, by user elder generation deployment template contract, which can in subsequent transaction
Instantiation meets the example contract of service logic.
It is real except the fields such as necessary object of transferring accounts, number of transferring accounts in txout fields for example, when sending UTXO transaction
Logic verify of subsequently transferring accounts now is carried out to Token carry traffic contracts, user also needs in addition to provide parameter.
Optionally, the parameter includes:Call the function interface of template contract and further include allow to consume the transaction it is new
The account list of the Token of generation, and/or allows to consume the amount of money upper limit of the newly-generated Token of the transaction, and/or allow to disappear
Take the newly-generated time limit of the transaction.
For example, the address of template contract is initcontract field values, parameter is initfuncandparams fields
Value then coins transaction in execution when creating new Token, first judges initcontract fields and initfuncandparams
Whether field has value, if there is value, illustrates that the newly-built Token needs carry service logic to verify contract;Based on the template
The address of contract and above-mentioned parameter build new ether mill transaction, ether mill transaction are executed, for generating the template contract
The address of example contract contains data record and relevant operation interface needed for service logic verification in the example contract.
For example, newly-generated a Token, the Token are mounted with verification contract, are then built by above-mentioned parameter in account A
The constraint item such as constraints of the subsequent consumption Token, such as specified account, consumption time, the spending amount for consuming the Token
Part, if then the subsequent consumption Token when parameter that is passed to meet institute's Prescribed Properties of the Token, service logic verification
Pass through, allows to consume the Token.
In the present embodiment, due to the transaction that the ether mill transaction of structure is ether mill type, it is therefore desirable to create EVM objects
To execute the newly-built ether mill transaction.Simultaneously as verifying the ether mill that contract is built to creating Token carries to realize
Transaction is not the true sale in the network of ether mill, thus the receipt after ether mill transaction and ether mill transaction execution is not
It charges in block chain.
In the present embodiment, since the storage mode of intelligent contract in ether mill is contract address, execute the ether mill
The result of transaction is an example contract address of template contract.Finally generated the address of the example contract as the transaction
The addresses of verification contract of Token carries be written in the database.
To further understand the present invention, the verification contract of exchange's carry in the present invention is illustrated below.
(1) the realization position of the corresponding verifying logic of contract
The verifying logic of the present invention is realized currently based on intelligent contract, if the verification that follow-up intelligence contract is realized
After logic carries out day-to-day immobilization, the corresponding verifying logic of contract can turn to be realized by bottom code, and then may be implemented
Higher verification performance and offer widely verification ability.
(2) action type of the verifying logic to data
The intelligent contract that verifying logic is based on, the operation according to verifying logic to data on chain, and can be divided into read-only
Contract and write-in contract.
For example, whether the account for initiating money transfer transactions is one of particular account number that contract has recorded, being limited with this can only be by
Particular account number uses a Token, then the type of the contract is read-only contract during executing business check logic.
For example, one account of limitation is externally transferred accounts for one day, limit is 500 yuan, needs to verify limit of having transferred accounts before each money transfer transactions
Whether volume and this transaction the sum of the number that will transfer accounts transfinite, and can just transfer accounts after being proved to be successful, while can update the account after transferring accounts successfully
Number transferred accounts limit record, then be directed to business check logic during the contract type be write-in contract.
(3) classification of contract is verified
Contract is verified according to the relationship of the logical AND carry contract main body (Token) of contract, can divide into example contract and
General contract.
Example contract and Token are corresponded, and " whether the account for initiating money transfer transactions is spy that contract has recorded with above-mentioned
Determine one of account " circumscription logic for, the restrictive condition is effective just for some Token, the restrictive condition between each Token
Can be different, and restrictive condition is recorded only on the Token.Example contract is the instantiation of template contract as a result, UTXO is handed over
Called in easy implementation procedure the example contract that template contract generates by containing needed for verifying logic data record and relevant operation
Interface.By taking above-mentioned service logic as an example, template contract provides the white list record of an account list and judges that an input account is
The no interface in white list account list, by the account that can be used according to incoming Token come just when example contract generates
The white list account list of beginning chemical combination about.
The data of general contract are globally shared, with the limit of above-mentioned " one account of limitation externally transfers accounts limit for one day as 500 yuan "
For logic processed, the service logic for limit of transferring accounts an account day is related with the account, is not related to some specific Token, because
And when there is the Token of above-mentioned business circumscription logic to create, the address of general contract will be assigned, consequently facilitating subsequent consumption should
It is supplied to the contract object to be written and read the operation for limit of transferring accounts day when Token.
The classification of example contract and general contract is that read-only contract or write-in contract do not join necessarily with the intelligence contract
System.
With reference to Fig. 5, Fig. 5 is the function module signal of the verification device first embodiment of transferring accounts the present invention is based on block chain
Figure.In the present embodiment, the verification device of transferring accounts based on block chain includes:
Judgment module 10, for being broadcasted in executing ether mill network when the transaction in block transaction queue of knowing together,
Judge the type of currently performed transaction, the type of the transaction includes UTXO transaction;
From the basic handling flow of money transfer transactions in block chain:When the untreated transaction in block chain network reaches one
When fixed number amount, each transaction is packaged according to processing sequence and is broadcast to block chain network by some node in block chain network
In, so that each node is handled and known together to transaction in block chain network.
In the present embodiment, different types of transaction, corresponding processing logic.Judgment module 30 is first sentenced when executing transaction
The type of disconnected currently performed transaction.The type merchandised in the block transaction queue to be known together broadcasted in block chain is handed over except ether mill
Further include having UTXO transaction except easily.The transaction of ether mill is the transaction based on account model, and UTXO transaction is based on UTXO mould
It the transaction of type and can concurrently be executed when meeting certain condition.The type of transaction can be sentenced by the coding form of transaction
Break, for example the data data in the transaction of ether mill are encoded using RLP, and the data data in UTXO transaction are encoded using Json.
Different types of transaction, corresponding processing logic are different.
Read module 20, for when the type of the transaction of execution is UTXO transaction and when being money transfer transactions, from database
Read relevant information;
In the present embodiment, to realize that the verification merchandised to UTXO, read module 10 need the data merchandised from storage UTXO
Relevant information is read in library.For example, the input parameter tokenkey based on UTXO transaction, reads the Token that transaction uses and corresponds to
Ownership information;The number of this token ready for use that merchandises.
Authentication module 30 verifies the transaction for being based on the relevant information;
Optionally, the relevant information includes:The merchandise corresponding ownership information of Token used, the transaction
The number of token ready for use;
The authentication module 30 is specifically used for:
Based on the corresponding ownership information of Token merchandised and used, verify whether the Token used that merchandises belongs to
In legal account, if so, ownership is verified;
The amount of money of number and this transaction based on the transaction token ready for use, it is ready for use to verify the transaction
Whether the number summation of token is equal to the number summation of this Token to be generated that merchandises, if so, Accounting equation verification is logical
It crosses.
Optionally, if the Token that uses of transaction is mounted with verification contract, the also verification contract address field of even Token
There is value, then also needs to carry out service logic verification to transaction.
In the present embodiment, the authentication module 30 also particularly useful for:
When in the relevant information including the address of verification contract of the Token carries merchandised and used, it is based on
The parameter that the address of the verification contract is passed to the transaction, builds new ether mill and merchandises and execute, described for being based on
It verifies contract and service logic verification is carried out to the transaction.
Optionally, the parameter includes:Calling verifies the function interface of contract and further includes consuming the transaction to correspond to
It the account of Token, and/or consumes the transaction and corresponds to the number of Token, and/or consume the time that the transaction corresponds to Token.
With reference to Fig. 6, Fig. 6 is the function module signal of the verification device second embodiment of transferring accounts the present invention is based on block chain
Figure.Originally it applies in example, the verification device of transferring accounts based on block chain further includes:
Generation module 40, for when being verified, executing transfer operation, generating new UTXO data;By the UTXO
Data are stored in the database, and the UTXO data include:New Token;
Wherein, the generation module 40 is additionally operable to:When generating new Token, judge whether there is with generating new contract
Whether include contract address in the parameter that location or the transaction are passed to, if so, the contract address is new as the transaction
The contract address of the Token carries of generation is written in the database.
UTXO data, including:New Token and data information associated with Token, for example generate a new
The relationships content such as owner's information, Token states repaiies in Vault data, a new UTXOTx data of generation and Token
Change.
In the present embodiment, carry contract address may be selected in newly-generated Token, when for consuming the Token next time into
Industry business logic checking.
In the present embodiment, the source mode of the contract address of Token institutes carry has following two:
(1) while generating Token, contract address of the contract address as the Token institutes carry is generated;
(2) when initiating to merchandise, it is passed to contract address of the contract address as the Token institutes carry.
Further, in verification another embodiment of device of transferring accounts the present invention is based on block chain, the generation module 40
It is additionally operable to:
When the type of the transaction of execution is UTXO transaction and is operated to coin, operation of coining is executed, new UTXO is generated
Data;The UTXO data are stored in the database, the UTXO data include:New Token;
Wherein, the generation module 40 is additionally operable to:When generating new Token, judge whether there is with generating new contract
Whether include contract address in the parameter that location or the transaction are passed to, if so, the contract address is new as the transaction
The contract address of the Token carries of generation is written in the database.
In the present embodiment, during generation of coining new Token, for ease of being carried out when the subsequent consumption new Token
Service logic verifies, and therefore, it is necessary to the Token carry contracts addresses to coin newly-generated.Wherein, the contract of Token institutes carry
The source mode of address has following two:
(1) while generating Token, contract address of the contract address as the Token institutes carry is generated;(2) exist
When initiating transaction, it is passed to contract address of the contract address as the Token institutes carry.
The first source mode more than lower mask body is stated to be illustrated.
For example, before sending UTXO transaction, by user elder generation deployment template contract, which can in subsequent transaction
Instantiation meets the example contract of service logic.
It is real except the fields such as necessary object of transferring accounts, number of transferring accounts in txout fields for example, when sending UTXO transaction
Logic verify of subsequently transferring accounts now is carried out to Token carry traffic contracts, user also needs in addition to provide parameter.
Optionally, the parameter includes:Call the function interface of template contract and further include allow to consume the transaction it is new
The account list of the Token of generation, and/or allows to consume the amount of money upper limit of the newly-generated Token of the transaction, and/or allow to disappear
Take the newly-generated time limit of the transaction.
For example, the address of template contract is initcontract field values, parameter is initfuncandparams fields
Value then coins transaction in execution when creating new Token, first judges initcontract fields and initfuncandparams
Whether field has value, if there is value, illustrates that the newly-built Token needs carry service logic to verify contract;Based on the template
The address of contract and above-mentioned parameter build new ether mill transaction, ether mill transaction are executed, for generating the template contract
The address of example contract contains data record and relevant operation interface needed for service logic verification in the example contract.
In the present embodiment, due to the transaction that the ether mill transaction of structure is ether mill type, it is therefore desirable to create EVM objects
To execute the newly-built ether mill transaction.Simultaneously as verifying the ether mill that contract is built to creating Token carries to realize
Transaction is not the true sale in the network of ether mill, thus the receipt after ether mill transaction and ether mill transaction execution is not
It charges in block chain.
In the present embodiment, since the storage mode of intelligent contract in ether mill is contract address, execute the ether mill
The result of transaction is an example contract address of template contract.Finally generated the address of the example contract as the transaction
The addresses of verification contract of Token carries be written in the database.
The present invention also provides a kind of computer readable storage mediums.
In the present embodiment, the proving program of transferring accounts based on block chain, institute are stored on the computer readable storage medium
State when the proving program of transferring accounts based on block chain is executed by processor realize as described in any of the above-described embodiment based on area
Block chain transfer accounts verification method the step of.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical scheme of the present invention substantially in other words does the prior art
Going out the part of contribution can be expressed in the form of software products, which is stored in a storage medium
In (such as ROM/RAM), including some instructions are used so that a station terminal (can be mobile phone, computer, server or network are set
It is standby etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited in above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form, it is every using equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content, directly or indirectly
Other related technical areas are used in, all of these belong to the protection of the present invention.
Claims (13)
1. a kind of verification method of transferring accounts based on block chain, which is characterized in that the verification method packet of transferring accounts based on block chain
Include following steps:
It is being broadcasted in executing block chain network when the transaction in block transaction queue of knowing together, is judging currently performed transaction
Type;
When the type of the transaction of execution is UTXO transaction and when being transfer operation, relevant information is read from database;
Based on the relevant information, the transaction is verified, wherein make when including the transaction in the relevant information
When the contract address of Token carries, based on the contract address parameter incoming with the transaction, new ether mill is built
It merchandises and executes, service logic verification is carried out to the transaction for being based on the contract.
2. the verification method of transferring accounts based on block chain as described in claim 1, which is characterized in that be based on the correlation described
Information further includes after being verified to the transaction:
When being verified, transfer operation is executed, new UTXO data are generated;
The UTXO data are stored in the database, the UTXO data include:New Token;
Wherein, when generating new Token, judging whether there is to generate in new contract address or the incoming parameter of merchandising is
No includes contract address, if so, being write the contract address as the contract address for merchandising newly-generated Token carries
Enter in the database.
3. the verification method of transferring accounts based on block chain as claimed in claim 1 or 2, which is characterized in that the transaction was passed to
Parameter includes:It calls for the function interface of the contract of service logic verification and verifies relevant ginseng with service logic is carried out
Number;
It is described to include with the relevant parameter of progress service logic verification:Consume account, and/or consumption that the transaction corresponds to Token
The transaction corresponds to the number of Token, and/or consumes the time that the transaction corresponds to Token.
4. the verification method of transferring accounts based on block chain as claimed in claim 3, which is characterized in that when the transaction generates newly
When Token, the incoming parameter of the transaction further includes:Call contract for generating new contract address function interface and with
The corresponding service logics of new Token verify relevant parameter;
The service logic corresponding with new Token verifies relevant parameter:Allow the account for consuming newly-generated Token
Number list, and/or allows the amount of money upper limit for consuming newly-generated Token, and/or allow the time for consuming newly-generated Token
Time limit.
5. the verification method of transferring accounts based on block chain as claimed in claim 1 or 2, which is characterized in that the relevant information is also
Including:The number of the corresponding ownership information of Token used of merchandising, the transaction token ready for use;
Described to be based on the relevant information, carrying out verification to the transaction includes:
Based on the corresponding ownership information of Token merchandised and used, verify whether the Token used that merchandises belongs to conjunction
Method account;
The amount of money of number and this transaction based on the transaction token ready for use verifies the transaction token ready for use
Number summation whether be equal to this Token to be generated that merchandises number summation.
6. a kind of verification method of transferring accounts based on block chain, which is characterized in that the verification method packet of transferring accounts based on block chain
It includes:
It is being broadcasted in executing block chain network when the transaction in block transaction queue of knowing together, is judging currently performed transaction
Type;
When the type of the transaction of execution is UTXO transaction and is operated to coin, operation of coining is executed, new UTXO data are generated;
The UTXO data are stored in database, the UTXO data include:New Token;
Wherein, when generating new Token, judging whether there is to generate in new contract address or the incoming parameter of merchandising is
No includes contract address, if so, being write the contract address as the contract address for merchandising newly-generated Token carries
Enter in the database, for when the new Token, corresponding to contract for subsequent consumption by the contract call by location and offseting
The transaction for taking the new Token carries out service logic verification.
7. the verification method of transferring accounts based on block chain as claimed in claim 6, which is characterized in that the incoming parameter of the transaction
Including:Call function interface and service logic corresponding with the new Token verification of the contract for generating new contract address
Relevant parameter;
The service logic corresponding with new Token verifies relevant parameter:Allow the account for consuming newly-generated Token
Number list, and/or allows the amount of money upper limit for consuming newly-generated Token, and/or allow the time for consuming newly-generated Token
Time limit.
8. a kind of verification device of transferring accounts based on block chain, which is characterized in that the verification device packet of transferring accounts based on block chain
It includes:
Judgment module judges to work as broadcasting in executing block chain network when the transaction in block transaction queue of knowing together
The type of the transaction of preceding execution;
Read module, for when the type of the transaction of execution is UTXO transaction and when being transfer operation, phase to be read from database
Close information;
Authentication module verifies the transaction for being based on the relevant information;
The authentication module is additionally operable to:When the contract in the relevant information including the Token carries merchandised and used
When location, based on the contract address parameter incoming with the transaction, builds new ether mill and merchandise and execute, for being based on
It states contract and service logic verification is carried out to the transaction.
9. the verification device of transferring accounts based on block chain as claimed in claim 8, which is characterized in that described to be turned based on block chain
Account verifies device:
Generation module, for when being verified, executing transfer operation, generating new UTXO data;The UTXO data are deposited
Enter in the database, the UTXO data include:New Token;
Wherein, the generation module is additionally operable to:When generating new Token, judges whether there is and generate new contract address or institute
Whether include contract address, if so, the contract address is newly-generated as the transaction if stating in the incoming parameter of transaction
The contract address of Token carries is written in the database.
10. the verification device of transferring accounts based on block chain as claimed in claim 8 or 9, which is characterized in that the transaction was passed to
Parameter includes:It calls for the function interface of the contract of service logic verification and verifies relevant ginseng with service logic is carried out
Number;
It is described to include with the relevant parameter of progress service logic verification:Consume account, and/or consumption that the transaction corresponds to Token
The transaction corresponds to the number of Token, and/or consumes the time that the transaction corresponds to Token.
11. the verification device of transferring accounts based on block chain as claimed in claim 10, which is characterized in that when the transaction generates newly
Token when, the incoming parameter of the transaction further includes:Call contract for generating new contract address function interface and
Service logic corresponding with new Token verifies relevant parameter;
The service logic corresponding with new Token verifies relevant parameter:Allow the account for consuming newly-generated Token
Number list, and/or allows the amount of money upper limit for consuming newly-generated Token, and/or allow the time for consuming newly-generated Token
Time limit.
12. the verification device of transferring accounts based on block chain as claimed in claim 8 or 9, which is characterized in that the relevant information is also
Including:The number of the corresponding ownership information of Token used of merchandising, the transaction token ready for use;
The authentication module is additionally operable to:
Based on the corresponding ownership information of Token merchandised and used, verify whether the Token used that merchandises belongs to conjunction
Method account;
The amount of money of number and this transaction based on the transaction token ready for use verifies the transaction token ready for use
Number summation whether be equal to this Token to be generated that merchandises number summation.
13. a kind of computer readable storage medium, which is characterized in that be stored with based on area on the computer readable storage medium
The proving program of transferring accounts of block chain realizes such as claim 1- when the proving program of transferring accounts based on block chain is executed by processor
Described in any one of 7 based on block chain transfer accounts verification method the step of.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810611101.0A CN108694575A (en) | 2018-06-13 | 2018-06-13 | Verification method of transferring accounts, device and storage medium based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810611101.0A CN108694575A (en) | 2018-06-13 | 2018-06-13 | Verification method of transferring accounts, device and storage medium based on block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108694575A true CN108694575A (en) | 2018-10-23 |
Family
ID=63848715
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810611101.0A Pending CN108694575A (en) | 2018-06-13 | 2018-06-13 | Verification method of transferring accounts, device and storage medium based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108694575A (en) |
Cited By (29)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109493027A (en) * | 2018-11-19 | 2019-03-19 | 众安信息技术服务有限公司 | A kind of method and device realized across chain transactional operation |
CN109636388A (en) * | 2018-12-07 | 2019-04-16 | 深圳市智税链科技有限公司 | Data processing method, device, medium and electronic equipment in block chain network |
CN109697596A (en) * | 2018-11-02 | 2019-04-30 | 湖南智慧政务区块链科技有限公司 | A kind of method and device constructing E-Government |
CN109741038A (en) * | 2018-12-12 | 2019-05-10 | 深圳市网心科技有限公司 | Token processing method, computer readable storage medium and electronic equipment based on block chain account |
CN109886675A (en) * | 2019-02-01 | 2019-06-14 | 杭州电子科技大学 | The distribution of resource access token based on block chain and resource use monitoring method |
CN110009321A (en) * | 2018-12-12 | 2019-07-12 | 阿里巴巴集团控股有限公司 | A kind of transfer account method and system based on block chain intelligence contract |
CN110135993A (en) * | 2019-05-17 | 2019-08-16 | 深圳银链科技有限公司 | Method, equipment and the storage medium of UTXO model adaptation intelligence contract account model |
CN110163754A (en) * | 2019-04-26 | 2019-08-23 | 华中科技大学 | Method, client, block chain and the system of transaction of coining are realized in Fabric block chain |
CN110210857A (en) * | 2019-05-17 | 2019-09-06 | 杭州宇链科技有限公司 | A kind of logical card method of commerce and device based on publicly-owned chain |
CN110263580A (en) * | 2019-04-29 | 2019-09-20 | 阿里巴巴集团控股有限公司 | Data processing method, device and block chain node based on block chain |
CN110535639A (en) * | 2019-08-20 | 2019-12-03 | 深圳市网心科技有限公司 | Block chain assets disposition method and relevant device based on more asset models |
CN110675147A (en) * | 2019-09-11 | 2020-01-10 | 上海唯链信息科技有限公司 | Block chain transaction method, electronic equipment and storage device |
CN110704134A (en) * | 2019-09-12 | 2020-01-17 | 杭州秘猿科技有限公司 | Method and device for performing function expansion on block chain |
CN111813999A (en) * | 2020-08-13 | 2020-10-23 | 广州东港安全印刷有限公司 | Method for improving expandability of intelligent contract field of Etheng |
CN111835884A (en) * | 2020-07-13 | 2020-10-27 | 北京好扑信息科技有限公司 | Virtual address generation method for block chain |
CN112199729A (en) * | 2020-11-11 | 2021-01-08 | 山西特信环宇信息技术有限公司 | Verification method and system for cone block chain |
CN112732720A (en) * | 2021-01-11 | 2021-04-30 | 杭州复杂美科技有限公司 | Data storage method, data query method, computer device and storage medium |
CN112767153A (en) * | 2019-02-01 | 2021-05-07 | 创新先进技术有限公司 | Block chain transaction method and device, electronic equipment and storage medium |
CN113222748A (en) * | 2021-01-05 | 2021-08-06 | 上海能链众合科技有限公司 | Execution method of block chain based on concurrency model |
US11115188B2 (en) | 2019-04-29 | 2021-09-07 | Advanced New Technologies Co., Ltd. | Blockchain-based data processing method, apparatus, and blockchain node |
CN113379416A (en) * | 2020-03-10 | 2021-09-10 | 本无链科技(深圳)有限公司 | Method and system for realizing similar biological groups with consistent memory but different behaviors |
CN113450223A (en) * | 2021-07-13 | 2021-09-28 | 成都质数斯达克科技有限公司 | Transaction processing method, device and equipment based on UTXO model and storage medium |
CN113450224A (en) * | 2021-07-13 | 2021-09-28 | 成都质数斯达克科技有限公司 | Transaction processing method, device and equipment based on UTXO model and storage medium |
CN113469668A (en) * | 2021-07-15 | 2021-10-01 | 中国银行股份有限公司 | Block chain-based method and device for limiting public customer transaction |
CN113704745A (en) * | 2021-08-25 | 2021-11-26 | 史云凌 | UTXO authorization and certificate management method and system based on role authority |
CN114066456A (en) * | 2022-01-13 | 2022-02-18 | 环球数科集团有限公司 | ERC 1155-based cross-chain NFT transfer and settlement system |
US11379858B2 (en) | 2020-01-17 | 2022-07-05 | Samsung Electronics Co., Ltd. | User apparatus and manager apparatus included in blockchain network and controlling method thereof |
CN114884734A (en) * | 2022-05-10 | 2022-08-09 | 中山市当下科技有限公司 | Checking method for one-layer data structure of block chain |
CN115357346A (en) * | 2022-10-13 | 2022-11-18 | 北京百度网讯科技有限公司 | Transaction processing method and device based on block chain, electronic equipment and medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160217436A1 (en) * | 2015-01-25 | 2016-07-28 | Dror Samuel Brama | Method, System and Program Product for Tracking and Securing Transactions of Authenticated Items over Block Chain Systems. |
CN106940854A (en) * | 2017-03-06 | 2017-07-11 | 钱德君 | A kind of bridging method between UTXO models and contract |
US20170344988A1 (en) * | 2016-05-24 | 2017-11-30 | Ubs Ag | System and method for facilitating blockchain-based validation |
CN107678865A (en) * | 2017-09-20 | 2018-02-09 | 中国银行股份有限公司 | The verification method and system of block chain based on transaction packet |
CN107911216A (en) * | 2017-10-26 | 2018-04-13 | 矩阵元技术(深圳)有限公司 | A kind of block chain transaction method for secret protection and system |
-
2018
- 2018-06-13 CN CN201810611101.0A patent/CN108694575A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160217436A1 (en) * | 2015-01-25 | 2016-07-28 | Dror Samuel Brama | Method, System and Program Product for Tracking and Securing Transactions of Authenticated Items over Block Chain Systems. |
US20170344988A1 (en) * | 2016-05-24 | 2017-11-30 | Ubs Ag | System and method for facilitating blockchain-based validation |
CN106940854A (en) * | 2017-03-06 | 2017-07-11 | 钱德君 | A kind of bridging method between UTXO models and contract |
CN107678865A (en) * | 2017-09-20 | 2018-02-09 | 中国银行股份有限公司 | The verification method and system of block chain based on transaction packet |
CN107911216A (en) * | 2017-10-26 | 2018-04-13 | 矩阵元技术(深圳)有限公司 | A kind of block chain transaction method for secret protection and system |
Cited By (41)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109697596A (en) * | 2018-11-02 | 2019-04-30 | 湖南智慧政务区块链科技有限公司 | A kind of method and device constructing E-Government |
CN109493027A (en) * | 2018-11-19 | 2019-03-19 | 众安信息技术服务有限公司 | A kind of method and device realized across chain transactional operation |
CN109636388A (en) * | 2018-12-07 | 2019-04-16 | 深圳市智税链科技有限公司 | Data processing method, device, medium and electronic equipment in block chain network |
CN109636388B (en) * | 2018-12-07 | 2024-02-23 | 深圳市智税链科技有限公司 | Data processing method, device, medium and electronic equipment in block chain network |
CN109741038A (en) * | 2018-12-12 | 2019-05-10 | 深圳市网心科技有限公司 | Token processing method, computer readable storage medium and electronic equipment based on block chain account |
CN110009321A (en) * | 2018-12-12 | 2019-07-12 | 阿里巴巴集团控股有限公司 | A kind of transfer account method and system based on block chain intelligence contract |
CN110009321B (en) * | 2018-12-12 | 2020-08-11 | 阿里巴巴集团控股有限公司 | Transfer method and system based on block chain intelligent contract |
CN109886675B (en) * | 2019-02-01 | 2021-03-30 | 杭州电子科技大学 | Resource access token distribution and resource use monitoring method based on block chain |
CN109886675A (en) * | 2019-02-01 | 2019-06-14 | 杭州电子科技大学 | The distribution of resource access token based on block chain and resource use monitoring method |
CN112767153A (en) * | 2019-02-01 | 2021-05-07 | 创新先进技术有限公司 | Block chain transaction method and device, electronic equipment and storage medium |
CN110163754A (en) * | 2019-04-26 | 2019-08-23 | 华中科技大学 | Method, client, block chain and the system of transaction of coining are realized in Fabric block chain |
CN110163754B (en) * | 2019-04-26 | 2021-07-27 | 华中科技大学 | Method, client, blockchain and system for realizing coinage transaction in Fabric blockchain |
US11115188B2 (en) | 2019-04-29 | 2021-09-07 | Advanced New Technologies Co., Ltd. | Blockchain-based data processing method, apparatus, and blockchain node |
CN110263580A (en) * | 2019-04-29 | 2019-09-20 | 阿里巴巴集团控股有限公司 | Data processing method, device and block chain node based on block chain |
CN110263580B (en) * | 2019-04-29 | 2021-03-23 | 创新先进技术有限公司 | Data processing method and device based on block chain and block chain link points |
CN110135993B (en) * | 2019-05-17 | 2021-07-30 | 深圳银链科技有限公司 | Method, equipment and storage medium for adapting UTXO model to intelligent contract account model |
CN110210857A (en) * | 2019-05-17 | 2019-09-06 | 杭州宇链科技有限公司 | A kind of logical card method of commerce and device based on publicly-owned chain |
CN110135993A (en) * | 2019-05-17 | 2019-08-16 | 深圳银链科技有限公司 | Method, equipment and the storage medium of UTXO model adaptation intelligence contract account model |
CN110535639A (en) * | 2019-08-20 | 2019-12-03 | 深圳市网心科技有限公司 | Block chain assets disposition method and relevant device based on more asset models |
CN110675147A (en) * | 2019-09-11 | 2020-01-10 | 上海唯链信息科技有限公司 | Block chain transaction method, electronic equipment and storage device |
CN110675147B (en) * | 2019-09-11 | 2022-11-29 | 上海唯链信息科技有限公司 | Block chain transaction method, electronic equipment and storage device |
CN110704134A (en) * | 2019-09-12 | 2020-01-17 | 杭州秘猿科技有限公司 | Method and device for performing function expansion on block chain |
US11379858B2 (en) | 2020-01-17 | 2022-07-05 | Samsung Electronics Co., Ltd. | User apparatus and manager apparatus included in blockchain network and controlling method thereof |
CN113379416A (en) * | 2020-03-10 | 2021-09-10 | 本无链科技(深圳)有限公司 | Method and system for realizing similar biological groups with consistent memory but different behaviors |
CN111835884B (en) * | 2020-07-13 | 2022-11-04 | 北京好扑信息科技有限公司 | Virtual address generation method for block chain |
CN111835884A (en) * | 2020-07-13 | 2020-10-27 | 北京好扑信息科技有限公司 | Virtual address generation method for block chain |
CN111813999A (en) * | 2020-08-13 | 2020-10-23 | 广州东港安全印刷有限公司 | Method for improving expandability of intelligent contract field of Etheng |
CN111813999B (en) * | 2020-08-13 | 2024-01-05 | 广州科创空间信息科技有限公司 | Method for improving expansibility of intelligent contract field of Ethernet |
CN112199729B (en) * | 2020-11-11 | 2023-09-12 | 山西特信环宇信息技术有限公司 | Cone blockchain verification method and system |
CN112199729A (en) * | 2020-11-11 | 2021-01-08 | 山西特信环宇信息技术有限公司 | Verification method and system for cone block chain |
CN113222748A (en) * | 2021-01-05 | 2021-08-06 | 上海能链众合科技有限公司 | Execution method of block chain based on concurrency model |
CN112732720B (en) * | 2021-01-11 | 2022-05-24 | 杭州复杂美科技有限公司 | Data storage method, data query method, computer device and storage medium |
CN112732720A (en) * | 2021-01-11 | 2021-04-30 | 杭州复杂美科技有限公司 | Data storage method, data query method, computer device and storage medium |
CN113450223A (en) * | 2021-07-13 | 2021-09-28 | 成都质数斯达克科技有限公司 | Transaction processing method, device and equipment based on UTXO model and storage medium |
CN113450224A (en) * | 2021-07-13 | 2021-09-28 | 成都质数斯达克科技有限公司 | Transaction processing method, device and equipment based on UTXO model and storage medium |
CN113450224B (en) * | 2021-07-13 | 2024-02-27 | 成都质数斯达克科技有限公司 | Transaction processing method, device, equipment and storage medium based on UTXO model |
CN113469668A (en) * | 2021-07-15 | 2021-10-01 | 中国银行股份有限公司 | Block chain-based method and device for limiting public customer transaction |
CN113704745A (en) * | 2021-08-25 | 2021-11-26 | 史云凌 | UTXO authorization and certificate management method and system based on role authority |
CN114066456A (en) * | 2022-01-13 | 2022-02-18 | 环球数科集团有限公司 | ERC 1155-based cross-chain NFT transfer and settlement system |
CN114884734A (en) * | 2022-05-10 | 2022-08-09 | 中山市当下科技有限公司 | Checking method for one-layer data structure of block chain |
CN115357346A (en) * | 2022-10-13 | 2022-11-18 | 北京百度网讯科技有限公司 | Transaction processing method and device based on block chain, electronic equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108694575A (en) | Verification method of transferring accounts, device and storage medium based on block chain | |
CN108846659B (en) | Block chain-based transfer method and device and storage medium | |
Singh et al. | Blockchain technology for decentralized autonomous organizations | |
CN110175913A (en) | Data processing system, method, calculating equipment and storage medium based on block chain | |
US20220036350A1 (en) | Cross-border resource transfer authenticity verification method, device and electronic equipment | |
KR20180115778A (en) | Integrated block chain-based data transfer control method and system | |
CN108776929A (en) | Bill processing method, system based on block chain database and readable storage medium storing program for executing | |
CN108492183A (en) | Account trading method, system and the computer readable storage medium of block chain | |
CN109064334A (en) | A kind of intelligence contract bookkeeping methods, computer installation and readable storage medium storing program for executing | |
CN108537667A (en) | Financial asset anti money washing management-control method, equipment and storage medium based on block chain | |
CN111784514B (en) | Service processing method and device based on block chain | |
CN108427601A (en) | A kind of cluster transaction processing method of privately owned chain node | |
CN108269072A (en) | For the transaction processing method and network node of block chain | |
CN110163744A (en) | A kind of method of payment and device based on block chain | |
CN111309745B (en) | Virtual resource processing method and device, electronic equipment and storage medium | |
CN109816323A (en) | Transaction auditing method, calculating equipment, storage medium for block chain network | |
CN109992285A (en) | Block chain code block standalone upgrade method, apparatus and electronic equipment | |
CN107730223A (en) | It is a kind of to polymerize the system and method paid | |
CN111639125A (en) | Resource circulation method and device based on block chain | |
CN112330181A (en) | Enterprise credit evaluation method and device based on block chain | |
CN109086398A (en) | Asynchronous cochain method, equipment and computer readable storage medium | |
CN111552991A (en) | Block chain transaction method and device | |
Garcia Bringas et al. | BlockChain platforms in financial services: current perspective | |
CN112559635A (en) | Service processing method, device, equipment and medium for Ether house alliance link node | |
CN113553378A (en) | Block chain data deleting method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181023 |