CN109447636A - A kind of assets transfer method and device - Google Patents
A kind of assets transfer method and device Download PDFInfo
- Publication number
- CN109447636A CN109447636A CN201811198220.4A CN201811198220A CN109447636A CN 109447636 A CN109447636 A CN 109447636A CN 201811198220 A CN201811198220 A CN 201811198220A CN 109447636 A CN109447636 A CN 109447636A
- Authority
- CN
- China
- Prior art keywords
- transaction
- account
- encryption algorithm
- mark
- input
- 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
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/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
Abstract
The invention discloses a kind of assets transfer method and devices, the described method includes: reception transaction executes request, the signature and public key of the private key generated according to corresponding first Encryption Algorithm of first account for executing the first account comprising transaction input each in transaction in request, and the public key of the second account that each transaction exports in transaction generated according to corresponding second Encryption Algorithm of second account, wherein the first account of at least one transaction input of transaction Encryption Algorithm corresponding with the second account of at least one transaction output is identical or different, construct the transaction;It is inputted for transaction each in the transaction, according to the target lock-on script for the target transaction output that the transaction input is directed toward, sign test is carried out to the unlock script of the transaction input;And after the unlock script sign test that each transaction inputs in the transaction passes through, the block chain is written into the transaction.To provide a kind of assets transfer scheme that can support multiple encryption algorithms.
Description
Technical field
The present invention relates to block chain technical field more particularly to a kind of assets transfer method and devices.
Background technique
The transaction output (Unspent Transaction Output, UTXO) that do not consume be it is a kind of comprising transaction data and
Execute the data structure of code.Each transaction of UTXO construction includes at least one transaction input (TxIn) and at least one friendship
Easily output (TxOut), and the TxIn of each transaction must be the original TxOut of certain transaction in UTXO, and
Need the signature and public key of the private key of account corresponding to the original TxOut.Assets transfer refers to number in block chain
The transfer of word currency, in order to guarantee the accuracy and reliability of assets transfer, existing block chain generallys use the money based on UTXO
Produce transfer scheme.As shown in Figure 1, the transaction that transaction number is Tx002 includes 2 TxIn and 3 TxOut, wherein output index
It include the public key generation of a certain account for navigating to the position of TxIn or TxOut in transaction, in locking script to sign test
Data, usually the cryptographic Hash of the public key of account, unlocks the signed data in script comprising a certain account, the usually private of account
The signature and public key of key.Specifically, after the execution that the node of block chain receives the transaction that reference numeral is Tx002 is requested, structure
The transaction that transaction number as shown in Figure 1 is Tx002 is made, and in the mesh for the target TxOut being respectively directed to by TxIn0 and TxIn1
Mark locking script in include to sign test data, respectively to the signed data sign test for including in the unlock script of TxIn0 and TxIn1
By rear, block chain is written into transaction, transaction is completed.
However, the assets transfer scheme based on UTXO that existing block chain uses can only support a kind of Encryption Algorithm, i.e., only
A kind of Encryption Algorithm can be used to generate includes the key pair of public key and private key, as the block chain of bit coin can only support elliptic curve
ECDSA-P256 in algorithm (ECDSA).But with the continuous improvement of computer capacity and scientific and technological level, many Encryption Algorithm
It is cracked, after a kind of Encryption Algorithm that the assets transfer scheme that block chain uses is supported is cracked, entire block chain is forced to stop
It only uses, reduces the availability of block chain;Furthermore with the continuous promotion of business complexity, each user requires to make in block chain
With user in the Encryption Algorithm of different security levels, such as block chain from bank and enterprise, bank is required strictly using high
The Encryption Algorithm of security level, such as: ECDSA-P521, and enterprise requirements are not high using security level, but execution efficiency is high
Encryption Algorithm, such as: ECDSA-P256, therefore a kind of assets transfer scheme of Encryption Algorithm can only be supported to be no longer satisfied use
The demand at family.
Summary of the invention
The present invention provides a kind of assets transfer method and device, to solve to exist in the prior art assets transfer scheme only
The problem of capable of supporting a kind of Encryption Algorithm, influencing user experience.
In a first aspect, the invention discloses a kind of assets transfer method, applied to the node of block chain, the method packet
It includes:
Receive the request that executes of transaction, first account executed comprising transaction input each in the transaction in request
The private key generated according to corresponding first Encryption Algorithm of first account signature and public key and the transaction in each friendship
The public key of the second account easily exported generated according to corresponding second Encryption Algorithm of second account, wherein the transaction
Corresponding Encryption Algorithm of the second account that first account of at least one transaction input and at least one transaction export is identical or not
Together;
According to the signature and public key of the private key of the first account of transaction input each in the transaction, each friendship is generated
The unlock script easily inputted generates each transaction according to the public key of the second account of transaction output each in the transaction
The locking script of output;Construct the transaction;
It is inputted for transaction each in the transaction, the target for the target transaction output being directed toward according to the transaction input is locked
Determine script, sign test is carried out to the unlock script of the transaction input;And the unlock script that each transaction inputs in the transaction
After sign test passes through, the block chain is written into the transaction.
Optionally, if the first account corresponding first also comprising each transaction input in the execution request adds
The mark of close algorithm, the signature and public key of the private key of first account according to transaction input each in the transaction, generates
It is described it is each transaction input unlock script include:
It is inputted for transaction each in the transaction, according to the signature and public affairs of the private key of the first account of the transaction input
The mark of key and corresponding first Encryption Algorithm of first account generates the unlock of the mark comprising first Encryption Algorithm
Script;
If described execute in request further includes each corresponding second Encryption Algorithm of the second account exported of trading
Mark, it is described according in the transaction it is each transaction output the second account public key, generate it is described it is each transaction output
Locking script includes:
It is exported for transaction each in the transaction, according to the public key and described second of the second account of the transaction output
The mark of corresponding second Encryption Algorithm of account generates the locking script of the mark comprising second Encryption Algorithm.
Optionally, described for transaction input each in the transaction, the target transaction being directed toward according to the transaction input
The target lock-on script of output, carrying out sign test to the unlock script of the transaction input includes:
It is inputted for transaction each in the transaction, the target transaction output being directed toward according to the transaction input includes mesh
The target lock-on script for marking the mark of Encryption Algorithm, to the solution of the mark comprising first Encryption Algorithm of the transaction input
It locks script and carries out sign test.
Optionally, it is not created if there is the second account of output of trading in transaction described at least one, the reception is handed over
Before easy execution request, for the second account of the transaction output not created each in the transaction, the method also includes:
The request to create of second account is received, the request to create carries second account corresponding second and adds
The mark of close algorithm;
The key pair of second account is generated according to second Encryption Algorithm, and according to the public key of the cipher key pair
The account address of second account is generated with the mark of second Encryption Algorithm.
Second aspect, the invention discloses a kind of assets transfer devices, applied to the node of block chain, described device packet
It includes:
Receiving module includes each transaction in the transaction in the execution request for receiving the request that executes of transaction
The signature and public key of the private key of first account of input generated according to corresponding first Encryption Algorithm of first account and institute
The public key of the second account of each transaction output in transaction generated according to corresponding second Encryption Algorithm of second account is stated,
Wherein the first account of at least one transaction input of the transaction is corresponding with the second account of at least one transaction output adds
Close algorithm is identical or different;
Constructing module, the signature and public key of the private key of the first account for being inputted according to transaction each in the transaction,
The unlock script of each transaction input is generated, it is raw according to the public key of the second account of transaction output each in the transaction
At the locking script of each transaction output;Construct the transaction;
Execution module, for being handed over according to the target that the transaction input is directed toward for transaction input each in the transaction
The target lock-on script easily exported carries out sign test to the unlock script of the transaction input;And each transaction in the transaction
After the unlock script sign test of input passes through, the block chain is written into the transaction.
Optionally, the constructing module, if be specifically used in execution request also comprising each transaction input
Corresponding first Encryption Algorithm of the first account mark, for transaction each in the transaction input, according to it is described transaction it is defeated
The mark of the signature and public key of the private key of the first account entered and corresponding first Encryption Algorithm of first account, generation include
The unlock script of the mark of first Encryption Algorithm;If described execute further includes the of each transaction output in request
The mark of corresponding second Encryption Algorithm of two accounts is exported for transaction each in the transaction, according to the transaction output
The mark of the public key of second account and corresponding second Encryption Algorithm of second account, generating includes second Encryption Algorithm
Mark locking script.
Optionally, the execution module is specifically used for for transaction input each in the transaction, defeated according to the transaction
The target lock-on script for entering the mark comprising target Encryption Algorithm of the target transaction output of direction, to the packet of the transaction input
The unlock script of mark containing first Encryption Algorithm carries out sign test.
Optionally, described device further include:
Account creation module, for not created if there is the second account of output of trading in transaction described at least one,
Before the execution request for receiving transaction, for the second account of the transaction output not created each in the transaction, receive
The request to create of second account, the request to create carry the mark of corresponding second Encryption Algorithm of second account
Know;The key pair of second account is generated according to second Encryption Algorithm, and according to the public key of the cipher key pair and institute
The mark for stating the second Encryption Algorithm generates the account address of second account.
The third aspect, the invention discloses a kind of nodes, comprising: memory and processor;
It is stored with computer program in the memory, when described program is executed by the processor, so that the place
Manage the step of device executes any of the above-described the method.
Fourth aspect, the present invention disclose a kind of computer readable storage medium, are stored with the calculating that can be executed by node
Machine program, when described program is run on the node, so that the step of node executes any of the above-described the method.
Since in embodiments of the present invention, the node of block chain is defeated according to transaction each in transaction when constructing transaction
The signature and public key for the private key that corresponding first Encryption Algorithm of the first account entered generates generate the unlock foot of each transaction input
This generates each transaction according to the public key that corresponding second Encryption Algorithm of the second account of transaction output each in transaction generates
The locking script of output, and the second account of the first account of at least one the transaction input traded and at least one transaction output
Corresponding Encryption Algorithm is identical or different;Each user can select the corresponding encryption of account of itself to calculate according to demand in block chain
Method;And after the corresponding Encryption Algorithm of a certain account of block chain is cracked, the user of the account can be by not being cracked
Encryption Algorithm generate new account, and by the assets transfer under former account into new account, will not influence the fortune of block chain
Row, improves the availability of block chain, provides a kind of assets transfer scheme that can support multiple encryption algorithms, improves use
Family experience.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is the structure of deal schematic diagram of construction;
Fig. 2 is the function composition schematic diagram that assets transfer is related to;
Fig. 3 is a kind of assets transfer process schematic provided in an embodiment of the present invention;
Fig. 4 is a kind of Encryption Algorithm concordance list schematic diagram provided in an embodiment of the present invention;
Fig. 5 is a kind of unlock script provided in an embodiment of the present invention and locking script structural schematic diagram;
Fig. 6 is a kind of structure of deal schematic diagram of construction provided in an embodiment of the present invention;
Fig. 7 is a kind of locking script structural schematic diagram provided in an embodiment of the present invention;
Fig. 8 is a kind of assets transfer apparatus structure schematic diagram provided in an embodiment of the present invention;
Fig. 9 is a kind of node schematic diagram provided in an embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, make below in conjunction with the attached drawing present invention into one
Step ground detailed description, it is clear that described embodiment is only a part of the embodiments of the present invention, rather than whole implementation
Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts
Every other embodiment, shall fall within the protection scope of the present invention.
As shown in Fig. 2, the existing assets transfer model based on assets transfer scheme constructs is usually directed to account creation, hands over
The easily functions such as construction, signature sign test (sign test), transaction verification, Transaction Inquiries, transaction storage, are supported in the present invention in order to realize
The assets transfer scheme of multiple encryption algorithms, and guarantee the accuracy and reliability of assets transfer, it is related to account creation, transaction
The improvement of the functions such as construction, signature sign test, is illustrated combined with specific embodiments below.
In addition, it is necessary to understand, it is multiple involved in the present invention, refer to two or more, of the invention
In description, the vocabulary such as " first ", " second " are only used for distinguishing the purpose of description, be not understood to indicate or imply relatively heavy
The property wanted can not be interpreted as indication or suggestion sequence.
Embodiment 1:
Fig. 3 is a kind of assets transfer process schematic provided in an embodiment of the present invention, and the process includes:
S301: receiving the request that executes of transaction, the executed in request comprising transaction input each in the transaction
In the signature and public key and the transaction of the private key of one account generated according to corresponding first Encryption Algorithm of first account
The public key of second account of each transaction output generated according to corresponding second Encryption Algorithm of second account, wherein described
First account of at least one transaction input of transaction Encryption Algorithm phase corresponding with the second account of at least one transaction output
It is same or different.
Assets transfer method provided in an embodiment of the present invention is applied to the node of block chain, and the node can be for fortune
It calculates and the electronic equipments such as PC machine, server, the server cluster of store function.
In assets transfer method provided in an embodiment of the present invention, the first account of at least one transaction input of every transaction
Family Encryption Algorithm corresponding with the second account of at least one transaction output can be the same or different.Such as: transaction number
The first account of transaction input and the second account of transaction output being related to for the transaction of Tx008 include: account 1, account 2, account
Family 3, the wherein corresponding Encryption Algorithm of account 1 are as follows: ECDSA-P521, the corresponding Encryption Algorithm of account 2 are ECDSA-P256, account
3 corresponding Encryption Algorithm are ECDSA-P256.
Specifically, user can select one kind according to the demand of itself when user carries out the account creation for transaction
Account corresponding Encryption Algorithm of the Encryption Algorithm as creation, the account of the mark of the Encryption Algorithm comprising selection is sent to node
Request to create after node receives the request to create of account, according to the mark of Encryption Algorithm in account creation request, determines encryption
Algorithm, and according to the key pair of determining Encryption Algorithm generation account, wherein key pair includes public key and private key, and according to key
The public key of centering generates account address, account creation is completed, preferably, for the ease of the knowledge to the corresponding Encryption Algorithm of account
Not, the mark of the corresponding Encryption Algorithm of account can also be bound in the account address of generation, in embodiments of the present invention, encryption
The mark of algorithm can be the type of Encryption Algorithm, title of Encryption Algorithm etc..
Such as: as shown in figure 4, to carry out the Encryption Algorithm concordance list of Encryption Algorithm selection for user, if node receives
To user 1 send comprising Encryption Algorithm be identified as the account creation request of " 4 " after, illustratively, the process of account creation
It is as follows:
(1) node generates key pair according to the corresponding Encryption Algorithm " RSA1024 " of mark " 4 " of Encryption Algorithm;
(2) mathematic(al) manipulation is carried out to the public key of cipher key pair, wherein carrying out mathematic(al) manipulation to public key includes Hash (Hash)
Transformation, addition version number etc., such as: by the SHA-256 algorithm in Message Digest 5 (RIPEMD-160) to public key
(Pubk) mathematic(al) manipulation is carried out, is generated unique value (PKID), in the head of PKID or the mark of tail portion addition Encryption Algorithm, such as 4#
PKID, PKID#4 etc. generate account address, and the key pair of account address and account is sent to user 1, completes account creation.
S302: according to the signature and public key of the private key of the first account of transaction input each in the transaction, described in generation
The unlock script of each transaction input generates described every according to the public key of the second account of transaction output each in the transaction
The locking script of a transaction output;Construct the transaction.
Fig. 5 is a kind of unlock script provided in an embodiment of the present invention and locking script structural schematic diagram, as shown in figure 5, solution
The information of signature (sig) and Pubk in script comprising private key are locked, the information of the hash value in script comprising Pubk is locked
(PubkHash), the meaning for locking script is for Whom capable of providing a signature and a public key, and the operation of this script is allowed to pass through, who
This transaction can be spent to input.In embodiments of the present invention, according to the signature of private key and public key generate unlock script and according to
It is the prior art that public key, which generates locking script, is no longer repeated.
S303: for transaction input each in the transaction, according to the target transaction output of the transaction input direction
Target lock-on script carries out sign test to the unlock script of the transaction input;And the solution that each transaction inputs in the transaction
After lock script sign test passes through, the block chain is written into the transaction.
As shown in fig. 6, being a kind of structure of deal schematic diagram of construction provided in an embodiment of the present invention, transaction number is
The transaction of Tx003 includes TxIn0, TxIn1 and TxOut0, TxOut1, and node is according to the corresponding transaction number Tx002 of TxIn0, defeated
0 is indexed out, and the corresponding locking script 3 of TxIn0 is found on block chain;According to the corresponding transaction number Tx002 of TxIn1, defeated
2 are indexed out, and the corresponding locking script 5 of TxIn1 is found on block chain;According to locking script 3 to the unlock script 3 of TxIn0
It carries out sign test, sign test is carried out according to unlock script 5 of the locking script 5 to TxIn1, it is equal in the unlock script to TxIn0 and TxIn1
After sign test passes through, block chain is written into the transaction that transaction number is Tx003, wherein the corresponding public key of locking script, if with solution
The corresponding public key of lock script and private key correspond to same account, then can sign test pass through, if the different accounts of correspondence, sign test are obstructed
It crosses.
Since in embodiments of the present invention, the node of block chain is defeated according to transaction each in transaction when constructing transaction
The signature and public key for the private key that corresponding first Encryption Algorithm of the first account entered generates generate the unlock foot of each transaction input
This generates each transaction according to the public key that corresponding second Encryption Algorithm of the second account of transaction output each in transaction generates
The locking script of output, and the second account of the first account of at least one the transaction input traded and at least one transaction output
Corresponding Encryption Algorithm is identical or different;Each user can select the corresponding encryption of account of itself to calculate according to demand in block chain
Method;And after the corresponding Encryption Algorithm of a certain account of block chain is cracked, the user of the account can be by not being cracked
Encryption Algorithm generate new account, and by the assets transfer under former account into new account, will not influence the fortune of block chain
Row, improves the availability of block chain, provides a kind of assets transfer scheme that can support multiple encryption algorithms, improves use
Family experience.
Embodiment 2:
In order to guarantee the accuracy and reliability of assets transfer, on the basis of the above embodiments, in the embodiment of the present invention
In, if the mark for executing corresponding first Encryption Algorithm of the first account in request also comprising each transaction input
Know, the signature and public key of the private key of first account according to transaction input each in the transaction generate each friendship
The unlock script easily inputted includes:
It is inputted for transaction each in the transaction, according to the signature and public affairs of the private key of the first account of the transaction input
The mark of key and corresponding first Encryption Algorithm of first account generates the unlock of the mark comprising first Encryption Algorithm
Script;
If described execute in request further includes each corresponding second Encryption Algorithm of the second account exported of trading
Mark, it is described according in the transaction it is each transaction output the second account public key, generate it is described it is each transaction output
Locking script includes:
It is exported for transaction each in the transaction, according to the public key and described second of the second account of the transaction output
The mark of corresponding second Encryption Algorithm of account generates the locking script of the mark comprising second Encryption Algorithm.
Specifically, if executing corresponding first encryption of the first account of each transaction input in request also comprising transaction
The mark of algorithm, node, can the addition transaction inputs in unlock script when generating the unlock script of each transaction input
The mark of corresponding first Encryption Algorithm of first account, specifically, the can be spliced by unlock script after the sig of private key
The modes such as the mark of one Encryption Algorithm are realized.
If described execute in request further includes each corresponding second Encryption Algorithm of the second account exported of trading
Mark, node generate it is each transaction input locking script when, can locking script in addition transaction output second
The mark of corresponding second Encryption Algorithm of account, specifically, can be added by splicing second after the PubkHash in locking script
The modes such as the mark of close algorithm are realized.Such as: as shown in fig. 7, splicing has Encryption Algorithm after PubkHash in locking script
It identifies (AlgType).
Preferably, node according to the private key of account create private key signature before, can also verify private key type whether
The type of Encryption Algorithm corresponding with account is identical, if identical, further according to the signature of the private key creation private key of account.
It, in embodiments of the present invention, can be by the inclusion of in order to further increase the accuracy and reliability of assets transfer
The locking script of the mark of Encryption Algorithm carries out sign test to the unlock script of the mark comprising Encryption Algorithm, further to unlock foot
Whether this account corresponding with locking script, which corresponds to same Encryption Algorithm, is verified, specifically, described in the transaction
Each transaction input inputs the transaction according to the target lock-on script for the target transaction output that the transaction input is directed toward
Unlock script carry out sign test include:
It is inputted for transaction each in the transaction, the target transaction output being directed toward according to the transaction input includes mesh
The target lock-on script for marking the mark of Encryption Algorithm, to the solution of the mark comprising first Encryption Algorithm of the transaction input
It locks script and carries out sign test.
Embodiment 3:
In order to guarantee the reliability of assets transfer, on the basis of the various embodiments described above, in embodiments of the present invention, if
There are the second accounts of output of trading in transaction described at least one not to create, before the execution request for receiving transaction, needle
To in the transaction each do not create transaction output the second account, the method also includes:
The request to create of second account is received, the request to create carries second account corresponding second and adds
The mark of close algorithm;
The key pair of second account is generated according to second Encryption Algorithm, and according to the public key of the cipher key pair
The account address of second account is generated with the mark of second Encryption Algorithm.
In embodiments of the present invention, if user needs transfer of the New Account for assets, in the execution for sending transaction
Before request, need to create the account, i.e., the second account of output of trading in the transaction not created in creation block chain, specifically
The creation process of account may refer to embodiment 1, no longer repeated.
Embodiment 4:
Fig. 8 is a kind of assets transfer apparatus structure schematic diagram provided in an embodiment of the present invention, applied to the node of block chain,
Described device includes:
Receiving module 81 includes each friendship in the transaction in the execution request for receiving the request that executes of transaction
The signature and public key for the private key of the first account easily inputted generated according to corresponding first Encryption Algorithm of first account, and
The public affairs of second account of each transaction output generated according to corresponding second Encryption Algorithm of second account in the transaction
Key, wherein the first account of at least one transaction input of the transaction is corresponding with the second account of at least one transaction output
Encryption Algorithm is identical or different;
Constructing module 82, the signature and public affairs of the private key of the first account for being inputted according to transaction each in the transaction
Key, generate it is described it is each transaction input unlock script, according in the transaction it is each transaction output the second account public key,
Generate the locking script of each transaction output;Construct the transaction;
Execution module 83, for inputting the target being directed toward according to the transaction for transaction input each in the transaction
The target lock-on script of transaction output carries out sign test to the unlock script of the transaction input;And each friendship in the transaction
After the unlock script sign test easily inputted passes through, the block chain is written into the transaction.
The constructing module 82, if executing also input comprising each transaction in request first specifically for described
The mark of corresponding first Encryption Algorithm of account is inputted for transaction each in the transaction, according to the of the transaction input
The mark of the signature and public key of the private key of one account and corresponding first Encryption Algorithm of first account is generated comprising described the
The unlock script of the mark of one Encryption Algorithm;If described execute in request further includes each second account exported of trading
The mark of corresponding second Encryption Algorithm is exported for transaction each in the transaction, according to the second account of the transaction output
The mark of the public key at family and corresponding second Encryption Algorithm of second account generates the mark comprising second Encryption Algorithm
Locking script.
The execution module 83 is specifically used for being referred to for transaction input each in the transaction according to transaction input
To the target lock-on script of the mark comprising target Encryption Algorithm that exports of target transaction, to the transaction input comprising institute
The unlock script for stating the mark of the first Encryption Algorithm carries out sign test.
Described device further include:
Account creation module 84, for not created if there is the second account of output of trading in transaction described at least one
It builds, before the execution request for receiving transaction, for the second account of the transaction output not created each in the transaction, connects
The request to create of second account is received, the request to create carries the mark of corresponding second Encryption Algorithm of second account
Know;The key pair of second account is generated according to second Encryption Algorithm, and according to the public key of the cipher key pair and institute
The mark for stating the second Encryption Algorithm generates the account address of second account.
Embodiment 5:
Based on the same inventive concept, a kind of node is additionally provided in the embodiment of the present invention, since above-mentioned node solves the problems, such as
Principle it is similar to consistency desired result method, therefore the implementation of above-mentioned node may refer to the implementation of method, repeat place no longer
It repeats.
As shown in figure 9, it is the structural schematic diagram of node provided in an embodiment of the present invention, wherein in Fig. 9, bus architecture
It may include the bus and bridge of any number of interconnection, specifically there is the one or more processors 91 and storage of the representative of processor 91
The various circuits for the memory 92 that device 92 represents link together.Bus architecture can also will such as peripheral equipment, voltage-stablizer and
Various other circuits of management circuit or the like link together, and these are all it is known in the art, therefore, herein not
It is described further again.Bus interface provides interface.Processor 91 is responsible for management bus architecture and common processing, deposits
Reservoir 92 can store the used data when executing operation of processor 91.
In node provided in an embodiment of the present invention:
The processor 91, for reading the program in memory 92, execute following process: the execution for receiving transaction is asked
It asks, it is described to execute the corresponding according to first account of the first account inputted in request comprising transaction each in the transaction
First Encryption Algorithm generate private key signature and public key and the transaction in it is each transaction output the second account according to institute
The public key that corresponding second Encryption Algorithm of the second account generates is stated, wherein the first account of at least one transaction input of the transaction
Family Encryption Algorithm corresponding with the second account of at least one transaction output is identical or different;According to transaction each in the transaction
The signature and public key of the private key of first account of input generate the unlock script of each transaction input, according to the transaction
In it is each transaction output the second account public key, generate it is described it is each transaction output locking script;Construct the transaction;Needle
Transaction each in the transaction is inputted, it is right according to the target lock-on script for the target transaction output that the transaction input is directed toward
The unlock script of the transaction input carries out sign test;And the unlock script sign test of each transaction input passes through in the transaction
Afterwards, the block chain is written into the transaction.
Preferably, the processor 91, if be specifically used in execution request also comprising each transaction input
Corresponding first Encryption Algorithm of the first account mark, for transaction each in the transaction input, according to it is described transaction it is defeated
The mark of the signature and public key of the private key of the first account entered and corresponding first Encryption Algorithm of first account, generation include
The unlock script of the mark of first Encryption Algorithm;If described execute further includes the of each transaction output in request
The mark of corresponding second Encryption Algorithm of two accounts is exported for transaction each in the transaction, according to the transaction output
The mark of the public key of second account and corresponding second Encryption Algorithm of second account, generating includes second Encryption Algorithm
Mark locking script.
Preferably, the processor 91 is specifically used for for transaction input each in the transaction, defeated according to the transaction
The target lock-on script for entering the mark comprising target Encryption Algorithm of the target transaction output of direction, to the packet of the transaction input
The unlock script of mark containing first Encryption Algorithm carries out sign test.
Preferably, the processor 91 is also used to the second account if there is output of trading in transaction described at least one
Family does not create, for the second account of the transaction output not created each in the transaction, receives the creation of second account
Request, the request to create carry the mark of corresponding second Encryption Algorithm of second account;According to second encryption
Algorithm generates the key pair of second account, and according to the mark of the public key of the cipher key pair and second Encryption Algorithm
Generate the account address of second account.
Embodiment 6:
On the basis of the various embodiments described above, the embodiment of the invention also provides a kind of computers to store readable storage medium
Matter is stored with the computer program that can be executed by node in the computer readable storage medium, when described program is in the section
When being run on point, so that the node realizes the step of above method is realized.
For systems/devices embodiment, since it is substantially similar to the method embodiment, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications can be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the application range.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (10)
1. a kind of assets transfer method, which is characterized in that the node applied to block chain, which comprises
Receive the request that executes of transaction, the root for executing the first account comprising transaction input each in the transaction in request
It is defeated according to each transaction in the signature of the private key of the corresponding first Encryption Algorithm generation of first account and public key and the transaction
The public key of the second account out generated according to corresponding second Encryption Algorithm of second account, wherein the transaction is at least
First account of one transaction input Encryption Algorithm corresponding with the second account of at least one transaction output is identical or different;
According to the signature and public key of the private key of the first account of transaction input each in the transaction, it is defeated to generate each transaction
The unlock script entered generates each transaction output according to the public key of the second account of transaction output each in the transaction
Locking script;Construct the transaction;
It is inputted for transaction each in the transaction, according to the target lock-on foot for the target transaction output that the transaction input is directed toward
This, carries out sign test to the unlock script of the transaction input;And the unlock script sign test that each transaction inputs in the transaction
By rear, the block chain is written into the transaction.
2. the method as described in claim 1, which is characterized in that if also defeated comprising each transaction in execution request
The mark of corresponding first Encryption Algorithm of the first account entered, first account according to transaction input each in the transaction
Private key signature and public key, generate it is described it is each transaction input unlock script include:
For transaction each in the transaction input, according to it is described transaction input the first account private key signature and public key and
The mark of corresponding first Encryption Algorithm of first account, generates the unlock foot of the mark comprising first Encryption Algorithm
This;
If in the execution request further including the mark of corresponding second Encryption Algorithm of the second account of each transaction output
Know, the public key of second account according to transaction output each in the transaction generates the locking of each transaction output
Script includes:
It is exported for transaction each in the transaction, according to the public key of the second account of the transaction output and second account
The mark of corresponding second Encryption Algorithm generates the locking script of the mark comprising second Encryption Algorithm.
3. method according to claim 2, which is characterized in that it is described for transaction input each in the transaction, according to institute
The target lock-on script for stating the target transaction output that transaction input is directed toward carries out sign test packet to the unlock script of the transaction input
It includes:
It is inputted for transaction each in the transaction, the target transaction output being directed toward according to the transaction input adds comprising target
The target lock-on script of the mark of close algorithm, to the unlock foot of the mark comprising first Encryption Algorithm of the transaction input
This progress sign test.
4. the method as described in claim 1, which is characterized in that if there is the of output of trading in transaction described at least one
Two accounts do not create, before the execution request for receiving transaction, for the transaction output not created each in the transaction
Second account, the method also includes:
The request to create of second account is received, the request to create carries corresponding second encryption of second account and calculates
The mark of method;
The key pair of second account is generated according to second Encryption Algorithm, and according to the public key of the cipher key pair and institute
The mark for stating the second Encryption Algorithm generates the account address of second account.
5. a kind of assets transfer device, which is characterized in that applied to the node of block chain, described device includes:
Receiving module includes transaction input each in the transaction in the execution request for receiving the request that executes of transaction
The first account the private key generated according to corresponding first Encryption Algorithm of first account signature and public key and the friendship
The public key of second account of each transaction output generated according to corresponding second Encryption Algorithm of second account in easily, wherein
The encryption corresponding with the second account of at least one transaction output of first account of at least one transaction input of the transaction is calculated
Method is identical or different;
Constructing module, the signature and public key of the private key of the first account for being inputted according to transaction each in the transaction, generates
The unlock script of each transaction input generates institute according to the public key of the second account of transaction output each in the transaction
State the locking script of each transaction output;Construct the transaction;
Execution module, for for transaction input each in the transaction, the target transaction being directed toward according to the transaction input to be defeated
Target lock-on script out carries out sign test to the unlock script of the transaction input;And each transaction input in the transaction
Unlock script sign test pass through after, the block chain is written into the transaction.
6. device as claimed in claim 5, which is characterized in that the constructing module, if executing request specifically for described
In corresponding first Encryption Algorithm of the first account also comprising each transaction input mark, for each in the transaction
Transaction input, according to the signature of the private key of the first account of the transaction input and public key and first account corresponding first
The mark of Encryption Algorithm generates the unlock script of the mark comprising first Encryption Algorithm;If in the execution request also
The mark of corresponding second Encryption Algorithm of the second account including each transaction output, for each transaction in the transaction
Output, according to it is described transaction output the second account public key and corresponding second Encryption Algorithm of second account mark,
Generate the locking script of the mark comprising second Encryption Algorithm.
7. device as claimed in claim 6, which is characterized in that the execution module is specifically used for for every in the transaction
The target of a transaction input, the mark comprising target Encryption Algorithm for the target transaction output being directed toward according to the transaction input is locked
Determine script, sign test is carried out to the unlock script of the mark comprising first Encryption Algorithm of the transaction input.
8. device as claimed in claim 5, which is characterized in that described device further include:
Account creation module, it is described for not created if there is the second account of output of trading in transaction described at least one
Before the execution request for receiving transaction, for the second account of the transaction output not created each in the transaction, described in reception
The request to create of second account, the request to create carry the mark of corresponding second Encryption Algorithm of second account;Root
The key pair of second account is generated according to second Encryption Algorithm, and according to the public key of the cipher key pair and described second
The mark of Encryption Algorithm generates the account address of second account.
9. a kind of node characterized by comprising memory and processor;
It is stored with computer program in the memory, when described program is executed by the processor, so that the processor
Perform claim requires the step of any one of 1-4 the method.
10. a kind of computer readable storage medium, which is characterized in that it is stored with the computer program that can be executed by node, when
Described program on the node when running, so that the step of node perform claim requires any one of 1-4 the method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811198220.4A CN109447636A (en) | 2018-10-15 | 2018-10-15 | A kind of assets transfer method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811198220.4A CN109447636A (en) | 2018-10-15 | 2018-10-15 | A kind of assets transfer method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109447636A true CN109447636A (en) | 2019-03-08 |
Family
ID=65546309
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811198220.4A Pending CN109447636A (en) | 2018-10-15 | 2018-10-15 | A kind of assets transfer method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109447636A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110322346A (en) * | 2019-04-02 | 2019-10-11 | 武汉天喻信息产业股份有限公司 | A kind of condition that supporting uxto model can set method of payment and system |
CN110458543A (en) * | 2019-07-31 | 2019-11-15 | 腾讯科技(深圳)有限公司 | Data processing method, relevant device and medium |
CN111061558A (en) * | 2019-10-30 | 2020-04-24 | 北京海益同展信息科技有限公司 | Method, device, computer equipment and storage medium for processing virtual resource data |
CN111369254A (en) * | 2020-03-28 | 2020-07-03 | 北京俩撇科技有限公司 | Method and device for creating block chain account |
CN112543103A (en) * | 2019-09-23 | 2021-03-23 | 百度在线网络技术(北京)有限公司 | Account address generation method and verification method, device, equipment and medium |
CN113256902A (en) * | 2020-02-27 | 2021-08-13 | 深圳怡化电脑股份有限公司 | Safe input method, equipment, system and storage medium of sensitive information |
CN116051088A (en) * | 2023-04-03 | 2023-05-02 | 布比(北京)网络技术有限公司 | Transaction method and device based on non-spent transaction output model and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106897906A (en) * | 2017-02-28 | 2017-06-27 | 北京众享比特科技有限公司 | Exciting-simulator system content distribution method and system |
CN106910072A (en) * | 2017-02-15 | 2017-06-30 | 捷德(中国)信息科技有限公司 | Digital cash management method and system |
CN106940854A (en) * | 2017-03-06 | 2017-07-11 | 钱德君 | A kind of bridging method between UTXO models and contract |
CN107094077A (en) * | 2017-04-21 | 2017-08-25 | 杭州秘猿科技有限公司 | A kind of license chain Accounting system for not limiting signature algorithm |
CN107566117A (en) * | 2017-07-14 | 2018-01-09 | 浙商银行股份有限公司 | A kind of block chain key management system and method |
WO2018116104A1 (en) * | 2016-12-21 | 2018-06-28 | nChain Holdings Limited | Computer-Implemented Systems and Methods To Enable Complex Functionality On A Blockchain While Preserving Security-Based Restrictions On Script Size and Opcode Limits |
-
2018
- 2018-10-15 CN CN201811198220.4A patent/CN109447636A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018116104A1 (en) * | 2016-12-21 | 2018-06-28 | nChain Holdings Limited | Computer-Implemented Systems and Methods To Enable Complex Functionality On A Blockchain While Preserving Security-Based Restrictions On Script Size and Opcode Limits |
CN106910072A (en) * | 2017-02-15 | 2017-06-30 | 捷德(中国)信息科技有限公司 | Digital cash management method and system |
CN106897906A (en) * | 2017-02-28 | 2017-06-27 | 北京众享比特科技有限公司 | Exciting-simulator system content distribution method and system |
CN106940854A (en) * | 2017-03-06 | 2017-07-11 | 钱德君 | A kind of bridging method between UTXO models and contract |
CN107094077A (en) * | 2017-04-21 | 2017-08-25 | 杭州秘猿科技有限公司 | A kind of license chain Accounting system for not limiting signature algorithm |
CN107566117A (en) * | 2017-07-14 | 2018-01-09 | 浙商银行股份有限公司 | A kind of block chain key management system and method |
Non-Patent Citations (1)
Title |
---|
李博: "比特币矿工节点的区块链存储分析与优化研究", 《中国优秀硕士学位论文全文数据库(经济与管理科学辑)》 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110322346A (en) * | 2019-04-02 | 2019-10-11 | 武汉天喻信息产业股份有限公司 | A kind of condition that supporting uxto model can set method of payment and system |
CN110322346B (en) * | 2019-04-02 | 2022-02-15 | 武汉天喻信息产业股份有限公司 | Settable payment method and system supporting utxo model |
CN110458543A (en) * | 2019-07-31 | 2019-11-15 | 腾讯科技(深圳)有限公司 | Data processing method, relevant device and medium |
CN110458543B (en) * | 2019-07-31 | 2021-04-30 | 腾讯科技(深圳)有限公司 | Data processing method, related device and medium |
CN112543103A (en) * | 2019-09-23 | 2021-03-23 | 百度在线网络技术(北京)有限公司 | Account address generation method and verification method, device, equipment and medium |
CN111061558A (en) * | 2019-10-30 | 2020-04-24 | 北京海益同展信息科技有限公司 | Method, device, computer equipment and storage medium for processing virtual resource data |
CN111061558B (en) * | 2019-10-30 | 2023-09-01 | 京东科技信息技术有限公司 | Method, apparatus, computer device and storage medium for processing virtual resource data |
CN113256902A (en) * | 2020-02-27 | 2021-08-13 | 深圳怡化电脑股份有限公司 | Safe input method, equipment, system and storage medium of sensitive information |
CN111369254A (en) * | 2020-03-28 | 2020-07-03 | 北京俩撇科技有限公司 | Method and device for creating block chain account |
CN116051088A (en) * | 2023-04-03 | 2023-05-02 | 布比(北京)网络技术有限公司 | Transaction method and device based on non-spent transaction output model and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109447636A (en) | A kind of assets transfer method and device | |
JP7128111B2 (en) | Systems and methods for controlling asset-related activities via blockchain | |
CN108200203B (en) | Block chain system based on double-layer network | |
CN109417465B (en) | Registration and automatic management method of intelligent contracts executed by block chains | |
KR102416506B1 (en) | Implementation of logic gate function using blockchain | |
CN110046996B (en) | Data processing method and device | |
CN106504094B (en) | Transaction matching method and system of distributed general ledger system based on block chain technology | |
CN105573828B (en) | A kind of operation processing method and device | |
JP2021502745A (en) | A system for recording verification keys on the blockchain | |
CN108985772A (en) | A kind of verification method, device, equipment and the storage medium of block chain | |
KR101937220B1 (en) | Method for generating and verifying a digital signature or message authentication code based on a block chain that does not require key management | |
CN109669986A (en) | Blacklist sharing method, device, equipment and storage medium based on block chain | |
KR20190070163A (en) | Resources operating method of each of nodes communicating one another and computer device operating as one of nodes | |
EP3779760B1 (en) | Blockchain-based data processing method and apparatus, and electronic device | |
CN107438002A (en) | Electronic equipment and method in system and system based on block chain | |
CN110288480A (en) | A kind of Private transaction method and device of block chain | |
CN110659906B (en) | Bill information processing method, related device and medium | |
KR101798119B1 (en) | Method and server for registering stockholder's list, recording transfer of stock ownership and verifying the registered stockholder's list file | |
CN115427995A (en) | Time-locked blockchain transactions and related blockchain techniques | |
CN114175036A (en) | Providing down-link functionality using blockchain transactions | |
CN109446211A (en) | A kind of consistency desired result method and device | |
CN116210200A (en) | Blockchain communication syndrome | |
CN111597269A (en) | Block chain-based contract implementation method, device and equipment | |
CN110176998A (en) | A kind of common recognition method, apparatus, equipment and the storage medium of proof of work | |
KR101829731B1 (en) | Method and server for registering stockholder's list and recording transfer of stock ownership |
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 |
Application publication date: 20190308 |
|
RJ01 | Rejection of invention patent application after publication |