




技术领域technical field
本发明涉及计算机技术领域,尤其涉及一种基于数字货币钱包的存币方法和系统。The invention relates to the field of computer technology, in particular to a method and system for depositing coins based on a digital currency wallet.
背景技术Background technique
目前,现有常见的电子钱包和数字钱包主要分为三类,其中,第一类是基于账户体系的钱包,其功能是账户功能的延伸,这类钱包参与的交易,实际是背后账户系统的交易,钱包本身不实际存放任何实际的资金或资产,只是作为后台账户系统账务数据和功能的前端展示。第二类钱包是作为银行卡或其他卡介质访问的聚合入口存在,这类钱包只是卡功能的聚合管理,只是将多个卡的网络支付入口功能进行封装,实现单一入口访问,简化用户多卡操作的复杂性,这种钱包的功能需要对应调用具体卡的网络应用功能来实现。第三类是以比特币为代表的基于区块链技术发展而来的一类私人准数字货币的钱包,该类钱包主要是用于保存私钥,用于对链上记录的私人准数字货币进行签名交易。At present, the existing common electronic wallets and digital wallets are mainly divided into three categories. Among them, the first category is the wallet based on the account system, and its function is an extension of the account function. The transactions that such wallets participate in are actually the accounts behind the system. For transactions, the wallet itself does not actually store any actual funds or assets, but only serves as the front-end display of the accounting data and functions of the back-end account system. The second type of wallet exists as an aggregated portal accessed by bank cards or other card media. This type of wallet is only the aggregated management of card functions. It only encapsulates the network payment portal functions of multiple cards to achieve single portal access and simplify users with multiple cards. Due to the complexity of the operation, the function of this wallet needs to be implemented by calling the network application function of the specific card. The third type is a private quasi-digital currency wallet developed based on blockchain technology represented by Bitcoin. This type of wallet is mainly used to save private keys and to record private quasi-digital currencies on the chain. Make a signed transaction.
在实现本发明过程中,发明人发现现有技术中至少存在如下问题:以上三类钱包都无法支持数字货币发行机构发行的真正数字货币,因而与数字货币发行机构没有系统之间交互和访问机制,不能实现数字货币实际存放保管和流通等功能。同时,以上三类钱包或依赖后台账户体系,钱包本身不独立,或钱包安全方面存在不足,或不能很好应用于现有金融服务和交易场景中。In the process of implementing the present invention, the inventor found that there are at least the following problems in the prior art: none of the above three types of wallets can support the real digital currency issued by the digital currency issuer, so there is no system-to-system interaction and access mechanism with the digital currency issuer , it cannot realize the functions of the actual storage, custody and circulation of digital currency. At the same time, the above three types of wallets rely on the back-end account system, the wallet itself is not independent, or the wallet security is insufficient, or it cannot be well applied to existing financial services and transaction scenarios.
因此,亟需一种能够实现数字货币的存币过程,并且具有独立性和较高安全性以及能很好的应用于现有金融服务和交易场景中的基于数字货币钱包的存币方法和系统。Therefore, there is an urgent need for a digital currency wallet-based deposit method and system that can realize the deposit process of digital currency, has independence and high security, and can be well applied to existing financial services and transaction scenarios. .
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明实施例提供一种基于数字货币钱包的存币方法和系统,实现了数字货币的存币过程,将钱包终端中的数字货币存入钱包服务端的数字货币保管箱,并兑换成钱包关联账户余额资金,具有独立性和较高安全性,能很好的应用于现有金融服务和交易场景中。In view of this, the embodiments of the present invention provide a method and system for depositing coins based on a digital currency wallet, which realizes the depositing process of digital currency, deposits the digital currency in the wallet terminal into the digital currency safe deposit box of the wallet server, and exchanges It has independence and high security, and can be well applied to existing financial services and transaction scenarios.
为实现上述目的,根据本发明实施例的一个方面,提供了一种基于数字货币钱包的存币方法,包括:In order to achieve the above purpose, according to an aspect of the embodiments of the present invention, a method for depositing coins based on a digital currency wallet is provided, including:
数字货币钱包终端根据用户的操作指令将存币指令信息发送给数字货币钱包服务端,所述存币指令信息包括:存入来源币串列表、存入金额以及数字货币钱包服务端标识;The digital currency wallet terminal sends the coin deposit instruction information to the digital currency wallet server according to the user's operation instruction, and the coin deposit instruction information includes: the deposit source coin string list, the deposit amount and the digital currency wallet server identifier;
数字货币钱包服务端为所述存币指令信息添加服务端数字货币保管箱标识以生成存币转移请求,并将该请求发送给数字货币发行登记端;The digital currency wallet server adds the server-side digital currency safe deposit box identifier to the deposit instruction information to generate a deposit transfer request, and sends the request to the digital currency issuance and registration terminal;
数字货币发行登记端响应所述请求,根据所述数字货币钱包服务端标识和服务端数字货币保管箱标识确认所述服务端数字货币保管箱属于所述存币指令的作为收款方的数字货币钱包服务端,然后基于存入金额和预定义的支付策略确定实际转移金额,并根据实际转移金额将所述存入来源币串列表作废,生成存入去向币串列表,将包含所述存入去向币串列表、实际转移金额的转移结果信息发送给数字货币钱包服务端;The digital currency issuance and registration terminal responds to the request, and confirms that the server-side digital currency safe deposit box belongs to the digital currency of the payee of the coin deposit instruction according to the digital currency wallet server identification and the server digital currency safe deposit box identification. The wallet server then determines the actual transfer amount based on the deposit amount and the predefined payment strategy, invalidates the deposit source coin string list according to the actual transfer amount, and generates a deposit destination coin string list, which will include the deposit source coin string list. The destination currency list and the transfer result information of the actual transfer amount are sent to the digital currency wallet server;
数字货币钱包服务端将所述存入去向币串列表存入服务端数字货币保管箱,并根据所述实际转移金额对所述用户的账户进行入账,并生成入账结果信息,根据入账结果信息和转移结果信息生成存币结果信息以发送给数字货币钱包终端;The digital currency wallet server stores the deposit and destination currency string list into the server-side digital currency safe deposit box, and credits the user's account according to the actual transfer amount, and generates the credit result information, according to the credit result information and The transfer result information generates deposit result information to send to the digital currency wallet terminal;
数字货币钱包终端向所述用户展示存币结果信息。The digital currency wallet terminal displays the deposit result information to the user.
进一步的,所述存币指令信息还包括:钱包终端标识和钱包终端签名,所述存币转移请求还包括:数字货币钱包服务端签名,所述转移结果信息还包括:数字货币发行登记端签名;Further, the deposit instruction information further includes: wallet terminal identification and wallet terminal signature, the deposit transfer request further includes: digital currency wallet server signature, and the transfer result information further includes: digital currency issuance registration terminal signature ;
所述方法还包括:The method also includes:
在数字货币钱包服务端为所述存币指令信息添加服务端数字货币保管箱标识以生成存币转移请求之前,数字货币钱包服务端验证所述钱包终端签名;Before the digital currency wallet server adds a server-side digital currency safe deposit box identifier to the deposit instruction information to generate a deposit transfer request, the digital currency wallet server verifies the wallet terminal signature;
在数字货币钱包服务端将所述存入去向币串列表存入服务端数字货币保管箱之前,数字货币钱包服务端确定所述钱包终端标识与预存储的所述用户的账户关联钱包标识一致;Before the digital currency wallet server saves the deposit destination coin string list into the server-side digital currency safe, the digital currency wallet server determines that the wallet terminal identifier is consistent with the pre-stored wallet identifier associated with the user's account;
在数字货币发行登记端在根据所述数字货币钱包服务端标识和服务端数字货币保管箱标识确认所述服务端数字货币保管箱属于所述存币指令的作为收款方的数字货币钱包服务端之前,所述方法还包括:数字货币发行登记端验证数字货币钱包服务端签名和/或所述存币指令信息的钱包终端签名;At the digital currency issuance and registration end, the digital currency wallet server as the payee that confirms that the server-side digital currency safe deposit box belongs to the coin deposit instruction according to the digital currency wallet server-side identifier and the server-side digital currency safe deposit box identifier Before, the method further includes: the digital currency issuance registration terminal verifies the digital currency wallet server signature and/or the wallet terminal signature of the coin deposit instruction information;
在数字货币钱包服务端将所述存入去向币串列表存入服务端数字货币保管箱之前,数字货币钱包服务端验证所述数字货币发行登记端签名,并确认所述实际转移金额与所述存入去向币串列表金额一致。Before the digital currency wallet server stores the deposit-to-go currency list in the server-side digital currency safe, the digital currency wallet server verifies the signature of the digital currency issuance registration terminal, and confirms that the actual transfer amount is the same as the The amount deposited in the destination currency list is the same.
进一步的,所述转移结果信息还包括:找零去向币串列表;Further, the transfer result information also includes: a list of currency strings for change;
所述方法还包括:数字货币发行登记端根据实际转移金额生成找零去向币串列表;The method further includes: the digital currency issuance and registration terminal generates a change destination currency string list according to the actual transfer amount;
数字货币钱包终端收到存币结果信息后,确认所述实际转移金额等于作废的存入来源币串列表的金额与找零去向币串列表的金额的差,然后存入找零去向币串列表。After receiving the coin deposit result information, the digital currency wallet terminal confirms that the actual transfer amount is equal to the difference between the voided amount deposited in the source coin string list and the amount in the change destination coin string list, and then stores the change in the change destination coin string list .
进一步的,所述数字货币钱包终端包括:终端安全模块和合约功能执行模块,所述数字货币钱包终端根据用户的操作指令将存币指令信息发送给数字货币钱包服务端包括:Further, the digital currency wallet terminal includes: a terminal security module and a contract function execution module, and the digital currency wallet terminal sends the coin deposit instruction information to the digital currency wallet server according to the user's operation instruction, including:
合约功能执行模块接收用户的操作指令,然后根据该操作指令生成存币请求,并向终端安全模块发送该存币请求,所述存币请求包括:钱包终端标识和证书,所述用户的账户信息;The contract function execution module receives the user's operation instruction, then generates a coin deposit request according to the operation instruction, and sends the coin deposit request to the terminal security module. The coin deposit request includes: wallet terminal identification and certificate, the user's account information ;
终端安全模块向用户显示该存币请求,并在接收到用户输入的存币金额和确认信息后,对该存币请求进行签名,然后将存币请求发送给合约功能执行模块;The terminal security module displays the deposit request to the user, and after receiving the deposit amount and confirmation information input by the user, signs the deposit request, and then sends the deposit request to the contract function execution module;
合约功能执行模块验证终端安全模块的签名,根据存币金额和预定义的匹配策略匹配存入来源币串列表,然后生成所述存币指令信息并将所述存币指令信息发送给终端安全模块;The contract function execution module verifies the signature of the terminal security module, matches and stores the source currency string list according to the deposit amount and the predefined matching strategy, then generates the deposit instruction information and sends the deposit instruction information to the terminal security module ;
终端安全模块向用户显示所述存币指令信息,并在接收到用户的确认信息后,验证所述钱包终端标识和证书,然后对所述存币指令信息进行签名,将所述存币指令信息发送给合约功能执行模块;The terminal security module displays the coin deposit instruction information to the user, and after receiving the confirmation information from the user, verifies the wallet terminal identification and certificate, and then signs the coin deposit instruction information, and the coin deposit instruction information Sent to the contract function execution module;
合约功能执行模块验证终端安全模块的签名,然后将所述存币指令信息发送给所述数字货币钱包服务端;The contract function execution module verifies the signature of the terminal security module, and then sends the deposit instruction information to the digital currency wallet server;
所述确认所述实际转移金额等于作废的存入来源币串列表的金额与找零去向币串列表的金额的差,然后存入找零去向币串列表的步骤是由合约功能执行模块执行的。The confirming that the actual transfer amount is equal to the difference between the voided amount deposited in the source coin string list and the amount in the change destination coin string list, and then the step of depositing the change in the change destination coin string list is performed by the contract function execution module .
进一步的,数字货币钱包服务端包括:钱包服务模块、数字货币核心模块和账户核心模块,Further, the digital currency wallet server includes: a wallet service module, a digital currency core module and an account core module,
所述数字货币钱包服务端验证所述钱包终端签名包括:钱包服务模块接收所述存币指令信息,验证所述钱包终端签名;The verification of the wallet terminal signature by the digital currency wallet server includes: the wallet service module receives the coin deposit instruction information, and verifies the wallet terminal signature;
钱包服务模块将所述存币指令信息发送给数字货币核心模块;The wallet service module sends the deposit instruction information to the digital currency core module;
数字货币核心模块验证所述钱包终端的签名,然后对所述存币指令信息进行签名,并为所述存币指令信息添加服务端数字货币保管箱标识和证书以生成存币转移请求,将该存币转移请求发送给数字货币发行登记端;The digital currency core module verifies the signature of the wallet terminal, then signs the coin deposit instruction information, and adds the server-side digital currency safe deposit box identification and certificate to the coin deposit instruction information to generate a coin deposit transfer request. The deposit transfer request is sent to the digital currency issuance registration terminal;
所述验证数字货币发行登记端签名,并确认所述实际转移金额与所述存入去向币串列表金额一致,然后将所述存入去向币串列表存入服务端数字货币保管箱的步骤,是由数字货币核心模块执行的;The step of verifying the signature of the digital currency issuance and registration terminal, and confirming that the actual transfer amount is consistent with the amount of the deposit destination coin string list, and then depositing the deposit destination coin string list into the server-side digital currency safe deposit box, is executed by the digital currency core module;
所述数字货币钱包服务端根据所述实际转移金额入账所述用户的账户,并将包括账户信息的存币结果信息发送给数字货币钱包终端包括:The digital currency wallet server credits the user's account according to the actual transfer amount, and sends the deposit result information including the account information to the digital currency wallet terminal, including:
钱包服务模块接收数字货币核心模块转发的转移结果信息,并生成包括所述存币指令信息和实际转移金额的入账请求,将该入账请求发送给账户核心模块;The wallet service module receives the transfer result information forwarded by the digital currency core module, generates an account entry request including the coin deposit instruction information and the actual transfer amount, and sends the account entry request to the account core module;
所述确定所述钱包终端标识与预存储的所述用户的账户关联钱包标识一致,然后根据所述实际转移金额入账所述用户的账户的步骤,是由账户核心模块执行的;The step of determining that the wallet terminal identifier is consistent with the pre-stored wallet identifier associated with the user's account, and then crediting the user's account according to the actual transfer amount, is performed by the account core module;
所述数字货币钱包服务端生成入账结果信息,根据入账结果信息和转移结果信息生成存币结果信息以发送给数字货币钱包终端包括:The digital currency wallet server generates the account entry result information, and generates the deposit result information according to the account entry result information and the transfer result information to send to the digital currency wallet terminal, including:
账户核心模块生成入账结果信息,并将入账结果信息发送给钱包服务模块,所述入账结果信息包括:入账金额、入账账户、入账前余额、入账后余额;The account core module generates account entry result information, and sends the account entry result information to the wallet service module, where the account entry result information includes: entry amount, entry account, balance before entry, and balance after entry;
钱包服务模块根据所述入账结果信息和转移结果信息生成存币结果信息,并将存币结果信息发送给数字货币钱包终端。The wallet service module generates the deposit result information according to the account entry result information and the transfer result information, and sends the deposit result information to the digital currency wallet terminal.
为实现上述目的,根据本发明实施例的一个方面,提供了一种基于数字货币钱包的存币系统,包括:In order to achieve the above purpose, according to an aspect of the embodiments of the present invention, a system for depositing coins based on a digital currency wallet is provided, including:
数字货币钱包终端,用于根据用户的操作指令将存币指令信息发送给数字货币钱包服务端,所述存币指令信息包括:存入来源币串列表、存入金额以及数字货币钱包服务端标识;The digital currency wallet terminal is used to send the deposit instruction information to the digital currency wallet server according to the user's operation instruction, and the deposit instruction information includes: the deposit source currency string list, the deposit amount and the digital currency wallet server identifier ;
数字货币钱包服务端,用于为所述存币指令信息添加服务端数字货币保管箱标识以生成存币转移请求,并将该请求发送给数字货币发行登记端;The digital currency wallet server is used to add the server-side digital currency safe deposit box identifier to the deposit instruction information to generate a deposit transfer request, and send the request to the digital currency issuance and registration terminal;
数字货币发行登记端,用于响应所述请求,根据所述数字货币钱包服务端标识和服务端数字货币保管箱标识确认所述服务端数字货币保管箱属于所述存币指令的作为收款方的数字货币钱包服务端,然后基于存入金额和预定义的支付策略确定实际转移金额,并根据实际转移金额将所述存入来源币串列表作废,生成存入去向币串列表,将包含所述存入去向币串列表、实际转移金额的转移结果信息发送给数字货币钱包服务端;The digital currency issuance and registration terminal is used to respond to the request, and confirms that the server-side digital currency safe box belongs to the coin deposit instruction according to the digital currency wallet server-side identifier and the server-side digital currency safe deposit box identifier as the payee The digital currency wallet server, then determines the actual transfer amount based on the deposit amount and the predefined payment strategy, and invalidates the deposit source currency string list according to the actual transfer amount, and generates a deposit destination currency string list, which will contain all the Send the transfer result information of the deposit and destination currency string list and the actual transfer amount to the digital currency wallet server;
数字货币钱包服务端进一步用于将所述存入去向币串列表存入服务端数字货币保管箱,并根据所述实际转移金额对所述用户的账户进行入账,并生成入账结果信息,根据入账结果信息和转移结果信息生成存币结果信息以发送给数字货币钱包终端;The digital currency wallet server is further configured to store the deposit-to-go currency string list into the server-side digital currency safe deposit box, and credit the user's account according to the actual transfer amount, and generate credit result information. The result information and the transfer result information generate the deposit result information to send to the digital currency wallet terminal;
数字货币钱包终端进一步用于向所述用户展示存币结果信息。The digital currency wallet terminal is further configured to display the deposit result information to the user.
进一步的,所述存币指令信息还包括:钱包终端标识和钱包终端签名,所述存币转移请求还包括:数字货币钱包服务端签名,所述转移结果信息还包括:数字货币发行登记端签名;Further, the deposit instruction information further includes: wallet terminal identification and wallet terminal signature, the deposit transfer request further includes: digital currency wallet server signature, and the transfer result information further includes: digital currency issuance registration terminal signature ;
所述数字货币钱包服务端进一步用于在为所述存币指令信息添加服务端数字货币保管箱标识以生成存币转移请求之前,验证所述钱包终端签名;The digital currency wallet server is further configured to verify the wallet terminal signature before adding a server-side digital currency safe deposit box identifier to the deposit instruction information to generate a deposit transfer request;
所述数字货币钱包服务端进一步用于在将所述存入去向币串列表存入服务端数字货币保管箱之前,确定所述钱包终端标识与预存储的所述用户的账户关联钱包标识一致;The digital currency wallet server is further configured to determine that the wallet terminal identifier is consistent with the pre-stored wallet identifier associated with the user's account before depositing the deposit-to-go coin string list into the server-side digital currency safe;
所述数字货币发行登记端进一步用于在根据所述数字货币钱包服务端标识和服务端数字货币保管箱标识确认所述服务端数字货币保管箱属于作为所述存币指令的收款方的数字货币钱包服务端之前,验证数字货币钱包服务端签名和/或所述存币指令信息的钱包终端签名;The digital currency issuance registration terminal is further configured to confirm that the server-side digital currency safe deposit box belongs to the digital currency that is the payee of the coin deposit instruction according to the digital currency wallet server-side identifier and the server-side digital currency safe deposit box identifier. Before the currency wallet server, verify the digital currency wallet server signature and/or the wallet terminal signature of the deposit instruction information;
所述数字货币钱包服务端在将所述存入去向币串列表存入服务端数字货币保管箱之前,验证所述数字货币发行登记端签名,并确认所述实际转移金额与所述存入去向币串列表金额一致。The digital currency wallet server verifies the signature of the digital currency issuance and registration terminal, and confirms the actual transfer amount and the deposit destination before depositing the deposit destination currency string list into the server-side digital currency safe deposit box. The amount of the currency string list is the same.
进一步的,所述转移结果信息还包括:找零去向币串列表;Further, the transfer result information also includes: a list of currency strings for change;
所述数字货币发行登记端进一步用于根据实际转移金额生成找零去向币串列表;The digital currency issuance and registration terminal is further configured to generate a change destination currency string list according to the actual transfer amount;
所述数字货币钱包终端进一步用于在收到存币结果信息后,确认所述实际转移金额等于作废的存入来源币串列表的金额与找零去向币串列表的金额的差,然后存入找零去向币串列表。The digital currency wallet terminal is further configured to, after receiving the deposit result information, confirm that the actual transfer amount is equal to the difference between the voided amount deposited in the source coin string list and the amount in the change destination coin string list, and then deposit the List of currency strings where change goes.
进一步的,所述数字货币钱包终端包括:终端安全模块和合约功能执行模块,Further, the digital currency wallet terminal includes: a terminal security module and a contract function execution module,
合约功能执行模块用于接收用户的操作指令,然后根据该操作指令生成存币请求,并向终端安全模块发送该存币请求,所述存币请求包括:钱包终端标识和证书,所述用户的账户信息;The contract function execution module is used to receive the user's operation instruction, and then generate a coin deposit request according to the operation instruction, and send the coin deposit request to the terminal security module. The coin deposit request includes: wallet terminal identification and certificate, the user's account information;
终端安全模块用于向用户显示该存币请求,并在接收到用户输入的存币金额和确认信息后,对该存币请求进行签名,然后将存币请求发送给合约功能执行模块;The terminal security module is used to display the deposit request to the user, and after receiving the deposit amount and confirmation information input by the user, sign the deposit request, and then send the deposit request to the contract function execution module;
合约功能执行模块进一步用于验证终端安全模块的签名,根据存币金额和预定义的匹配策略匹配存入来源币串列表,然后生成所述存币指令信息并将所述存币指令信息发送给终端安全模块;The contract function execution module is further used to verify the signature of the terminal security module, match and deposit the source currency string list according to the deposit amount and the predefined matching strategy, and then generate the deposit instruction information and send the deposit instruction information to the Terminal security module;
终端安全模块进一步用于向用户显示所述存币指令信息,并在接收到用户的确认信息后,验证所述钱包终端标识和证书,然后对所述存币指令信息进行签名,将所述存币指令信息发送给合约功能执行模块;The terminal security module is further used to display the coin deposit instruction information to the user, and after receiving the confirmation information from the user, verify the wallet terminal identification and certificate, and then sign the coin deposit instruction information, and store the coin deposit instruction information. The currency instruction information is sent to the contract function execution module;
合约功能执行模块进一步用于验证终端安全模块的签名,然后将所述存币指令信息发送给所述数字货币钱包服务端;The contract function execution module is further configured to verify the signature of the terminal security module, and then send the deposit instruction information to the digital currency wallet server;
合约功能执行模块进一步用于接收存币结果信息,确认所述实际转移金额等于作废的存入来源币串列表的金额与找零去向币串列表的金额的差,然后存入找零去向币串列表。The contract function execution module is further configured to receive the deposit result information, confirm that the actual transfer amount is equal to the difference between the voided amount deposited in the source coin string list and the amount in the change destination coin string list, and then deposit the change into the change destination coin string list.
进一步的,所述数字货币钱包服务端包括:钱包服务模块、数字货币核心模块和账户核心模块,Further, the digital currency wallet server includes: a wallet service module, a digital currency core module and an account core module,
钱包服务模块用于接收所述存币指令信息,验证所述钱包终端签名,然后将所述存币指令信息发送给数字货币核心模块;The wallet service module is used for receiving the coin deposit instruction information, verifying the wallet terminal signature, and then sending the coin deposit instruction information to the digital currency core module;
数字货币核心模块用于验证所述钱包终端签名,然后对所述存币指令信息进行签名,并为所述存币指令信息添加服务端数字货币保管箱标识和证书以生成存币转移请求,将该存币转移请求发送给数字货币发行登记端;The digital currency core module is used to verify the wallet terminal signature, then sign the deposit instruction information, and add the server-side digital currency safe deposit box identification and certificate to the deposit instruction information to generate a deposit transfer request, and The deposit transfer request is sent to the digital currency issuance and registration terminal;
数字货币核心模块进一步用于接收转移结果信息,验证数字货币发行登记端签名,并确认所述实际转移金额与所述存入去向币串列表金额一致,然后将所述存入去向币串列表存入服务端数字货币保管箱;The digital currency core module is further used to receive the transfer result information, verify the signature of the digital currency issuance and registration terminal, and confirm that the actual transfer amount is consistent with the amount of the deposit destination coin string list, and then store the deposit destination coin string list. into the server-side digital currency safe deposit box;
钱包服务模块进一步用于接收数字货币核心模块转发的转移结果信息,并生成包括所述存币指令信息和实际转移金额的入账请求,将该入账请求发送给账户核心模块;The wallet service module is further configured to receive the transfer result information forwarded by the digital currency core module, generate an account entry request including the coin deposit instruction information and the actual transfer amount, and send the account entry request to the account core module;
账户核心模块用于确定所述钱包终端标识与预存储的所述用户的账户关联钱包标识一致,然后根据所述实际转移金额入账所述用户的账户;The account core module is used to determine that the wallet terminal identifier is consistent with the pre-stored wallet identifier associated with the user's account, and then credit the user's account according to the actual transfer amount;
账户核心模块进一步用于生成入账结果信息,并将入账结果信息发送给钱包服务模块,所述入账结果信息包括:入账金额、入账账户、入账前余额、入账后余额;The account core module is further configured to generate account entry result information, and send the account entry result information to the wallet service module, where the account entry result information includes: entry amount, entry account, balance before entry, and balance after entry;
钱包服务模块进一步用于根据所述入账结果信息和转移结果信息生成存币结果信息,并将存币结果信息发送给数字货币钱包终端。The wallet service module is further configured to generate deposit result information according to the account entry result information and transfer result information, and send the deposit result information to the digital currency wallet terminal.
为实现上述目的,根据本发明实施例的一个方面,提供了一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现本发明实施例提供的基于数字货币钱包的存币方法。In order to achieve the above object, according to an aspect of the embodiments of the present invention, a computer-readable medium is provided, on which a computer program is stored, characterized in that, when the program is executed by a processor, the based on the embodiments of the present invention are implemented. The deposit method of digital currency wallet.
本发明实施例提供的基于数字货币钱包的存币方法和系统,实现了基于数字货币钱包的数字货币存币过程,具有较高的安全性,能很好的应用于现有金融服务和交易场景中。其中,在数字货币钱包终端、数字货币钱包服务端和数字货币发行登记端三者之间的交互过程中设置有多次签名和验证过程,以确保存币过程的安全性,并且数字货币钱包终端和数字货币钱包服务端充分利用了本地化安全技术,有效的提高了钱包和服务端数字货币系统以及账户系统的安全性。The method and system for depositing coins based on digital currency wallets provided by the embodiments of the present invention realize the process of depositing coins based on digital currency wallets, have high security, and can be well applied to existing financial services and transaction scenarios middle. Among them, multiple signature and verification processes are set up in the interaction process between the digital currency wallet terminal, the digital currency wallet server and the digital currency issuance and registration terminal to ensure the security of the deposit process, and the digital currency wallet terminal And digital currency wallet server makes full use of localized security technology, effectively improving the security of wallet and server digital currency system and account system.
上述的非惯用的可选方式所具有的进一步效果将在下文中结合具体实施方式加以说明。Further effects of the above non-conventional alternatives will be described below in conjunction with specific embodiments.
附图说明Description of drawings
附图用于更好地理解本发明,不构成对本发明的不当限定。其中:The accompanying drawings are used for better understanding of the present invention and do not constitute an improper limitation of the present invention. in:
图1是本发明实施例提供基于数字货币钱包的存币方法的主要流程的示意图;1 is a schematic diagram of the main process of providing a method for depositing coins based on a digital currency wallet according to an embodiment of the present invention;
图2是本发明实施例提供基于数字货币钱包的存币方法的数字货币钱包终端的主要流程的时序图;2 is a sequence diagram of a main process of a digital currency wallet terminal providing a digital currency wallet-based coin deposit method according to an embodiment of the present invention;
图3是本发明实施例提供基于数字货币钱包的存币方法的数字货币钱包服务端的主要流程的时序图;Fig. 3 is the sequence diagram of the main process of the digital currency wallet server providing the digital currency wallet-based coin deposit method according to the embodiment of the present invention;
图4是本发明实施例提供基于数字货币钱包的存币系统的主要模块的示意图;4 is a schematic diagram of the main modules of a coin deposit system based on a digital currency wallet provided by an embodiment of the present invention;
图5是本发明实施例提供基于数字货币钱包的存币系统的数字货币钱包终端、数字货币钱包服务端以及数字货币发行登记端的示意图。FIG. 5 is a schematic diagram of a digital currency wallet terminal, a digital currency wallet service terminal, and a digital currency issuance registration terminal of a digital currency wallet-based coin deposit system according to an embodiment of the present invention.
具体实施方式Detailed ways
以下结合附图对本发明的示范性实施例做出说明,其中包括本发明实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本发明的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding and should be considered as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
本发明实施例提供一种基于数字货币钱包的存币方法,该方法通过数字货币钱包终端、数字货币钱包服务端和数字货币发行登记端三者之间的交互,实现基于数字货币钱包的数字货币存币过程。其中,数字货币钱包终端提供数字货币钱包的相关业务功能,数字货币钱包终端同时还包括与数字货币安全相关的保障功能以及与可以用户进行交互的系统。The embodiment of the present invention provides a method for depositing coins based on a digital currency wallet, which realizes the digital currency based on the digital currency wallet through the interaction between the digital currency wallet terminal, the digital currency wallet server and the digital currency issuance and registration terminal. deposit process. Among them, the digital currency wallet terminal provides the relevant business functions of the digital currency wallet, and the digital currency wallet terminal also includes the security function related to the security of the digital currency and the system that can interact with the user.
数字货币钱包服务端(例如,可以为银行的数字货币管理系统)与账户系统(例如,银行账户系统)整合,提供钱包与账户兑换能力,对用户的账户及钱包进行管理。其中数字货币钱包服务端设置有数字货币保管箱,本发明提供的存币方法用来实现用户将自己的数字货币钱包中的数字货币存入数字货币钱包服务端的过程,存入数字货币钱包服务端的数字货币被保存在数字货币钱包服务端的数字货币保管箱中,同时,数字货币钱包服务端更新用户的账户并告知用户,从而实现数字货币的存币。The digital currency wallet server (for example, can be a bank's digital currency management system) is integrated with an account system (for example, a bank account system), provides wallet and account exchange capabilities, and manages user accounts and wallets. The digital currency wallet server is provided with a digital currency safe deposit box, and the coin deposit method provided by the present invention is used to realize the process of depositing the digital currency in the user's own digital currency wallet into the digital currency wallet server. The digital currency is stored in the digital currency safe deposit box of the digital currency wallet server. At the same time, the digital currency wallet server updates the user's account and informs the user, thereby realizing the deposit of the digital currency.
数字货币发行登记端为数字货币的发行登记机构,负责数字货币发行和回收,以及整个数字货币生命周期的相关登记。用户数字货币钱包终端中要存入数字货币钱包服务端的数字货币需先发至数字货币发行登记端进行作废,然后由数字货币发行登记端生成新的数字货币再存入数字货币钱包服务端。The digital currency issuance and registration terminal is the issuance and registration agency of the digital currency, responsible for the issuance and recycling of the digital currency, as well as the related registration of the entire digital currency life cycle. The digital currency that needs to be deposited into the digital currency wallet server in the user's digital currency wallet terminal needs to be sent to the digital currency issuance and registration terminal for invalidation, and then the digital currency issuance and registration terminal generates new digital currency and then deposits it into the digital currency wallet server.
如图1所示,本发明提供的基于数字货币钱包的存币方法包括:步骤S101至步骤S105。其中,在步骤S101中数字货币钱包终端根据用户的操作指令将存币指令信息发送给数字货币钱包服务端,存币指令信息包括:存入来源币串列表、存入金额以及数字货币钱包服务端标识等。数字货币钱包服务端标识用于在后续步骤中由数字货币发行登记端进行存入数字货币的数字货币保管箱的验证。然后,在步骤S102中,数字货币钱包服务端收到存币指令信息后发起数字货币转移操作,数字货币钱包服务端为存币指令信息添加服务端数字货币保管箱标识以生成存币转移请求,并将该请求发送给数字货币发行登记端。As shown in FIG. 1 , the method for depositing coins based on a digital currency wallet provided by the present invention includes steps S101 to S105. Wherein, in step S101, the digital currency wallet terminal sends the coin deposit instruction information to the digital currency wallet server according to the user's operation instruction, and the coin deposit instruction information includes: the deposit source coin string list, the deposit amount, and the digital currency wallet server. identification, etc. The digital currency wallet server identification is used for verification of the digital currency safe deposit box in which the digital currency is deposited by the digital currency issuance and registration terminal in the subsequent steps. Then, in step S102, the digital currency wallet server initiates a digital currency transfer operation after receiving the coin deposit instruction information, and the digital currency wallet server adds the server-side digital currency safe box identifier to the coin deposit instruction information to generate a coin deposit transfer request, And send the request to the digital currency issuance registration terminal.
在步骤S103中,数字货币发行登记端响应请求,对存入数字货币的数字货币保管箱进行验证:根据数字货币钱包服务端标识和服务端数字货币保管箱标识确认服务端数字货币保管箱属于存币指令的作为收款方的数字货币钱包服务端,以防数字货币被转给恶意的第三方。验证通过后,数字货币发行登记端基于存入金额和预定义的支付策略确定实际转移金额,并根据实际转移金额将存入来源币串列表作废,生成存入去向币串列表,并在数字货币确权链上进行相应的登记和同步更新。然后将包含存入去向币串列表、实际转移金额的转移结果信息发送给数字货币钱包服务端。In step S103, the digital currency issuance and registration terminal responds to the request, and verifies the digital currency safe deposit box in which the digital currency is deposited: confirming that the server digital currency safe deposit box belongs to the storage terminal according to the digital currency wallet server identification and the server digital currency safe deposit box identification. The digital currency wallet server of the coin order as the payee to prevent the digital currency from being transferred to a malicious third party. After the verification is passed, the digital currency issuance and registration terminal determines the actual transfer amount based on the deposit amount and the pre-defined payment strategy, and invalidates the deposit source currency string list according to the actual transfer amount, generates a deposit destination currency string list, and records it in the digital currency. Corresponding registration and synchronization updates are carried out on the confirmation chain. Then, send the transfer result information including the list of the deposit to the currency string and the actual transfer amount to the digital currency wallet server.
在本发明中,预定义的支付策略根据具体应用场景进行设置,例如,支付策略可以为最大可能策略,即如果存币金额与收到有效数字货币字串金额不匹配时,取两者小者,尽可能完成此次支付操作,此时,数字货币发行登记端按存入金额核对存入来源币串列表金额,取两者中的小者,作为实际转移金额。或者,支付策略可以为最大精准策略,即如果存币金额大于收到有效数字货币字串列表金额时,则判定此次数字货币转移操作失败并返回。In the present invention, the predefined payment strategy is set according to the specific application scenario. For example, the payment strategy can be the maximum possible strategy, that is, if the amount of the deposited currency does not match the amount of the received valid digital currency string, the smaller of the two is taken. , to complete the payment operation as much as possible. At this time, the digital currency issuance and registration terminal checks the amount deposited in the source currency string list according to the deposited amount, and takes the smaller of the two as the actual transfer amount. Alternatively, the payment strategy can be the maximum precision strategy, that is, if the deposit amount is greater than the amount received in the valid digital currency string list, it is determined that the digital currency transfer operation has failed and returned.
在本发明实施例中,数字货币发行登记端确定实际转移金额后,当数字货币发行登记端收到有效的存入来源币串列表金额大于实际转移金额时,数字货币发行登记端根据实际转移金额生成找零去向币串列表,发回给用户的数字货币钱包终端。In the embodiment of the present invention, after the digital currency issuance and registration end determines the actual transfer amount, when the digital currency issuance and registration end receives a valid deposit source currency string list amount greater than the actual transfer amount, the digital currency issuance and registration end according to the actual transfer amount Generate a list of change destination currency strings and send them back to the user's digital currency wallet terminal.
在步骤S104中,数字货币钱包服务端将存入去向币串列表存入服务端数字货币保管箱,并根据实际转移金额对用户的账户进行入账,并生成入账结果信息,根据入账结果信息和转移结果信息生成存币结果信息以发送给数字货币钱包终端。最后,步骤S105,数字货币钱包终端根据存币结果信息向用户展示存币结果。In step S104, the digital currency wallet server stores the deposit and destination currency string list into the server-side digital currency safe deposit box, and credits the user's account according to the actual transfer amount, and generates the credit result information, according to the credit result information and transfer The result information generates deposit result information to send to the digital currency wallet terminal. Finally, in step S105, the digital currency wallet terminal displays the deposit result to the user according to the deposit result information.
本发明实施例提供的基于数字货币钱包的存币方法,通过上述步骤实现了基于数字货币钱包的数字货币存币过程,具有较高的安全性,能很好的应用于现有金融服务和交易场景中。The method for depositing coins based on a digital currency wallet provided by the embodiments of the present invention realizes the process of depositing coins based on a digital currency wallet through the above steps, has high security, and can be well applied to existing financial services and transactions in the scene.
在本发明实施例中,为了确保存币过程的安全性,在数字货币钱包终端、数字货币钱包服务端和数字货币发行登记端三者之间的交互过程中还设置有多次签名和验证过程如下。存币指令还包括:钱包终端标识和钱包终端签名,存币转移请求还包括:数字货币钱包服务端签名,转移结果信息还包括:数字货币发行登记端签名。In the embodiment of the present invention, in order to ensure the security of the coin deposit process, multiple signature and verification processes are also set in the interaction process between the digital currency wallet terminal, the digital currency wallet server, and the digital currency issuance and registration terminal. as follows. The deposit instruction further includes: wallet terminal identification and wallet terminal signature, the deposit transfer request further includes: the signature of the digital currency wallet server, and the transfer result information also includes: the signature of the digital currency issuance and registration terminal.
存币指令信息还包括:钱包终端标识和钱包终端签名。本发明中,签名是指数据电文中以电子形式所含、所附用于识别签名人身份并表明签名人认可其中内容的数据签名,其过程是根据特定算法处理待签名信息,输出一个可以唯一确认该信息合法性的数据标签,即签名。在步骤S102,数字货币钱包服务端为存币指令信息添加服务端数字货币保管箱标识以生成存币转移请求之前,数字货币钱包服务端需首先验证钱包终端签名的有效性,以确保存币指令信息是由钱包终端发出的,防止恶意第三方伪造该存币指令信息。若验证不通过,则不继续进行后续的存币步骤。The deposit instruction information also includes: wallet terminal identification and wallet terminal signature. In the present invention, a signature refers to a data signature contained in the data message in electronic form and attached to identify the signer's identity and indicate that the signer approves the content. The process is to process the information to be signed according to a specific algorithm, and output a unique A data tag that confirms the legitimacy of the information, that is, a signature. In step S102, before the digital currency wallet server adds the server-side digital currency safe deposit box identifier to the deposit instruction information to generate a deposit transfer request, the digital currency wallet server needs to first verify the validity of the wallet terminal signature to ensure the deposit instruction The information is sent by the wallet terminal to prevent malicious third parties from forging the deposit instruction information. If the verification fails, the subsequent deposit steps will not be continued.
在步骤S104,数字货币钱包服务端将存入去向币串列表存入服务端数字货币保管箱之前,数字货币钱包服务端确定钱包终端标识与预存储的用户的账户关联钱包标识一致。即数字货币钱包服务端在对账户进行入账之前需先确定,入账的账户为发起本次存币过程的钱包终端的用户的账户。In step S104, before the digital currency wallet server stores the deposit destination currency string list in the server's digital currency safe, the digital currency wallet server determines that the wallet terminal identifier is consistent with the pre-stored wallet identifier associated with the user's account. That is, the digital currency wallet server needs to determine the account before entering the account, and the account entered is the account of the user of the wallet terminal that initiated the deposit process.
在步骤S103,数字货币发行登记端在根据数字货币钱包服务端标识和服务端数字货币保管箱标识确认服务端数字货币保管箱属于存币指令的作为收款方的数字货币钱包服务端之前,数字货币发行登记端需先验证数字货币钱包服务端签名和/或存币指令信息的钱包终端签名,以确保存币转移请求和存币指令信息的合法性,防止恶意第三方伪造或修改存币转移请求和存币指令信息。若验证不通过,则不继续进行后续的存币步骤。In step S103, before the digital currency issuance and registration terminal confirms that the server-side digital currency safe deposit box belongs to the digital currency wallet server serving as the payee of the coin deposit instruction according to the digital currency wallet server identification and the server digital currency safe deposit box identification, the digital currency The currency issuance and registration terminal must first verify the signature of the digital currency wallet server and/or the wallet terminal signature of the deposit instruction information to ensure the legitimacy of the deposit transfer request and the deposit instruction information, and prevent malicious third parties from forging or modifying the deposit transfer. Request and deposit instruction information. If the verification fails, the subsequent deposit steps will not be continued.
在步骤S104,数字货币钱包服务端将存入去向币串列表存入服务端数字货币保管箱之前,数字货币钱包服务端需先验证数字货币发行登记端签名,并确认实际转移金额与存入去向币串列表金额一致。以确保转移结果信息是由数字货币发行登记端发出的,防止恶意第三方伪造该转移结果信息。若验证不通过,或金额不一致,则不继续进行后续的存币步骤。In step S104, before the digital currency wallet server stores the deposit destination currency string list into the server-side digital currency safe, the digital currency wallet server needs to verify the signature of the digital currency issuance registration terminal, and confirm the actual transfer amount and the deposit destination. The amount of the currency string list is the same. In order to ensure that the transfer result information is issued by the digital currency issuance and registration terminal, and prevent malicious third parties from forging the transfer result information. If the verification fails, or the amount is inconsistent, the subsequent deposit steps will not be continued.
当数字货币发行登记端根据实际转移金额生成找零去向币串列表,在数字货币钱包终端收到带有找零去向币串列表的存币结果信息后,需确认实际转移金额等于作废的存入来源币串列表的金额与找零去向币串列表的金额的差,以确保存入金额和找零金额的正确,然后存入找零去向币串列表。When the digital currency issuance and registration terminal generates a list of change destination coin strings according to the actual transfer amount, after the digital currency wallet terminal receives the coin deposit result information with the change destination coin string list, it needs to confirm that the actual transfer amount is equal to the voided deposit. The difference between the amount in the source currency string list and the amount in the change destination currency string list is to ensure that the deposit amount and the change amount are correct, and then deposit the change in the change destination currency string list.
更为具体的,在本发明实施例中,如图2所示,数字货币钱包终端包括:终端安全模块和合约功能执行模块。在数字货币钱包终端中,终端安全模块和合约功能执行模块具有不同的分工,合约功能执行模块负责处理数字货币钱包相关的业务,终端安全模块负责处理与安全相关的操作,比如密钥的绑定及签名、验签等。数字货币钱包终端与用户的交互过程必须要经由终端安全模块,以确保安全。More specifically, in the embodiment of the present invention, as shown in FIG. 2 , the digital currency wallet terminal includes: a terminal security module and a contract function execution module. In the digital currency wallet terminal, the terminal security module and the contract function execution module have different divisions of labor. The contract function execution module is responsible for processing digital currency wallet-related business, and the terminal security module is responsible for processing security-related operations, such as key binding. and signature, verification, etc. The interaction process between the digital currency wallet terminal and the user must go through the terminal security module to ensure security.
通过终端安全模块和合约功能执行模块之间的交互以及与用户的交互实现步骤S101的过程,具体为:首先,合约功能执行模块经由终端安全模块接收用户的操作指令,例如,用户通过钱包终端提供的交互系统输入想要存币的操作指令,合约功能执行模块根据该操作指令生成存币请求,并向终端安全模块发送该存币请求,存币请求包括:钱包终端标识和证书,用户的账户信息。The process of step S101 is implemented through the interaction between the terminal security module and the contract function execution module and the interaction with the user, specifically: first, the contract function execution module receives the user's operation instruction via the terminal security module, for example, the user provides the user through the wallet terminal. The interactive system inputs the operation instruction for depositing coins, the contract function execution module generates a deposit request according to the operation instruction, and sends the deposit request to the terminal security module. The deposit request includes: the wallet terminal identification and certificate, the user's account information.
终端安全模块向用户显示该存币请求,终端安全模块通过交互系统将存币界面显示给用户,例如提供输入存币金额的输入框,向用户显示当前的账户信息等。用户可以在存币界面输入金额并通过点击确认,终端安全模块在接收到用户输入的存币金额和确认信息后,对该存币请求用钱包密钥进行签名,然后将存币请求发送给合约功能执行模块。The terminal security module displays the deposit request to the user, and the terminal security module displays the deposit interface to the user through the interactive system, such as providing an input box for inputting the deposit amount, and displaying the current account information to the user. The user can enter the amount on the deposit interface and click to confirm. After receiving the deposit amount and confirmation information input by the user, the terminal security module signs the deposit request with the wallet key, and then sends the deposit request to the contract. Function execution module.
合约功能执行模块验证终端安全模块的签名,若验证不通过,则不进行后续步骤,若验证通过,根据存币金额和预定义的匹配策略匹配存入来源币串列表,然后生成存币指令信息,将存币指令信息发送给终端安全模块。存币指令信息包括钱包终端标识和证书,数字货币钱包服务端标识,存入来源币串列表列表,存入金额,入账账户信息等。在具体实施过程中,可以根据实际的应用需要选择匹配策略,匹配策略可以作为合约功能执行模块提供的功能,由用户指定,或系统自动推荐。例如,当想要用存入最大的数字货币字串,希望找零时,则可应用最少币串列表策略,当希望把零钱存入时,则可应用最多币串列表策略,当希望存入的数字货币字串与存入金额尽量接近时,应用最少差额策略。The contract function execution module verifies the signature of the terminal security module. If the verification fails, the subsequent steps are not performed. If the verification is passed, it is matched and stored in the source currency string list according to the deposit amount and the predefined matching strategy, and then the deposit instruction information is generated. , and send the deposit instruction information to the terminal security module. The deposit instruction information includes wallet terminal identification and certificate, digital currency wallet server identification, deposit source currency string list list, deposit amount, account information and so on. In the specific implementation process, the matching strategy can be selected according to the actual application needs. The matching strategy can be used as a function provided by the contract function execution module, specified by the user, or automatically recommended by the system. For example, when you want to deposit the largest digital currency string and want to get change, you can apply the least currency string list strategy, when you want to deposit change, you can apply the most currency string list strategy, when you want to deposit When the digital currency string is as close as possible to the deposit amount, the least difference strategy is applied.
终端安全模块向用户显示上述存币指令信息,并在接收到用户的确认信息后,验证钱包终端标识和证书,然后对存币指令信息进行签名,将存币指令信息发送给合约功能执行模块。合约功能执行模块验证终端安全模块的签名,将存币指令信息发送给数字货币钱包服务端。The terminal security module displays the above deposit instruction information to the user, and after receiving the user's confirmation information, verifies the wallet terminal identification and certificate, then signs the deposit instruction information, and sends the deposit instruction information to the contract function execution module. The contract function execution module verifies the signature of the terminal security module, and sends the deposit instruction information to the digital currency wallet server.
本发明实施例提供的数字货币钱包终端,处理数字货币业务的合约功能执行模块与用户的交互过程必须要经由终端安全模块,终端安全模块在向合约功能执行模块进行涉及存币过程的通信时,都要进行签名-验证以确保安全,从而充分利用了本地化安全技术,有效的提高了钱包的安全性。In the digital currency wallet terminal provided by the embodiment of the present invention, the interaction process between the contract function execution module processing the digital currency business and the user must go through the terminal security module. When the terminal security module communicates with the contract function execution module involving the deposit process, Both signature and verification are required to ensure security, thus making full use of localized security technology and effectively improving the security of the wallet.
在本发明实施例中,如图3所示,数字货币钱包服务端包括:钱包服务模块、数字货币核心模块和账户核心模块,在数字货币钱包服务端中,钱包服务模块、数字货币核心模块和账户核心模块具有不同的分工,钱包服务模块面向用户的钱包终端提供钱包相关服务,数字货币核心模块是数字货币钱包服务端数字货币业务的核心,其负责管理数字货币保管箱,账户核心模块负责管理用户的账户。In the embodiment of the present invention, as shown in FIG. 3 , the digital currency wallet server includes: a wallet service module, a digital currency core module and an account core module. In the digital currency wallet server, the wallet service module, the digital currency core module and The account core module has different divisions of labor. The wallet service module provides wallet-related services for the user's wallet terminal. The digital currency core module is the core of the digital currency business of the digital currency wallet server. It is responsible for managing the digital currency safe deposit box, and the account core module is responsible for management. User's account.
通过钱包服务模块和数字货币核心模块之间的交互以及与用户的钱包终端的交互实现步骤S102的过程,具体为:钱包服务模块接收钱包终端发来的存币指令信息,并验证钱包终端签名,若验证不通过,则不继续进行后续的步骤。然后,钱包服务模块发起数字货币转移操作,将存币指令信息发送给数字货币核心模块,数字货币核心模块验证钱包终端的签名,然后对存币指令信息进行签名,并为存币指令信息添加服务端数字货币保管箱标识和证书以生成存币转移请求,将该存币转移请求发送给数字货币发行登记端。数字货币保管箱标识和证书用于数字货币发行登记端验证数字货币保管箱的有效性和合法性,从而通过数字货币保管箱接收数字货币发行登记端发回的存入去向币串列表。The process of step S102 is implemented through the interaction between the wallet service module and the digital currency core module and the interaction with the user's wallet terminal, specifically: the wallet service module receives the deposit instruction information sent by the wallet terminal, and verifies the wallet terminal signature, If the verification fails, do not proceed to the subsequent steps. Then, the wallet service module initiates the digital currency transfer operation, and sends the deposit instruction information to the digital currency core module. The digital currency core module verifies the signature of the wallet terminal, then signs the deposit instruction information, and adds services for the deposit instruction information. The terminal digital currency safe box identification and certificate to generate a deposit transfer request, and send the deposit transfer request to the digital currency issuance and registration terminal. The digital currency safe deposit box identification and certificate are used by the digital currency issuance registration terminal to verify the validity and legality of the digital currency safe deposit box, so as to receive the deposit destination currency list sent back by the digital currency issuance registration terminal through the digital currency safe deposit box.
通过钱包服务模块、数字货币核心模块和账户核心模块之间的交互以及与用户的钱包终端的交互实现步骤S104的过程,具体为:数字货币核心模块接收数字货币发行登记端返回的转移结果信息,例如,转移结果信息可以包括:转移状态(成功或失败),实际转移金额、转入数字货币钱包服务端数字货币保管箱的存入去向币串列表列表,以及找回钱包终端的找零去向币串列表列表等。数字货币核心模块验证数字货币发行登记端签名,并确认实际转移金额与存入去向币串列表金额一致,然后将存入去向币串列表存入服务端数字货币保管箱。The process of step S104 is realized through the interaction between the wallet service module, the digital currency core module and the account core module, and the interaction with the user's wallet terminal, specifically: the digital currency core module receives the transfer result information returned by the digital currency issuance and registration terminal, For example, the transfer result information may include: the transfer status (success or failure), the actual transfer amount, the list of the deposit and destination coins transferred to the digital currency safe deposit box of the digital currency wallet server, and the change destination coins of the wallet terminal. list of strings, etc. The digital currency core module verifies the signature of the digital currency issuance and registration terminal, and confirms that the actual transfer amount is consistent with the amount deposited in the destination coin list, and then stores the deposited destination coin list into the server-side digital currency safe.
钱包服务模块在接收到钱包终端发来的存币指令信息后,可对存币指令信息进行保存。钱包服务模块接收数字货币核心模块转发的转移结果信息,验证转移结果信息中的转移金额与保存的存币指令信息中的存币金额一致,然后生成包括存币指令信息和实际转移金额的入账请求,将该入账请求发送给账户核心模块。若转移结果信息中的转移金额与保存的存币指令信息中的存币金额不一致,则可进行后续的调账等相应处理。After receiving the coin deposit instruction information sent by the wallet terminal, the wallet service module can save the coin deposit instruction information. The wallet service module receives the transfer result information forwarded by the digital currency core module, verifies that the transfer amount in the transfer result information is consistent with the deposit amount in the stored deposit instruction information, and then generates an account entry request including the deposit instruction information and the actual transfer amount , and send the account entry request to the account core module. If the transfer amount in the transfer result information is inconsistent with the deposit amount in the stored deposit instruction information, the subsequent account adjustment and other corresponding processing can be performed.
账户核心模块收到入账请求后,判断钱包终端标识与预存储的用户的账户关联钱包标识是否一致,若一致,则根据实际转移金额对用户的账户进行入账,入账完成后,账户核心模块生成入账结果信息,并将入账结果信息发送给钱包服务模块,例如,入账结果信息可以包括:入账金额、入账账户、入账前余额、入账后余额等。After receiving the account entry request, the account core module determines whether the wallet terminal identifier is consistent with the pre-stored user's account associated wallet identifier. If they are consistent, the user's account is credited according to the actual transfer amount. After the credit is completed, the account core module generates an entry. The result information, and the account result information is sent to the wallet service module. For example, the account result information may include: the account amount, the account account, the balance before the account, the balance after the account, etc.
钱包服务模块根据入账结果信息和转移结果信息生成存币结果信息,并将存币结果信息发送给数字货币钱包终端。其中,由于存入去向币串列表已存入数字货币钱包服务端数字货币保管箱,所以存币结果信息中不携带该存入去向币串列表。The wallet service module generates the deposit result information according to the account entry result information and the transfer result information, and sends the deposit result information to the digital currency wallet terminal. Among them, since the deposit destination coin string list has been stored in the digital currency safe deposit box of the digital currency wallet server, the deposit destination coin string list is not carried in the deposit result information.
钱包终端合约功能执行模块接收该存币结果信息,并验证其中的数字货币发行登记端签名,以及验证其中的实际转移金额是否等于作废存入来源币串列表的金额与找零去向币串列表的金额的差。若存币结果信息没有找零去向币串列表,则验证实际转移金额是否等于作废的存入来源币串列表的金额。其中,作废的存入来源币串列表的金额信息可以由转移结果信息携带,从数字货币发行登记端发送至钱包终端合约功能执行模块,也可以由其他方式预保存在钱包终端合约功能执行模块。The wallet terminal contract function execution module receives the coin deposit result information, and verifies the signature of the digital currency issuance registration terminal, and verifies whether the actual transfer amount is equal to the amount of the voided deposit in the source coin string list and the change destination coin string list. difference in amount. If the coin deposit result information does not have the change destination coin string list, verify whether the actual transfer amount is equal to the voided amount deposited in the source coin string list. Among them, the amount of information that is voided and deposited in the source currency string list can be carried by the transfer result information, sent from the digital currency issuance and registration terminal to the wallet terminal contract function execution module, or can be pre-stored in the wallet terminal contract function execution module by other means.
若验证没有问题,则合约功能执行模块将找零去向币串列表存入钱包终端,并通过钱包终端交互系统向用户展示该存币结果信息,例如通过存币界面将转移状态(成功或失败)、实际转移金额、存入去向币串列表列表,以及找回钱包终端的找零去向币串列表列表、账户的入账金额、入账账户、入账前余额以及入账后余额进行显示,从而让用户了解存币的交易明细。If there is no problem in the verification, the contract function execution module will store the list of change destination currency strings in the wallet terminal, and display the deposit result information to the user through the wallet terminal interactive system, such as the transfer status (success or failure) through the deposit interface. , the actual transfer amount, the list of the deposit to the currency string, and the list of the currency string of the change destination of the wallet terminal, the account's credit amount, the credit account, the balance before credit and the balance after credit are displayed, so that users can understand the deposit. Coin transaction details.
本发明实施例还提供一种基于数字货币钱包的存币系统,如图4所示,该系统包括:数字货币钱包终端401,数字货币钱包服务端402和数字货币发行登记端403。其中,数字货币钱包终端401用于根据用户的操作指令将存币指令信息发送给数字货币钱包服务端,存币指令信息包括:存入来源币串列表、存入金额以及数字货币钱包服务端标识等。The embodiment of the present invention also provides a coin deposit system based on a digital currency wallet, as shown in FIG. Among them, the digital
数字货币钱包服务端402用于为存币指令信息添加服务端数字货币保管箱标识以生成存币转移请求,并将该请求发送给数字货币发行登记端。The digital
数字货币发行登记端403用于响应请求,根据数字货币钱包服务端标识和服务端数字货币保管箱标识确认服务端数字货币保管箱属于数字货币钱包服务端,然后基于存入金额和预定义的匹配策略确定实际转移金额,并根据实际转移金额将存入来源币串列表作废,生成存入去向币串列表,将包含存入去向币串列表、实际转移金额的转移结果信息发送给数字货币钱包服务端。The digital currency
数字货币钱包服务端402还用于将存入去向币串列表存入服务端数字货币保管箱,并根据实际转移金额对用户的账户进行入账,并生成入账结果信息,根据入账结果信息和转移结果信息生成存币结果信息以发送给数字货币钱包终端。The digital
数字货币钱包终端401还用于根据存币结果信息向用户展示存币结果。The digital
在本发明实施例中,存币指令还包括:钱包终端标识和钱包终端签名,存币转移请求还包括:数字货币钱包服务端签名,转移结果信息还包括:数字货币发行登记端签名。In the embodiment of the present invention, the deposit instruction further includes a wallet terminal identification and a wallet terminal signature, the deposit transfer request further includes a digital currency wallet server signature, and the transfer result information further includes a digital currency issuance and registration terminal signature.
数字货币钱包服务端进一步用于在为存币指令信息添加服务端数字货币保管箱标识以生成存币转移请求之前,验证钱包终端签名。The digital currency wallet server is further configured to verify the wallet terminal signature before adding the server-side digital currency safe deposit box identifier to the deposit instruction information to generate the deposit transfer request.
数字货币钱包服务端进一步用于在将存入去向币串列表存入服务端数字货币保管箱之前,确定钱包终端标识与预存储的用户的账户关联钱包标识一致。The digital currency wallet server is further configured to determine that the wallet terminal identifier is consistent with the pre-stored wallet identifier associated with the user's account before storing the deposit-to-go currency string list in the server-side digital currency safe.
数字货币发行登记端进一步用于在根据数字货币钱包服务端标识和服务端数字货币保管箱标识确认服务端数字货币保管箱属于数字货币钱包服务端之前,验证数字货币钱包服务端签名和/或所述存币指令信息的钱包终端签名。The digital currency issuance registration terminal is further used to verify the digital currency wallet server signature and/or all signatures before confirming that the server digital currency safe deposit box belongs to the digital currency wallet server according to the digital currency wallet server identification and the server digital currency safe deposit box identification. The wallet terminal signature of the deposit instruction information.
数字货币钱包服务端进一步用于将存入去向币串列表存入服务端数字货币保管箱之前,验证数字货币发行登记端签名,并确认实际转移金额与存入去向币串列表金额一致。The digital currency wallet server is further used to verify the signature of the digital currency issuance and registration terminal before depositing the deposit-to-go coin list into the server-side digital currency safe, and to confirm that the actual transfer amount is consistent with the amount deposited in the destination coin-string list.
在本发明实施例中,转移结果信息还包括:找零去向币串列表。数字货币发行登记端还用于根据实际转移金额生成找零去向币串列表。数字货币钱包终端还用于收到存币结果信息后,确认实际转移金额等于作废的存入来源币串列表的金额与找零去向币串列表的金额的差。In this embodiment of the present invention, the transfer result information further includes: a list of currency strings for change. The digital currency issuance and registration terminal is also used to generate a list of change destination currency strings according to the actual transfer amount. The digital currency wallet terminal is also used to confirm that the actual transfer amount is equal to the difference between the amount deposited in the source coin string list and the amount in the change destination coin string list after receiving the coin deposit result information.
在本发明实施例中,如图5所示,数字货币钱包终端包括:终端安全模块和合约功能执行模块。终端安全模块通过交互系统与用户交互,采集用户的操作指令,并向用户展示需要用户本人确认签名的信息,合约功能执行模块用于通过终端安全模块接收用户的操作指令,然后根据该操作指令生成存币请求,并向终端安全模块发送该存币请求,存币请求包括:钱包终端标识和证书,用户的账户信息。In the embodiment of the present invention, as shown in FIG. 5 , the digital currency wallet terminal includes: a terminal security module and a contract function execution module. The terminal security module interacts with the user through the interactive system, collects the user's operation instructions, and displays to the user information that requires the user's own signature to confirm. A coin deposit request is sent to the terminal security module. The coin deposit request includes: wallet terminal identification and certificate, and user account information.
终端安全模块用于通过交互系统向用户显示该存币请求,并在通过交互系统接收到用户输入的存币金额和确认信息后,对该存币请求进行签名,然后将存币请求发送给合约功能执行模块。The terminal security module is used to display the deposit request to the user through the interactive system, and after receiving the deposit amount and confirmation information input by the user through the interactive system, sign the deposit request, and then send the deposit request to the contract Function execution module.
合约功能执行模块用于验证终端安全模块的签名,根据存币金额和预定义的匹配策略匹配存入来源币串列表,然后生成存币指令信息,将存币指令信息发送给终端安全模块。The contract function execution module is used to verify the signature of the terminal security module, match and deposit the source currency string list according to the deposit amount and the predefined matching strategy, then generate the deposit instruction information, and send the deposit instruction information to the terminal security module.
终端安全模块进一步用于向用户显示存币指令信息,并在接收到用户的确认信息后,验证钱包终端标识和证书,然后对存币指令信息进行签名,将存币指令信息发送给合约功能执行模块。The terminal security module is further used to display the deposit instruction information to the user, and after receiving the confirmation information from the user, verify the wallet terminal identification and certificate, then sign the deposit instruction information, and send the deposit instruction information to the contract function execution. module.
合约功能执行模块用于验证终端安全模块的签名,将签名后的存币指令信息发送给数字货币钱包服务端。The contract function execution module is used to verify the signature of the terminal security module, and send the signed deposit instruction information to the digital currency wallet server.
合约功能执行模块进一步用于接收存币结果信息,当存在找零去向币串列表时,确认实际转移金额等于作废的存入来源币串列表的金额与找零去向币串列表的金额的差,然后存入找零去向币串列表。The contract function execution module is further used to receive the deposit result information, and when there is a change destination currency string list, confirm that the actual transfer amount is equal to the difference between the voided amount deposited in the source currency string list and the change destination currency string list. Then deposit the change destination currency string list.
在本发明实施例中,数字货币钱包服务端包括:钱包服务模块、数字货币核心模块和账户核心模块。钱包服务模块用于接收存币指令信息,验证钱包终端签名,然后将存币指令信息发送给数字货币核心模块。In the embodiment of the present invention, the digital currency wallet server includes: a wallet service module, a digital currency core module and an account core module. The wallet service module is used to receive the deposit instruction information, verify the wallet terminal signature, and then send the deposit instruction information to the digital currency core module.
数字货币核心模块用于验证钱包终端的签名,然后对存币指令信息进行签名,并为存币指令信息添加服务端数字货币保管箱标识和证书以生成存币转移请求,将该存币转移请求发送给数字货币发行登记端。The digital currency core module is used to verify the signature of the wallet terminal, then sign the deposit instruction information, and add the server-side digital currency safe deposit box identification and certificate to the deposit instruction information to generate a deposit transfer request, and the deposit transfer request Sent to the digital currency issuance registration terminal.
数字货币核心模块进一步用于接收转移结果信息,验证数字货币发行登记端签名,并确认实际转移金额与存入去向币串列表金额一致,然后将存入去向币串列表存入服务端数字货币保管箱。The digital currency core module is further used to receive the transfer result information, verify the signature of the digital currency issuance registration terminal, and confirm that the actual transfer amount is consistent with the amount deposited in the destination currency string list, and then store the deposited destination currency string list in the server for digital currency custody. box.
钱包服务模块进一步用于接收数字货币核心模块转发的转移结果信息,并生成包括存币指令信息和实际转移金额的入账请求,将该入账请求发送给账户核心模块。The wallet service module is further configured to receive the transfer result information forwarded by the digital currency core module, and generate a credit request including the deposit instruction information and the actual transfer amount, and send the credit request to the account core module.
账户核心模块用于确定钱包终端标识与预存储的用户的账户关联钱包标识一致,然后根据实际转移金额入账用户的账户。The account core module is used to determine that the wallet terminal identifier is consistent with the pre-stored user's account associated wallet identifier, and then credit the user's account according to the actual transfer amount.
账户核心模块进一步用于生成入账结果信息,并将入账结果信息发送给钱包服务模块,入账结果信息包括:入账金额、入账账户、入账前余额、入账后余额。The account core module is further used to generate the account result information, and send the account result information to the wallet service module, and the account result information includes: the account amount, the account account, the balance before the account, and the balance after the account.
钱包服务模块进一步用于根据入账结果信息和转移结果信息生成存币结果信息,并将存币结果信息发送给数字货币钱包终端。The wallet service module is further configured to generate the deposit result information according to the account entry result information and the transfer result information, and send the deposit result information to the digital currency wallet terminal.
上述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711470888.5ACN108229954B (en) | 2017-12-28 | 2017-12-28 | A method and system for depositing coins based on a digital currency wallet |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711470888.5ACN108229954B (en) | 2017-12-28 | 2017-12-28 | A method and system for depositing coins based on a digital currency wallet |
| Publication Number | Publication Date |
|---|---|
| CN108229954A CN108229954A (en) | 2018-06-29 |
| CN108229954Btrue CN108229954B (en) | 2020-11-03 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711470888.5AActiveCN108229954B (en) | 2017-12-28 | 2017-12-28 | A method and system for depositing coins based on a digital currency wallet |
| Country | Link |
|---|---|
| CN (1) | CN108229954B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109242482A (en)* | 2018-07-31 | 2019-01-18 | 北京比特大陆科技有限公司 | A kind of method and apparatus for realizing the integration of digital cash transaction record |
| CN109636601B (en)* | 2018-11-30 | 2023-04-07 | 无锡井通网络科技有限公司 | Digital asset management system |
| CN110852730B (en)* | 2019-10-23 | 2024-01-26 | 中国人民银行数字货币研究所 | Transaction processing method and device based on digital currency and electronic equipment |
| CN110838061A (en)* | 2019-10-31 | 2020-02-25 | 支付宝(杭州)信息技术有限公司 | Digital currency account control method and device |
| CN116185807A (en)* | 2021-11-26 | 2023-05-30 | 中国人民银行数字货币研究所 | A testing method, device and system for digital currency offline transactions |
| CN114612085A (en)* | 2022-01-30 | 2022-06-10 | 广州运通数达科技有限公司 | Digital currency medium, payment method and payment system supporting smart contracts |
| CN116562870B (en)* | 2022-01-30 | 2024-12-13 | 中国人民银行数字货币研究所 | A digital currency transaction method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107330784B (en)* | 2017-06-26 | 2020-11-03 | 中国人民银行数字货币研究所 | Method and system for exchanging digital currency |
| CN107330692B (en)* | 2017-06-26 | 2022-05-24 | 中国人民银行数字货币研究所 | Digital currency circulation method and device |
| CN107358436B (en)* | 2017-06-26 | 2020-12-29 | 中国人民银行数字货币研究所 | Method and system for accessing authenticated digital currency wallet payment through bank account |
| Publication number | Publication date |
|---|---|
| CN108229954A (en) | 2018-06-29 |
| Publication | Publication Date | Title |
|---|---|---|
| CN108229954B (en) | A method and system for depositing coins based on a digital currency wallet | |
| US12229826B2 (en) | Cryptocurrency-cash gateway | |
| US12388619B2 (en) | System and method for authorizing transactions in an authorized member network | |
| JP6242809B2 (en) | Electronic check-based payment system and method for issuing, transferring, paying and verifying electronic checks | |
| CN108229938B (en) | A method and system for opening a digital currency wallet | |
| US20170221053A1 (en) | Digital asset conversion | |
| CN108133369B (en) | Digital currency exchange method and system | |
| CN108256841A (en) | Actively turn the method, apparatus and system of coin | |
| CN107358436B (en) | Method and system for accessing authenticated digital currency wallet payment through bank account | |
| CN108335103A (en) | A kind of deducting money method and system based on digital cash | |
| CN107230072B (en) | Method and system for online payment using digital currency chip card | |
| CN112334938A (en) | Decentralized digital payment service system | |
| US20210374843A1 (en) | Debt Resource Management in a Distributed Ledger System | |
| CN111062717A (en) | Data transfer processing method and device and computer readable storage medium | |
| CN108197214A (en) | The querying method and inquiry system of digital cash Transaction Information | |
| CN108092778A (en) | Method and system based on digital cash wallet inquiry interlock account | |
| US20240257243A1 (en) | A system and method for trading cryptocurrencies, tokenized assets and/or fiat currencies on a single distributed ledger system with multiple issuing institutions | |
| JP2018088076A (en) | Settlement system, information processing unit, settlement method, and program | |
| KR102207653B1 (en) | System and method for deposit and withdrawal service using automated teller machine and computer program for the same | |
| CN108038678A (en) | The method and system that a kind of digital cash wallet is nullified | |
| CN107230299B (en) | Method and system for bank storage of digital currency | |
| CN107230300B (en) | Method and system for exchanging physical cash using digital currency chip card | |
| EP3489875A1 (en) | Device for payment of vehicle based costs, a respective vehicle and a respective method | |
| CN112446787A (en) | Resource transfer method, device, equipment and storage medium | |
| KR102375888B1 (en) | System for real name authentication based on passport and method for account transfer using the same |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |