WO2020063036A1 - 数字货币的结账方法、终端及机器可读存储介质 - Google Patents

数字货币的结账方法、终端及机器可读存储介质 Download PDF

Info

Publication number
WO2020063036A1
WO2020063036A1 PCT/CN2019/095810 CN2019095810W WO2020063036A1 WO 2020063036 A1 WO2020063036 A1 WO 2020063036A1 CN 2019095810 W CN2019095810 W CN 2019095810W WO 2020063036 A1 WO2020063036 A1 WO 2020063036A1
Authority
WO
WIPO (PCT)
Prior art keywords
record
account
bank
ledger
authenticity
Prior art date
Application number
PCT/CN2019/095810
Other languages
English (en)
French (fr)
Inventor
南相浩
Original Assignee
晋商博创(北京)科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 晋商博创(北京)科技有限公司 filed Critical 晋商博创(北京)科技有限公司
Publication of WO2020063036A1 publication Critical patent/WO2020063036A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3821Electronic credentials

Definitions

  • the present invention relates to the technical field of computers and software, and in particular to a method, terminal, and machine-readable storage medium for settlement of digital currency.
  • the bookkeeping and storage methods of bank books are the key to bank financial security.
  • the security of the ledger is mostly compensated by the storage method.
  • the second method is distributed storage in a database. Comparing the above two, the distributed storage method in the library has higher system efficiency. Whether it is block storage between libraries or distributed storage within the library, the management mode is basically the same.
  • the third is a centralized hot backup storage method, which is a traditional storage and management mode and one of the effective methods.
  • the self-protecting accounting method has not been solved, and the security protection problem of the library has become prominent.
  • the inventor of the present application found in the process of implementing the present invention that the above-mentioned solution of the prior art has the following defects: when the self-protection of the ledger is solved, the system efficiency cannot be guaranteed, or when the system efficiency is guaranteed, the ledger storage cannot be guaranteed Security.
  • the purpose of the embodiments of the present invention is to provide a digital currency checkout method, terminal, and machine-readable storage medium, and simultaneously solve the problems of security and system efficiency of ledger storage, and propose a storage method based on evidence chain, which is not subject to storage.
  • the impact of location and management methods can not only ensure the integrity of the ledger, but also restore lost accounts in the ledger.
  • an embodiment of the present invention provides a method for settling a digital currency.
  • the method includes: obtaining a bill and verifying the authenticity of the bill, the bill including account information and a certificate of authenticity of the account information,
  • the evidence chain and the authenticity proof of the evidence chain, the evidence chain is a linear sum of the account names in the account information; when the bill is verified to be true, obtain the account information in the account name; find and Update the evidence in the ledger record according to the account record corresponding to the account information, and store the bill as the latest record in the corresponding ledger record; and according to the payment amount in the account information and the evidence chain
  • the chain code and the balance are stored in the latest record, and the evidence chain code is a linear sum of the evidence chain in the ledger record.
  • the account information includes a receiving account and a payment account.
  • updating the evidence chain code in the ledger record according to the evidence chain in the account information includes: or Evidence obtained ecode n chain code books after updating the record, wherein, Isum n is the chain of evidence and the account information, ecode n-1 is the latest recording on a record in a chain of evidence code , Isum i is the chain of evidence in the i record in the ledger record.
  • evidence chain code ecode 1 records the i-1;
  • Isum i-1 ecode i -ecode i-1, i-1 to determine the first record in the record books in the chain of evidence i-1 the Isum.
  • the balance i-1 in one record, where balance i is the balance in the i- th record in the ledger record, and amount i is the payment amount in the i-th record in the ledger record; according to amount i-1 balance i-1 -balance i-2 , determine the payment amount amount i-1 in the record i-1 in the ledger record, where balance i-2 is the first in the ledger record The balance in i-2 records.
  • the method further includes: according to a preset list of bank name, account information, and fund use, the first i-1 record
  • the payment amount and the evidence chain in the bank determine the bank name, account information, and use of funds in the i-1 record in the ledger record through exhaustive operations.
  • the method further includes: searching for the i-1 record in the hot backup database, extracting and recovering the first ledger record Article i-1 record.
  • an embodiment of the present invention further provides a bank terminal, where the bank terminal is configured to execute a settlement method of the digital currency.
  • an embodiment of the present invention further provides a machine-readable storage medium, where the machine-readable storage medium stores instructions, and the instructions are used to cause a machine to execute the digital currency checkout method.
  • FIG. 1 is a schematic diagram of a digital account provided by an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a digital currency checkout method according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a ledger record provided by an embodiment of the present invention.
  • Digital currency is digitized cash, which is printed at the factory and is called the factory currency.
  • the account currency in digital currency is issued by an account like a check.
  • Household currency is indispensable to convert all the proof functions in cash. Household currency is more superior than cash. It can be circulated on the market or on the Internet. Its security function is stronger than cash. The most important one is that the household currency is not afraid of being lost, not afraid of being copied, and it does not make sense to steal it. This is vital to the security of bank books.
  • one transaction between the receiving account and the payment account forms a single bill
  • the account information included in a single bill contains multiple account names, such as bank name, receiving account, payment account, payment amount, fund use, and so on.
  • Multiple transactions form a ledger record, and each record in the ledger record contains the contents of the bill formed by one transaction.
  • the transaction is carried out through the account currency, so a bill is a digital account currency, as shown in Figure 1, which includes the account name and evidence provided by the issuing bank and the account name and evidence provided by the payment account.
  • Account opening can be circulated not only on the market, but also on the Internet, and it is also directly applicable to bank settlement.
  • the settlement of digital currency is implemented by digital signature technology.
  • the digital signature is provided by CPK (Combined Public Key).
  • CPK is an identity-based combined public key system.
  • Alice's identity is Alice
  • Alice's public and private keys are:
  • the identity is transformed into a series of random number sequences by Hash transformation, the random number sequence is used as the coordinates of the matrix, and the variables on the 32 coordinates are accumulated respectively for public and private. key.
  • Hash transformation the random number sequence is used as the coordinates of the matrix
  • variables on the 32 coordinates are accumulated respectively for public and private. key.
  • the bill for the settlement of digital currency further includes a linear sum of account names, and a linear sum forms a chain of evidence.
  • the chain of evidence can be used to determine whether the record is lost or not, and which record is lost, and the lost chain can be recovered through the chain of evidence and the chain of evidence code in the record. Embodiments are described below.
  • FIG. 2 is a schematic flowchart of a digital currency checkout method according to an embodiment of the present invention. The method is applied to a bank terminal. As shown in FIG. 2, the method includes the following steps:
  • Step 201 Obtain a bill and verify the authenticity of the bill, the bill includes account information and a certificate of authenticity of the account information, a chain of evidence, and a certificate of authenticity of the chain of evidence, and the chain of evidence is the account Linear sum of account names in the message.
  • the beneficiary account when a beneficiary account and a payment account are transacted, the beneficiary account first issues a receipt notice.
  • the receipt notice may be in the form of a two-dimensional code or other data form and sent to the payment account.
  • the payment account after receiving the payment notification, the payment account also uses the CPK signature protocol to verify the authenticity certificate therein, for example, to verify its authenticity according to the following methods:
  • a verification code c11' is obtained to prove the authenticity of the receipt amount.
  • VER is the verification function
  • FIRM is the public key of the receiving account.
  • the public key matrix is available to everyone based on the CPK system. Therefore, the payment account obtains the public account of the receiving account according to the identity of the receiving account Firm and the public key matrix. key. The payment account verifies whether c10 and c10 ', c11 and c11' are the same, and determines whether the payment notification is true. If true, the payment account fills in relevant account information according to the requirements of the currency template. If it is not true, the payment account will not make a payment to the receiving account.
  • the household currency template is obtained by applying for a payment account to a bank according to its own payment needs. The application for the household currency template is not the content to be explained in the present invention, and those skilled in the art can obtain it based on the existing technology, and will not repeat them here .
  • the payment account verifies that the receipt notice from the beneficiary account is true, a bill is sent to the beneficiary account, that is, the digital account currency shown in FIG. 1.
  • the bank is called the issuing bank of the payment account.
  • the payment account directly writes the account information such as the payment amount, the use of funds, and the receiving account into the digital account currency shown in Figure 1, and digitally signs it.
  • the specific implementation method is as follows:
  • the account information includes the digital signature sign1 of the time signature time1 of the bank to the bank, which indicates the authenticity certificate of the bank name, and the digital signature sign2 of the payment account Client, and that the authenticity certificate of the payment account is passed.
  • the private key of the bank is signed.
  • the account information also includes a digital signature sign3 of the payment account signing time2 of the payment account, a digital signature sign4 of the payment amount amount, a digital signature sign5 of the use of funds, a digital signature sign6 of the receiving account Firm, and Bank name, payment account, amount, fund use, and beneficiary account linearity and Isum digital signature sign7, which respectively represent the proof of authenticity of the payment account, the proof of authenticity of the payment amount, the proof of authenticity of the use of funds, the proof of authenticity of the receiving account, Both linear and authenticity proofs are signed by the payment account private key client.
  • SIG is a signature function
  • s1, s2, s3, s4, s5, s6, and s7 are signature codes
  • c1, c2, c3, c4, c5, c6, and c7 are verification codes.
  • each account is digitally signed, so that each account has its own independent protection capabilities.
  • the digital account currency specifies the receiving account and is signed by the payment account.
  • the local currency is only meaningful to the designated receiving account and has no meaning to any third party. Therefore, the bill is not afraid of being lost or stolen, which is the basic guarantee of the security of the ledger.
  • the bill data ⁇ bank, time1, sign1, Client, sign2, Client, time2, sign3, amount, sign4, use, sign5, Firm, sign6, Isum, sign7 ⁇ is sent to the payment Account, beneficiary account need to verify the authenticity proof in the bill, as follows:
  • VER is the verification function
  • BANK is the public key of the bank
  • CLIENT is the public key of the payment account
  • the receiving account calculates the bank public key and the payment account public key according to the identification of the bank name, the identification of the payment account, and the public key matrix.
  • the receiving account verifies whether c1 and c1 ', c2 and c2', c3 and c3 ', c4 and c4', c5 and c5 ', c6 and c6', c7 and c7 'are the same, and determine whether the bill is true.
  • the bank After obtaining the bill, the bank must verify the authenticity of the bill.
  • step 202 is performed. Otherwise, the bill is discarded.
  • the remaining account information is signed by the payment account, which realizes the principle of autonomous and controllable account, and the remaining account information is used as independent variables. Achieved "one event, one certificate”, put an end to the transfer of trust and the takeover of rights.
  • digital signatures they have the ability to protect themselves and do not require additional protection. Therefore, there is no requirement for the security of the storage place of the bill, and the storage place is not affected limit.
  • Step 202 When verifying that the bill is true, obtain account information in the account name;
  • Step 203 Find a ledger record corresponding to the account information, and store the bill as the latest record in the corresponding ledger record.
  • the bank needs to obtain the account information in the account name, that is, the receiving account and the payment account. Then, look up the ledger records corresponding to the receiving account and the payment account locally, that is, the ledger records corresponding to the receiving account stored locally in the bank terminal, which contains records of the transactions between the receiving account and other accounts, and there is a receiving record And payment records.
  • the book record corresponding to the payment account also includes the transaction records between the payment account and other accounts, and there are also collection records and payment records.
  • the record in the ledger record corresponding to the payment account is the payment record
  • the record in the ledger record corresponding to the receiving account is the payment record.
  • the difference between the specific records is whether the payment amount is positive or negative. For the payment account, the payment amount is negative, and for the receiving account, the payment amount is positive.
  • the account name and evidence provided by the issuing bank may be stored together with the account name and evidence provided by the payment account, or, as provided by the issuing bank
  • the account name and evidence provided by the bank are the evidence provided by the bank itself, which is only used to check its authenticity, and may not participate in bank records, that is, the account name and evidence provided by the issuing bank in the statement may not be stored, but only the statement
  • the account name and evidence provided by the payment account in the current account are stored in the corresponding ledger record as the latest record.
  • the payment account in this bill with its digital signature and payment amount instead of its digital signature, the use of funds and its digital signature, the receiving account and its digital signature, the chain of evidence and its digital signature are stored in its ledger records as the latest record.
  • the n record is the latest record of the payment account.
  • Step 204 Update the evidence chain code and balance in the ledger record according to the payment amount in the account information and the evidence chain, and store the evidence chain code in the latest record, where the evidence chain code is the ledger Linear sum of the evidence chain in the record.
  • the bank first calculates the balance when checking out.
  • the calculation method is as follows:
  • balance n balance n-1 -amount (for the ledger records of the payment account)
  • balance n balance n-1 + amount (for the ledger record of the receiving account)
  • SIG is the signature function
  • bank is the private key of the bank name
  • balance n is the updated balance
  • sign9 is used to mark (s9, c9), and it represents the updated balance authenticity proof
  • s9 is the signature code
  • c9 is the verification code.
  • the bank terminal updates the evidence chain code in the ledger record according to the evidence chain in the account information:
  • the updated evidence chain code ecode n in the ledger record is obtained.
  • Isum n is the evidence chain in the account information
  • ecode n -1 is the evidence chain code in the previous record of the latest record
  • Isum i is the i-th record in the ledger record Chain of evidence.
  • the updated evidence chain code there may be the above two methods, that is, to obtain the updated evidence chain code through the linearity of the evidence chain of all records in the ledger record (including the latest record), or, When the integrity of the ledger record has not been verified, the updated evidence chain code can also be obtained through the linear sum of the evidence chain code in the previous record and the evidence chain in this bill.
  • ecode n is the updated evidence chain code
  • sign8 is used to mark (s8, c8) and represents the updated evidence chain code authenticity proof
  • s8 is the signature code
  • c8 is the verification code.
  • a ledger record is composed of records. If a ledger record is complete, it is proved that the records in the ledger record are complete. Because each account in the record has a digital signature, its own protection function is very strong, tampering is unlikely, but the digital signature cannot be found or not. Therefore, it is necessary to verify the integrity of the ledger record according to the evidence chain and evidence chain code in the ledger record. Taking the ledger record shown in Figure 3 as an example, from the linear sum of the evidence chain code It can be seen that if the chain of evidence is disconnected, the two ends of the equation will not be equal, and the disconnected place is where the records are lost.
  • the first way is to check after going, that is, starting from the first record:
  • the i-1 record in the ledger record is lost.
  • the third record will be checked as the second record, that is, Isum 3 as Isum 2 , ecode 3 as ecode 2 , But actually From this, it can be judged that the second record is lost.
  • the second way is to reverse the verification from the back, that is, check from the nth record:
  • Article n record Article n-1 record Article n-2 Records Where i 1,2,3, ..., n, verify in turn whether each record in the ledger record is lost.
  • the i-1 record in the ledger record is lost.
  • the second record because the second record is lost, then when checking the third record, the first record will be regarded as the second record, that is, ecode 1 as ecode 2 , But actually From this, it can be judged that the second record is lost.
  • the evidence chain and the evidence chain code can be directly used to determine the lost records, without the need to perform a one-to-one correspondence between the locally stored ledger records and the corresponding ledger records in the hot backup database to check their integrity, reducing the The workload of the integrity check of the ledger records.
  • the payment amount, the evidence chain, the evidence chain code, and the balance in the ledger record may also be used to compare the -1 records are restored to obtain payment amount, chain of evidence, chain of evidence code and balance in record i-1.
  • the specific way is as follows:
  • the recovery of the evidence chain and the evidence chain code in the record of the first i-1 is only an example.
  • the evidence chain and the evidence chain code in the record of the first i-1 can be obtained by other methods.
  • the payment amount and evidence chain in the i-1 record can be substituted into the above linear and Isum
  • the bank name, account information, and fund use in the i-1 record in the ledger record are determined through an exhaustive operation.
  • the bank name, payment account, payment amount, use of funds, receiving account, evidence chain, chain of evidence code and balance in the record of Article i-1 can be recovered, but the authenticity of the above information cannot be recovered, so Hot backup database support is necessary. Since the lost records are clarified, the authenticity proof of the above information can be recovered by searching the corresponding records in the hot backup database.
  • the digital signature used by the digital account is a CPK signature protocol
  • the settlement time of a transaction only needs milliseconds, and there is no need to worry about the existing technology. Emerging system efficiency and overhead issues.
  • the payment account and payment account are specified in the digital account currency, and the transaction amount is digitally signed.
  • CPK digital signature is composed of time factor and identification factor, which prevents being copied and used, and can eliminate the possibility of internal and external crimes.
  • Digital currency is not afraid of being lost or copied, because digital currency has no meaning to non-parties.
  • bank book records settled in digital currency are not afraid of being stolen or copied, which is critical to the security of the database in which the bank stores the book records.
  • the storage method of digital account records the only worry is the loss of bills. Although the loss of one bill does not affect daily settlement and does not cause security hazards, it causes trouble to account management.
  • the storage method based on the chain of evidence is not affected by the storage location and the storage method. It can not only judge whether the bills in the ledger records are lost or not, but also determine which ledger records and bills are lost, and can recover the lost ones.
  • the accounts the chain of evidence can be established between the ledger record and the ledger record to determine whether the ledger record is lost.
  • the completeness of the ledger records is only related to the evidence chain and the evidence chain code, and has nothing to do with the storage of the ledger records. This self-protecting bookkeeping method can greatly ease the security burden of the ledger record database.
  • an embodiment of the present invention further provides a bank terminal, where the bank terminal is configured to execute the digital currency settlement method described in the foregoing embodiment.
  • an embodiment of the present invention further provides a machine-readable storage medium, where the machine-readable storage medium stores instructions, and the instructions are used to make the machine execute the digital currency checkout method described in the foregoing embodiment.
  • the private key of the bank can be protected by a software package or stored in a storage medium, including: U disk, mobile Hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store parameters.

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本发明实施例提供一种数字货币的结账方法、终端及机器可读存储介质,属于计算机及其软件技术领域,保证了账本的安全性,不受账本存放方式的限制,另外由于提供了账单中各账目的线性和,在账单丢失时为恢复账目提供条件,缩小查账范围。所述方法包括:获取账单并验证账单的真实性,账单包括账目信息以及账目信息的真实性证明、证据链以及证据链的真实性证明;当验证账单为真时,获取账目名称中的账户信息;查找与账户信息对应的账本记录,并将账单作为最新一条记录存储在对应的账本记录中;以及根据账目信息中的付款金额以及证据链,更新账本记录中的证据链码和余额,并存储在最新一条记录中。本发明实施例适用于银行终端对于数字户币的结账过程。

