Digital wallet device and its double offline transaction method
Patent Information
- Application Number
- CN202110860218.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-28
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2041-07-28
AI Technical Summary
[0003]但是,现有的电子支付手段严重依赖中心化的互联网与PKI系统,设备之间的交易实质上是存储一些对于交易的记录和凭证,真正将这些交易的记录转换为价值的是与后台之间进行的清结算
[0046]通过本发明的数字钱包设备及其离线交易方法,采用标识认证技术对每一个设备分配唯一身份标识,进而基于标识认证技术建立标识账本系统,通过标识账本记录交易记录,并在交易过程中于交易方之间签名交换,实现安全可信的点对点可离线交易。
Smart Images

Figure CN115689559B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to digital currency and digital wallet technology, including a digital wallet device based on an identifier ledger and an offline transaction method implemented through the digital wallet device. Background Technology
[0002] In recent years, with the further development of information technology and the rapid popularization of smart devices, electronic payment has played an important role in citizens' lives. In this context, how to achieve deeper digitalization in the payment and even financial sectors has become a new topic of concern. The concepts of digital currency and digital wallets have also become increasingly popular with the development of blockchain technology and the promotion of related applications. Since 2019, the topic of central bank digital currency has been a focus of attention and research in many countries around the world, and related technologies and management models are constantly evolving.
[0003] However, existing electronic payment methods heavily rely on centralized internet and PKI systems. Transactions between devices essentially store transaction records and credentials; the real conversion of these records into value occurs through clearing and settlement with backend systems. Therefore, even with so-called offline transaction methods, the assets acquired after the transaction cannot be used and circulated promptly while ensuring security. Traditional technologies based on internet and PKI systems cannot break free from this dependence on centralization, thus failing to truly realize the value circulation function of digital currencies and preventing them from proving their value during circulation. To break this constraint, new peer-to-peer security technologies and the ability to truly record value in local transaction records are needed to achieve trusted peer-to-peer authentication and transactions between devices, with sufficient security capabilities to prevent counterfeiting, tampering, theft, and double-spending. Summary of the Invention
[0004] Therefore, it is necessary to provide secure, reliable, convenient and easy-to-use devices for the use of digital currencies, as well as efficient offline transaction methods similar to traditional cash.
[0005] This invention provides a digital wallet device, characterized in that it comprises:
[0006] Security chips and communication modules;
[0007] The communication module is used for short-range communication with other digital wallet devices and may include one or more of the following: Bluetooth module, NFC module, infrared communication module, and wireless LAN module.
[0008] The security chip further includes an identification ledger system and an encryption / decryption module. The identification ledger system includes at least one identification ledger, each of which is used to store and update the transaction records of the digital wallet device. The security chip calculates the balance of each identification ledger based on the transaction records.
[0009] The security chip stores the unique identifier ID of the digital wallet device; the encryption / decryption module uses a mapping algorithm to calculate the public key within the security chip based on the unique identifier ID of the digital wallet device.
[0010] in,
[0011] The encryption / decryption module is also used to store and manage local keys, and to use the keys to encrypt and decrypt communication instructions and transaction information, as well as to sign and verify signatures.
[0012] Each of the aforementioned identification ledgers includes an identification ledger header and an identification ledger body;
[0013] The identifier ledger header includes the issuer's unique identifier (IAN) and the total amount (CV) issued by the issuer to the digital wallet device;
[0014] The identification ledger entity includes several transaction records arranged in chronological order; each transaction record further includes the transaction amount, the unique number SAN of the transaction source account, the unique number TAN of the transaction target account, the signature SSD of the transaction source for the transaction, and the signature TSD of the transaction target for the transaction.
[0015] in,
[0016] The identifier ledger header also includes the issuer's unique identifier ISN for the ledger, the ledger's timestamp TS, and the cryptographic hash value calculated using the IAN, ISN, TS, and CV.
[0017] in,
[0018] The source of the first transaction record in the identifier ledger body is the issuer in the identifier ledger header, and the transaction record includes the hash value of the identifier ledger header;
[0019] The transaction records in the identified ledger entity further include the hash value of the previous transaction, the transaction sequence number, and the transaction timestamp.
[0020] in,
[0021] The latest transaction record in each identifier ledger is the transaction record where the local digital wallet device is the source or destination of the transaction.
[0022] in,
[0023] The difference between the transaction amount of the last transaction record in each of the identification ledgers where the terminal device is the destination party and the total transaction amount of all subsequent transaction records where the terminal device is the source party is the available amount of the identification ledger for that terminal device.
[0024] in,
[0025] The digital wallet device may also include an input module and a display module;
[0026] The input module is used to input transaction information such as transaction amount, and can be a keyboard or touch screen;
[0027] The display module is used to display transaction information.
[0028] The present invention further provides a dual offline transaction method for a digital wallet device, characterized in that the method includes:
[0029] Step 1: Digital wallet device A and digital wallet device B complete mutual authentication through identity-based two-way authentication;
[0030] Step 2: Digital wallet A sends a transaction preparation instruction to its internal security chip. The security chip of digital wallet device A determines the number of identity ledgers required for this transaction based on the required payment amount and the balance of the local identity ledger. If the total payment amount is less than the maximum available amount of a single identity ledger, only one identity ledger is selected for use; otherwise, multiple identity ledgers are selected sequentially for the transaction.
[0031] Step 3: The security chip adds a new transaction preparation data entry to the end of one of the identified ledgers L0 selected in Step 2 as the current last transaction record, resulting in a new identified ledger L1, which is then sent to the digital wallet device B. The digital wallet B performs further verification. The transaction preparation data includes the transaction amount, the account identifiers of the source and target parties, and the signature of the digital wallet A for the transaction.
[0032] Step 4: Digital wallet device A receives transaction confirmation data information with the signature of digital wallet device B. The transaction confirmation data information includes transaction preparation data information for this transaction, the signature of digital wallet device A, and the signature of digital wallet device B. Digital wallet device A verifies the signature of digital wallet device B and the transaction confirmation data information. If successful, digital wallet device A adds the signature of digital wallet device B to the last transaction record of the identification ledger L1 and saves it as identification ledger L2, which will be used as the identification ledger for subsequent transactions.
[0033] Step 5: The security chip of digital wallet device A determines whether the transaction of all identified ledgers in this transaction is completed based on the transaction information. If not, the next identified ledger to participate in the transaction is selected and steps 3-5 are repeated until the transaction of all identified ledgers in this transaction is completed.
[0034] in,
[0035] The transaction preparation data further includes the hash value, transaction sequence number, and transaction timestamp of the previous transaction.
[0036] in,
[0037] Further verification steps in step 3 for digital wallet device B include:
[0038] Step 3-1: Digital wallet device B receives the identifier ledger L1 and transaction-related information sent by A, verifies A's signature and checks the authenticity and legality of the transaction, including calculating the available amount of identifier ledger L0 for A and comparing it with the transaction amount to determine whether the transaction is legal.
[0039] Step 3-2: Digital wallet device B signs the transaction preparation data record of the identification ledger L1 and forms a transaction confirmation data. The signed identification ledger record is saved as a new identification ledger L2 available to B, and the transaction confirmation data is sent to A.
[0040] in,
[0041] The two-way authentication process described in step 1 may include:
[0042] Step 1-1: Digital wallet device A generates an 8-byte random number R1, obtains its own CCKS identifier ID1, and calculates the signature C1 S1 on R1. It then sends the signature to digital wallet device B through authentication and key exchange instructions. The necessary parameters of the instructions are ID1, R1, C1, and S1.
[0043] Steps 1-2: After receiving the authentication and key exchange instruction, digital wallet device B first authenticates the legitimacy of ID1 through a blacklist (or whitelist) and / or ID rules. After successful authentication, it calculates the public key PUB1 of digital wallet device A using ID1 and verifies the signature value C1 S1. If the verification is successful, it indicates that digital wallet device A is legitimate and can proceed to the following steps: Digital wallet device B generates a random number R2, obtains the process key K by XORing R1 and R2, then obtains its own CCKS identifier ID2, encrypts R2 using the public key PUB1 to obtain ENC2, and then signs ENC2 to obtain C2 S2. After completing the above calculations, digital wallet device B ends the authentication and key exchange instruction processing and returns the following data to digital wallet device A: ID2, ENC2, C2, S2, and response code.
[0044] Steps 1-3: After receiving the response, digital wallet device A first verifies the legitimacy of ID2 through a blacklist (or whitelist) and / or ID rules. After verification, it calculates the public key PUB2 of digital wallet device A using ID2. Digital wallet device A uses PUB2 to verify the signature of C2 S2. If the verification is successful, it means that digital wallet device B is legitimate and can proceed to the following process: Digital wallet device A decrypts ENC2 with its own private key to obtain a random number R2. It obtains the process key K by XORing R1 and R2. The process key K is used for encrypted communication in subsequent steps.
[0045] The present invention can achieve at least the following beneficial effects:
[0046] The digital wallet device and its offline transaction method of the present invention employ identification authentication technology to assign a unique identity to each device, and then establish an identification ledger system based on the identification authentication technology. The identification ledger records transaction records, and signatures are exchanged between the transacting parties during the transaction process, thereby realizing secure and reliable peer-to-peer offline transactions.
[0047] Based on identifier authentication technology, the identity identifier ID of a digital wallet device is strongly bound to the hardware and established with the corresponding public key through a public key mapping algorithm. This allows digital wallet devices to directly complete mutual identity verification through the exchange of identifier IDs, ensuring that digital wallet devices can achieve peer-to-peer dual offline authentication.
[0048] By combining a security chip with authentication technology, the system prevents local devices from tampering with or deleting transaction records. Simultaneously, it establishes a link between transaction records by storing the hash of the previous transaction record for each transaction in each ledger. Each transaction contains an identifier ID representing the signatures of both parties, allowing digital wallet devices to verify the signature of any transaction locally. This ensures that past transaction records can be verified locally, resolving the issues of forgery and double-spending in offline transactions.
[0049] Transactions are recorded using an identifier ledger and the transaction records within that ledger, ensuring that every transaction is traceable and preventing repudiation after completion. After each transaction is completed, both parties can immediately use the new identifier ledger to transact again, without a transaction cooldown period or the need for immediate settlement with the backend, truly achieving real-time and continuous transactions that can be conducted offline.
[0050] The available amount of a device is identified by identifying the ledger and the transaction records in the ledger, replacing the traditional balance record. This ensures the legality of the transaction amount during the transaction process and can be verified locally to guarantee the authenticity of the transaction amount in the transaction record, preventing the falsification of the balance or transaction amount.
[0051] The digital wallet device and its dual offline transaction method provided by this invention, through the combination of identification authentication technology and identification ledger, truly realize the secure and reliable value transfer of digital currency, enabling peer-to-peer dual offline transactions and continuous transactions. Each transaction is verifiable and traceable, preventing counterfeiting, tampering, theft, double-spending and other behaviors, and promoting the safe, convenient and reliable circulation of digital currency in different scenarios. Attached Figure Description
[0052] Figure 1 This is a schematic diagram of a digital wallet device structure according to an embodiment of the present invention;
[0053] Figure 2 This is a schematic diagram of the identification ledger structure according to an embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram of the structure of a single transaction record according to an embodiment of the present invention;
[0055] Figure 4 This is a data structure diagram of a single transaction record according to a preferred embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram of the structure of multiple transaction records according to a preferred embodiment of the present invention;
[0057] Figure 6 This is a schematic diagram illustrating the process of offline transactions using a digital wallet device based on the present invention. Detailed Implementation
[0058] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0059] Figure 1 The diagram shows a schematic of a digital wallet device 1 based on an identity ledger according to the present invention. The digital wallet device can be a standalone hardware unit or a Trusted Execution Environment (TEE). The digital wallet device 1 includes a Secure Element (SE) chip 11, a communication module 12, an encryption / decryption module 13, and an identity ledger system 14, wherein both the encryption / decryption module 13 and the identity ledger system 14 are stored in the SE secure chip 11.
[0060] Preferably, the digital wallet device 1 may further include an input module 15 and a display module 16.
[0061] The SE security chip 11 stores the unique device account number (DAN) of the digital wallet device 1, and the encryption / decryption module 13 assigns the corresponding transaction private key. It features secure computation and secure storage capabilities. The secure computation can support asymmetric encryption algorithms and resist side-channel attacks and analysis of the computation process; the secure storage means that the contents of its storage device cannot be directly accessed from outside the chip. Each SE security chip 11 records a version number and a batch number.
[0062] The identifier encryption technology of this invention supports directly calculating the public key from the ID, that is:
[0063] Pub key =Pub(ID)
[0064] Where: Pubkey is the public key; Pub() is the public key mapping function, which can calculate the public key value using ID; ID is the device account identifier.
[0065] The communication module 12 is mainly used for short-range communication, and the communication methods that can be used include one or more of the following short-range communication methods: Bluetooth and NFC, infrared communication module, wireless local area network module, etc.
[0066] The encryption / decryption module 13 is integrated into the SE security chip 11. It is used to store and manage local keys, and to perform operations such as encryption / decryption, signature verification, and other functions on the identification ledger data and transaction process data. A strong binding relationship is established between the encryption / decryption module and the public key of the digital wallet device through the mapping algorithm of the encryption / decryption module. Because there is a strong binding relationship between the public key and the unique identifier ID of the digital wallet device, it can be directly calculated in the security chip based on the unique identifier ID, thus avoiding the dangers of impersonation such as man-in-the-middle attacks and eliminating the need for third-party certificates for verification. The identification authentication technology used in this invention is CCKS technology, which supports a large key capacity in a single domain and offline peer-to-peer authentication, providing support for offline transactions and verification of the identification ledger.
[0067] The identification ledger system 14 of the present invention consists of multiple identification ledgers 141-14n, and the storage structure of each identification ledger further consists of an identification ledger header and an identification ledger body, such as... Figure 2 The diagram shows the specific structure of the identification ledger 141 as an example. It includes an identification ledger header 141A, which records ledger amount information, and an identification ledger body 141B, which sequentially records multiple transaction records TR1-TRN in the identification ledger.
[0068] The ledger header 141A, generated by the issuer, primarily represents the total amount in the ledger. It may include the issuer's unique issuer account number (IAN) and the total amount (CV) issued to the digital wallet device. For example... Figure 3 The diagram shown is an identification ledger according to an embodiment of the present invention, wherein "01" in the header of the identification ledger represents the unique identifier of the issuer's issuing account, and "100" represents the amount of 100 issued by the issuer to the digital wallet device. It is understood that the issuer can be an institution in any country or region with legal qualifications to issue digital currency, such as the People's Bank of China, and the unit of measurement can be yuan, US dollars, euros, etc.
[0069] Preferably, the ledger header may further include the issuer's unique identifier for the ledger (ISN, issueserial number); the ledger generation timestamp (TS); and the encrypted hash (HH, header hash) calculated by the encryption / decryption module 13 using IAN, ISN, TS, and CV. The encrypted hash algorithm can be a commonly used algorithm, such as SHA2, SHA3, or SM3; SHA3 is a suitable choice. The asymmetric signature (ISD, issuer signature data) is calculated using the private key corresponding to IAN. The ISD can be an ECDSA signature algorithm based on Secp256R1 elliptic curves, obtained by calculating the signature of HH using the private key [Key]_IAN corresponding to the issuing account. Its structure can be as follows: Figure 4 As shown.
[0070] The ledger entity 141B includes several transaction records TR1-TRn arranged in chronological order. Each transaction record may include the transaction amount TA, the unique identifier SAN of the source account, the unique identifier TAN of the target account, the source signature data SSD (source signature data) of the transaction (the signature algorithm can be calculated from the private key corresponding to the SAN, and the algorithm is the same as the ISD, which is the ECDSA signature algorithm based on Secp256R1 elliptic curves), and the target signature data TSD (target signature data) of the transaction (which can be calculated from the private key corresponding to the TAN, and the algorithm is the same as above).
[0071] The above encryption and signing processes are both encrypted and decrypted through the encryption / decryption module 13.
[0072] Still refer to Figure 3As shown, the ledger body below the ledger header records two transaction records.
[0073] Where 100 represents the first transaction amount of 100, the identifier I indicates that the transaction source is the issuer's account ID, the identifier A indicates that the transaction target is the digital wallet device ID with device account number A, and Si and Sa are the signatures of the issuer account I and the digital wallet device A for the transaction, respectively.
[0074] Similarly, the second transaction amount is 50, the source account is the digital wallet A account ID, and the target account is the digital wallet B account ID, where Sa and Sb are the signatures of digital wallet A and digital wallet B for this transaction, respectively.
[0075] Preferably, the transaction record information may further include the hash value PH of the previous transaction, the sequence number TN of the current transaction, the transaction timestamp TS, and the transaction hash value TH. For example... Figure 4 The diagram shown is a preferred schematic diagram of the main data structure of the identification ledger of the present invention.
[0076] It is important to note that the source of the first transaction record in the identifier ledger body is the corresponding issuer. Therefore, the transaction record does not include the hash value of the previous transaction, but it does include the hash value of the identifier ledger header.
[0077] The previous transaction hash (PH) is calculated from the data of the previous transaction record using a cryptographic hash algorithm. Specifically, the previous transaction hash for the first transaction is calculated from the data identifying the ledger header. The cryptographic hash algorithm used in this invention is the SHA3 algorithm. All the above hash encryption processes are performed by the encryption / decryption module 13.
[0078] The transaction number (TN) is generated sequentially by the digital wallet of the transaction originator.
[0079] It should be noted that the latest transaction record in each identification ledger should be a transaction record where the digital wallet device is the payer or payee; the balance calculation rule for each identification ledger in this invention is that the difference between the transaction amount of the last transaction record in which the digital wallet device was the transaction recipient and the total transaction amount of all subsequent transaction records in which the terminal device was the transaction source is the available balance of that identification ledger for that terminal device. For example, Figure 5In the ledger shown, the balance for digital wallet A at this time is 22 = 30 - 5 - 3. This is because, according to the above rules, the transaction records of digital wallet A as the target are TR1 and TR4. The transaction amount of the last transaction TR4 is 30, which is calculated by subtracting the transaction amounts of the transaction records TR5 and TR6 of digital wallet A as the source.
[0080] The maximum amount that the payer can pay for each transaction is the amount available to the payer in the identification ledger before the transaction was generated. Transactions exceeding this available amount cannot be signed.
[0081] When a transaction anomaly occurs during the transaction process, a transaction record in the ledger may be incomplete or may not include the signature of one of the parties involved in the transaction. Such a transaction record is invalid, and therefore the transaction amount involved in this transaction record cannot be used for payment transactions and will be locked. It cannot be used again before reconciliation with the back-end system.
[0082] Furthermore, the digital wallet device that identifies the ledger may also include an input module and a display module. The input module may be a small input device integrated into the device, such as a touchscreen or keyboard, used to input transaction information such as transaction amount and transaction confirmation information. The display module may be an external display device, such as an electronic display screen, used to display transaction information, which may include information that needs to be confirmed during the transaction, transaction success information, wallet balance, etc.
[0083] Digital wallet devices based on an identifier ledger may or may not include an internet communication module, depending on actual usage requirements. Digital wallet devices without an internet communication module, when needing to communicate with a network backend, establish communication with other smart terminals via short-range communication (SMR) and conduct internet communication through those smart terminals.
[0084] Figure 6 This is a schematic diagram illustrating the process of performing dual offline transactions using a digital wallet device based on an identifier ledger, as provided by this invention.
[0085] When using the digital wallet device based on the identifier ledger provided by this invention to perform dual offline transactions, the specific steps are as follows:
[0086] First, the transaction user initializes the transaction using a digital wallet device; for ease of explanation, as follows: Figure 6 As shown, the transaction user can be a user of digital wallet device A or a user of digital wallet device B;
[0087] Then, digital wallet device A and digital wallet device B involved in the transaction establish near-field communication; the way to establish near-field communication can be, for example, by first touching each other to trigger NFC communication, and then exchanging the recipient's Bluetooth address to establish Bluetooth communication;
[0088] Then proceed to the offline trading steps:
[0089] Step a) The users of digital wallet device A and digital wallet device B participating in the transaction complete mutual authentication by exchanging their respective device identifiers and signatures. All instructions in the above process can use a symmetric encryption algorithm and process key K to encrypt the entire instruction data. The encryption algorithm can be a well-known algorithm such as SM4, AES, Blowfish, DES, Triple DES, Serpent, Twofish, etc. At this point, digital wallet device A and digital wallet device B have completed mutual authentication and obtained the process key K, enabling subsequent encrypted communication.
[0090] The transaction originator (payer) digital wallet device A user or the transaction target (recipient) digital wallet device B user generates a transaction instruction by inputting information such as the transaction amount through the input module on the corresponding digital wallet device. It should be noted that if the transaction target user inputs the information, the transaction instruction needs to be sent to the transaction originator digital wallet device. Here, we assume that the transaction originator is digital wallet device A and the transaction target is digital wallet device B.
[0091] Step b) Digital wallet device A sends a transaction preparation instruction to the internal security chip. The security chip adds a new transaction preparation data to the end of its original identification ledger L0, such as "50-AB-Sa-_" as shown in the figure. The transaction preparation data includes "50" which is the transaction amount, "A" and "B" which are the account identifiers of the source and the target respectively, and "Sa" which is the signature of digital wallet A for the transaction. Since the data has not yet been provided to the target of the transaction, the signature of the target of the transaction is empty (_).
[0092] The security chip determines the total transaction amount and related information based on the transaction instructions, and retrieves the locally stored identification ledger based on the total transaction amount;
[0093] If there exists an identifier ledger whose available amount on the digital wallet device of the transaction originator is greater than or equal to the total transaction amount, that identifier ledger is selected to participate in the transaction; if the available amount on each identifier ledger is less than the total transaction amount on the digital wallet device of the transaction originator, multiple identifier ledgers are selected for the transaction, and the total transaction amount is allocated to each identifier ledger to ensure that the transaction amount of each identifier ledger is less than or equal to the available amount on that identifier ledger on the digital wallet device of the transaction originator.
[0094] Therefore, if digital wallet device A needs to transfer 60 yuan to digital wallet device B, as mentioned above, such as Figure 5In the identified ledger shown, the current balance for digital wallet A is 22 = 30 - 5 - 3, which is insufficient to pay the amount of 60 yuan. Therefore, digital wallet device A needs to send two or more identified ledgers to digital wallet device B simultaneously. For example, it can send... Figure 3 The ledger shown has a balance of 50 yuan.
[0095] The transaction preparation data may further include the hash value, transaction sequence number, and transaction timestamp of the previous transaction.
[0096] Step c) Digital wallet A sends the identifier ledger L1 containing the new transaction preparation data to digital wallet B;
[0097] Step d) Digital wallet device B verifies the signature in the transaction record and checks the authenticity and legality of the transaction information;
[0098] Specifically, this includes verifying whether the identifiers of both parties in the transaction and the transaction amount in the ledger of that identifier are less than or equal to the available amount in the ledger for the transaction source party; after the transaction target party completes the verification and validation of the transaction record, if both pass, the hash of the transaction information is signed and written into a new transaction record to make the transaction record complete; if the digital wallet device B fails the verification, the transaction is rejected and the transaction ends.
[0099] Step e) The digital wallet device B of the transaction target responds to the transaction result. Specifically, it signs the transaction preparation data record of the identification ledger L1, saves the signed identification ledger record as a new identification ledger L2 available to B, and sends the transaction confirmation data information, such as "50-AB-Sa-Sb", to A. It can be understood that the transaction confirmation data information at this time includes the transaction preparation data information of this transaction and the signature of the digital wallet device B.
[0100] Step f) After receiving the transaction confirmation data information with the signature of digital wallet device B, the digital wallet device A of the transaction originator verifies the signature of digital wallet device B and the transaction confirmation data information. If the verification is successful, the digital wallet device B's signature is added to the corresponding transaction record in the identification ledger L1 and saved as identification ledger L2, which serves as the identification ledger for subsequent transactions.
[0101] It should be noted that steps b)-f) only describe the processing procedure for a single identification ledger. If the transaction source needs to send multiple identification ledgers to the transaction target, the transaction source will repeat steps b)-f) for that identification ledger until the transaction of all identification ledgers in this transaction is completed.
[0102] If any step fails to verify the signature or transaction information, the corresponding identifier ledger must be obtained again from the other party's device to overwrite the identifier ledger that failed verification. If the corresponding identifier ledger cannot be obtained again, the party whose verification failed will hold an identifier ledger containing incomplete transaction records. The transaction amounts involved in the incomplete transaction records in this identifier ledger cannot be used in other transactions.
[0103] The two-way authentication in step 1 involves the two parties establishing close-range communication and exchanging IDs and signatures. This requires only a single interaction to verify the legitimacy of both parties' identities, completing mutual authentication and negotiation of process keys. Specific methods include:
[0104] Step 1-1: Digital wallet device A generates an 8-byte random number R1, obtains its own CCKS identifier ID1, and calculates the signature C1 S1 on R1. It then sends the signature to digital wallet device B through an authentication and key exchange instruction. The necessary parameters of the instruction are ID1, R1, C1, and S1.
[0105] Steps 1-2: After receiving the authentication and key exchange instruction, digital wallet device B first authenticates the legitimacy of ID1 through a blacklist (or whitelist) and / or ID rules. After successful authentication, it calculates the public key PUB1 of digital wallet device A using ID1 and verifies the signature value C1 S1. If the verification is successful, it indicates that digital wallet device A is legitimate and can proceed to the following steps: Digital wallet device B generates a random number R2 and obtains the process key K by XORing R1 and R2. Then, digital wallet device B obtains its own CCKS identifier ID2 and encrypts R2 using the public key PUB1 to obtain ENC2. Finally, it signs ENC2 to obtain C2 S2. After completing the above calculations, digital wallet device B ends the authentication and key exchange instruction processing and returns the following data to digital wallet device A: ID2, ENC2, C2, S2, and response code.
[0106] Steps 1-3: After receiving the response, digital wallet device A first verifies the legitimacy of ID2 using a blacklist (or whitelist) and / or ID rules. Upon successful verification, it calculates its public key PUB2 using ID2. Digital wallet device A then uses PUB2 to verify the signature of C2 S2. If the verification is successful, digital wallet device B is considered legitimate and can proceed to the following steps: Digital wallet device A decrypts ENC2 using its own private key, obtaining a random number R2. The process key K is then obtained by XORing R1 and R2. At this point, digital wallet device A and digital wallet device B have completed their authentication and obtained the process key K, enabling subsequent encrypted communication.
[0107] The above descriptions are merely preferred embodiments of the present invention, and the present invention is not limited to the above embodiments. It is understood that other improvements and variations that can be directly derived or conceived by those skilled in the art without departing from the spirit and concept of the present invention should be considered to be included within the protection scope of the present invention.
Claims
1. A digital wallet device, characterized in that, include: Security chips and communication modules; The communication module is used for short-range communication with other digital wallet devices, including one or more of Bluetooth, NFC, infrared communication, and wireless LAN modules; The security chip further includes an identification ledger system and an encryption / decryption module. The identification ledger system includes at least one identification ledger, each of which is used to store and update the transaction records of the digital wallet device. The security chip calculates the balance of each identification ledger based on the transaction records. The security chip stores the unique identifier ID of the digital wallet device; the encryption / decryption module uses a mapping algorithm to calculate the public key within the security chip based on the unique identifier ID of the digital wallet device. Each of the aforementioned identification ledgers includes an identification ledger header and an identification ledger body; The identifier ledger header includes the issuer's unique identifier (IAN) and the total amount (CV) issued by the issuer to the digital wallet device; The identifier ledger body includes several transaction records arranged in chronological order; each transaction record further includes the transaction amount, the unique number SAN of the transaction source account, the unique number TAN of the transaction target account, the signature SSD of the transaction source for the transaction, and the signature TSD of the transaction target for the transaction; the source in the first transaction record in the identifier ledger body is the issuer in the identifier ledger header, and the transaction record includes the hash value of the identifier ledger header; The transaction records in the identified ledger entity further include the hash value of the previous transaction, the transaction sequence number, and the transaction timestamp.
2. The device according to claim 1, characterized in that: The encryption / decryption module is also used to store and manage local keys, and to use the keys to encrypt and decrypt communication instructions and transaction information, as well as to sign and verify signatures.
3. The device according to claim 2, characterized in that: The identifier ledger header also includes the issuer's unique identifier ISN for the ledger, the ledger's timestamp TS, and the cryptographic hash value calculated using the IAN, ISN, TS, and CV.
4. The device according to claim 1, characterized in that: The latest transaction record in each identifier ledger is the transaction record where the local digital wallet device is the source or destination of the transaction.
5. The device according to claim 1, characterized in that: The difference between the transaction amount of the last transaction record in each of the identified ledgers where the digital wallet device is the destination and the total transaction amount of all subsequent transactions where the digital wallet device is the source is the balance of the identified ledger for the digital wallet device.
6. The device according to claim 1, characterized in that: The digital wallet device also includes an input module and a display module; The input module is a keyboard or touchscreen, used to input transaction information; The display module is used to display transaction information.
7. A dual offline transaction method for a digital wallet device as described in any one of claims 1-6, characterized in that, The method includes: Step 1: Digital wallet device A and digital wallet device B complete mutual authentication through identity-based two-way authentication; Step 2: Digital wallet A sends a transaction preparation instruction to its internal security chip. The security chip of digital wallet device A determines the number of identity ledgers required for this transaction based on the required payment amount and the balance of the identity ledger. If the total payment amount is less than the maximum available amount of a single identity ledger, only one identity ledger is selected for use; otherwise, multiple identity ledgers are selected sequentially for the transaction. Step 3: The security chip adds a new transaction preparation data entry to the end of one of the identified ledgers L0 selected in Step 2 as the current last transaction record, resulting in a new identified ledger L1, which is then sent to the digital wallet device B. The digital wallet B performs further verification. The transaction preparation data includes the transaction amount, the account identifiers of the source and target parties, and the signature of the digital wallet A for the transaction. Step 4: Digital wallet device A receives transaction confirmation data information with the signature of digital wallet device B. The transaction confirmation data information includes transaction preparation data information for this transaction, the signature of digital wallet device A, and the signature of digital wallet device B. Digital wallet device A verifies the signature of digital wallet device B and the transaction confirmation data information. If successful, digital wallet device A adds the signature of digital wallet device B to the last transaction record of the identification ledger L1 and saves it as identification ledger L2, which will be used as the identification ledger for subsequent transactions. Step 5: The security chip of digital wallet device A determines whether the transaction of all identified ledgers in this transaction is completed based on the transaction information. If not, the next identified ledger to participate in the transaction is selected and steps 3-5 are repeated until the transaction of all identified ledgers in this transaction is completed.
8. The method according to claim 7, characterized in that: The transaction preparation data further includes the hash value, transaction sequence number, and transaction timestamp of the previous transaction.
9. The method according to claim 7, characterized in that: Further verification steps in step 3 for digital wallet device B include: Step 3-1: Digital wallet device B receives the identifier ledger L1 and transaction-related information sent by A, verifies A's signature and checks the authenticity and legality of the transaction, including calculating the available amount of identifier ledger L0 for A and comparing it with the transaction amount to determine whether the transaction is legal. Step 3-2: Digital wallet device B signs the transaction preparation data record of the identification ledger L1 and forms a transaction confirmation data. The signed identification ledger record is saved as a new identification ledger L2 available to B, and the transaction confirmation data is sent to A.
10. The method according to claim 7, characterized in that: The identifier-based two-way authentication described in step 1 includes the following steps: Step 1-1: Digital wallet device A generates an 8-byte random number R1, obtains its own CCKS identifier ID1, and calculates the signature C1 S1 on R1. It then sends the signature to digital wallet device B through authentication and key exchange instructions. The necessary parameters of the instructions are ID1, R1, C1, and S1. Steps 1-2: After receiving the authentication and key exchange instruction, digital wallet device B first authenticates the legitimacy of ID1 through a blacklist or whitelist and / or ID rules. After successful authentication, it calculates the public key PUB1 of digital wallet device A using ID1 and verifies the signature value C1S1. If the verification is successful, it indicates that digital wallet device A is legitimate. The following steps are then performed: Digital wallet device B generates a random number R2 and obtains the process key K by XORing R1 and R2. Then, digital wallet device B obtains its own CCKS identifier ID2 and encrypts R2 using the public key PUB1 to obtain ENC2. Finally, it signs ENC2 to obtain C2S2. After completing the above calculations, digital wallet device B ends the authentication and key exchange instruction processing and returns the following data to digital wallet device A: ID2, ENC2, C2, S2, and response code. Steps 1-3: After receiving the response, digital wallet device A first verifies the legitimacy of ID2 through a blacklist or whitelist and / or ID rules. After verification, it calculates the public key PUB2 of digital wallet device A using ID2. Digital wallet device A uses PUB2 to verify the signature of C2S2. If the verification is successful, it means that digital wallet device A is legitimate, and the following process is performed: Digital wallet device A decrypts ENC2 with its own private key to obtain a random number R2. The process key K is obtained by XORing R1 and R2. The process key K is used for encrypted communication in subsequent steps.
Citation Information
Patent Citations
Digital wallet supporting anonymous or real-name offline transaction and use method
CN110766383A
Secure offline transaction system using digital tokens and a secure ledger database
CN111373429A