A method and system for implementing a blockchain account system with master and sub-account attributes

By introducing the main sub-account attributes into the blockchain account system, the handling fee and storage problems caused by the collection operation are solved, more efficient account management is achieved and the storage burden of blockchain nodes is reduced.

CN112711638BActive Publication Date: 2025-01-10BEIJING YINGXIANG TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011631044.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2025-01-10
Estimated Expiration
2040-12-30

AI Technical Summary

Technical Problem

The collection operation in the existing blockchain account system increases the transfer fee and storage burden, and the account relationship is inconvenient for management.

Method used

A blockchain account system with the attributes of the main sub-accounts is used to create a main account as a fund pool account and create a sub-account of the main account for each user. The recharge and transfer operations are directly processed in the main account to generate the corresponding ledger records.

Benefits of technology

Reduced handling fees, reduced blockchain storage burden, and improved the convenience and controllability of account management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112711638B_ABST
    Figure CN112711638B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for implementing a blockchain account system with master-subaccount attributes. The method comprises the following steps: creating a master account and setting the master account as a fund pool account; creating a subaccount belonging to the master account according to the master account; responding to the recharge operation of the subaccount and transferring the recharged funds to the master account, and generating a book record corresponding to the recharged funds in the subaccount. The technical solution of the present invention can reduce the account content stored on the blockchain to a certain extent, reduce the number of transactions, and reduce the size of the blockchain node storage content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain account system method and system with master and sub-account attributes. Background Art

[0002] Blockchain technology is a new distributed infrastructure and computing method that uses block chain data structures to verify and store data, distributed node consensus algorithms to generate and update data, cryptography to ensure the security of data transmission and access, and smart contracts composed of automated script codes to program and operate data.

[0003] The current blockchain account system is mainly based on the UTXO model and the Ethereum account system.

[0004] Centralized exchanges will create an account on each blockchain for each user. Each account on the blockchain is independent. After the user creates an account on the platform, when performing a recharge operation, the assets will be recharged to the account created by the platform for the user. When the platform receives the assets recharged by the user, the assets recharged by the user will be transferred from the user account to the platform's fund pool account to ensure the normal operation of the platform's business (this step is the collection operation). When the user withdraws assets from the platform, it is actually transferred from the platform's fund pool account to the user's other accounts.

[0005] The inventors found that the existence of the aggregation operation not only increases the procedures and fees required for transfers, but also increases the account content, transaction volume, and blockchain node storage content stored on the blockchain. There is no clear relationship between accounts, making management inconvenient.

[0006] Therefore, it is necessary to provide a new blockchain account system method and system with master-sub-account attributes to solve the above technical problems. Summary of the invention

[0007] The main purpose of the present invention is to provide a blockchain account system method and system with master-sub-account attributes, aiming to solve the technical problems in related technologies that collection operations bring many inconveniences.

[0008] To achieve the above purpose, the present invention provides a method for implementing a blockchain account system with master and sub-account attributes, comprising the following steps:

[0009] Create a master account and set the master account as a fund pool account;

[0010] Creating a sub-account belonging to the main account according to the main account;

[0011] Respond to the recharge operation of the sub-account, remit the recharged funds to the main account, and generate a ledger record corresponding to the recharged funds in the sub-account.

[0012] Preferably, the method further comprises the following steps:

[0013] Responding to the transfer operation of the credit sub-account, and determining whether the credit sub-account and the debit sub-account belong to the same master account;

[0014] When the credit account and the debit sub-account belong to the same master account, a ledger record corresponding to the transferred funds is generated in both the credit account and the debit sub-account;

[0015] When the credit account and the debit sub-account do not belong to the same master account, the credit master account remits the transferred funds to the debit master account, and generates account book records corresponding to the transferred funds in both the credit sub-account and the debit sub-account.

[0016] Preferably, the method further comprises the following steps:

[0017] The address data of the primary account is obtained, and the corresponding primary account is retrieved according to the address data.

[0018] Preferably, the method further comprises the following steps:

[0019] The index information of the sub-account is obtained, and the corresponding sub-account is retrieved according to the index information.

[0020] Preferably, the method further comprises the following steps:

[0021] The balance data of the sub-account is obtained, and the account balance of the sub-account is obtained according to the balance data.

[0022] In order to solve the above technical problems, the present invention also provides a blockchain account system implementation system with master and sub-account attributes, including:

[0023] A master account creation module, which is used to create a master account and set the master account as a fund pool account;

[0024] A sub-account creation module, the sub-account creation module is used to create a sub-account belonging to the main account according to the main account;

[0025] A recharge module, the recharge module is used to respond to the recharge operation of the sub-account, and remit the recharge funds to the main account, and generate a ledger record corresponding to the recharge funds in the sub-account.

[0026] Preferably, it also includes a transfer module, and the transfer module is used to:

[0027] Responding to the transfer operation of the credit sub-account, and determining whether the credit sub-account and the debit sub-account belong to the same master account;

[0028] When the credit account and the debit sub-account belong to the same master account, a ledger record corresponding to the transferred funds is generated in both the credit account and the debit sub-account;

[0029] When the credit account and the debit sub-account do not belong to the same master account, the credit master account remits the transferred funds to the debit master account, and generates account book records corresponding to the transferred funds in both the credit sub-account and the debit sub-account.

[0030] Preferably, it further comprises a first retrieval module, wherein the first retrieval module is used to:

[0031] The address data of the primary account is obtained, and the corresponding primary account is retrieved according to the address data.

[0032] Preferably, it further comprises a second retrieval module, wherein the second retrieval module is used to:

[0033] The index information of the sub-account is obtained, and the corresponding sub-account is retrieved according to the index information.

[0034] Preferably, it also includes a query module, wherein the query module is used to:

[0035] The balance data of the sub-account is obtained, and the account balance of the sub-account is obtained according to the balance data.

[0036] The present invention provides a method and system for implementing a blockchain account system with master-sub-account attributes. A centralized exchange first creates a master account to be used as a fund pool account, and then creates an account for each user as a sub-account of the master account. After the user creates an account on the platform, when performing a recharge operation, the asset itself is transferred to the master account (i.e., the platform fund pool account), and there will also be a record on the sub-account (i.e., the user account), but only to indicate how much assets the user has.

[0037] This can effectively avoid the step from the user account to the platform fund pool account (there will be many steps in applications such as centralized exchanges). When users withdraw assets from the platform, they are transferred from the main account.

[0038] It can avoid the large number of aggregation operations that occur when exchanges or wallet applications are used in the current account system, reducing transaction fees; it can create associations between accounts and manage accounts in wallets more friendly; it can reduce the account content stored on the blockchain to a certain extent, reduce the number of transactions, and reduce the size of blockchain node storage content. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A flowchart of a first embodiment of a method for implementing a blockchain account system with master and sub-account attributes provided by the present invention;

[0040] Figure 2 A flowchart of a second embodiment of a method for implementing a blockchain account system with master and sub-account attributes provided by the present invention;

[0041] Figure 3 A flowchart of a third embodiment of a method for implementing a blockchain account system with master and sub-account attributes provided by the present invention;

[0042] Figure 4 An architectural diagram of a blockchain account system implementation system with master and sub-account attributes provided by the present invention.

[0043] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0045] To facilitate the understanding of the technical solution of the present invention, the relevant concepts are described as follows:

[0046] (1) Private key: A private key is a set of 64-bit hexadecimal characters. Through the private key, a user can access an account. The private key is generated using the secp256k1 elliptic curve algorithm. secp256k1 is an elliptic curve algorithm with the same algorithm principle as Bitcoin. The child private key is derived from the master private key and the child index number using the HMAC-SHA512 irreversible encryption algorithm. The algorithm principle is the same as that of Bitcoin's HD wallet to generate child private keys.

[0047] (2) Public key: The public key derived from the private key using the secp256k1 elliptic curve.

[0048] (3) Address: The address is divided into main account address and sub-account address.

[0049] The master account address is the hash value generated by the Keccak-256 algorithm using the master account public key and then taking the first 20 bytes;

[0050] The subaccount address is a hash value generated by the Keccak-256 algorithm after the master account public key, subaccount index, and subaccount public key are concatenated. The first 20 bytes are taken and the final form is master account address: subaccount index: subaccount address.

[0051] The present invention provides a method for implementing a blockchain account system with master and sub-account attributes.

[0052] See also Figure 1 To achieve the above purpose, in a first embodiment of the present invention, a method 100 for implementing a blockchain account system with master and sub-account attributes comprises the following steps:

[0053] S01, create a master account and set the master account as a fund pool account;

[0054] For example, if a main account is created, the generated main account address can be expressed in the style of 0x47ef4053dcc2867ccaf09585faab356bcaaedd85.