Description

数字货币的结账方法、终端及机器可读存储介质 技术领域
本发明涉及计算机及其软件技术领域,具体地涉及一种数字货币的结账方法、终端及机器可读存储介质。
背景技术
银行账本的记账方法与存储方法,是关系到银行金融安全的关键所在。目前,由于没有解决自我保护性记账方法,账本的安全大都靠存储方法来弥补。现有的存储方式有三种,第一种是将一个账本在不同区块分散存储,用数据完整性码形成数据链,以数据链的完备性来保证账本的完整性。因为结账是在不同区块间进行,***效率和***开销是可想而知的。第二种方法是在一个数据库内分布式存储的方式。上述二者比较起来,库内分布式存放方式,其***效率更高。无论是库间区块式存储或库内分布式存储,其管理模式基本相同。第三种是集中式热备份的存储方式,是传统的存放和管理模式,也是行之有效的方法之一,但一直没有解决自我保护性记账方法,库的安全保护问题变得很突出。
本申请发明人在实现本发明的过程中发现,现有技术的上述方案具有以下缺陷:在解决账本的自我保护性的时候,无法保证***效率,或者在保证***效率的时候,无法保证账本存储的安全性。
发明内容
本发明实施例的目的是提供一种数字货币的结账方法、终端及机器可读存储介质,同时解决了账本存储的安全性以及***效率的问题,提出了基于证据链的存储方法,不受存储地和管理方法的影响,不仅能保证账本的完整性还能恢复账本中丢失的账目。
为了实现上述目的,本发明实施例提供一种数字货币的结账方法,所述方法包括:获取账单并验证所述账单的真实性,所述账单包括账目信息以及所述账目信息的真实性证明、证据链以及所述证据链的真实性证明,所述证据链为所述账目信息中的账目名称的线性和;当验证所述账单为真时,获取所述账目名称中的账户信息;查找与所述账户信息对应的账本记录,并将所述账单作为最新一条记录存储在对应的账本记录中;以及根据所述账目信息中的付款金额以及所述证据链,更新所述账本记录中的证据链码和余额,并存储在所述最新一条记录中,所述证据链码为所述账本记录中的证据链的线性和。
进一步地,所述获取账单并验证所述账单的真实性包括:获取账单,所述账单为data={bank,time1,sign1,Client,sign2,Client,time2,sign3,amount,sign4,use,sign5,Firm,sign6,Isum,sign7},其中,Bank为银行名;time1为银行签名时间;sign1为银行对time1的数字签名,用于标记(s1,c1),且表示银行名真实性证明;Client为付款账户;sign2为银行对付款账户的数字签名,用于标记(s2,c2),且表示付款账户真实性证明;time2为付款账户签名时间;sign3为付款账户对time2的数字签名,用于标记(s3,c3),且表示付款账户真实性证明;amount为付款金额;sign4为付款账户对付款金额的数字签名,用于标记(s4,c4),且表示付款金额真实性证明;use为资金用途;sign5为付款账户对资金用途的数字签名,用于标记(s5,c5),且表示资金用途真实性证明;Firm为收款账户;sign6为付款账户对收款账户的数字签名,用于标记(s6,c6),且表示收款账户真实性证明;Isum为银行名、付款账户、金额、资金用途和收款账户的线性和;sign7为付款账户对线性和的数字签名,用于标记(s7,c7),且表示线性和真实性证明;s1、s2、s3、s4、s5、s6和s7为签名码,c1、c2、c3、c4、c5、c6和c7为验证码;根据VER BANK(time1,s1)=c1’,VER BANK(Client,s2)=c2’,VER CLIENT(time2,s3)=c3’,VER CLIENT(amount,s4)=c4’,VER CLIENT(use,s5)=c5’,VER CLIENT(Firm,s6)=c6’,VER CLIENT(Isum,s7)=c7’,分别得到银行名真实性证明的验证码c1’,付款账户真实性证明c2’,付款账户真实性证明c3’,付款金额真实性证明c4’,资金用途真实性证明c5’,收款账户真实性证明c6’,线性和真实性证明c7’,其中,VER为验证函数,BANK为银行名的公钥,CLIENT为收款账户的公钥;分别验证c1与c1’,c2与c2’,c3与c3’,c4与c4’,c5与c5’,c6与c6’,c7与c7’是否相同,确定所述账单是否为真。
进一步地,所述账户信息包括收款账户和付款账户。
进一步地,所述根据所述账目信息中的所述证据链,更新所述账本记录中的证据链码包括:根据
Figure PCTCN2019095810-appb-000001
或者
Figure PCTCN2019095810-appb-000002
得到所述账本记录中更新后的证据链码ecode n,其中,Isum n为所述账目信息中的所述证据链,ecode n-1为所述最新一条记录的上一条记录中的证据链码,Isum i为所述账本记录中的第i条记录中的证据链。
进一步地,在所述更新所述账本记录中的证据链码和余额,并存储在所述最新一条记录中之后,所述方法还包括:根据SIG bank(ecode n)=(s8,c8)=sign8,SIG bank(balance n)=(s9,c9)=sign9,分别得到所述银行名对更新后的证据链码的数字签名以及所述银行名对更新后的余额的数字签名,其中,SIG为签名函数;bank为所述银行名的私钥;ecode n 为更新后的证据链码;balance n为更新后的余额;sign8用于标记(s8,c8),且表示更新后的证据链码真实性证明;sign9用于标记(s9,c9),且表示更新后的余额真实性证明;s8和s9为签名码;c8和c9为验证码;将所述银行名对更新后的证据链码的数字签名以及所述银行名对更新后的余额的数字签名存储在所述最新一条记录中。
进一步地,所述方法还包括:通过下述方式,根据账本记录中的证据链和证据链码验证所述账本记录的完整性:根据
Figure PCTCN2019095810-appb-000003
或者
Figure PCTCN2019095810-appb-000004
依次验证所述账本记录中的每条记录是否丢失,其中i=1,2,3,…,n;当存在
Figure PCTCN2019095810-appb-000005
或者
Figure PCTCN2019095810-appb-000006
时,确定所述账本记录中的第i-1条记录丢失。
进一步地,在所述确定所述账本记录中的第i-1条记录丢失之后,所述方法还包括:根据ecode i-1=ecode i-Isum i,确定所述账本记录中的第i-1条记录中的证据链码ecode i-1;根据Isum i-1=ecode i-ecode i-1,确定所述账本记录中的第i-1条记录中的证据链Isum i-1
进一步地,在所述确定所述账本记录中的第i-1条记录丢失之后,所述方法还包括:根据balance i-1=balance i-amount i,确定所述账本记录中的第i-1条记录中的余额balance i-1,其中,balance i为所述账本记录中的第i条记录中的余额,amount i为所述账本记录中的第i条记录中的付款金额;根据amount i-1=balance i-1-balance i-2,确定所述账本记录中的第i-1条记录中的付款金额amount i-1,其中,balance i-2为所述账本记录中的第i-2条记录中的余额。
进一步地,在所述确定所述账本记录中的第i-1条记录丢失之后,所述方法还包括:根据银行名、账户信息和资金用途的预设列表,所述第i-1条记录中的付款金额以及证据链,通过穷举运算确定所述账本记录中的第i-1条记录中的银行名、账户信息和资金用途。
进一步地,在所述确定所述账本记录中的第i-1条记录丢失之后,所述方法还包括:查找热备份数据库中所述第i-1条记录,提取并恢复所述账本记录中的第i-1条记录。
相应的,本发明实施例还提供一种银行终端,所述银行终端用于执行所述数字货币的结账方法。
相应的,本发明实施例还提供一种机器可读存储介质,该机器可读存储介质上存储有指令,该指令用于使得机器执行所述数字货币的结账方法。
通过上述技术方案,得到由账目之间建立的证据链以及账单之间建立的证据链码,同时解决了账本存储的安全性以及***效率的问题,能够及时发现账本记录中丢失的记录,并可以恢复丢失记录中的账目信息,这种自我保护性账本,大大减轻了账本存放的 负担。
本发明实施例的其它特征和优点将在随后的具体实施方式部分予以详细说明。
附图说明
附图是用来提供对本发明实施例的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本发明实施例,但并不构成对本发明实施例的限制。在附图中:
图1是本发明实施例提供的数字户币的示意图;
图2是本发明实施例提供的一种数字货币的结账方法的流程示意图;
图3是本发明实施例提供的账本记录的示意图。
具体实施方式
以下结合附图对本发明实施例的具体实施方式进行详细说明。应当理解的是,此处所描述的具体实施方式仅用于说明和解释本发明实施例,并不用于限制本发明实施例。
在网络化时代,纸质货币是不能在网上流通的,因此纸质货币必须改为数字化。那么,纸币上的所有物理签名必须改用数字签名实现,纸币上的所有物理防伪措施,必须改用逻辑措施实现。这种货币形态上的变化,必然引起结账方法的变化。
数字货币是数字化的现钞,现钞是工厂印制的,称为厂币。数字货币中的户币像支票一样是由账户开出的。户币要把现钞中的证明功能全部转化过来,缺一不可。户币比现钞更具有优越性,既可流通于市面,也可流通于网络,其安全性功能也比现钞强。其中最重要的一条就是户币不怕丢,不怕被复制,窃取了也没有意义,这对银行账本安全性是至关重要的。
其中,收款账户与付款账户之间的一次交易形成一个账单,一个账单包括的账目信息中包含多个账目名称,例如,银行名、收款账户、付款账户、付款金额、资金用途等。多次交易则形成账本记录,账本记录中的每一条记录包含了一次交易形成的账单的内容。交易是通过户币进行的,因此一个账单就是一张数字户币,如图1所示,其中包括发行行提供的账目名称和证据以及付款账户提供的账目名称和证据,在交易时其由付款账户开出,不仅能流通于市面上,也能流通于网络上,也直接适用于银行的结账。
本发明实施例是通过数字签名技术实现数字货币的结账。其中的数字签名是由CPK(Combined Public Key,组合公钥)提供的。CPK是基于标识的组合公钥体制,公钥由标识通过Hash变换和矩阵的组合运算而得到。其中,在椭圆曲线上,G是基点,如果 任意整数a是私钥,那么aG=A,A是对应于a的公钥。设:标识是Alice,那么Alice的公私钥分别是:标识通过Hash变换,变为一串随机数序列,将随机数序列当作矩阵的坐标,将32个坐标上的变量分别累加得公、私钥。如:
Figure PCTCN2019095810-appb-000007
(大写,斜体,表示公钥)
Figure PCTCN2019095810-appb-000008
(小写,斜体,表示私钥)
本发明实施例中数字货币的结账的账单中还包括账目名称的线性和,并由线性和形成证据链。在银行对收款账户和付款账户进行结账时,通过证据链可判断记录的丢失与否,以及丢失的是哪个记录,而且通过证据链以及记录中的证据链码可恢复被丢失的记录,具体实施方式如下所述。
图2是本发明实施例提供的一种数字货币的结账方法的流程示意图。该方法应用于银行终端,如图2所示,所述方法包括如下步骤:
步骤201,获取账单并验证所述账单的真实性,所述账单包括账目信息以及所述账目信息的真实性证明、证据链以及所述证据链的真实性证明,所述证据链为所述账目信息中的账目名称的线性和。
其中,在收款账户和付款账户交易的时候,收款账户首先发出收款通知,例如,该收款通知可以为二维码形式,或者其他数据形式发送给付款账户。当收款通知为二维码时,如QR1={Firm,time3,sign10,amount,sign11},其中包括了收款账户Firm;收款账户签名时间time3;收款账户对时间time3的数字签名sign10,用于标记(s10,c10),且表示收款账户真实性证明;收款金额amount;收款账户对收款金额的数字签名sign11,用于标记(s11,c11),且表示收款金额真实性证明。
由于上述的数字签名均是采用CPK签名协议,因此,付款账户接收到付款通知之后,也是利用CPK签名协议验证其中的真实性证明,例如,根据下述方式验证其真实性:
由VER FIRM(time3,s10)=c10’,得到收款账户真实性证明的验证码c10’;
由VER FIRM(amount,s11)=c11’,得到收款金额真实性证明的验证码c11’。
其中,VER为验证函数,FIRM为收款账户的公钥,其中基于CPK体制,公钥矩阵人人都可以获得,因此付款账户根据收款账户的标识Firm以及公钥矩阵得到收款账户的公钥。付款账户分别验证c10与c10’,c11与c11’是否相同,确定付款通知是否为真。若为真,则付款账户根据户币模板的要求填写相关账目信息。若不为真,则付款账户不向收款账户进行付款。其中,所述户币模板为付款账户根据自身付款需求向银行申请得到的,对于户币模板的申请不是本发明所要阐述的内容,本领域技术人员可根据现 有技术获得,此处不再赘述。
当付款账户验证收款账户发来的收款通知为真时,向收款账户发送账单,即如图1所示的数字户币。其中,银行名为付款账户的开户行。付款账户直接将付款金额、资金用途和收款账户等账目信息写入如图1所示的数字户币中,并对其进行数字签名,具体实施方式如下所示:
SIG bank(time1)=(s1,c1)=sign1,
SIG bank(Client)=(s2,c2)=sign2,
SIG client(time2)=(s3,c3)=sign3,
SIG client(amount)=(s4,c4)=sign4,
SIG client(use)=(s5,c5)=sign5,
SIG client(Firm)=(s6,c6)=sign6,
SIG client(Isum)=(s7,c7)=sign7。
其中,所述账目信息中包括了银行对银行签名时间time1的数字签名sign1,且表示银行名真实性证明,以及银行对付款账户Client的数字签名sign2,且表示付款账户真实性证明,均是通过银行私钥bank进行签名。所述账目信息中还包括了付款账户对付款账户签名时间time2的数字签名sign3、对付款金额amount的数字签名sign4、对资金用途use的数字签名sign5、对收款账户Firm的数字签名sign6以及对银行名、付款账户、金额、资金用途和收款账户的线性和Isum的数字签名sign7,分别表示付款账户真实性证明、付款金额真实性证明、资金用途真实性证明、收款账户真实性证明、线性和真实性证明,均是通过付款账户私钥client进行签名。另外,SIG为签名函数,s1、s2、s3、s4、s5、s6和s7为签名码,c1、c2、c3、c4、c5、c6和c7为验证码。
其中,线性和
Figure PCTCN2019095810-appb-000009
Figure PCTCN2019095810-appb-000010
由于上述账单中,各项账目都做了数字签名,使每一个账目都具有自身保护的独立能力。数字户币中规定了收款账户,并由付款账户签名,本户币只对指定的收款账户有意义,对任何第三方均没有意义。因此该账单不怕丢失,不怕被窃,是账本安全的基础保障。
另外,由于账单中提供了各账目的线性和,一旦账单被丢失,线性和提供恢复账目的条件,大大缩小了查账的范围。
付款账户将账单制作好之后,例如,账单data={bank,time1,sign1,Client,sign2,Client,time2,sign3,amount,sign4,use,sign5,Firm,sign6,Isum,sign7}发送给 收款账户,收款账户需要对所述账单中的真实性证明进行验证,如下所示:
根据VER BANK(time1,s1)=c1’,
VER BANK(Client,s2)=c2’,
VER CLIENT(time2,s3)=c3’,
VER CLIENT(amount,s4)=c4’,
VER CLIENT(use,s5)=c5’,
VER CLIENT(Firm,s6)=c6’,
VER CLIENT(Isum,s7)=c7’,
分别得到银行名真实性证明的验证码c1’,付款账户真实性证明c2’,付款账户真实性证明c3’,付款金额真实性证明c4’,资金用途真实性证明c5’,收款账户真实性证明c6’,线性和真实性证明c7’。其中,VER为验证函数,BANK为银行公钥,CLIENT为付款账户公钥,收款账户根据银行名的标识bank、付款账户的标识Client以及公钥矩阵计算出银行公钥和付款账户公钥。所述收款账户分别验证c1与c1’,c2与c2’,c3与c3’,c4与c4’,c5与c5’,c6与c6’,c7与c7’是否相同,确定所述账单是否为真。
当所述收款账户验证所述账单为真时,则向所述付款账户发送收据并将所述账单发送至银行。若不为真,则中断本次交易。
同样的,银行获取到所述账单之后也要验证所述账单的真实性。
其中,银行获取所述账单data={bank,time1,sign1,Client,sign2,Client,time2,sign3,amount,sign4,use,sign5,Firm,sign6,Isum,sign7}。
并根据VER BANK(time1,s1)=c1’,
VER BANK(Client,s2)=c2’,
VER CLIENT(time2,s3)=c3’,
VER CLIENT(amount,s4)=c4’,
VER CLIENT(use,s5)=c5’,
VER CLIENT(Firm,s6)=c6’,
VER CLIENT(Isum,s7)=c7’,
分别得到银行名真实性证明的验证码c1’,付款账户真实性证明c2’,付款账户真实性证明c3’,付款金额真实性证明c4’,资金用途真实性证明c5’,收款账户真实性证明c6’,线性和真实性证明c7’,其中,VER为验证函数,BANK为银行名的公钥,CLIENT为收款账户的公钥。
然后,分别验证c1与c1’,c2与c2’,c3与c3’,c4与c4’,c5与c5’,c6与c6’, c7与c7’是否相同,确定所述账单是否为真。
当银行验证所述账单为真时,则执行步骤202。否则,丢弃所述账单。
在所述账单中,除去银行对银行签名时间和付款账户的签名,其余各账目信息均是通过付款账户进行签名,实现了账户的自主可控的原则,而且其余各账目信息均作为独立变量,实现了“一事一证”,杜绝了信任转移以及权利被接管,另外通过数字签名,均具有自我保护能力,不需要额外的保护,因此对于账单的存储地的安全性没有要求,存储地不受限制。
步骤202,当验证所述账单为真时,获取所述账目名称中的账户信息;
步骤203,查找与所述账户信息对应的账本记录,并将所述账单作为最新一条记录存储在对应的账本记录中。
其中,银行需要获取所述账目名称中的账户信息,即收款账户和付款账户。然后,在本地查找与收款账户和付款账户对应的账本记录,即银行终端本地存储的收款账户对应的账本记录,其中包含收款账户与其他账户之间的交易的记录,存在收账记录和付账记录。同样的,付款账户对应的账本记录也包含付款账户与其他账户之间的交易记录,也存在收账记录和付账记录。其中,对于本次交易,付款账户对应的账本记录中的记录为付账记录,而收款账户对应的账本记录中的记录为收款记录,具体记录的不同之处在于付款金额是正还是负。对于付款账户来说,付款金额为负值,对于收款账户来说收款金额为正值。
另外,在将所述账单作为最新一条记录存储在对应的账本记录中的时候,可以将包含发行行提供的账目名称和证据与付款账户提供的账目名称和证据一同存储,或者,由于发行行提供的账目名称和证据是银行自己提供的证据,只用于检查其真伪,可不参与银行记录,即所述账单中的发行行提供的账目名称和证据可以不进行存储,而仅将所述账单中的付款账户提供的账目名称和证据作为最新一条记录存储在对应的账本记录中,如图3所示,对于付款账户对应的账本记录,将本次账单中的付款账户与其数字签名、付款金额与其数字签名、资金用途与其数字签名、收款账户与其数字签名、证据链与其数字签名作为最新一条记录存储在其账本记录中。如图3所示,第n条记录即为付款账户的最新一条记录。
步骤204,根据所述账目信息中的付款金额以及所述证据链,更新所述账本记录中的证据链码和余额,并存储在所述最新一条记录中,所述证据链码为所述账本记录中的证据链的线性和。
其中,银行在结账时,首先计算余额。计算方式如下所示:
balance n=balance n-1-amount(对于付款账户的账本记录)
balance n=balance n-1+amount(对于收款账户的账本记录)
然后对更新后的余额利用银行名的私钥进行数字签名,得到签名sign9:
SIG bank(balance n)=(s9,c9)=sign9
其中,SIG为签名函数,bank为所述银行名的私钥,balance n为更新后的余额,sign9用于标记(s9,c9),且表示更新后的余额真实性证明,s9为签名码,c9为验证码。
在线性和的基础上,银行终端根据所述账目信息中的所述证据链,更新所述账本记录中的证据链码:
Figure PCTCN2019095810-appb-000011
或者,
Figure PCTCN2019095810-appb-000012
得到所述账本记录中更新后的证据链码ecode n。其中,Isum n为所述账目信息中的所述证据链,ecode n-1为所述最新一条记录的上一条记录中的证据链码,Isum i为所述账本记录中的第i条记录中的证据链。
其中,对于计算更新后的证据链码,可以有上述两种方式,即通过所述账本记录中的所有记录(包括最新一条记录)的证据链的线性和得到更新后的证据链码,或者,在没有验证该账本记录的完整性时,也可以通过上一条记录中的证据链码与本次账单中的证据链的线性和得到更新后的证据链码。
然后,所述银行名对更新后的证据链码进行数字签名,得到签名8:
SIG bank(ecode n)=(s8,c8)=sign8
其中,ecode n为更新后的证据链码;sign8用于标记(s8,c8),且表示更新后的证据链码真实性证明;s8为签名码;c8为验证码。
之后,将更新后的证据链码与所述银行名对更新后的证据链码的数字签名,以及更新后的余额与所述银行名对更新后的余额的数字签名一同存储在所述最新一条记录中,如图3所示。
在本发明的一种实施方式中,一个账本记录是由记录构成的,如果一个账本记录是完整的,那么证明账本记录中的记录是完整的。因为记录中的每一账目都有数字签名,自身保护功能很强,篡改是不大可能的,但是数字签名不能发现丢失与否。因此,这就需要根据账本记录中的证据链和证据链码验证所述账本记录的完整性。还是以图3所示的账本记录为例,从证据链码的线性和
Figure PCTCN2019095810-appb-000013
中可知,如果证据链被断开,那么等式两端就不会相等,而断开的地方就是丢失记录的地方。
对于检查记录丢失的方式可以有以下两种:
第一种方式是从前往后检查,即从第一条记录开始检查:
第一条记录
Figure PCTCN2019095810-appb-000014
第二条记录
Figure PCTCN2019095810-appb-000015
第3条记录
Figure PCTCN2019095810-appb-000016
Figure PCTCN2019095810-appb-000017
第i条记录
Figure PCTCN2019095810-appb-000018
第n条记录
Figure PCTCN2019095810-appb-000019
其中i=1,2,3,…,n,依次验证所述账本记录中的每条记录是否丢失。
其中,若是发现
Figure PCTCN2019095810-appb-000020
即表示所述账本记录中的第i-1条记录丢失。例如,所述账本记录中的第2条记录丢失,由于第2条记录丢失,那么在检查第2条记录时,就会将第3条记录当做第2条记录来检查,即Isum 3当做Isum 2,ecode 3当做ecode 2
Figure PCTCN2019095810-appb-000021
但是实际上
Figure PCTCN2019095810-appb-000022
由此即可判断第2条记录丢失。
第二种方式是从后往前反推验证,即从第n条记录开始检查:
第n条记录
Figure PCTCN2019095810-appb-000023
第n-1条记录
Figure PCTCN2019095810-appb-000024
第n-2条记录
Figure PCTCN2019095810-appb-000025
Figure PCTCN2019095810-appb-000026
其中i=1,2,3,…,n,依次验证所述账本记录中的每条记录是否丢失。
其中,若是发现
Figure PCTCN2019095810-appb-000027
即表示所述账本记录中的第i-1条记录丢失。仍是以第2条记录丢失为例,由于第2条记录丢失,那么在检查第3条记录时,就会将第1条记录当做第2条记录,即ecode 1当做ecode 2
Figure PCTCN2019095810-appb-000028
但是实际上
Figure PCTCN2019095810-appb-000029
由此即可判断第2条记录丢失。
通过本实施方式,可直接利用证据链和证据链码来确定丢失的记录,而无需将本地存储的账本记录与热备份数据库中对应的账本记录进行一一对应的来检查其完整性,减少了账本记录完整性检查的工作量。
在本发明的另一个实施方式中,在确定所述账本记录中的第i-1条记录丢失之后,还可以利用所述账本记录中的付款金额、证据链、证据链码和余额对第i-1条记录进行恢复,从而得到第i-1条记录中的付款金额、证据链、证据链码和余额。具体方式如下所示:
例如,可以根据ecode i-1=ecode i-Isum i,确定所述账本记录中的第i-1条记录中的证据链码ecode i-1。然后根据Isum i-1=ecode i-ecode i-1,确定所述账本记录中的第i-1条记录中的证据链Isum i-1。仍是以第2条记录丢失为例,由于第3条记录是已知的,由ecode 2=ecode 3-Isum 3,得到第2条记录中的证据链码ecode 2,然后由Isum 2=ecode 3-ecode 2,得到第2条记录中的证据链Isum 2。当然上述恢复第i-1条记录中的证据链和证据链码仅 作为示例,还可以通过其他方式得到第i-1条记录中的证据链和证据链码,例如,当得到第i-1条记录中的证据链码ecode i-1之后,还可以通过Isum i-1=ecode i-1-ecode i-2,得到第i-1条记录中的证据链。对于其它方式得到第i-1条记录中的证据链和证据链码的示例,此处不再一一举例,无论通过什么方式,均是以
Figure PCTCN2019095810-appb-000030
以及
Figure PCTCN2019095810-appb-000031
Figure PCTCN2019095810-appb-000032
为基础的。
另外,在恢复第i-1条记录中的余额与付款金额时,可根据balance i-1=balance i-amount i,确定所述账本记录中的第i-1条记录中的余额balance i-1,以及根据amount i-1=balance i-1-balance i-2,确定所述账本记录中的第i-1条记录中的付款金额amount i-1,其中,balance i为所述账本记录中的第i条记录中的余额,amount i为所述账本记录中的第i条记录中的付款金额,balance i-2为所述账本记录中的第i-2条记录中的余额。以图3所示的账本记录为例,若其中第2条记录丢失,若该账本记录为付款账户“张三”的账本记录,则在确定第2条记录中的余额 2时,由于balance 3=balance 2+amount 3,则反推balance 2=balance 3-amount 3,即balance 2=balance 3-(-512),然后同样由于balance 2=balance 1+amount 2,则反推amount 2=balance 2-balance 1。同样,在确定第i-1条记录中的余额与付款金额也有其他示例,此处不再赘述。
在恢复第i-1条记录中的银行名、付款账户、资金用途与收款账户时,根据线性和
Figure PCTCN2019095810-appb-000033
可知,由于该账本记录属于付款账户或收款账户的,因此账户信息中的一者已知,通过上述实施方式得到付款金额已知,若该条记录为付款账户的账本记录所有时,则上述还存在未知因素银行名、资金用途和收款账户。如果是同行交易,则银行名也是已知的。若不是同行交易,则银行名的范围也是有限的,可根据银行名、账户信息和资金用途的预设列表,所述第i-1条记录中的付款金额以及证据链,代入上述线性和Isum中,通过穷举运算确定所述账本记录中的第i-1条记录中的银行名、账户信息和资金用途。
另外,对于第i-1条记录中的银行名、付款账户、付款金额、资金用途、收款账户、证据链、证据链码和余额可以恢复,但是上述信息的真实性证明却不能恢复,因此热备份数据库的支持就是必要的。由于明确了丢失的记录,则通过查找热备份数据库中对应的记录,即可恢复上述信息的真实性证明。
或者,在确定了所述账本记录中的第i-1条记录丢失之后,直接查找热备份数据库中所述第i-1条记录,直接提取拷贝到本地,恢复本地账本记录中的第i-1条记录。
通过本发明实施例,由于每次交易均是在数字户币基础上实现的,而数字户币所用数字签名是用CPK签名协议,一次交易的结账时间只需毫秒级,无需担心现有技术中 出现的***效率和开销的问题。另外,在数字户币中规定了收款账户和付款账户,而且都对交易金额做了数字签名。CPK数字签名由时间因素和标识因素构成,防止了被复制利用,可杜绝内、外作案的可能性。数字户币不怕被丢失、被复制,因为数字户币对非当事人没有任何意义。同样,以数字户币结账的银行账本记录,也不怕被窃、被复制,这对银行存储账本记录的数据库的安全性是至关重要的。
对数字户币的账本记录的存储方法,唯一担心的是账单的丢失,尽管一个账单的丢失不影响日常结账,不造成安全危害,但给账目管理造成麻烦。基于证据链码的存储方法,不受存储地和存放方式的影响,不仅能判别账本记录中账单的丢失与否,而且能确定丢失的是哪一个账本记录和哪一个账单,并能恢复被丢失的账目。另外,由本发明可扩展的,在账本记录和账本记录之间也可以建立证据链码,判断账本记录丢失与否。账本记录的完整性只与证据链、证据链码相关,与账本记录的存储无关。这种自我保护性记账方法,可大大缓解对账本记录数据库的安全负担。
相应的,本发明实施例还提供一种银行终端,所述银行终端用于执行上述实施例所述的数字货币的结账方法。
相应的,本发明实施例还提供一种机器可读存储介质,该机器可读存储介质上存储有指令,该指令用于使得机器执行上述实施例所述的数字货币的结账方法。
以上结合附图详细描述了本发明实施例的可选实施方式,但是,本发明实施例并不限于上述实施方式中的具体细节,在本发明实施例的技术构思范围内,可以对本发明实施例的技术方案进行多种简单变型,这些简单变型均属于本发明实施例的保护范围。
另外需要说明的是,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合。为了避免不必要的重复,本发明实施例对各种可能的组合方式不再另行说明。
本领域技术人员可以理解实现上述实施例方法中的全部或部分步骤的执行方法和地点不限,所用银行私钥可以用软件包保护,也可以存储在一个存储介质中,包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储参数的介质。
此外,本发明实施例的各种不同的实施方式之间也可以进行任意组合,只要其不违背本发明实施例的思想,其同样应当视为本发明实施例所公开的内容。

