Summary of the invention
The embodiment of the invention provides a kind of digital cash method of commerce based on hardware chip, by the terminal
Built-in security chip, and trading signature is isolated in safety chip and runs, and the security performance of transaction can not only be significantly greatly increased, and
User can carry, and user is facilitated to control.
First aspect of the embodiment of the present invention provides a kind of digital cash method of commerce based on hardware chip, and the method is answered
For in mobile terminal, the mobile terminal to include system environments and security context, safe core is built-in in the mobile terminal
Piece, the safety chip are run under the security context, which comprises
Into the block chain wallet application under the system environments;
The external exchange instruction that user inputs in the block chain wallet application is received, is instructed according to the external exchange
The Transaction Information unsigned is generated, and the Transaction Information unsigned is sent to the safety chip;
Signature operation is carried out to the Transaction Information unsigned by pre-stored private key in the safety chip, it is raw
At the Transaction Information after signature;
Transaction Information after receiving the signature that the safety chip returns.
As an alternative embodiment, in first aspect of the embodiment of the present invention, the system environments and the peace
It is physically isolated between full ambient engine, the hardware under the system environments and the safety chip are carried out by serial peripheral equipment interface SPI
Communication.
As an alternative embodiment, the security context is in offline in first aspect of the embodiment of the present invention
State.
As an alternative embodiment, in first aspect of the embodiment of the present invention, it is described to pass through the safety chip
In pre-stored private key signature operation is carried out to the Transaction Information unsigned, the Transaction Information after generating signature, comprising:
Elliptic curve cipher ECC algorithm or elliptic curve number are utilized by pre-stored private key in the safety chip
Signature algorithm ECDSA carries out static signature operation to the Transaction Information unsigned, the Transaction Information after generating signature.
As an alternative embodiment, in first aspect of the embodiment of the present invention, it is described to enter the system environments
Under block chain wallet application after, the external exchange that inputs in the block chain wallet application of user that receives instructs it
Before, the method also includes:
Wallet account is created, the private key for being directed to the wallet account is generated;
Back-up processing is carried out to the private key, the private key is backed up in the safety chip.
As an alternative embodiment, the private key is in the system ring in first aspect of the embodiment of the present invention
It is invisible under border.
As an alternative embodiment, in first aspect of the embodiment of the present invention, the method also includes:
Transaction Information after the signature is subjected to node broadcasts.
As an alternative embodiment, the safety chip supports state close in first aspect of the embodiment of the present invention
At least one of algorithm SM1, SM2, SM3, SM4.
As an alternative embodiment, being built-in in the safety chip in first aspect of the embodiment of the present invention
For resisting the high-low voltage detection unit of false voltage attack, also it is built-in in the safety chip for resisting failure-frequency
The clock unit of attack.
Compared with prior art, the embodiment of the present invention has the advantages that
Built-in security chip in the terminal of the embodiment of the present invention, and safety chip runs on the system with mobile terminal
Under the security context that environment is isolated, when entering the block chain wallet application being installed under system environments, user can receive
The external exchange instruction inputted in the block chain wallet application generates the transaction unsigned according to external exchange instruction and believes
Breath, and the Transaction Information that this is unsigned is sent to the safety chip in security context;Further, by pre- in safety chip
The private key first stored carries out signature operation to the Transaction Information unsigned, the Transaction Information after generating signature, and will be after signature
Transaction Information return to the block chain wallet application under system environments.Technical solution in the embodiment of the present invention, by moving
Built-in security chip in dynamic terminal, and trading signature is isolated in safety chip and runs, i.e. private key are only stored in and mobile terminal
The physically-isolated safety chip of system environments in, so as to which the security performance of transaction is significantly greatly increased, avoid the risk being hacked;
In addition, mobile terminal is carried convenient for user, user is facilitated to control.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that the described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this
Embodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative efforts
Example is applied, shall fall within the protection scope of the present invention.
It should be noted that term " includes " and " having " and their any changes in the embodiment of the present invention and attached drawing
Shape, it is intended that cover and non-exclusive include.Such as contain the process, method of a series of steps or units, system, product or
Equipment is not limited to listed step or unit, but optionally further comprising the step of not listing or unit or optional
Ground further includes the other step or units intrinsic for these process, methods, product or equipment.
The embodiment of the invention discloses a kind of digital cash method of commerce based on hardware chip, by the terminal
Built-in security chip, and trading signature is isolated in safety chip and runs, and the security performance of transaction can not only be significantly greatly increased, and
User can carry, and user is facilitated to control.It is described in detail separately below.
Referring to Fig. 1, Fig. 1 is a kind of knot of mobile terminal applied to digital cash transaction provided in an embodiment of the present invention
Structure schematic diagram.As shown in Figure 1, mobile terminal may include system environments and security context, and it is built-in with one in the terminal
Safety chip IC.Mobile terminal can include but is not limited to cell phone, tablet computer, personal digital assistant (Personal
Digital Assistant, PDA), intelligent wearable device (such as smartwatch, Intelligent bracelet, intelligent necklace), mobile interchange
Each class of electronic devices, the embodiment of the present invention such as net equipment (Mobile Internet Device, MID) are not construed as limiting.Safe core
Piece IC can be combined into one with integrated mode with mobile terminal, i.e. safety chip IC is non-dismountable in the terminal;Safety
Chip IC can also be by the way of plug in conjunction with mobile terminal, i.e. safety chip IC is detachable in the terminal, here
It is not construed as limiting.Block chain wallet application is installed in the terminal, which can be used for carrying out digital goods
The transaction of coin, wherein digital cash common are bit coin (Bitcoin), Lay spy coin, ZEC coin, bit stock etc., here not
It limits.A part of composed structure is illustrated only in mobile terminal shown in FIG. 1, can also include but is not limited to memory, figure
Shape processor (Graphics Processing Unit, GPU), antenna, camera, loudspeaker etc. hardware configuration, do not make here
It limits.
Wherein, system environments is the running environment of mobile terminal, can include but is not limited to Android environment, IOS ring
One of which in border, Windows environment etc..Block chain wallet application is installed under system environments, i.e. block chain wallet application
It is run under system environments.In addition, the online application, multimedia application, instant chat application etc. in mobile terminal are being
It is run under system environment.The central processing unit (Central Processing Unit, CPU) of mobile terminal is by calling memory
The various executable program codes of middle storage, to realize corresponding function.Safety chip IC is located under security system, i.e., safe core
Piece IC is run under security system.Security context is a kind of environment specially built for safety chip IC, it is a kind of offline
Environment is not networked always.It is physically-isolated between system environments and security context, and the hardware under system environments is (such as
CPU Serial Peripheral Interface (SPI) (Serial Peripheral) can be passed through between the safety chip under security context
Interface, SPI) it is communicated.Private key necessary to trading for digital cash is stored under safety chip IC, makes total
Word moneytary operations signature is executed at safety chip IC, and is static signature.The embodiment of the present invention is based on being built in mobile terminal
Safety chip IC come private key needed for saving digital cash transaction, and complete to grasp the signature of Transaction Information in safety chip
Make.Compared with existing digital mode of doing business, static signature can be avoided the risk being hacked, even if mobile terminal system environment exists
By hacker attack when line is networked, hacker also cannot be introduced under security context and get private key, to greatly improve digital cash
The safety of transaction.In addition, mobile terminal is carried convenient for user, user is facilitated to control the dynamic of digital cash transaction at any time
State.
Referring to Fig. 2, Fig. 2 is a kind of digital cash method of commerce based on hardware chip provided in an embodiment of the present invention
Flow diagram.Wherein, the digital cash method of commerce based on hardware chip described in Fig. 2 can be applied to mobile terminal
In, mobile terminal may include system environments and security context, be built-in with safety chip in mobile terminal, safety chip operation
Under security context.As shown in Figure 1, being somebody's turn to do the digital cash method of commerce based on hardware chip may comprise steps of:
210, block chain wallet application receives the external exchange instruction of user's input, is generated not according to external exchange instruction
The Transaction Information of signature.
In the embodiment of the present invention, block chain wallet application is installed under the system environments of mobile terminal, and block chain wallet is answered
With can be in mobile terminal carry application software.Enter block chain wallet application, tool under the system environments of mobile terminal
Body, user can click or double-click the icon of the block chain wallet application on mobile terminal desktop to enter the block chain wallet
Using certainly, except block chain wallet application default is opened.
In the embodiment of the present invention, enter block chain wallet application after, user can in block chain wallet application into
Row operations, for example, carry out the transaction (such as bank settlement) of digital cash, the checking of digital cash assets, modify payment cipher,
Account name etc..When user wants to carry out external exchange (as paid the bill), block chain wallet application can receive user's input
External exchange instruction, and the Transaction Information unsigned is generated according to external exchange instruction.Wherein, the external exchange of user's input
Instruction may include the amount of money (quantity of such as digital currency) of external exchange, reciprocal account information (the wallet address of such as debit), mine
Expenses of labour use etc..It is understood that generally requiring after opening block chain wallet application and first logging in wallet, user can at this time
To carry out logon operation, after logging in successfully, it can realize operations in block chain wallet application.Wherein, wallet is stepped on
Land mode may include that the account name for being manually entered wallet and modification logging are logged in, or the biological characteristic of acquisition user is believed
Breath is matched to complete to log in, wherein the biological information of user can include but is not limited to the fingerprint characteristic letter of user
Breath, iris feature information, face characteristic information, vocal print feature information, retinal feature information, gesture feature information, person's handwriting are special
At least one of reference breath etc..
220, the Transaction Information that block chain wallet application unsigns this is sent to safety chip.
230, safety chip private key according to the pre-stored data carries out signature operation to the Transaction Information unsigned, and generates label
Transaction Information after name.
It, can after the external exchange instruction inputted according to user generates the Transaction Information unsigned in the embodiment of the present invention
Safety chip is sent to the Transaction Information that this is unsigned.Safety chip is after receiving the Transaction Information unsigned, root
Signature operation is carried out to the Transaction Information unsigned according to private key pre-stored in itself, to generate the transaction letter after signature
Breath.Wherein, safety chip is run in a secure environment, and wallet private key is only stored in the safety chip under security system,
It is not saved under the system environments of mobile terminal, so that private key is sightless under system environments.System environments and safety collar
It is physically isolated between border, and the hardware under system environments is communicated with safety chip by serial peripheral equipment interface SPI, therefore,
When the Transaction Information unsigned is issued safety chip by block chain wallet application, the SPI of the CPU by mobile terminal can be
The Transaction Information that interface unsigns this issues safety chip, i.e., the exchange of information between the two is realized by SPI interface.It moves
To move subterminal system environments and security context can only be communicated on hardware by SPI interface, thus considered critical system
(Application Programming Interface, application programming connect CommAPI between environment and safety chip
Mouthful) quantity and function, the safety of private key is ensured with this.Private key is run in a secure environment with signature process, and outside can only
Obtain a result.
Optionally, step 230 safety chip private key according to the pre-stored data signs to the Transaction Information that this is unsigned
The specific embodiment of operation, the Transaction Information after generating signature may comprise steps of:
21) safety chip private key according to the pre-stored data utilizes elliptic curve cipher ECC algorithm or elliptic curve number label
Name algorithm ECDSA carries out static signature operation to the Transaction Information unsigned, the Transaction Information after generating signature.
Wherein, safety chip can support digital cash signature algorithm ECC (Elliptic curve cryptography,
Elliptic Curve Cryptography) and ECDSA (Elliptic Curve Digital Signature Algorithm, elliptic curve
At least one of word signature algorithm).It is understood that safety chip can also support other numbers popular on current market
Word currency signature algorithm, is not construed as limiting here.ECC and ECDSA is that more signature algorithm is used to obtain in current industry, specific
Realization process thing embodiment of the present invention will not describe.External exchange can be understood as the ownership of digital cash from an address
Turn to the process of another address.Transaction has output side and recipient, and output side needs a cryptography digital signature, is used for
Unlock fund, and legitimate signature could be created by only possessing private key, just can guarantee that transaction goes on.Due to system environments and peace
Full ambient engine is physically-isolated, even if security context can not also connect network in the state of system environments networking, so that safety
Environment forms a completely offline state.Safety chip carries out signature operation under offline environment, can be greatly improved
The safety of transaction prevents malicious attack of the hacker to private key, private key is avoided to be stolen.
240, safety chip returns to the Transaction Information after the signature.
In the embodiment of the present invention, after safety chip carries out static signature to Transaction Information using private key, signature can be returned
Transaction Information afterwards gives block chain wallet application, specifically, safety chip is anti-by the Transaction Information after the signature by SPI interface
CPU under feeding system environment feeds back to block chain wallet application by CPU.
Optionally, after block chain wallet application receives the Transaction Information after the signature, Fig. 2 is described to be based on hardware core
The digital cash method of commerce of piece can with the following steps are included:
22) Transaction Information after the signature is carried out node broadcasts by block chain wallet application.
Specifically, need to broadcast Transaction Information to the whole network after block chain wallet application one external exchange of every initiation, with
Other nodes (as dug mine node) are made to carry out some basic verifications, such as the digital cash that this transaction is spent to the Transaction Information
It whether is the currency not being spent, i.e. the process of trade confirmation.When being identified through, it may indicate that this transaction is safe, and
It is difficult to tamper with.
Built-in security chip in the terminal of the embodiment of the present invention, and safety chip runs on the system with mobile terminal
Under the security context that environment is isolated, when entering the block chain wallet application being installed under system environments, user can receive
The external exchange instruction inputted in the block chain wallet application generates the transaction unsigned according to external exchange instruction and believes
Breath, and the Transaction Information that this is unsigned is sent to the safety chip in security context;Further, by pre- in safety chip
The private key first stored carries out signature operation to the Transaction Information unsigned, the Transaction Information after generating signature, and will be after signature
Transaction Information return to the block chain wallet application under system environments.Technical solution in the embodiment of the present invention, by moving
Built-in security chip in dynamic terminal, and trading signature is isolated in safety chip and runs, i.e. private key are only stored in and mobile terminal
The physically-isolated safety chip of system environments in, so as to which the security performance of transaction is significantly greatly increased, avoid the risk being hacked;
In addition, mobile terminal is carried convenient for user, user is facilitated to control.
Referring to Fig. 3, Fig. 3 is another digital cash method of commerce based on hardware chip provided in an embodiment of the present invention
Flow diagram.Wherein, this method can be applied in mobile terminal, and mobile terminal may include system environments and safety collar
Border is built-in with safety chip in mobile terminal, which runs under security context.As shown in figure 3, hardware core should be based on
The digital cash method of commerce of piece may comprise steps of:
310, block chain wallet application creates wallet account, generates the private key for being directed to the wallet account.
In the embodiment of the present invention, block chain wallet application is run under system environments.When using wallet application or again for the first time
When one new wallet of new registration, need first to create wallet account when opening wallet application.Wherein, wallet account may include
Wallet account (such as account name) and modification logging.Wallet account and modification logging can be manually entered by user, and can be by
User's sets itself and modification.After successfully creating wallet account, wallet created can be backed up, the benefit of backup
It is, it, can be by straight when wallet application is deleted or wallet account is deleted, or forgets wallet account or modification logging
The wallet that importing has been backed up is connect to restore wallet.The essence of backup wallet is backup private key in fact, can be generated in backup wallet
One private key, and the private key is unique.
320, block chain wallet application backs up to the private key in safety chip.
In the embodiment of the present invention, which is transmitted directly to save in safety chip by block chain wallet application, and
Private key is not saved under the system environments of mobile terminal.In addition, any wallet application will be unable to again from the safety under security context
The private key information is got in chip, when showing wallet account information under the system environments of mobile terminal, is only able to display except private
Other other than key information can disclose information, such as account name, account assets remaining sum information, i.e. private key is not under system environments
It is visible.
330, block chain wallet application receives the external exchange instruction of user's input, is generated not according to external exchange instruction
The Transaction Information of signature.
In the embodiment of the present invention, when user wants to carry out external exchange (as paid the bill), block chain wallet application can be connect
The external exchange instruction of user's input is received, and the Transaction Information unsigned is generated according to external exchange instruction.Wherein, user is defeated
The external exchange entered instructs the amount of money (quantity of such as digital currency) that may include external exchange, reciprocal account information (such as debit
Wallet address), miner's expense etc..
The Transaction Information that 340 block chain wallet applications unsign this is sent to safety chip.
350, safety chip private key according to the pre-stored data carries out signature operation to the Transaction Information unsigned, and generates label
Transaction Information after name.
In the embodiment of the present invention, the private key saved when pre-stored private key is backup wallet in safety chip, one
A wallet can only correspond to a private key, and the private key of different wallets is different.Preferably, safety chip can be with private according to the pre-stored data
Key carries out the Transaction Information unsigned using elliptic curve cipher ECC algorithm or elliptic curve digital signature algorithm ECDSA
Static signature operation, the Transaction Information after generating signature.Since security context is one offline and carry out object with system environments
Private key is stored in the offline environment of an isolation by the environment for managing isolation, and signature operation is also to complete under off-line state
, so as to which the safety of transaction is greatly improved, prevents malicious attack of the hacker to private key, private key is avoided to be stolen.
In the embodiment of the present invention, safety chip can be regarded as to an encryption chip, can be current line and encrypt in the industry
The higher encryption chip of performance.The safety chip can support at least one of state close SM1, SM2, SM3, SM4 etc. password to calculate
Method can additionally support that some other popular cryptographic algorithm, the embodiment of the present invention are not construed as limiting in the industry.
In the embodiment of the present invention, safety chip can prevent various attacks, specifically, can be built-in with height in safety chip
Low voltage test unit, for resisting the attack of false voltage;It can be built-in with high-precision clock unit in safety chip, use
To resist failure-frequency attack;Safety chip can also be supported by technologies such as comprehensive wiring, increase redundant circuit, balance power consumptions
Imperial SPA (Simple Power Analysis, simple power consumption analysis), DPA (Differential Power Analysis, it is poor
Point power consumption analysis) etc. the bypass attack based on power consumption;Safety chip can also by multilayer wiring, bus scrambling, bus encryption,
Redundant circuit etc. resists physical attacks, such as cuts open piece attack, probe attack, domain conversed analysis.
360, safety chip returns to the Transaction Information after the signature.
In the embodiment of the present invention, block chain wallet application receive safety chip return signature after Transaction Information after,
Transaction Information after the signature is broadcast to all nodes.Specifically, block chain wallet application is by the peripherad section of Transaction Information
Point is broadcasted, and node is broadcast to the node around oneself again after receiving, finally diffuse to the whole network.
Wherein, the private key of backup production is transmitted to and is moved when creating wallet account by method described in implementing Fig. 3
It is stored in the physically-isolated security context of system environments of dynamic terminal, and private can not be obtained under the system environments of mobile terminal
Key, and security context is offline, so that even if hacker also cannot be introduced into safety when system environments is by hacker's malicious attack
Private key is obtained under environment.Therefore, by saving private key into the safety chip built in mobile terminal, and the friendship to digital cash
The signature operation of easy information is carried out offline in safety chip, so as to which the safety of transaction is greatly improved, is prevented black
Malicious attack of the visitor to private key, avoids private key from being stolen.Further, since the mobile terminal for being built-in with safety chip can be hand
The isometric smaller equipment of machine, wearable device, therefore user can be facilitated to carry, so that user can slap whenever and wherever possible
Control wallet.
Mobile terminal provided by the embodiment of the present invention at least may include: to be stored with executable program under system environments
The memory of code, the central processing unit coupled with memory;Wherein, central processing unit can call stored in memory can
Program code is executed, the operation that control block chain wallet application is completed under system environments is executed.
In addition, the safety chip of mobile terminal in a secure environment at least may include being stored with executable program code
Memory, the processor coupled with memory;Wherein, processor can call the executable program code stored in memory,
Execute the operation that safety chip is completed, such as signature operation.
The embodiment of the present invention provides a kind of computer readable storage medium, stores computer program, wherein the computer
Program enables a computer to execute method described in Fig. 2 or Fig. 3.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can be stored in a computer readable storage medium, storage
Medium include read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory,
RAM), programmable read only memory (Programmable Read-only Memory, PROM), erasable programmable is read-only deposits
Reservoir (Erasable Programmable Read Only Memory, EPROM), disposable programmable read-only memory (One-
Time Programmable Read-Only Memory, OTPROM), the electronics formula of erasing can make carbon copies read-only memory
(Electrically-Erasable Programmable Read-Only Memory, EEPROM), CD-ROM (Compact
Disc Read-Only Memory, CD-ROM) or other disc memories, magnetic disk storage, magnetic tape storage or can
For carrying or any other computer-readable medium of storing data.
A kind of digital cash method of commerce based on hardware chip disclosed by the embodiments of the present invention has been carried out in detail above
It introduces, used herein a specific example illustrates the principle and implementation of the invention, the explanation of above embodiments
It is merely used to help understand method and its core concept of the invention;At the same time, for those skilled in the art, according to this
The thought of invention, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification is not answered
It is interpreted as limitation of the present invention.