[0055] S02, creating a sub-account belonging to the main account according to the main account;

[0056] For example, two sub-accounts are created based on the master account, and the generated sub-account No. 1 index address can be expressed as:

[0057] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:1:0xff0aac63ea388872d7783e8c3cfd8981adbdf7a9.

[0058] The generated sub-account 2 index address can be expressed as:

[0059] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:2:0x44f03e4df61ae45258d9d267e853b5c238813307.

[0060] S03, responding to the recharge operation of the sub-account, transferring the recharged funds to the main account, and generating a ledger record corresponding to the recharged funds in the sub-account.

[0061] The present invention provides a method and system for implementing a blockchain account system with master-sub-account attributes. A centralized exchange first creates a master account to be used as a fund pool account, and then creates an account for each user as a sub-account of the master account. After the user creates an account on the platform, when performing a recharge operation, the asset itself is transferred to the master account (i.e., the platform fund pool account), and there will also be a record on the sub-account (i.e., the user account), but only to indicate how much assets the user has.

[0062] This can effectively avoid the step from the user account to the platform fund pool account (there will be many steps in applications such as centralized exchanges). When users withdraw assets from the platform, they are transferred from the main account.

[0063] It can avoid the large number of aggregation operations that occur when exchanges or wallet applications are used in the current account system, reducing transaction fees; it can create associations between accounts and manage accounts in wallets more friendly; it can reduce the account content stored on the blockchain to a certain extent, reduce the number of transactions, and reduce the size of blockchain node storage content.

[0064] Second embodiment

[0065] See also Figure 2 Based on the method 100 for implementing a blockchain account system with master-sub-account attributes provided by the first embodiment of the present invention, the second embodiment of the present invention provides another method 200 for implementing a blockchain account system with master-sub-account attributes, wherein steps S01 to S03 are the same and will not be described one by one herein. The difference is that the method further includes the following steps:

[0066] S04, responding to the transfer operation of the credit sub-account, and determining whether the credit sub-account and the debit sub-account belong to the same master account;

[0067] S05, when the credit account and the debit sub-account belong to the same master account, generating a ledger record corresponding to the transferred funds in both the credit account and the debit sub-account;

[0068] S06, when the credit account and the debit sub-account do not belong to the same master account, the credit master account transfers the transferred funds to the debit master account, and generates account book records corresponding to the transferred funds in both the credit sub-account and the debit sub-account.

[0069] It can be understood that in this embodiment, the credit side refers to the party that transfers out funds (sender), and the debit side refers to the party that receives funds (receiver).

[0070] For example, when a user transfers money, the sender is:

[0071] 0xbfda346bb93e9d9c546053de4d69bdd2c083ce63:1:0x1ad2467b1dac6a00054e6285464ea83266e0fed5.

[0072] The receiver is:

[0073] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:2:0x44f03e4df61ae45258d9d267e853b5c238813307.

[0074] Among them, the sender indicates that the main account is:

[0075] The first sub-account of 0xbfda346bb93e9d9c546053de4d69bdd2c083ce63.

[0076] The recipient is represented as the main account:

[0077] The second sub-account of 0x47ef4053dcc2867ccaf09585faab356bcaaedd85.

[0078] When constructing a transaction, you need to first sign with the private key of the sub-account and then sign with the private key of the main account.

[0079] When the node receives the transaction and executes it, the assets of the main account and the sub-account will increase and decrease accordingly. However, the assets of the sub-account are only used to indicate how much assets the sub-account has. The total balance of assets on the chain is based on the main account.

[0080] Third embodiment

[0081] See also Figure 3 Based on the method 200 for implementing a blockchain account system with master-sub-account attributes provided by the second embodiment of the present invention, the third embodiment of the present invention provides another method 300 for implementing a blockchain account system with master-sub-account attributes, wherein steps S01 to S06 are the same and will not be described one by one herein. The difference is that the method further includes the following steps:

[0082] S07, obtaining the address data of the primary account, and retrieving the corresponding primary account according to the address data.

[0083] S08, obtaining index information of the sub-account, and retrieving the corresponding sub-account according to the index information.

[0084] S09, obtaining the balance data of the sub-account, and obtaining the account balance of the sub-account according to the balance data.

[0085] Specifically, on-chain account storage: The on-chain account storage data structure is

[0086]