Claims (12)

  1. 一种数字货币的结账方法,其特征在于,包括:
    获取账单并验证所述账单的真实性,所述账单包括账目信息以及所述账目信息的真实性证明、证据链以及所述证据链的真实性证明,所述证据链为所述账目信息中的账目名称的线性和;
    当验证所述账单为真时,获取所述账目名称中的账户信息;
    查找与所述账户信息对应的账本记录,并将所述账单作为最新一条记录存储在对应的账本记录中;以及
    根据所述账目信息中的付款金额以及所述证据链,更新所述账本记录中的证据链码和余额,并存储在所述最新一条记录中,所述证据链码为所述账本记录中的证据链的线性和。
  2. 根据权利要求1所述的方法,其特征在于,所述获取账单并验证所述账单的真实性包括:
    获取账单,所述账单为data={bank,time1,sign1,Client,sign2,Client,time2,sign3,amount,sign4,use,sign5,Firm,sign6,Isum,sign7},
    其中,Bank为银行名;time1为银行签名时间;sign1为银行对time1的数字签名,用于标记(s1,c1),且表示银行名真实性证明;Client为付款账户;sign2为银行对付款账户的数字签名,用于标记(s2,c2),且表示付款账户真实性证明;time2为付款账户签名时间;sign3为付款账户对time2的数字签名,用于标记(s3,c3),且表示付款账户真实性证明;amount为付款金额;sign4为付款账户对付款金额的数字签名,用于标记(s4,c4),且表示付款金额真实性证明;use为资金用途;sign5为付款账户对资金用途的数字签名,用于标记(s5,c5),且表示资金用途真实性证明;Firm为收款账户;sign6为付款账户对收款账户的数字签名,用于标记(s6,c6),且表示收款账户真实性证明;Isum为银行名、付款账户、金额、资金用途和收款账户的线性和;sign7为付款账户对线性和的数字签名,用于标记(s7,c7),且表示线性和真实性证明;s1、s2、s3、s4、s5、s6和s7为签名码,c1、c2、c3、c4、c5、c6和c7为验证码;
    根据VER BANK(time1,s1)=c1’,
    VER BANK(Client,s2)=c2’,
    VER CLIENT(time2,s3)=c3’,
    VER CLIENT(amount,s4)=c4’,
    VER CLIENT(use,s5)=c5’,
    VER CLIENT(Firm,s6)=c6’,
    VER CLIENT(Isum,s7)=c7’,
    分别得到银行名真实性证明的验证码c1’,付款账户真实性证明c2’,付款账户真实性证明c3’,付款金额真实性证明c4’,资金用途真实性证明c5’,收款账户真实性证明c6’,线性和真实性证明c7’,其中,VER为验证函数,BANK为银行名的公钥,CLIENT为收款账户的公钥;
    分别验证c1与c1’,c2与c2’,c3与c3’,c4与c4’,c5与c5’,c6与c6’,c7与c7’是否相同,确定所述账单是否为真。
  3. 根据权利要求1所述的方法,其特征在于,所述账户信息包括收款账户和付款账户,所述账本记录包括所述收款账户对应的账本记录和所述付款账户对应的账本记录。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述根据所述账目信息中的所述证据链,更新所述账本记录中的证据链码包括:
    根据
    Figure PCTCN2019095810-appb-100001
    或者
    Figure PCTCN2019095810-appb-100002
    得到所述账本记录中更新后的证据链码ecode n,其中,Isum n为所述账目信息中的所述证据链,ecode n-1为所述最新一条记录的上一条记录中的证据链码,Isum i为所述账本记录中的第i条记录中的证据链。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,在所述更新所述账本记录中的证据链码和余额,并存储在所述最新一条记录中之后,所述方法还包括:
    根据SIG bank(ecode n)=(s8,c8)=sign8,SIG bank(balance n)=(s9,c9)=sign9,分别得到所述银行名对更新后的证据链码的数字签名以及所述银行名对更新后的余额的数字签名,其中,SIG为签名函数;bank为所述银行名的私钥;ecode n为更新后的证据链码;balance n为更新后的余额;sign8用于标记(s8,c8),且表示更新后的证据链码真实性证明;sign9用于标记(s9,c9),且表示更新后的余额真实性证明;s8和s9为签名码;c8和c9为验证码;
    将所述银行名对更新后的证据链码的数字签名以及所述银行名对更新后的余额的数字签名存储在所述最新一条记录中。
  6. 根据权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:
    通过下述方式,根据账本记录中的证据链和证据链码验证所述账本记录的完整性:
    根据
    Figure PCTCN2019095810-appb-100003
    或者
    Figure PCTCN2019095810-appb-100004
    依次验证所述账本记录中的每条记录是否丢失,其中i=1,2,3,…,n;
    当存在
    Figure PCTCN2019095810-appb-100005
    或者
    Figure PCTCN2019095810-appb-100006
    时,确定所述账本记录中的第i-1条记录丢失。
  7. 根据权利要求6所述的方法,其特征在于,在所述确定所述账本记录中的第i-1条记录丢失之后,所述方法还包括:
    根据ecode i-1=ecode i-Isum i,确定所述账本记录中的第i-1条记录中的证据链码ecode i-1
    根据Isum i-1=ecode i-ecode i-1,确定所述账本记录中的第i-1条记录中的证据链Isum i-1
  8. 根据权利要求6所述的方法,其特征在于,在所述确定所述账本记录中的第i-1条记录丢失之后,所述方法还包括:
    根据balance i-1=balance i-amount i,确定所述账本记录中的第i-1条记录中的余额balance i-1,其中,balance i为所述账本记录中的第i条记录中的余额,amount i为所述账本记录中的第i条记录中的付款金额;
    根据amount i-1=balance i-1-balance i-2,确定所述账本记录中的第i-1条记录中的付款金额amount i-1,其中,balance i-2为所述账本记录中的第i-2条记录中的余额。
  9. 根据权利要求6所述的方法,其特征在于,在所述确定所述账本记录中的第i-1条记录丢失之后,所述方法还包括:
    根据银行名、账户信息和资金用途的预设列表,所述第i-1条记录中的付款金额以及证据链,通过穷举运算确定所述账本记录中的第i-1条记录中的银行名、账户信息和资金用途。
  10. 根据权利要求6所述的方法,其特征在于,在所述确定所述账本记录中的第i-1条记录丢失之后,所述方法还包括:
    查找热备份数据库中所述第i-1条记录,提取并恢复所述账本记录中的第i-1条记 录。
  11. 一种银行终端,其特征在于,所述银行终端用于执行所述权利要求1-10任一项所述的数字货币的结账方法。
  12. 一种机器可读存储介质,其特征在于,该机器可读存储介质上存储有指令,该指令用于使得机器执行上述权利要求1-10任一项所述的数字货币的结账方法。