[0087] Among them, the Nonce field is used to avoid replay attacks. The account Nonce starts at 0. Each subsequent triggering of the account execution increases the Nonce value by 1. The transactions sent by the sub-account also increase by 1. The Balance field indicates the amount of assets owned by the main account and all sub-accounts, which is called the total balance of the account. The Root field is the hash value of the main account status. The ChildAccountInfo field is the balance information of all sub-accounts, with the sub-account index: the sub-account address concatenated into a string as the index key (the special case of the main account balance key is "0"), and the balance information corresponding to the sub-account is value.

[0088] Assume that the sender of a transaction is:

[0089] 0xbfda346bb93e9d9c546053de4d69bdd2c083ce63:1:0x1ad2467b1dac6a00054e6285464ea83266e0fed5;

[0090] The receiver is:

[0091] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:2:0x44f03e4df61ae45258d9d267e853b5c238813307, the transfer amount is 10.

[0092] When the node program receives and processes the transfer transaction, it subtracts 10 from the Balance field in the sender's main account 0xbfda346bb93e9d9c546053de4d69bdd2c083ce63;

[0093] The key in the ChildAccountInfo field of the subaccount balance information is:

[0094] 1: The value corresponding to 0x1ad2467b1dac6a00054e6285464ea83266e0fed5 minus 10;

[0095] Add 10 to the Balance field of the recipient's main account 0x47ef4053dcc2867ccaf09585faab356bcaaedd85;

[0096] The key in the ChildAccountInfo field of the subaccount balance information is:

[0097] 2: Add 10 to the value corresponding to 0x44f03e4df61ae45258d9d267e853b5c238813307.

[0098] When a user queries the total balance of an account, he can find the Balance field in the account information corresponding to the account through the main account address.

[0099] Check the balance of a sub-account.

[0100] For example:

[0101] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:2:0x44f03e4df61ae45258d9d267e853b5c238813307;

[0102] First, find the account information through the main account address 0x47ef4053dcc2867ccaf09585faab356bcaaedd85;

[0103] Then use 2:0x44f03e4df61ae45258d9d267e853b5c238813307 as the key index to get the value corresponding to the ChildAccountInfo field, which is the sub-account balance.

[0104] The present invention also provides a blockchain account system implementation system with master and sub-account attributes.

[0105] See also Figure 4 To achieve the above purpose, in one embodiment of the present invention, a blockchain account system with master and sub-account attributes is implemented, including:

[0106] A master account creation module, which is used to create a master account and set the master account as a fund pool account;

[0107] For example, if a main account is created, the generated main account address can be expressed in the style of 0x47ef4053dcc2867ccaf09585faab356bcaaedd85.

[0108] A sub-account creation module, the sub-account creation module is used to create a sub-account belonging to the main account according to the main account;

[0109] For example, two sub-accounts are created based on the master account, and the generated sub-account No. 1 index address can be expressed as:

[0110] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:1:0xff0aac63ea388872d7783e8c3cfd8981adbdf7a9.

[0111] The generated sub-account 2 index address can be expressed as:

[0112] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:2:0x44f03e4df61ae45258d9d267e853b5c238813307.

[0113] A recharge module, the recharge module is used to respond to the recharge operation of the sub-account, and remit the recharge funds to the main account, and generate a ledger record corresponding to the recharge funds in the sub-account.

[0114] As a preferred method of this embodiment, the blockchain account system with master-sub-account attributes further includes a transfer module, which is used to:

[0115] Responding to the transfer operation of the credit sub-account, and determining whether the credit sub-account and the debit sub-account belong to the same master account;

[0116] When the credit account and the debit sub-account belong to the same master account, a ledger record corresponding to the transferred funds is generated in both the credit account and the debit sub-account;

[0117] When the credit account and the debit sub-account do not belong to the same master account, the credit master account remits the transferred funds to the debit master account, and generates account book records corresponding to the transferred funds in both the credit sub-account and the debit sub-account.

[0118] It can be understood that in this embodiment, the credit side refers to the party that transfers out funds (sender), and the debit side refers to the party that receives funds (receiver).

[0119] For example, when a user transfers money, the sender is:

[0120] 0xbfda346bb93e9d9c546053de4d69bdd2c083ce63:1:0x1ad2467b1dac6a00054e6285464ea83266e0fed5,

[0121] The receiver is:

[0122] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:2:0x44f03e4df61ae45258d9d267e853b5c238813307.

[0123] Among them, the sender indicates that the main account is:

[0124] The first sub-account of 0xbfda346bb93e9d9c546053de4d69bdd2c083ce63.

[0125] The recipient is represented as the main account:

[0126] The second sub-account of 0x47ef4053dcc2867ccaf09585faab356bcaaedd85.

[0127] When constructing a transaction, you need to first sign with the private key of the sub-account and then sign with the private key of the main account.

[0128] When the node receives the transaction and executes it, the assets of the main account and the sub-account will increase and decrease accordingly. However, the assets of the sub-account are only used to indicate how much assets the sub-account has. The total balance of assets on the chain is based on the main account.

[0129] As a preferred method of this embodiment, the blockchain account system with master-sub-account attributes further includes a first retrieval module, which is used to:

[0130] The address data of the primary account is obtained, and the corresponding primary account is retrieved according to the address data.

[0131] The blockchain account system with master and sub-account attributes also includes a second search module, which is used to:

[0132] The index information of the sub-account is obtained, and the corresponding sub-account is retrieved according to the index information.

[0133] The blockchain account system with master and sub-account attributes also includes a query module, which is used to:

[0134] The balance data of the sub-account is obtained, and the account balance of the sub-account is obtained according to the balance data.

[0135] Specifically, on-chain account storage: The on-chain account storage data structure is

[0136]

[0137] Among them, the Nonce field is used to avoid replay attacks. The account Nonce starts at 0. Each subsequent triggering of the account execution increases the Nonce value by 1. The transactions sent by the sub-account also increase by 1. The Balance field indicates the amount of assets owned by the main account and all sub-accounts, which is called the total balance of the account. The Root field is the hash value of the main account status. The ChildAccountInfo field is the balance information of all sub-accounts, with the sub-account index: the sub-account address concatenated into a string as the index key (the special case of the main account balance key is "0"), and the balance information corresponding to the sub-account is value.

[0138] Assume that the sender of a transaction is:

[0139] 0xbfda346bb93e9d9c546053de4d69bdd2c083ce63:1:0x1ad2467b1dac6a00054e6285464ea83266e0fed5;

[0140] The receiver is:

[0141] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:2:0x44f03e4df61ae45258d9d267e853b5c238813307, the transfer amount is 10.

[0142] When the node program receives and processes the transfer transaction, it subtracts 10 from the Balance field in the sender's main account 0xbfda346bb93e9d9c546053de4d69bdd2c083ce63;

[0143] The key in the ChildAccountInfo field of the subaccount balance information is:

[0144] 1: The value corresponding to 0x1ad2467b1dac6a00054e6285464ea83266e0fed5 minus 10;

[0145] Add 10 to the Balance field of the recipient's main account 0x47ef4053dcc2867ccaf09585faab356bcaaedd85;

[0146] The key in the ChildAccountInfo field of the subaccount balance information is:

[0147] 2: Add 10 to the value corresponding to 0x44f03e4df61ae45258d9d267e853b5c238813307.

[0148] When a user queries the total balance of an account, he can find the Balance field in the account information corresponding to the account through the main account address.

[0149] Check the balance of a sub-account.

[0150] For example:

[0151] 0x47ef4053dcc2867ccaf09585faab356bcaaedd85:2:0x44f03e4df61ae45258d9d267e853b5c238813307;

[0152] First, find the account information through the main account address 0x47ef4053dcc2867ccaf09585faab356bcaaedd85;

[0153] Then use 2:0x44f03e4df61ae45258d9d267e853b5c238813307 as the key index to get the value corresponding to the ChildAccountInfo field, which is the sub-account balance.