PCT/CN2019/095810 2018-09-26 2019-07-12 数字货币的结账方法、终端及机器可读存储介质 WO2020063036A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811124244.5A CN109345222B (zh) 2018-09-26 2018-09-26 数字货币的结账方法、终端及机器可读存储介质
CN201811124244.5 2018-09-26

Publications (1)

Publication Number Publication Date
WO2020063036A1 true WO2020063036A1 (zh) 2020-04-02

Family

ID=65306562

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/095810 WO2020063036A1 (zh) 2018-09-26 2019-07-12 数字货币的结账方法、终端及机器可读存储介质

Country Status (2)

Country Link
CN (1) CN109345222B (zh)
WO (1) WO2020063036A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109345222B (zh) * 2018-09-26 2022-04-26 晋商博创(北京)科技有限公司 数字货币的结账方法、终端及机器可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107240017A (zh) * 2017-07-20 2017-10-10 捷德(中国)信息科技有限公司 区块链交易管理***及方法
CN107274159A (zh) * 2017-06-09 2017-10-20 北京泛融科技有限公司 一种基于区块并发执行算法的记账***及方法
WO2017194976A1 (en) * 2016-05-13 2017-11-16 De La Rue International Limited Methods and systems for processing assets
CN109345222A (zh) * 2018-09-26 2019-02-15 晋商博创(北京)科技有限公司 数字货币的结账方法、终端及机器可读存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106779696B (zh) * 2016-11-29 2020-09-29 晋商博创(北京)科技有限公司 一种基于cpk的数字银行和数字货币及支付方法
CN107580022B (zh) * 2017-08-02 2020-11-06 国家计算机网络与信息安全管理中心 一种数据共享***和方法
CN108122098A (zh) * 2018-01-10 2018-06-05 晋商博创(北京)科技有限公司 基于cpk的数字货币***、支付方法及终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017194976A1 (en) * 2016-05-13 2017-11-16 De La Rue International Limited Methods and systems for processing assets
CN107274159A (zh) * 2017-06-09 2017-10-20 北京泛融科技有限公司 一种基于区块并发执行算法的记账***及方法
CN107240017A (zh) * 2017-07-20 2017-10-10 捷德(中国)信息科技有限公司 区块链交易管理***及方法
CN109345222A (zh) * 2018-09-26 2019-02-15 晋商博创(北京)科技有限公司 数字货币的结账方法、终端及机器可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BA, JIEM: "Application of Distributed Ledger Technology to High Value Payment System: Advantage, Risk and Countermeasure", SOUTH CHINA FINANCE, 31 December 2017 (2017-12-31), pages 82 - 88 *