[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device to enter the method described in each embodiment of the present invention.

[0155] In the description of this specification, the description with reference to the terms "an embodiment", "another embodiment", "other embodiments", or "first embodiment to Xth embodiment" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, method steps or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0156] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0157] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0158] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for implementing a blockchain account system with master and sub-account attributes, characterized in that: The steps include: Create a master account and set the master account as a fund pool account; Creating a sub-account belonging to the main account according to the main account; Responding to the recharge operation of the sub-account and transferring the recharged funds to the main account, generating a ledger record corresponding to the recharged funds in the sub-account; Obtain the address data of the primary account, and retrieve the corresponding primary account according to the address data; the primary account address is the hash value generated by the primary account public key through the Keccak-256 algorithm and then the first 20 bytes are taken; Obtain the index information of the sub-account, and retrieve the corresponding sub-account according to the index information; the sub-account address is the hash value generated by the Keccak-256 algorithm after the master account public key, sub-account index, and sub-account public key are concatenated, and then the first 20 bytes are taken. The final form is master account address: sub-account index: sub-account address; Obtaining the balance data of the sub-account, and obtaining the account balance of the sub-account according to the balance data; Specifically, on-chain account storage: The on-chain account storage data structure is type Account struct{ Nonce uint64 Balance*big.Int Root common.Hash ChildAccountInfo map[string]*big.Int } Among them, the Nonce field is used to avoid replay attacks. The account Nonce starts at 0. Each subsequent triggering of the account execution increases the Nonce value by 1. The transaction sent by the sub-account also increases by 1 at this point; the Balance field indicates the amount of assets owned by the master account and all the sub-accounts, which is called the total balance of the account; the Root field is the hash value of the master account status, and the ChildAccountInfo field is the balance information of all sub-accounts, with the sub-account index: the sub-account address concatenated into a string as the index key. The special case master account balance key is "0", and the corresponding balance information of the sub-account is value.

2. The method for implementing a blockchain account system with master and sub-account attributes as claimed in claim 1, characterized in that: The following steps are also included: Responding to the transfer operation of the credit sub-account, and determining whether the credit sub-account and the debit sub-account belong to the same master account; When the credit account and the debit sub-account belong to the same master account, a ledger record corresponding to the transferred funds is generated in both the credit account and the debit sub-account; When the credit account and the debit sub-account do not belong to the same master account, the credit master account remits the transferred funds to the debit master account, and generates account book records corresponding to the transferred funds in both the credit sub-account and the debit sub-account.

3. A blockchain account system with master and sub-account attributes, characterized in that: include: A master account creation module, which is used to create a master account and set the master account as a fund pool account; A sub-account creation module, the sub-account creation module is used to create a sub-account belonging to the main account according to the main account; A recharge module, the recharge module is used to respond to the recharge operation of the sub-account, remit the recharged funds to the main account, and generate a ledger record corresponding to the recharged funds in the sub-account; The invention also includes a first retrieval module, wherein the first retrieval module is used to: Obtain the address data of the primary account, and retrieve the corresponding primary account according to the address data; the primary account address is the hash value generated by the primary account public key through the Keccak-256 algorithm and then the first 20 bytes are taken; The invention also includes a second retrieval module, wherein the second retrieval module is used to: Obtain the index information of the sub-account, and retrieve the corresponding sub-account according to the index information; the sub-account address is the hash value generated by the Keccak-256 algorithm after the master account public key, sub-account index, and sub-account public key are concatenated, and then the first 20 bytes are taken. The final form is master account address: sub-account index: sub-account address; It also includes a query module, wherein the query module is used to: Obtaining the balance data of the sub-account, and obtaining the account balance of the sub-account according to the balance data; Specifically, on-chain account storage: The on-chain account storage data structure is type Account struct{ Nonce uint64 Balance*big.Int Root common.Hash ChildAccountInfo map[string]*big.Int } The Nonce field is used to prevent replay attacks. The account Nonce starts at 0. Each subsequent triggering of the account execution increases the Nonce value by 1. The transaction sent by the sub-account also increases by 1. The Balance field indicates the amount of assets owned by the main account and all the sub-accounts, which is called the total balance of the account. The Root field is the hash value of the master account status, and the ChildAccountInfo field is the balance information of all sub-accounts, with the sub-account index: the sub-account address concatenated into a string as the index key. The special case master account balance key is "0", and the corresponding balance information of the sub-account is value.

4. The blockchain account system with master and sub-account attributes as claimed in claim 3, characterized in that: It also includes a transfer module, which is used to: Responding to the transfer operation of the credit sub-account, and determining whether the credit sub-account and the debit sub-account belong to the same master account; When the credit account and the debit sub-account belong to the same master account, a ledger record corresponding to the transferred funds is generated in both the credit account and the debit sub-account; When the credit account and the debit sub-account do not belong to the same master account, the credit master account remits the transferred funds to the debit master account, and generates account book records corresponding to the transferred funds in both the credit sub-account and the debit sub-account.

Citation Information

Patent Citations

  • Fund pool management method and device

    CN108921691A

  • Financial system and digital currency hosting system with same

    CN111461682A