Also Published As

Publication number Publication date
CN109345222B (zh) 2022-04-26
CN109345222A (zh) 2019-02-15

Similar Documents

Publication Publication Date Title
US11037111B2 (en) Method for issuing currency and making payment by managing balance database for each block in blockchain network and server using same
US20190379531A1 (en) Method For Registration Of Data In A Blockchain Database And A Method For Verifying Data
US10410214B2 (en) System and method for financial transaction validation
US20190103973A1 (en) Hash subtrees for grouping components by component type
CN109919756A (zh) 基于Merkle树回溯定位技术的转账***、查验方法及交易方法
CN108009445B (zh) 一种半中心化的可信数据管理***
WO2018231397A1 (en) Identity ledger in crypto currency transactions
WO2017163220A1 (en) Methods and Systems for Recording Multiple Transactions on a Blockchain
CN107171812A (zh) 一种基于区块链的无密钥签名基础设施构建方法
US20200082388A1 (en) Authenticating server and method for transactions on blockchain
CN111989663A (zh) 基于区块链的智能合约池
CN106056373A (zh) 一种基于区块链的可分割的数字资产转账方法
CN109508564A (zh) 一种基于区块链的数字资产存储***和方法
CN106909852B (zh) 基于三重md5加密算法的智能合约加密方法及装置
US11818271B2 (en) Linking transactions
WO2020063036A1 (zh) 数字货币的结账方法、终端及机器可读存储介质
KR20190093011A (ko) 보안성이 강화된 블록 체인 시스템 및 이중 블록 체인 구조를 이용한 데이터 블록 생성방법
WO2019177788A1 (en) Detecting alterations of journal data structures
CN115485707A (zh) 数字货币聚合处理
KR102376783B1 (ko) 블록체인 기반의 거래내역 확인 시스템
CN110163754B (zh) Fabric区块链中实现铸币交易的方法、客户端、区块链及***
US11995623B2 (en) Universal payment channels
CN115310978A (zh) 一种数字资产的交易方法及装置
CN111784339A (zh) 一种基于区块链的商品房项目证照文件防伪存证方法
Faridi et al. Improving SPV-based cryptocurrency wallet

Legal Events

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

Ref document number: 19864839

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19864839

Country of ref document: EP

Kind code of ref document: A1