WO2021031473A1 - Blockchain asset processing method based on multiple asset models and related device - Google Patents

Blockchain asset processing method based on multiple asset models and related device Download PDF

Info

Publication number
WO2021031473A1
WO2021031473A1 PCT/CN2019/125619 CN2019125619W WO2021031473A1 WO 2021031473 A1 WO2021031473 A1 WO 2021031473A1 CN 2019125619 W CN2019125619 W CN 2019125619W WO 2021031473 A1 WO2021031473 A1 WO 2021031473A1
Authority
WO
WIPO (PCT)
Prior art keywords
account
asset
private key
data block
blockchain
Prior art date
Application number
PCT/CN2019/125619
Other languages
French (fr)
Chinese (zh)
Inventor
郭加楼
来鑫
陈磊
Original Assignee
深圳市网心科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市网心科技有限公司 filed Critical 深圳市网心科技有限公司
Publication of WO2021031473A1 publication Critical patent/WO2021031473A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3823Payment protocols; Details thereof insuring higher security of transaction combining multiple encryption tools for a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • the invention relates to the field of blockchain technology, in particular to a method, device, computer equipment and storage medium for processing blockchain assets based on a multi-asset model.
  • UTXO Unspent Transaction Output
  • users can have multiple UTXO assets, and transactions under the UTXO asset model can be executed concurrently, so the efficiency is higher.
  • UTXO asset model it is very difficult for UTXO asset model to directly implement Turing-complete smart contracts.
  • the main purpose of the present invention is to provide a blockchain asset processing method, device, computer equipment and storage medium based on a multi-asset model, aiming at the technical problem of slow asset processing efficiency or fewer functions under a single asset model.
  • the first aspect of the present invention provides a blockchain asset processing method based on a multi-asset model, the method including:
  • the first account and/or the second account are used to store the acquired digital asset.
  • the generating the second private key of the second account of the user includes:
  • a predetermined random number generation algorithm is used to generate a second random number as the second private key.
  • the calculating and generating the first account address corresponding to the first account according to the first private key includes:
  • the calculating and generating the second account address corresponding to the second account according to the second private key includes:
  • using the first account and/or the second account to store the acquired digital asset includes:
  • the first account is an Account account
  • the second account is a UTXO account
  • the first account is a UTXO account
  • the second account is an Account account
  • the method further includes:
  • the method further includes:
  • a second aspect of the present invention provides a blockchain asset processing device based on a multi-asset model, the device comprising:
  • the request receiving module is used to receive the user's request to create a digital asset account
  • a first calculation module configured to generate a first private key of the user's first account, and calculate and generate a first account address corresponding to the first account according to the first private key;
  • the second calculation module is configured to generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account according to the second private key, wherein the second account is the same as the The first account is based on different asset models;
  • the asset storage module is configured to use the first account and/or the second account to store the acquired digital assets when digital assets are acquired.
  • a third aspect of the present invention provides a computer device, the computer device includes a memory and a processor, the memory stores a multi-asset model-based blockchain that can run on the processor A download program for asset processing, which implements the method for processing blockchain assets based on the multi-asset model when the download program for processing blockchain assets based on the multi-asset model is executed by the processor.
  • the fourth aspect of the present invention provides a computer-readable storage medium storing a download program for blockchain asset processing based on a multi-asset model.
  • the download program for blockchain asset processing can be executed by one or more processors to implement the described blockchain asset processing method based on the multi-asset model.
  • the blockchain asset processing method, device, computer equipment and storage medium based on the multi-asset model described in the embodiment of the present invention can integrate the advantages of each asset model by generating account addresses for accounts of different asset models, allowing users Mixed use of its own multiple assets to achieve functions such as asset privacy transactions.
  • the multi-asset model makes the system more scalable and brings a better transaction experience to users.
  • FIG. 1 is a schematic flowchart of a blockchain asset processing method based on a multi-asset model according to a first embodiment of the present invention
  • FIG. 2 is a schematic diagram of functional modules of a blockchain asset processing device based on a multi-asset model according to a second embodiment of the present invention
  • Fig. 3 is a schematic diagram of the internal structure of a computer device according to a third embodiment of the present invention.
  • FIG. 1 is a flowchart of a blockchain asset processing method based on a multi-asset model disclosed in the first embodiment of the present invention.
  • the blockchain asset processing method based on the multi-asset model is applied to a blockchain system, and the blockchain system may include a plurality of consensus nodes, and the consensus node refers to the consensus that participates in the consensus of the blockchain data block Node device.
  • Each consensus node can be connected through a communication link, such as a wired communication link or a wireless communication link, etc., and multiple consensus nodes together form a blockchain network. It should be understood that the number of graph consensus nodes is only illustrative. According to implementation needs, there can be any number of consensus nodes.
  • the multi-model-based blockchain asset processing method provided by the embodiments of the present invention is generally executed by consensus nodes in the blockchain network. Accordingly, the multi-model-based blockchain asset processing device is generally set in the blockchain network In the consensus node.
  • the blockchain asset processing method based on the multi-asset model specifically includes the following steps. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted.
  • a blockchain digital wallet is installed in the consensus node.
  • the blockchain digital wallet is a software program that can generate and save the key and digital wallet address of the blockchain, and can access the consensus node
  • blockchain transactions can be sent and received, and blockchain transaction messages sent by users can be digitally signed with keys.
  • the digital wallet address represents a unique public key broadcast to all nodes in the blockchain system, and the private key is stored in the consensus node.
  • the user can create at least two digital asset accounts in the blockchain digital wallet.
  • the at least two digital asset accounts include two or more digital asset accounts, and different digital asset accounts correspond to different asset models.
  • the user creates two digital asset accounts in the blockchain digital wallet: the first account and the second account. If the first account is an Account account, then the second account is a UTXO account; or, if the first account is a UTXO account, then the second account is an Account account.
  • the Account account is based on the Account asset model, and the UTXO account is based on the UTXO asset model.
  • the user's total assets are the sum of assets under the asset model owned by the user, and multiple assets can be used alone or at the same time to conduct corresponding transactions.
  • S12 Generate a first private key of the user's first account, and calculate and generate a first account address corresponding to the first account according to the first private key.
  • the blockchain digital wallet when the user creates the first account through the blockchain digital wallet, the blockchain digital wallet will randomly generate a private key.
  • the consensus node can calculate the account address of the first account according to the randomly generated private key.
  • the calculating and generating the first account address corresponding to the first account according to the first private key includes:
  • the consensus node may call the SECP256K1 package to calculate the private key to generate a public key.
  • SECP256K1 refers to the Elliptic Curve Digital Signature Algorithm (ECDSA) used in Bitcoin.
  • EDSA Elliptic Curve Digital Signature Algorithm
  • the public key can be calculated through a known private key, but the private key cannot be calculated backward when the public key is known. , To ensure the safety of Bitcoin.
  • the using the first hash value as the first account address of the first account includes:
  • the RACE Integrity Primitives Evaluation Message Digest (RIPEMD) algorithm is used to calculate the public key to generate a public key hash, and the one-byte address version number is connected to the header of the public key hash , And then perform two hash (for example, SHA256) operations on the public key hash, use the first 4 bytes of the result as the check value of the public key hash, connect it to the tail of the public key hash, and then use Bitcoin BASE58 Encode, you can get the account address.
  • SHA256 hash
  • SECP256K1 the RIPEMD, BASE58, etc. are all existing technologies, and the present invention will not be described in detail here.
  • S13 Generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account according to the second private key.
  • the blockchain digital wallet when a user creates a second account through the blockchain digital wallet, the blockchain digital wallet will also randomly generate a private key.
  • the consensus node can calculate and generate the account address of the second account according to the randomly generated private key.
  • the generating the second private key of the user's second account includes:
  • a predetermined random number generation algorithm is used to generate a second random number as the second private key.
  • the consensus node may use a mapping algorithm, for example, a hash mapping, to map the first private key to obtain a new private key as the second private key. Mapping the private key to obtain a new private key is a prior art and will not be described in the present invention.
  • the consensus node may also randomly generate a number as the second private key through the blockchain digital wallet.
  • the calculating and generating the second account address corresponding to the second account according to the second private key includes:
  • the process of calculating and generating the second account address corresponding to the second account according to the second private key is the same as the process of calculating and generating the first account address corresponding to the first account according to the first private key.
  • the process of calculating and generating the second account address corresponding to the second account by the second private key will not be described in detail. For details, please refer to the process of calculating and generating the first account address corresponding to the first account according to the first private key and related descriptions. .
  • the digital assets may include mining rewards obtained from mining and transaction fees obtained from transactions, and the consensus node stores the digital assets after obtaining them.
  • using the first account and/or the second account to store the acquired digital asset includes:
  • the consensus node may display all created accounts to the user in the form of a list option, and the user selects an account on the list option as the account for storing the acquired digital assets.
  • the consensus node will store the acquired digital assets in the UTXO or Account.
  • the consensus node stores the acquired digital assets in the Account account as UTXO or Account.
  • the method further includes:
  • a data block is divided into two parts, namely "block header” and "block body".
  • the block header is used to record some descriptive information, and the block body is used to record " Transaction" list.
  • the block header includes six fields, which are the version number, the hash value of the previous block, the Merkel root, the preset difficulty value, the timestamp, and the random number to be found.
  • the mining process is to perform a series of conversions, connections and hash operations on the above six fields, and successfully find a random number that meets the conditions: the value after the hash operation is higher than the hash value of the preset difficulty value Small, then mining is successful.
  • the consensus node performs mining on the blockchain network, and after successfully digging a newly generated data block in the blockchain network, the data block is stored.
  • the blockchain system will issue a certain amount of tokens as mining rewards to consensus nodes that have successfully mined. In addition to obtaining mining rewards, consensus nodes can also obtain transaction fees corresponding to all transaction information in the data block.
  • the data block generated after the previous synchronization or subscribing to the data block is determined as the newly generated data block, and the blockchain digital wallet can periodically synchronize or subscribe to the newly generated data block on the block chain and execute it.
  • the method further includes:
  • the preset threshold is a preset threshold used to evaluate whether the data block is consensus completed.
  • the number of consensus nodes required to complete the consensus of the data block is different, that is, the preset threshold is set according to the blockchain system. For example, in the Bitcoin system, if the number of consensus nodes participating in the consensus reaches 51% of the entire consensus node, the consensus on the data block can be considered complete; otherwise, when the number of consensus nodes participating in the consensus is less than that of the entire consensus node At 51%, it is considered that the consensus on the data block has failed.
  • the number of consensus nodes participating in the consensus reaches 2/3 of the entire consensus node before the consensus on the data block can be considered complete; otherwise, the consensus node participating in the consensus When the number is less than 2/3 of the entire consensus node, it is considered that the consensus on the data block has failed.
  • the consensus node broadcasts the data block to other consensus nodes on the blockchain network, and performs a consensus on the data block through other consensus nodes to verify whether the data block is valid.
  • the consensus node stores the data block.
  • the consensus of the data block fails, it indicates that the data block is invalid, and the consensus node does not store the data block.
  • the consensus node can also detect whether the transaction data in the data block fails to be written into the storage space. If the transaction data is written If the storage space fails, you can rewrite it.
  • the transfer-in account can be a transfer Account address or UTXO address of the incoming party.
  • the contract address of this blockchain system uses the Account address.
  • the smart contract is executed directly; for UTXO account transactions, or UTXO account hybrid account account transactions, when calling the contract, the UTXO account transaction needs to be converted into the input message of the smart contract before executing the smart contract.
  • the service fee consumed can be refunded to the Account or UTXO account in the form of Account or UTXO.
  • the blockchain asset processing method based on the multi-asset model described in this embodiment can integrate the advantages of each asset model by generating account addresses for accounts of different asset models, allowing users to mix their own multiple assets to achieve Asset privacy transactions and other functions, the multi-asset model makes the system more scalable and brings users a better transaction experience.
  • FIG. 2 is a schematic diagram of functional modules of a blockchain asset processing device based on a multi-asset model disclosed in Embodiment 2 of the present invention.
  • the blockchain asset processing device 20 based on the multi-asset model runs in a resource server.
  • the block chain asset processing device 20 based on the multi-asset model may include multiple functional modules composed of download programs.
  • the program code of each download program in the multi-asset model-based blockchain asset processing device 20 can be stored in the memory of the computer device and executed by the at least one processor to execute (see Figure 1 for details) ) All or part of the steps in the blockchain asset processing method based on the multi-asset model.
  • the multi-asset model-based blockchain asset processing device 20 can be divided into multiple functional modules according to the functions it performs.
  • the functional modules may include: request receiving module 201, first calculation module 202, second calculation module 203, asset storage module 204, block acquisition module 205, asset refresh module 206, asset display module 207, and block consensus module 208 .
  • the module referred to in the present invention refers to a series of download programs that can be executed by at least one processor and can complete fixed functions, and are stored in a memory. In this embodiment, the function of each module will be described in detail in subsequent embodiments.
  • the request receiving module 201 is configured to receive a user's request to create a digital asset account.
  • a blockchain digital wallet is installed in the consensus node.
  • the blockchain digital wallet is a software program that can generate and save the key and digital wallet address of the blockchain, and can access the consensus node
  • blockchain transactions can be sent and received, and blockchain transaction messages sent by users can be digitally signed with keys.
  • the digital wallet address represents a unique public key broadcast to all nodes in the blockchain system, and the private key is stored in the consensus node.
  • the user can create at least two digital asset accounts in the blockchain digital wallet.
  • the at least two digital asset accounts include two or more digital asset accounts, and different digital asset accounts correspond to different asset models.
  • the user creates two digital asset accounts in the blockchain digital wallet: the first account and the second account. If the first account is an Account account, then the second account is a UTXO account; or, if the first account is a UTXO account, then the second account is an Account account.
  • the Account account is based on the Account asset model, and the UTXO account is based on the UTXO asset model.
  • the user's total assets are the sum of assets under the asset model owned by the user, and multiple assets can be used alone or at the same time to conduct corresponding transactions.
  • the first calculation module 202 is configured to generate a first private key of the user's first account, and calculate and generate a first account address corresponding to the first account according to the first private key.
  • the blockchain digital wallet when the user creates the first account through the blockchain digital wallet, the blockchain digital wallet will randomly generate a private key.
  • the consensus node can calculate the account address of the first account according to the randomly generated private key.
  • the first calculation module 202 calculating and generating the first account address corresponding to the first account according to the first private key includes:
  • the consensus node may call the SECP256K1 package to calculate the private key to generate a public key.
  • SECP256K1 refers to the Elliptic Curve Digital Signature Algorithm (ECDSA) used in Bitcoin.
  • EDSA Elliptic Curve Digital Signature Algorithm
  • the public key can be calculated through a known private key, but the private key cannot be calculated backward when the public key is known. , To ensure the safety of Bitcoin.
  • the using the first hash value as the first account address of the first account includes:
  • the RACE Integrity Primitives Evaluation Message Digest (RIPEMD) algorithm is used to calculate the public key to generate a public key hash, and the one-byte address version number is connected to the header of the public key hash , And then perform two hash (for example, SHA256) operations on the public key hash, use the first 4 bytes of the result as the check value of the public key hash, connect it to the tail of the public key hash, and then use Bitcoin BASE58 Encode, you can get the account address.
  • SHA256 hash
  • SECP256K1 the RIPEMD, BASE58, etc. are all existing technologies, and the present invention will not be described in detail here.
  • the second calculation module 203 is configured to generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account according to the second private key.
  • the blockchain digital wallet when a user creates a second account through the blockchain digital wallet, the blockchain digital wallet will also randomly generate a private key.
  • the consensus node can calculate and generate the account address of the second account according to the randomly generated private key.
  • the second calculation module 203 generating the second private key of the user's second account includes:
  • a predetermined random number generation algorithm is used to generate a second random number as the second private key.
  • the consensus node may use a mapping algorithm, for example, a hash mapping, to map the first private key to obtain a new private key as the second private key. Mapping the private key to obtain a new private key is a prior art and will not be described in the present invention.
  • the consensus node may also randomly generate a number as the second private key through the blockchain digital wallet.
  • the second calculation module 203 calculating and generating the second account address corresponding to the second account according to the second private key includes:
  • the process of calculating and generating the second account address corresponding to the second account according to the second private key is the same as the process of calculating and generating the first account address corresponding to the first account according to the first private key.
  • the process of calculating and generating the second account address corresponding to the second account by the second private key will not be described in detail. For details, please refer to the process of calculating and generating the first account address corresponding to the first account according to the first private key and related descriptions. .
  • the asset storage module 204 is configured to use the first account and/or the second account to store the acquired digital assets when digital assets are acquired.
  • the digital assets may include mining rewards obtained from mining and transaction fees obtained from transactions, and the consensus node stores the digital assets after obtaining them.
  • using the first account and/or the second account to store the acquired digital assets includes:
  • the consensus node may display all created accounts to the user in the form of a list option, and the user selects an account on the list option as the account for storing the acquired digital assets.
  • the consensus node will store the acquired digital assets in the UTXO or Account.
  • the consensus node stores the acquired digital assets in the Account account as UTXO or Account.
  • the block chain asset processing device 20 based on the multi-asset model further includes:
  • the block acquisition module 205 is used for timing synchronization or subscribing to newly generated data blocks on the blockchain network;
  • the asset refresh module 206 is configured to use the private key corresponding to the UTXO account to filter out the UTXO in the newly generated data block when the asset in the data block is UTXO, and to filter the filtered UTXO Add to the UTXO account;
  • the asset refresh module 206 is further configured to obtain an Account in the newly generated data block when the asset in the data block is an Account, and add the obtained Account to the Account account;
  • the asset display module 207 is configured to display the face value of the UTXO account or the amount of the Account account.
  • a data block is divided into two parts, namely "block header” and "block body".
  • the block header is used to record some descriptive information, and the block body is used to record " Transaction" list.
  • the block header includes six fields, which are the version number, the hash value of the previous block, the Merkel root, the preset difficulty value, the timestamp, and the random number to be found.
  • the mining process is to perform a series of conversions, connections and hash operations on the above six fields, and successfully find a random number that meets the conditions: the value after the hash operation is higher than the hash value of the preset difficulty value Small, then mining is successful.
  • the consensus node performs mining on the blockchain network, and after successfully mining a newly generated data block in the blockchain network, the data block is stored.
  • the blockchain system will issue a certain amount of tokens as mining rewards to consensus nodes that have successfully mined. In addition to obtaining mining rewards, consensus nodes can also obtain transaction fees corresponding to all transaction information in the data block.
  • the data block generated after the previous synchronization or subscribing to the data block is determined as the newly generated data block, and the blockchain digital wallet can periodically synchronize or subscribe to the newly generated data block on the block chain and execute it.
  • the block chain asset processing device 20 based on the multi-asset model further includes: a block consensus module 208 for:
  • the preset threshold is a preset threshold used to evaluate whether the data block is consensus completed.
  • the number of consensus nodes required to complete the consensus of the data block is different, that is, the preset threshold is set according to the blockchain system. For example, in the Bitcoin system, if the number of consensus nodes participating in the consensus reaches 51% of the entire consensus node, the consensus on the data block can be considered complete; otherwise, when the number of consensus nodes participating in the consensus is less than that of the entire consensus node At 51%, it is considered that the consensus on the data block has failed.
  • the number of consensus nodes participating in the consensus reaches 2/3 of the entire consensus node before the consensus on the data block can be considered complete; otherwise, the consensus node participating in the consensus When the number is less than 2/3 of the entire consensus node, it is considered that the consensus on the data block has failed.
  • the consensus node broadcasts the data block to other consensus nodes on the blockchain network, and performs a consensus on the data block through other consensus nodes to verify whether the data block is valid.
  • the consensus node stores the data block.
  • the consensus of the data block fails, it indicates that the data block is invalid, and the consensus node does not store the data block.
  • the consensus node can also detect whether the transaction data in the data block fails to be written into the storage space. If the transaction data is written If the storage space fails, you can rewrite it.
  • the transfer-in account can be a transfer Account address or UTXO address of the incoming party.
  • the contract address of this blockchain system uses the Account address.
  • the smart contract is executed directly; for the UTXO account transaction, or the UTXO account hybrid account account transaction, when calling the contract, the transaction of the UTXO account needs to be converted into the input message of the smart contract before executing the smart contract.
  • the service fee consumed can be refunded to the Account or UTXO account in the form of Account or UTXO.
  • the block chain asset processing device based on the multi-asset model described in this embodiment can integrate the advantages of each asset model by generating account addresses for accounts of different asset models, allowing users to mix their own multiple assets to achieve Asset privacy transactions and other functions, the multi-asset model makes the system more scalable and brings users a better transaction experience.
  • FIG. 3 is a schematic diagram of the internal structure of a computer device disclosed in an embodiment of the present invention.
  • the computer device 3 may be a consensus node, a resource server, or other electronic devices.
  • the computer device 3 may include a memory 31, a processor 32, and a bus 33.
  • the memory 31 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 31 may be an internal storage unit of the computer device 3 in some embodiments, such as a hard disk of the computer device 3.
  • the memory 31 may also be an external storage device of the computer device 3, for example, a plug-in hard disk equipped on the computer device 3, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital). Digital, SD) cards, flash cards, etc.
  • the memory 31 may also include both an internal storage unit of the computer device 3 and an external storage device.
  • the memory 31 can be used not only to store application programs and various data installed in the computer equipment 3, such as download programs of the blockchain asset processing device 20 based on the multi-asset model, and various modules, but also to temporarily store Data that has been output or will be output.
  • the processor 32 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments, and is used to run the download program or processing stored in the memory 31 data.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor or other data processing chip in some embodiments, and is used to run the download program or processing stored in the memory 31 data.
  • the bus 33 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus, etc.
  • only one thick line is used in FIG. 3 to represent, but it does not mean that there is only one bus or one type of bus.
  • the computer device 3 may also include a network interface.
  • the network interface may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to connect the computer device 3 with other Establish a communication connection between computer devices.
  • a wireless interface such as a WI-FI interface, a Bluetooth interface, etc.
  • the computer device 3 may also include a user interface.
  • the user interface may include a display (Display) and an input unit such as a keyboard (Keyboard).
  • the optional user interface may also include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an organic light-emitting diode (OLED) touch device, and the like.
  • the display can also be called a display screen or a display unit as appropriate, and is used to display messages processed in the computer device and to display a visualized user interface.
  • FIG. 3 only shows the computer device 3 with components 31-33.
  • the structure shown in FIG. 3 does not constitute a limitation on the computer device 3, and may be a bus type
  • the structure may also be a star structure, and the computer device 3 may also include fewer or more components than shown in the figure, or a combination of certain components, or a different component arrangement. If other existing or future electronic products can be adapted to the present invention, they should also be included in the protection scope of the present invention and included here by reference.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website site, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line) or wireless (for example, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or application program functional unit.
  • the integrated unit is implemented in the form of an application functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of an application product, and the computer application product is stored in a storage
  • the medium includes a number of instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, hard disk, read-only memory (Read-Only Memory, ROM), magnetic disk or optical disk and other media that can store download programs.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Theoretical Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

Disclosed is a blockchain asset processing method based on multiple asset models, comprising: receiving a user's request for creating a digital asset account; generating a first private key of a first account of the user, and performing calculation according to the first private key to generate a first account address corresponding to the first account; generating a second private key of a second account of the user, and performing calculation according to the second private key to generate a second account address corresponding to the second account, wherein the second account and the first account are based on different asset models; and when obtaining a digital asset, storing the obtained digital asset by using the first account and/or the second account. Also disclosed is a blockchain asset processing apparatus based on multiple asset models, a computer device, and a storage medium. According to the present invention, by generating account addresses for the accounts of multiple asset models, a user can use multiple assets in combination, so that the efficiency is high and the expansibility is high.

Description

基于多资产模型的区块链资产处理方法及相关设备Blockchain asset processing method and related equipment based on multi-asset model
本申请要求于2019年08月20日提交中国专利局,申请号为201910769523.5、发明名称为“基于多资产模型的区块链资产处理方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on August 20, 2019. The application number is 201910769523.5 and the invention title is "Multi-asset model-based blockchain asset processing method and related equipment". The entire content of the Chinese patent application Incorporated in this application by reference.
技术领域Technical field
本发明涉及区块链术领域,尤其涉及一种基于多资产模型的区块链资产处理方法、装置、计算机设备及存储介质。The invention relates to the field of blockchain technology, in particular to a method, device, computer equipment and storage medium for processing blockchain assets based on a multi-asset model.
背景技术Background technique
在UTXO(Unspent Transaction Output,未花费的交易输出)资产模型下,用户可以有多笔UTXO资产,UTXO资产模型下的交易可以并发执行,因此效率更高。然而UTXO资产模型直接实现图灵完备的智能合约是非常困难的。Under the UTXO (Unspent Transaction Output) asset model, users can have multiple UTXO assets, and transactions under the UTXO asset model can be executed concurrently, so the efficiency is higher. However, it is very difficult for UTXO asset model to directly implement Turing-complete smart contracts.
将Account资产模型应用于区块链上,容易实现图灵完备的虚拟机,并且支持用图灵完备的语言去开发分散式的应用程序(Decentralized Application,DApp),能让区块链提供更复杂的功能。然而Account资产模型下用户资产被抽象为一个Account对象,因此无法并发执行多笔交易。Applying the Account asset model to the blockchain makes it easy to implement a Turing-complete virtual machine, and supports the use of Turing-complete language to develop decentralized applications (Decentralized Application, DApp), which can make the blockchain provide more complex Function. However, user assets under the Account asset model are abstracted as an Account object, so multiple transactions cannot be executed concurrently.
因此,有必要提供一种的新的区块链资产处理方案,以解决单一资产模型下的资产处理效率较慢或者功能较少的技术问题。Therefore, it is necessary to provide a new blockchain asset processing solution to solve the technical problems of slower asset processing efficiency or fewer functions under the single asset model.
发明内容Summary of the invention
本发明的主要目的在于提供一种基于多资产模型的区块链资产处理方法、装置、计算机设备及存储介质,旨在单一资产模型下的资产处理效率较慢或者功能较少的技术问题。The main purpose of the present invention is to provide a blockchain asset processing method, device, computer equipment and storage medium based on a multi-asset model, aiming at the technical problem of slow asset processing efficiency or fewer functions under a single asset model.
为实现上述目的,本发明的第一方面提供一种基于多资产模型的区块链资产处理方法,所述方法包括:To achieve the above objective, the first aspect of the present invention provides a blockchain asset processing method based on a multi-asset model, the method including:
接收用户创建数字资产账户的请求;Receive users' requests to create digital asset accounts;
生成所述用户的第一账户的第一私钥,并根据所述第一私钥计算生成对应所述第一账户的第一账户地址;Generating a first private key of the user's first account, and calculating and generating a first account address corresponding to the first account according to the first private key;
生成所述用户的第二账户的第二私钥,并根据所述第二私钥计算生成对应第二账户的第二账户地址,其中所述第二账户与所述第一账户基于不同的资产模型;Generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account based on the second private key, wherein the second account and the first account are based on different assets model;
当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产。When a digital asset is acquired, the first account and/or the second account are used to store the acquired digital asset.
根据本发明的一个可选实施例,所述生成所述用户的第二账户的第二私钥包括:According to an optional embodiment of the present invention, the generating the second private key of the second account of the user includes:
利用预定的映射算法对所述第一私钥进行映射计算,得到所述第二私钥;或者,Perform a mapping calculation on the first private key using a predetermined mapping algorithm to obtain the second private key; or,
利用预定的随机数生成算法生成第二随机数作为所述第二私钥。A predetermined random number generation algorithm is used to generate a second random number as the second private key.
根据本发明的一个可选实施例,所述根据所述第一私钥计算生成对应所述第一账户的第一账户地址包括:According to an optional embodiment of the present invention, the calculating and generating the first account address corresponding to the first account according to the first private key includes:
根据所述第一私钥计算生成第一公钥;Calculating and generating a first public key according to the first private key;
采用第一哈希函数计算所述第一公钥的第一哈希值;Calculating the first hash value of the first public key by using a first hash function;
将所述第一哈希值作为所述第一账户的第一账户地址。Use the first hash value as the first account address of the first account.
根据本发明的一个可选实施例,所述根据所述第二私钥计算生成对应第二账户的第二账户地址包括:According to an optional embodiment of the present invention, the calculating and generating the second account address corresponding to the second account according to the second private key includes:
根据所述第二私钥计算生成第二公钥;Calculating and generating a second public key according to the second private key;
采用第二哈希函数计算所述第一公钥的第二哈希值;Calculating the second hash value of the first public key by using a second hash function;
将所述第二哈希值作为所述第二账户的第二账户地址。Use the second hash value as the second account address of the second account.
根据本发明的一个可选实施例,所述当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产包括:According to an optional embodiment of the present invention, when a digital asset is acquired, using the first account and/or the second account to store the acquired digital asset includes:
显示所述第一账户及所述第二账户;Display the first account and the second account;
当接收用户对所述第一账户及所述第二账户的选定操作时,将用户选定的账户作为目标账户;When receiving the user's selection operation on the first account and the second account, use the account selected by the user as the target account;
利用所述目标账户存储所述获取到的数字资产。Use the target account to store the acquired digital asset.
根据本发明的一个可选实施例,所述第一账户为Account账户,所述第二账户为UTXO账户;或者,所述第一账户为UTXO账户,所述第二账户为Account账户。According to an optional embodiment of the present invention, the first account is an Account account, and the second account is a UTXO account; or, the first account is a UTXO account, and the second account is an Account account.
根据本发明的一个可选实施例,所述方法还包括:According to an optional embodiment of the present invention, the method further includes:
定时同步或订阅所述区块链网络上新生成的数据区块;Regularly synchronize or subscribe to newly generated data blocks on the blockchain network;
当所述数据区块中的资产为UTXO时,采用与所述UTXO账户对应的私钥过滤出所述新生成的数据区块中的UTXO,并将过滤出的UTXO添加至所述UTXO账户;When the asset in the data block is UTXO, use the private key corresponding to the UTXO account to filter out the UTXO in the newly generated data block, and add the filtered UTXO to the UTXO account;
当所述数据区块中的资产为Account时,获取所述新生成的数据区块中的Account,并将获取到的Account添加至所述Account账户中;When the asset in the data block is Account, obtain the Account in the newly generated data block, and add the obtained Account to the Account account;
显示所述UTXO账户的面值或者所述Account账户的金额。Display the face value of the UTXO account or the amount of the Account account.
根据本发明的一个可选实施例,所述方法还包括:According to an optional embodiment of the present invention, the method further includes:
当定时同步或订阅到所述区块链网络上新生成的数据区块时,将所述数据区块广播至所述区块链网络上的其他共识节点;When timing synchronization or subscription to the newly generated data block on the blockchain network, broadcasting the data block to other consensus nodes on the blockchain network;
验证所述其他共识节点中是否有超过预设阈值的节点对所述数据区块进行共识;及Verifying whether any of the other consensus nodes exceeds a preset threshold for consensus on the data block; and
当所述其他共识节点中有超过预设阈值的节点对所述数据区块进行了共识,确定所述数据区块共识完成;或When the other consensus nodes that exceed the preset threshold have reached a consensus on the data block, it is determined that the data block consensus is completed; or
当所述其他共识节点中没有超过预设阈值的节点对所述数据区块进行共识,确定所述数据区块共识失败。When none of the other consensus nodes exceeds the preset threshold to reach a consensus on the data block, it is determined that the data block consensus fails.
为实现上述目的,本发明的第二方面提供一种基于多资产模型的区块链资产处理装置,所述装置包括:In order to achieve the above objective, a second aspect of the present invention provides a blockchain asset processing device based on a multi-asset model, the device comprising:
请求接收模块,用于接收用户创建数字资产账户的请求;The request receiving module is used to receive the user's request to create a digital asset account;
第一计算模块,用于生成所述用户的第一账户的第一私钥,并根据所述第一私钥计算生成对应所述第一账户的第一账户地址;A first calculation module, configured to generate a first private key of the user's first account, and calculate and generate a first account address corresponding to the first account according to the first private key;
第二计算模块,用于生成所述用户的第二账户的第二私钥,并根据所述第二私钥计算生成对应第二账户的第二账户地址,其中所述第二账户与所述第一账户基于不同的资产模型;The second calculation module is configured to generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account according to the second private key, wherein the second account is the same as the The first account is based on different asset models;
资产存储模块,用于当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产。The asset storage module is configured to use the first account and/or the second account to store the acquired digital assets when digital assets are acquired.
为实现上述目的,本发明的第三方面提供一种计算机设备,所述计算机设备包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的基于多资产模型的区块链资产处理的下载程序,所述基于多资产模型的区块链资产处理的下载程序被所述处理器执行时实现所述的基于多资产模型的区块链资产处理 方法。To achieve the above objective, a third aspect of the present invention provides a computer device, the computer device includes a memory and a processor, the memory stores a multi-asset model-based blockchain that can run on the processor A download program for asset processing, which implements the method for processing blockchain assets based on the multi-asset model when the download program for processing blockchain assets based on the multi-asset model is executed by the processor.
为实现上述目的,本发明的第四方面提供一种计算机可读存储介质,所述计算机可读存储介质上存储有基于多资产模型的区块链资产处理的下载程序,所述基于多资产模型的区块链资产处理的下载程序可被一个或者多个处理器执行以实现所述的基于多资产模型的区块链资产处理方法。In order to achieve the above objective, the fourth aspect of the present invention provides a computer-readable storage medium storing a download program for blockchain asset processing based on a multi-asset model. The download program for blockchain asset processing can be executed by one or more processors to implement the described blockchain asset processing method based on the multi-asset model.
本发明实施例所述的基于多资产模型的区块链资产处理方法、装置、计算机设备及存储介质,通过为不同的资产模型的账户生成账户地址,能够融合每种资产模型的优势,让用户混合使用自己的多种资产,实现资产隐私交易等功能,多资产模型让系统扩展性更强,为用户带来更好的交易体验。The blockchain asset processing method, device, computer equipment and storage medium based on the multi-asset model described in the embodiment of the present invention can integrate the advantages of each asset model by generating account addresses for accounts of different asset models, allowing users Mixed use of its own multiple assets to achieve functions such as asset privacy transactions. The multi-asset model makes the system more scalable and brings a better transaction experience to users.
附图说明Description of the drawings
图1为本发明第一实施例的基于多资产模型的区块链资产处理方法的流程示意图;FIG. 1 is a schematic flowchart of a blockchain asset processing method based on a multi-asset model according to a first embodiment of the present invention;
图2为本发明第二实施例的基于多资产模型的区块链资产处理装置的功能模块示意图;2 is a schematic diagram of functional modules of a blockchain asset processing device based on a multi-asset model according to a second embodiment of the present invention;
图3为本发明第三实施例的计算机设备的内部结构示意图。Fig. 3 is a schematic diagram of the internal structure of a computer device according to a third embodiment of the present invention.
本发明目的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the objectives, functional characteristics and advantages of the present invention will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式detailed description
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the present invention clearer, the following further describes the present invention in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, but not to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first" and "second" in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than the content illustrated or described herein. In addition, the terms "including" and "having" and any variations of them are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to the clearly listed Those steps or units may include other steps or units that are not clearly listed or are inherent to these processes, methods, products, or equipment.
需要说明的是,在本发明中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本发明要求的保护范围之内。It should be noted that the descriptions related to "first", "second", etc. in the present invention are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. . Therefore, the features defined with "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on what can be achieved by a person of ordinary skill in the art. When the combination of technical solutions is contradictory or cannot be achieved, it should be considered that this combination of technical solutions does not exist , Is not within the protection scope of the present invention.
实施例一Example one
参阅图1所示,为本发明第一实施例揭露的基于多资产模型的区块链资产处理方法的流程图。Refer to FIG. 1, which is a flowchart of a blockchain asset processing method based on a multi-asset model disclosed in the first embodiment of the present invention.
所述基于多资产模型的区块链资产处理方法应用于区块链系统中,所述区块链系统可以包括多个共识节点,所述共识节点是指参与区块链数据区块共识的共识节点设备。各个共识节点之间可以通过通信链路进行连接,比如可以通过有线通信链路或无线通信链路进行连接等,多个共识节点共同组成了区块链网络。应该理解,图共识节点的数目仅仅是示意性的。根据实现需要,可以具有任意数目的共识节点。The blockchain asset processing method based on the multi-asset model is applied to a blockchain system, and the blockchain system may include a plurality of consensus nodes, and the consensus node refers to the consensus that participates in the consensus of the blockchain data block Node device. Each consensus node can be connected through a communication link, such as a wired communication link or a wireless communication link, etc., and multiple consensus nodes together form a blockchain network. It should be understood that the number of graph consensus nodes is only illustrative. According to implementation needs, there can be any number of consensus nodes.
本发明实施例所提供的基于多模型的区块链资产处理方法一般由区块链网络中的共识节点执行,相应地,基于多模型的区块链资产处理装置一般设置于区块链网络中的共识节点中。The multi-model-based blockchain asset processing method provided by the embodiments of the present invention is generally executed by consensus nodes in the blockchain network. Accordingly, the multi-model-based blockchain asset processing device is generally set in the blockchain network In the consensus node.
如图1所示,所述基于多资产模型的区块链资产处理方法,具体包括以下步骤,根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。As shown in Figure 1, the blockchain asset processing method based on the multi-asset model specifically includes the following steps. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted.
S11,接收用户创建数字资产账户的请求。S11, receiving a user's request to create a digital asset account.
本实施例中,共识节点中安装有区块链数字钱包,所述区块链数字钱包是一款软件程序,能生成和保存区块链的密钥和数字钱包地址,能将共识节点接入区块链网络中,能发送和接收区块链交易,并能用密钥对用户发送的区块链交易消息进行数字签名等。数字钱包地址代表一个唯一的公钥广播给区块链系统中的所有节点,私钥则保存在共识节点中。In this embodiment, a blockchain digital wallet is installed in the consensus node. The blockchain digital wallet is a software program that can generate and save the key and digital wallet address of the blockchain, and can access the consensus node In the blockchain network, blockchain transactions can be sent and received, and blockchain transaction messages sent by users can be digitally signed with keys. The digital wallet address represents a unique public key broadcast to all nodes in the blockchain system, and the private key is stored in the consensus node.
用户可以在区块链数字钱包中创建至少两个数字资产账户,所述至少两个数字资产账户包括两个及以上数字资产账户,不同的数字资产账户对应不同的资产模型。示例性,用户在区块链数字钱包中创建了两个数字资产账户:第一账 户和第二账户。所述第一账户为Account账户,则所述第二账户为UTXO账户;或者,所述第一账户为UTXO账户,则所述第二账户为Account账户。所述Account账户基于Account资产模型,所述UTXO账户基于UTXO资产模型。用户的总资产为其所拥有的资产模型下的资产总和,可以单独或者同时利用多种资产去进行相应的交易。The user can create at least two digital asset accounts in the blockchain digital wallet. The at least two digital asset accounts include two or more digital asset accounts, and different digital asset accounts correspond to different asset models. Illustratively, the user creates two digital asset accounts in the blockchain digital wallet: the first account and the second account. If the first account is an Account account, then the second account is a UTXO account; or, if the first account is a UTXO account, then the second account is an Account account. The Account account is based on the Account asset model, and the UTXO account is based on the UTXO asset model. The user's total assets are the sum of assets under the asset model owned by the user, and multiple assets can be used alone or at the same time to conduct corresponding transactions.
S12,生成所述用户的第一账户的第一私钥,并根据所述第一私钥计算生成对应所述第一账户的第一账户地址。S12: Generate a first private key of the user's first account, and calculate and generate a first account address corresponding to the first account according to the first private key.
本实施例中,用户通过所述区块链数字钱包创建第一账户时,所述区块链数字钱包会随机生成一个私钥。共识节点可以根据随机生成的私钥在计算生成第一账户的账户地址。In this embodiment, when the user creates the first account through the blockchain digital wallet, the blockchain digital wallet will randomly generate a private key. The consensus node can calculate the account address of the first account according to the randomly generated private key.
在一个可选的实施例中,所述根据所述第一私钥计算生成对应所述第一账户的第一账户地址包括:In an optional embodiment, the calculating and generating the first account address corresponding to the first account according to the first private key includes:
根据所述第一私钥计算生成第一公钥;Calculating and generating a first public key according to the first private key;
采用第一哈希函数计算所述第一公钥的第一哈希值;Calculating the first hash value of the first public key by using a first hash function;
将所述第一哈希值作为所述第一账户的第一账户地址。Use the first hash value as the first account address of the first account.
在该可选的实施例中,共识节点可以调用SECP256K1包对所述私钥进行计算生成公钥。SECP256K1是指比特币中使用的椭圆曲线数字签名算法(Elliptic Curve Digital Signature Algorithm,ECDSA),通过一个已知私钥时可以计算得到公钥,而公钥已知时却无法反向计算出私钥,保障了比特币的安全。In this optional embodiment, the consensus node may call the SECP256K1 package to calculate the private key to generate a public key. SECP256K1 refers to the Elliptic Curve Digital Signature Algorithm (ECDSA) used in Bitcoin. The public key can be calculated through a known private key, but the private key cannot be calculated backward when the public key is known. , To ensure the safety of Bitcoin.
具体的,所述将所述第一哈希值作为所述第一账户的第一账户地址包括:Specifically, the using the first hash value as the first account address of the first account includes:
采用RACE原始完整性校验消息摘要(RACE Integrity Primitives Evaluation Message Digest,RIPEMD)算法对所述共钥进行计算生成公钥哈希,将一个字节的地址版本号连接到公钥哈希的头部,然后对公钥哈希进行两次哈希(例如,SHA256)运算,将结果的前4字节作为公钥哈希的校验值,连接在公钥哈希的尾部,再使用比特币BASE58进行编码,即可得到账户地址。The RACE Integrity Primitives Evaluation Message Digest (RIPEMD) algorithm is used to calculate the public key to generate a public key hash, and the one-byte address version number is connected to the header of the public key hash , And then perform two hash (for example, SHA256) operations on the public key hash, use the first 4 bytes of the result as the check value of the public key hash, connect it to the tail of the public key hash, and then use Bitcoin BASE58 Encode, you can get the account address.
所述SECP256K1、所述RIPEMD、BASE58等均为现有技术,本发明在此不再详细赘述。The SECP256K1, the RIPEMD, BASE58, etc. are all existing technologies, and the present invention will not be described in detail here.
S13,生成所述用户的第二账户的第二私钥,并根据所述第二私钥计算生成对应第二账户的第二账户地址。S13: Generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account according to the second private key.
本实施例中,用户通过所述区块链数字钱包创建第二账户时,所述区块链数 字钱包也会随机生成一个私钥。共识节点可以根据随机生成的私钥在计算生成第二账户的账户地址。In this embodiment, when a user creates a second account through the blockchain digital wallet, the blockchain digital wallet will also randomly generate a private key. The consensus node can calculate and generate the account address of the second account according to the randomly generated private key.
在一个可选的实施例中,所述生成所述用户的第二账户的第二私钥包括:In an optional embodiment, the generating the second private key of the user's second account includes:
利用预定的映射算法对所述第一私钥进行映射计算,得到所述第二私钥;或者,Perform a mapping calculation on the first private key using a predetermined mapping algorithm to obtain the second private key; or,
利用预定的随机数生成算法生成第二随机数作为所述第二私钥。A predetermined random number generation algorithm is used to generate a second random number as the second private key.
在该可选的实施例中,共识节点可以采用映射算法,例如,哈希映射,对所述第一私钥进行映射,得到一个新的私钥作为第二私钥。将私钥进行映射得到一个新的私钥,为现有技术,本发明不再阐述。共识节点还可以通过所述区块链数字钱包随机生成一个数作为所述第二私钥。In this optional embodiment, the consensus node may use a mapping algorithm, for example, a hash mapping, to map the first private key to obtain a new private key as the second private key. Mapping the private key to obtain a new private key is a prior art and will not be described in the present invention. The consensus node may also randomly generate a number as the second private key through the blockchain digital wallet.
在一个可选的实施例中,所述根据所述第二私钥计算生成对应第二账户的第二账户地址包括:In an optional embodiment, the calculating and generating the second account address corresponding to the second account according to the second private key includes:
根据所述第二私钥计算生成第二公钥;Calculating and generating a second public key according to the second private key;
采用第二哈希函数计算所述第一公钥的第二哈希值;Calculating the second hash value of the first public key by using a second hash function;
将所述第二哈希值作为所述第二账户的第二账户地址。Use the second hash value as the second account address of the second account.
根据所述第二私钥计算生成对应第二账户的第二账户地址的过程与根据所述第一私钥计算生成对应第一账户的第一账户地址的过程是相同的,本发明对根据所述第二私钥计算生成对应第二账户的第二账户地址的过程不再详细阐述,具体可参见根据所述第一私钥计算生成对应第一账户的第一账户地址的过程及其相关描述。The process of calculating and generating the second account address corresponding to the second account according to the second private key is the same as the process of calculating and generating the first account address corresponding to the first account according to the first private key. The process of calculating and generating the second account address corresponding to the second account by the second private key will not be described in detail. For details, please refer to the process of calculating and generating the first account address corresponding to the first account according to the first private key and related descriptions. .
S14,当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产。S14: When a digital asset is acquired, use the first account and/or the second account to store the acquired digital asset.
本实施例中,所述数字资产可以包括挖矿得到的挖矿奖励和交易得到的交易费用,共识节点获取到数字资产后进行存储。In this embodiment, the digital assets may include mining rewards obtained from mining and transaction fees obtained from transactions, and the consensus node stores the digital assets after obtaining them.
在一个可选的实施例中,所述当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产包括:In an optional embodiment, when a digital asset is acquired, using the first account and/or the second account to store the acquired digital asset includes:
显示所述第一账户及所述第二账户;Display the first account and the second account;
当接收用户对所述第一账户及所述第二账户的选定操作时,将用户选定的账户作为目标账户;When receiving the user's selection operation on the first account and the second account, use the account selected by the user as the target account;
利用所述目标账户存储所述获取到的数字资产。Use the target account to store the acquired digital asset.
在该可选的实施例中,共识节点可以以列表选项的形式将创建的所有账户显示给用户,用户在列表选项上选择一个账户作为存储所获取到的数字资产的账户。示例性的,假设共识节点中创建有UTXO账户和Account账户,假如用户选定了UTXO账户作为存储所获取到的数字资产的账户后,共识节点将获取到的数字资产以UTXO或者Account存储于所述UTXO账户中;假如用户选定了Account账户作为存储所获取到的数字资产的账户后,共识节点将获取到的数字资产以UTXO或者Account存储于所述Account账户中。In this alternative embodiment, the consensus node may display all created accounts to the user in the form of a list option, and the user selects an account on the list option as the account for storing the acquired digital assets. Exemplarily, suppose there are UTXO accounts and Account accounts created in the consensus node. If the user selects the UTXO account as the account for storing the acquired digital assets, the consensus node will store the acquired digital assets in the UTXO or Account. In the UTXO account; if the user selects an Account account as the account for storing the acquired digital assets, the consensus node stores the acquired digital assets in the Account account as UTXO or Account.
在一个可选的实施例中,所述方法还包括:In an optional embodiment, the method further includes:
定时同步或订阅所述区块链网络上新生成的数据区块;Regularly synchronize or subscribe to newly generated data blocks on the blockchain network;
当所述数据区块中的资产为UTXO时,采用与所述UTXO账户对应的私钥过滤出所述新生成的数据区块中的UTXO,并将过滤出的UTXO添加至所述UTXO账户;When the asset in the data block is UTXO, use the private key corresponding to the UTXO account to filter out the UTXO in the newly generated data block, and add the filtered UTXO to the UTXO account;
当所述数据区块中的资产为Account时,获取所述新生成的数据区块中的Account,并将获取到的Account添加至所述Account账户中;When the asset in the data block is Account, obtain the Account in the newly generated data block, and add the obtained Account to the Account account;
显示所述UTXO账户的面值或者所述Account账户的金额。Display the face value of the UTXO account or the amount of the Account account.
在该可选的实施例中,一个数据区块分为两部分,分别是“区块头”和“区块体”,其中区块头用来记录一些说明信息,而区块体是用来记录“交易”的列表。区块头包括六个字段,分别是版本号、前一区块的哈希值、梅克尔根、预设的难度值、时间戳、要寻找的随机数。挖矿过程就是对以上这六个字段进行一系列的转换、连接和哈希运算,并成功寻找到一个满足条件的随机数:经过哈希运算后的值,比预设难度值的哈希值小,那么挖矿成功。所述共识节点在区块链网络上进行挖矿,并在成功挖取到区块链网络中新生成的数据区块之后,存储该数据区块。区块链系统会对挖矿成功的共识节点发放一定量的代币作为挖矿奖励。共识节点除了获取挖矿奖励,还可以获取数据区块内所有交易信息所对应的交易费用。In this alternative embodiment, a data block is divided into two parts, namely "block header" and "block body". The block header is used to record some descriptive information, and the block body is used to record " Transaction" list. The block header includes six fields, which are the version number, the hash value of the previous block, the Merkel root, the preset difficulty value, the timestamp, and the random number to be found. The mining process is to perform a series of conversions, connections and hash operations on the above six fields, and successfully find a random number that meets the conditions: the value after the hash operation is higher than the hash value of the preset difficulty value Small, then mining is successful. The consensus node performs mining on the blockchain network, and after successfully digging a newly generated data block in the blockchain network, the data block is stored. The blockchain system will issue a certain amount of tokens as mining rewards to consensus nodes that have successfully mined. In addition to obtaining mining rewards, consensus nodes can also obtain transaction fees corresponding to all transaction information in the data block.
将前一次同步或订阅数据区块之后生成的数据区块确定为新生成的数据区块,所述区块链数字钱包可以定时同步或者订阅区块链上新生成的数据区块并执行。显示所述UTXO账户的面值或者所述Account账户的金额给用户,目的是为了便于用户管理资产,知道有多少资产,能做什么交易等。The data block generated after the previous synchronization or subscribing to the data block is determined as the newly generated data block, and the blockchain digital wallet can periodically synchronize or subscribe to the newly generated data block on the block chain and execute it. Display the face value of the UTXO account or the amount of the Account account to the user, the purpose is to facilitate the user to manage assets, know how many assets there are, and what transactions can be made.
在一个可选的实施例中,所述方法还包括:In an optional embodiment, the method further includes:
当定时同步或订阅到所述区块链网络上新生成的数据区块时,将所述数据区块广播至所述区块链网络上的其他共识节点;When timing synchronization or subscription to the newly generated data block on the blockchain network, broadcasting the data block to other consensus nodes on the blockchain network;
验证所述其他共识节点中是否有超过预设阈值的节点对所述数据区块进行共识;及Verifying whether any of the other consensus nodes exceeds a preset threshold for consensus on the data block; and
当所述其他共识节点中有超过预设阈值的节点对所述数据区块进行了共识,确定所述数据区块共识完成;或When the other consensus nodes that exceed the preset threshold have reached a consensus on the data block, it is determined that the data block consensus is completed; or
当所述其他共识节点中没有超过预设阈值的节点对所述数据区块进行共识,确定所述数据区块共识失败。When none of the other consensus nodes exceeds the preset threshold to reach a consensus on the data block, it is determined that the data block consensus fails.
在该可选的实施例中,所述预设阈值为预先设置的用以评价数据区块是否共识完成的临界值。不同的区块链系统中,对数据区块共识完成所需要的共识节点的数量是不同的,即,预设阈值是根据区块链系统设置的。例如,在比特币系统中,参与共识的共识节点的数量达到了整个共识节点的51%,方可认为对数据区块共识完成;否则,当参与共识的共识节点的数量少于整个共识节点的51%时,则认为对数据区块共识失败。又如,在数字币(DigiFinex Token,DFT)系统中,参与共识的共识节点的数量达到了整个共识节点的2/3,方可认为对数据区块共识完成;否则,当参与共识的共识节点的数量少于整个共识节点的2/3时,则认为对数据区块共识失败。共识节点将数据区块广播给区块链网络上的其他共识节点,通过其他共识节点对所述数据区块进行共识,来验证所述数据区块是否有效。当数据区块共识完成,表明所述数据区块有效,则所述共识节点存储所述数据区块。当数据区块共识失败,表明所述数据区块无效,所述共识节点不存储所述数据区块。In this optional embodiment, the preset threshold is a preset threshold used to evaluate whether the data block is consensus completed. In different blockchain systems, the number of consensus nodes required to complete the consensus of the data block is different, that is, the preset threshold is set according to the blockchain system. For example, in the Bitcoin system, if the number of consensus nodes participating in the consensus reaches 51% of the entire consensus node, the consensus on the data block can be considered complete; otherwise, when the number of consensus nodes participating in the consensus is less than that of the entire consensus node At 51%, it is considered that the consensus on the data block has failed. For another example, in the DigiFinex Token (DFT) system, the number of consensus nodes participating in the consensus reaches 2/3 of the entire consensus node before the consensus on the data block can be considered complete; otherwise, the consensus node participating in the consensus When the number is less than 2/3 of the entire consensus node, it is considered that the consensus on the data block has failed. The consensus node broadcasts the data block to other consensus nodes on the blockchain network, and performs a consensus on the data block through other consensus nodes to verify whether the data block is valid. When the data block consensus is completed, indicating that the data block is valid, the consensus node stores the data block. When the consensus of the data block fails, it indicates that the data block is invalid, and the consensus node does not store the data block.
在其他实施例中,在存储该数据区块的过程中或者存储该数据区块之后,共识节点还可以检测数据区块中的交易数据在写入存储空间中是否失败,若将交易数据写入存储空间失败,则可以重新写入。In other embodiments, during the process of storing the data block or after storing the data block, the consensus node can also detect whether the transaction data in the data block fails to be written into the storage space. If the transaction data is written If the storage space fails, you can rewrite it.
应当理解的是,当用户需要交易时,可以从上述多种账户中选择一种或两种或以上的账户作为转出账户,对转出账户中的资产进行签名交易,转入账户可以是转入方的Account地址或者UTXO地址。It should be understood that when a user needs a transaction, one or two or more of the above accounts can be selected as the transfer-out account, and the assets in the transfer-out account can be signed transactions. The transfer-in account can be a transfer Account address or UTXO address of the incoming party.
需要说明的是,由于以太坊的Account能够支持图灵完备的虚拟机及运行其上的图灵完备的智能合约,因此本区块链系统的合约地址采用的是Account地址。对于Account账户的交易,直接执行智能合约;对于UTXO账户的交易, 或者UTXO账户混合Account账户的交易,调用合约时,需要先将UTXO账户的交易转换为智能合约的输入消息,再执行智能合约。在执行智能合约时,消耗完的手续费,则可以Account或者UTXO的形式退还到Account账户或者UTXO账户。It should be noted that because Ethereum's Account can support a Turing-complete virtual machine and a Turing-complete smart contract running on it, the contract address of this blockchain system uses the Account address. For account transactions, the smart contract is executed directly; for UTXO account transactions, or UTXO account hybrid account account transactions, when calling the contract, the UTXO account transaction needs to be converted into the input message of the smart contract before executing the smart contract. When the smart contract is executed, the service fee consumed can be refunded to the Account or UTXO account in the form of Account or UTXO.
本实施例所述的基于多资产模型的区块链资产处理方法,通过为不同的资产模型的账户生成账户地址,能够融合每种资产模型的优势,让用户混合使用自己的多种资产,实现资产隐私交易等功能,多资产模型让系统扩展性更强,为用户带来更好的交易体验。The blockchain asset processing method based on the multi-asset model described in this embodiment can integrate the advantages of each asset model by generating account addresses for accounts of different asset models, allowing users to mix their own multiple assets to achieve Asset privacy transactions and other functions, the multi-asset model makes the system more scalable and brings users a better transaction experience.
实施例二Example two
参阅图2所示,为本发明实施例二揭露的基于多资产模型的区块链资产处理装置的功能模块示意图。Refer to FIG. 2, which is a schematic diagram of functional modules of a blockchain asset processing device based on a multi-asset model disclosed in Embodiment 2 of the present invention.
在一些实施例中,所述基于多资产模型的区块链资产处理装置20运行于资源服务器中。所述基于多资产模型的区块链资产处理装置20可以包括多个由下载程序所组成的功能模块。所述基于多资产模型的区块链资产处理装置20中的各个下载程序的程序代码可以存储于计算机设备的存储器中,并由所述至少一个处理器所执行,以执行(详见图1描述)基于多资产模型的区块链资产处理方法中的全部或者部分步骤。In some embodiments, the blockchain asset processing device 20 based on the multi-asset model runs in a resource server. The block chain asset processing device 20 based on the multi-asset model may include multiple functional modules composed of download programs. The program code of each download program in the multi-asset model-based blockchain asset processing device 20 can be stored in the memory of the computer device and executed by the at least one processor to execute (see Figure 1 for details) ) All or part of the steps in the blockchain asset processing method based on the multi-asset model.
本实施例中,所述基于多资产模型的区块链资产处理装置20根据其所执行的功能,可以被划分为多个功能模块。所述功能模块可以包括:请求接收模块201、第一计算模块202、第二计算模块203、资产存储模块204、区块获取模块205、资产刷新模块206、资产显示模块207及区块共识模块208。本发明所称的模块是指一种能够被至少一个处理器所执行并且能够完成固定功能的一系列下载程序,其存储在存储器中。在本实施例中,关于各模块的功能将在后续的实施例中详述。In this embodiment, the multi-asset model-based blockchain asset processing device 20 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: request receiving module 201, first calculation module 202, second calculation module 203, asset storage module 204, block acquisition module 205, asset refresh module 206, asset display module 207, and block consensus module 208 . The module referred to in the present invention refers to a series of download programs that can be executed by at least one processor and can complete fixed functions, and are stored in a memory. In this embodiment, the function of each module will be described in detail in subsequent embodiments.
请求接收模块201,用于接收用户创建数字资产账户的请求。The request receiving module 201 is configured to receive a user's request to create a digital asset account.
本实施例中,共识节点中安装有区块链数字钱包,所述区块链数字钱包是一款软件程序,能生成和保存区块链的密钥和数字钱包地址,能将共识节点接入区块链网络中,能发送和接收区块链交易,并能用密钥对用户发送的区块链交易消息进行数字签名等。数字钱包地址代表一个唯一的公钥广播给区块链系统中的 所有节点,私钥则保存在共识节点中。In this embodiment, a blockchain digital wallet is installed in the consensus node. The blockchain digital wallet is a software program that can generate and save the key and digital wallet address of the blockchain, and can access the consensus node In the blockchain network, blockchain transactions can be sent and received, and blockchain transaction messages sent by users can be digitally signed with keys. The digital wallet address represents a unique public key broadcast to all nodes in the blockchain system, and the private key is stored in the consensus node.
用户可以在区块链数字钱包中创建至少两个数字资产账户,所述至少两个数字资产账户包括两个及以上数字资产账户,不同的数字资产账户对应不同的资产模型。示例性,用户在区块链数字钱包中创建了两个数字资产账户:第一账户和第二账户。所述第一账户为Account账户,则所述第二账户为UTXO账户;或者,所述第一账户为UTXO账户,则所述第二账户为Account账户。所述Account账户基于Account资产模型,所述UTXO账户基于UTXO资产模型。用户的总资产为其所拥有的资产模型下的资产总和,可以单独或者同时利用多种资产去进行相应的交易。The user can create at least two digital asset accounts in the blockchain digital wallet. The at least two digital asset accounts include two or more digital asset accounts, and different digital asset accounts correspond to different asset models. For example, the user creates two digital asset accounts in the blockchain digital wallet: the first account and the second account. If the first account is an Account account, then the second account is a UTXO account; or, if the first account is a UTXO account, then the second account is an Account account. The Account account is based on the Account asset model, and the UTXO account is based on the UTXO asset model. The user's total assets are the sum of assets under the asset model owned by the user, and multiple assets can be used alone or at the same time to conduct corresponding transactions.
第一计算模块202,用于生成所述用户的第一账户的第一私钥,并根据所述第一私钥计算生成对应所述第一账户的第一账户地址。The first calculation module 202 is configured to generate a first private key of the user's first account, and calculate and generate a first account address corresponding to the first account according to the first private key.
本实施例中,用户通过所述区块链数字钱包创建第一账户时,所述区块链数字钱包会随机生成一个私钥。共识节点可以根据随机生成的私钥在计算生成第一账户的账户地址。In this embodiment, when the user creates the first account through the blockchain digital wallet, the blockchain digital wallet will randomly generate a private key. The consensus node can calculate the account address of the first account according to the randomly generated private key.
在一个可选的实施例中,所述第一计算模块202根据所述第一私钥计算生成对应所述第一账户的第一账户地址包括:In an optional embodiment, the first calculation module 202 calculating and generating the first account address corresponding to the first account according to the first private key includes:
根据所述第一私钥计算生成第一公钥;Calculating and generating a first public key according to the first private key;
采用第一哈希函数计算所述第一公钥的第一哈希值;Calculating the first hash value of the first public key by using a first hash function;
将所述第一哈希值作为所述第一账户的第一账户地址。Use the first hash value as the first account address of the first account.
在该可选的实施例中,共识节点可以调用SECP256K1包对所述私钥进行计算生成公钥。SECP256K1是指比特币中使用的椭圆曲线数字签名算法(Elliptic Curve Digital Signature Algorithm,ECDSA),通过一个已知私钥时可以计算得到公钥,而公钥已知时却无法反向计算出私钥,保障了比特币的安全。In this optional embodiment, the consensus node may call the SECP256K1 package to calculate the private key to generate a public key. SECP256K1 refers to the Elliptic Curve Digital Signature Algorithm (ECDSA) used in Bitcoin. The public key can be calculated through a known private key, but the private key cannot be calculated backward when the public key is known. , To ensure the safety of Bitcoin.
具体的,所述将所述第一哈希值作为所述第一账户的第一账户地址包括:Specifically, the using the first hash value as the first account address of the first account includes:
采用RACE原始完整性校验消息摘要(RACE Integrity Primitives Evaluation Message Digest,RIPEMD)算法对所述共钥进行计算生成公钥哈希,将一个字节的地址版本号连接到公钥哈希的头部,然后对公钥哈希进行两次哈希(例如,SHA256)运算,将结果的前4字节作为公钥哈希的校验值,连接在公钥哈希的尾部,再使用比特币BASE58进行编码,即可得到账户地址。The RACE Integrity Primitives Evaluation Message Digest (RIPEMD) algorithm is used to calculate the public key to generate a public key hash, and the one-byte address version number is connected to the header of the public key hash , And then perform two hash (for example, SHA256) operations on the public key hash, use the first 4 bytes of the result as the check value of the public key hash, connect it to the tail of the public key hash, and then use Bitcoin BASE58 Encode, you can get the account address.
所述SECP256K1、所述RIPEMD、BASE58等均为现有技术,本发明在此不 再详细赘述。The SECP256K1, the RIPEMD, BASE58, etc. are all existing technologies, and the present invention will not be described in detail here.
第二计算模块203,用于生成所述用户的第二账户的第二私钥,并根据所述第二私钥计算生成对应第二账户的第二账户地址。The second calculation module 203 is configured to generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account according to the second private key.
本实施例中,用户通过所述区块链数字钱包创建第二账户时,所述区块链数字钱包也会随机生成一个私钥。共识节点可以根据随机生成的私钥在计算生成第二账户的账户地址。In this embodiment, when a user creates a second account through the blockchain digital wallet, the blockchain digital wallet will also randomly generate a private key. The consensus node can calculate and generate the account address of the second account according to the randomly generated private key.
在一个可选的实施例中,所述第二计算模块203生成所述用户的第二账户的第二私钥包括:In an optional embodiment, the second calculation module 203 generating the second private key of the user's second account includes:
利用预定的映射算法对所述第一私钥进行映射计算,得到所述第二私钥;或者,Perform a mapping calculation on the first private key using a predetermined mapping algorithm to obtain the second private key; or,
利用预定的随机数生成算法生成第二随机数作为所述第二私钥。A predetermined random number generation algorithm is used to generate a second random number as the second private key.
在该可选的实施例中,共识节点可以采用映射算法,例如,哈希映射,对所述第一私钥进行映射,得到一个新的私钥作为第二私钥。将私钥进行映射得到一个新的私钥,为现有技术,本发明不再阐述。共识节点还可以通过所述区块链数字钱包随机生成一个数作为所述第二私钥。In this optional embodiment, the consensus node may use a mapping algorithm, for example, a hash mapping, to map the first private key to obtain a new private key as the second private key. Mapping the private key to obtain a new private key is a prior art and will not be described in the present invention. The consensus node may also randomly generate a number as the second private key through the blockchain digital wallet.
在一个可选的实施例中,所述第二计算模块203根据所述第二私钥计算生成对应第二账户的第二账户地址包括:In an optional embodiment, the second calculation module 203 calculating and generating the second account address corresponding to the second account according to the second private key includes:
根据所述第二私钥计算生成第二公钥;Calculating and generating a second public key according to the second private key;
采用第二哈希函数计算所述第一公钥的第二哈希值;Calculating the second hash value of the first public key by using a second hash function;
将所述第二哈希值作为所述第二账户的第二账户地址。Use the second hash value as the second account address of the second account.
根据所述第二私钥计算生成对应第二账户的第二账户地址的过程与根据所述第一私钥计算生成对应第一账户的第一账户地址的过程是相同的,本发明对根据所述第二私钥计算生成对应第二账户的第二账户地址的过程不再详细阐述,具体可参见根据所述第一私钥计算生成对应第一账户的第一账户地址的过程及其相关描述。The process of calculating and generating the second account address corresponding to the second account according to the second private key is the same as the process of calculating and generating the first account address corresponding to the first account according to the first private key. The process of calculating and generating the second account address corresponding to the second account by the second private key will not be described in detail. For details, please refer to the process of calculating and generating the first account address corresponding to the first account according to the first private key and related descriptions. .
资产存储模块204,用于当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产。The asset storage module 204 is configured to use the first account and/or the second account to store the acquired digital assets when digital assets are acquired.
本实施例中,所述数字资产可以包括挖矿得到的挖矿奖励和交易得到的交易费用,共识节点获取到数字资产后进行存储。In this embodiment, the digital assets may include mining rewards obtained from mining and transaction fees obtained from transactions, and the consensus node stores the digital assets after obtaining them.
在一个可选的实施例中,所述资产存储模块204当获取到数字资产时,利 用所述第一账户和/或第二账户存储获取到的数字资产包括:In an optional embodiment, when the asset storage module 204 acquires digital assets, using the first account and/or the second account to store the acquired digital assets includes:
显示所述第一账户及所述第二账户;Display the first account and the second account;
当接收用户对所述第一账户及所述第二账户的选定操作时,将用户选定的账户作为目标账户;When receiving the user's selection operation on the first account and the second account, use the account selected by the user as the target account;
利用所述目标账户存储所述获取到的数字资产。Use the target account to store the acquired digital asset.
在该可选的实施例中,共识节点可以以列表选项的形式将创建的所有账户显示给用户,用户在列表选项上选择一个账户作为存储所获取到的数字资产的账户。示例性的,假设共识节点中创建有UTXO账户和Account账户,假如用户选定了UTXO账户作为存储所获取到的数字资产的账户后,共识节点将获取到的数字资产以UTXO或者Account存储于所述UTXO账户中;假如用户选定了Account账户作为存储所获取到的数字资产的账户后,共识节点将获取到的数字资产以UTXO或者Account存储于所述Account账户中。In this alternative embodiment, the consensus node may display all created accounts to the user in the form of a list option, and the user selects an account on the list option as the account for storing the acquired digital assets. Exemplarily, suppose there are UTXO accounts and Account accounts created in the consensus node. If the user selects the UTXO account as the account for storing the acquired digital assets, the consensus node will store the acquired digital assets in the UTXO or Account. In the UTXO account; if the user selects an Account account as the account for storing the acquired digital assets, the consensus node stores the acquired digital assets in the Account account as UTXO or Account.
在一个可选的实施例中,所述基于多资产模型的区块链资产处理装置20还包括:In an optional embodiment, the block chain asset processing device 20 based on the multi-asset model further includes:
区块获取模块205,用于定时同步或订阅所述区块链网络上新生成的数据区块;The block acquisition module 205 is used for timing synchronization or subscribing to newly generated data blocks on the blockchain network;
资产刷新模块206,用于当所述数据区块中的资产为UTXO时,采用与所述UTXO账户对应的私钥过滤出所述新生成的数据区块中的UTXO,并将过滤出的UTXO添加至所述UTXO账户;The asset refresh module 206 is configured to use the private key corresponding to the UTXO account to filter out the UTXO in the newly generated data block when the asset in the data block is UTXO, and to filter the filtered UTXO Add to the UTXO account;
资产刷新模块206,还用于当所述数据区块中的资产为Account时,获取所述新生成的数据区块中的Account,并将获取到的Account添加至所述Account账户中;The asset refresh module 206 is further configured to obtain an Account in the newly generated data block when the asset in the data block is an Account, and add the obtained Account to the Account account;
资产显示模块207,用于显示所述UTXO账户的面值或者所述Account账户的金额。The asset display module 207 is configured to display the face value of the UTXO account or the amount of the Account account.
在该可选的实施例中,一个数据区块分为两部分,分别是“区块头”和“区块体”,其中区块头用来记录一些说明信息,而区块体是用来记录“交易”的列表。区块头包括六个字段,分别是版本号、前一区块的哈希值、梅克尔根、预设的难度值、时间戳、要寻找的随机数。挖矿过程就是对以上这六个字段进行一系列的转换、连接和哈希运算,并成功寻找到一个满足条件的随机数:经过哈希运算后的值,比预设难度值的哈希值小,那么挖矿成功。所述共识节点在区块链网络上 进行挖矿,并在成功挖取到区块链网络中新生成的数据区块之后,存储该数据区块。区块链系统会对挖矿成功的共识节点发放一定量的代币作为挖矿奖励。共识节点除了获取挖矿奖励,还可以获取数据区块内所有交易信息所对应的交易费用。In this alternative embodiment, a data block is divided into two parts, namely "block header" and "block body". The block header is used to record some descriptive information, and the block body is used to record " Transaction" list. The block header includes six fields, which are the version number, the hash value of the previous block, the Merkel root, the preset difficulty value, the timestamp, and the random number to be found. The mining process is to perform a series of conversions, connections and hash operations on the above six fields, and successfully find a random number that meets the conditions: the value after the hash operation is higher than the hash value of the preset difficulty value Small, then mining is successful. The consensus node performs mining on the blockchain network, and after successfully mining a newly generated data block in the blockchain network, the data block is stored. The blockchain system will issue a certain amount of tokens as mining rewards to consensus nodes that have successfully mined. In addition to obtaining mining rewards, consensus nodes can also obtain transaction fees corresponding to all transaction information in the data block.
将前一次同步或订阅数据区块之后生成的数据区块确定为新生成的数据区块,所述区块链数字钱包可以定时同步或者订阅区块链上新生成的数据区块并执行。显示所述UTXO账户的面值或者所述Account账户的金额给用户,目的是为了便于用户管理资产,知道有多少资产,能做什么交易等。The data block generated after the previous synchronization or subscribing to the data block is determined as the newly generated data block, and the blockchain digital wallet can periodically synchronize or subscribe to the newly generated data block on the block chain and execute it. Display the face value of the UTXO account or the amount of the Account account to the user, the purpose is to facilitate the user to manage assets, know how many assets there are, and what transactions can be made.
在一个可选的实施例中,所述基于多资产模型的区块链资产处理装置20还包括:区块共识模块208,用于:In an optional embodiment, the block chain asset processing device 20 based on the multi-asset model further includes: a block consensus module 208 for:
当定时同步或订阅到所述区块链网络上新生成的数据区块时,将所述数据区块广播至所述区块链网络上的其他共识节点;When timing synchronization or subscription to the newly generated data block on the blockchain network, broadcasting the data block to other consensus nodes on the blockchain network;
验证所述其他共识节点中是否有超过预设阈值的节点对所述数据区块进行共识;及Verifying whether any of the other consensus nodes exceeds a preset threshold for consensus on the data block; and
当所述其他共识节点中有超过预设阈值的节点对所述数据区块进行了共识,确定所述数据区块共识完成;或When the other consensus nodes that exceed the preset threshold have reached a consensus on the data block, it is determined that the data block consensus is completed; or
当所述其他共识节点中没有超过预设阈值的节点对所述数据区块进行共识,确定所述数据区块共识失败。When none of the other consensus nodes exceeds the preset threshold to reach a consensus on the data block, it is determined that the data block consensus fails.
在该可选的实施例中,所述预设阈值为预先设置的用以评价数据区块是否共识完成的临界值。不同的区块链系统中,对数据区块共识完成所需要的共识节点的数量是不同的,即,预设阈值是根据区块链系统设置的。例如,在比特币系统中,参与共识的共识节点的数量达到了整个共识节点的51%,方可认为对数据区块共识完成;否则,当参与共识的共识节点的数量少于整个共识节点的51%时,则认为对数据区块共识失败。又如,在数字币(DigiFinex Token,DFT)系统中,参与共识的共识节点的数量达到了整个共识节点的2/3,方可认为对数据区块共识完成;否则,当参与共识的共识节点的数量少于整个共识节点的2/3时,则认为对数据区块共识失败。共识节点将数据区块广播给区块链网络上的其他共识节点,通过其他共识节点对所述数据区块进行共识,来验证所述数据区块是否有效。当数据区块共识完成,表明所述数据区块有效,则所述共识节点存储所述数据区块。当数据区块共识失败,表明所述数据区块无效,所述共识节点不存 储所述数据区块。In this optional embodiment, the preset threshold is a preset threshold used to evaluate whether the data block is consensus completed. In different blockchain systems, the number of consensus nodes required to complete the consensus of the data block is different, that is, the preset threshold is set according to the blockchain system. For example, in the Bitcoin system, if the number of consensus nodes participating in the consensus reaches 51% of the entire consensus node, the consensus on the data block can be considered complete; otherwise, when the number of consensus nodes participating in the consensus is less than that of the entire consensus node At 51%, it is considered that the consensus on the data block has failed. For another example, in the DigiFinex Token (DFT) system, the number of consensus nodes participating in the consensus reaches 2/3 of the entire consensus node before the consensus on the data block can be considered complete; otherwise, the consensus node participating in the consensus When the number is less than 2/3 of the entire consensus node, it is considered that the consensus on the data block has failed. The consensus node broadcasts the data block to other consensus nodes on the blockchain network, and performs a consensus on the data block through other consensus nodes to verify whether the data block is valid. When the data block consensus is completed, indicating that the data block is valid, the consensus node stores the data block. When the consensus of the data block fails, it indicates that the data block is invalid, and the consensus node does not store the data block.
在其他实施例中,在存储该数据区块的过程中或者存储该数据区块之后,共识节点还可以检测数据区块中的交易数据在写入存储空间中是否失败,若将交易数据写入存储空间失败,则可以重新写入。In other embodiments, during the process of storing the data block or after storing the data block, the consensus node can also detect whether the transaction data in the data block fails to be written into the storage space. If the transaction data is written If the storage space fails, you can rewrite it.
应当理解的是,当用户需要交易时,可以从上述多种账户中选择一种或两种或以上的账户作为转出账户,对转出账户中的资产进行签名交易,转入账户可以是转入方的Account地址或者UTXO地址。It should be understood that when a user needs a transaction, one or two or more of the above accounts can be selected as the transfer-out account, and the assets in the transfer-out account can be signed transactions. The transfer-in account can be a transfer Account address or UTXO address of the incoming party.
需要说明的是,由于以太坊的Account能够支持图灵完备的虚拟机及运行其上的图灵完备的智能合约,因此本区块链系统的合约地址采用的是Account地址。对于Account账户的交易,直接执行智能合约;对于UTXO账户的交易,或者UTXO账户混合Account账户的交易,调用合约时,需要先将UTXO账户的交易转换为智能合约的输入消息,再执行智能合约。在执行智能合约时,消耗完的手续费,则可以Account或者UTXO的形式退还到Account账户或者UTXO账户。It should be noted that because Ethereum's Account can support a Turing-complete virtual machine and a Turing-complete smart contract running on it, the contract address of this blockchain system uses the Account address. For the account transaction, the smart contract is executed directly; for the UTXO account transaction, or the UTXO account hybrid account account transaction, when calling the contract, the transaction of the UTXO account needs to be converted into the input message of the smart contract before executing the smart contract. When the smart contract is executed, the service fee consumed can be refunded to the Account or UTXO account in the form of Account or UTXO.
本实施例所述的基于多资产模型的区块链资产处理装置,通过为不同的资产模型的账户生成账户地址,能够融合每种资产模型的优势,让用户混合使用自己的多种资产,实现资产隐私交易等功能,多资产模型让系统扩展性更强,为用户带来更好的交易体验。The block chain asset processing device based on the multi-asset model described in this embodiment can integrate the advantages of each asset model by generating account addresses for accounts of different asset models, allowing users to mix their own multiple assets to achieve Asset privacy transactions and other functions, the multi-asset model makes the system more scalable and brings users a better transaction experience.
实施例三Example three
图3为本发明实施例揭露的计算机设备的内部结构示意图。FIG. 3 is a schematic diagram of the internal structure of a computer device disclosed in an embodiment of the present invention.
在本实施例中,计算机设备3可以是共识节点,也可以是资源服务器,还可以是其他电子设备。In this embodiment, the computer device 3 may be a consensus node, a resource server, or other electronic devices.
所述计算机设备3可以包括存储器31、处理器32和总线33。The computer device 3 may include a memory 31, a processor 32, and a bus 33.
其中,存储器31至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器31在一些实施例中可以是所述计算机设备3的内部存储单元,例如所述计算机设备3的硬盘。存储器31在另一些实施例中也可以是所述计算机设备3的外部存储设备,例如所述计算机设备3上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,存储器31还可以既包括所述计算机设备3的内部存储单元也包括外部存储设备。存储器31不仅可以用于存储安装于所述计算机设备3的应用程序及各类数据,例如基于多资产模型的区块链资产处理装置20的下载程序等及各个模块,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 31 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 31 may be an internal storage unit of the computer device 3 in some embodiments, such as a hard disk of the computer device 3. In other embodiments, the memory 31 may also be an external storage device of the computer device 3, for example, a plug-in hard disk equipped on the computer device 3, a smart memory card (Smart Media Card, SMC), and a secure digital (Secure Digital). Digital, SD) cards, flash cards, etc. Further, the memory 31 may also include both an internal storage unit of the computer device 3 and an external storage device. The memory 31 can be used not only to store application programs and various data installed in the computer equipment 3, such as download programs of the blockchain asset processing device 20 based on the multi-asset model, and various modules, but also to temporarily store Data that has been output or will be output.
处理器32在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器31中存储的下载程序或处理数据。The processor 32 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments, and is used to run the download program or processing stored in the memory 31 data.
该总线33可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图3中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 33 may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in FIG. 3 to represent, but it does not mean that there is only one bus or one type of bus.
进一步地,所述计算机设备3还可以包括网络接口,网络接口可选的可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该计算机设备3与其他计算机设备之间建立通信连接。Further, the computer device 3 may also include a network interface. The network interface may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to connect the computer device 3 with other Establish a communication connection between computer devices.
可选地,该计算机设备3还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-Emitting Diode,OLED)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在所述计算机设备中处理的消息以及用于显示可视化的用户界面。Optionally, the computer device 3 may also include a user interface. The user interface may include a display (Display) and an input unit such as a keyboard (Keyboard). The optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch liquid crystal display, an organic light-emitting diode (OLED) touch device, and the like. Wherein, the display can also be called a display screen or a display unit as appropriate, and is used to display messages processed in the computer device and to display a visualized user interface.
图3仅示出了具有组件31-33的所述计算机设备3,本领域技术人员可以理解的是,图3示出的结构并不构成对所述计算机设备3的限定,既可以是总线型结构,也可以是星形结构,所述计算机设备3还可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。其他现有的或今后可能出现的电子产品如可适应于本发明,也应包含在本发明的保护范围以内,并以引用方式包含于此。FIG. 3 only shows the computer device 3 with components 31-33. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the computer device 3, and may be a bus type The structure may also be a star structure, and the computer device 3 may also include fewer or more components than shown in the figure, or a combination of certain components, or a different component arrangement. If other existing or future electronic products can be adapted to the present invention, they should also be included in the protection scope of the present invention and included here by reference.
在上述实施例中,可以全部或部分地通过应用程序、硬件、固件或者其任意组合来实现。当使用应用程序实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it may be implemented in whole or in part by application programs, hardware, firmware, or any combination thereof. When implemented using an application program, it can be implemented in the form of a computer program product in whole or in part.
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如,同轴电缆、光纤、数字用户线)或无线(例如,红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD),或者半导体介质(例如,固态硬盘(Solid State Disk,SSD))等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website site, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line) or wireless (for example, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)).
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例中的方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用应用程序功能单元的形式实现。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or application program functional unit.
所述集成的单元如果以应用程序功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以应用程序产品的形式体现出来,该计算机应用程序产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储下载程序的介质。If the integrated unit is implemented in the form of an application functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of an application product, and the computer application product is stored in a storage The medium includes a number of instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, hard disk, read-only memory (Read-Only Memory, ROM), magnetic disk or optical disk and other media that can store download programs.
需要说明的是,上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、物品或者方法中还存在另外的相同要素。It should be noted that the serial numbers of the above-mentioned embodiments of the present invention are only for description, and do not represent the superiority of the embodiments. And the terms "include", "include" or any other variations thereof in this article are intended to cover non-exclusive inclusion, so that a process, article or method including a series of elements not only includes those elements, but also includes those that are not explicitly listed The other elements of, or also include elements inherent to this process, article or method. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, article or method that includes the element.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only the preferred embodiments of the present invention, and do not limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied to other related technical fields , The same reason is included in the scope of patent protection of the present invention.

Claims (11)

  1. 一种基于多资产模型的区块链资产处理方法,其特征在于,所述方法包括:A blockchain asset processing method based on a multi-asset model, characterized in that the method includes:
    接收用户创建数字资产账户的请求;Receive users' requests to create digital asset accounts;
    生成所述用户的第一账户的第一私钥,并根据所述第一私钥计算生成对应所述第一账户的第一账户地址;Generating a first private key of the user's first account, and calculating and generating a first account address corresponding to the first account according to the first private key;
    生成所述用户的第二账户的第二私钥,并根据所述第二私钥计算生成对应第二账户的第二账户地址,其中所述第二账户与所述第一账户基于不同的资产模型;Generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account based on the second private key, wherein the second account and the first account are based on different assets model;
    当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产。When a digital asset is acquired, the first account and/or the second account are used to store the acquired digital asset.
  2. 根据权利要求1所述的方法,其特征在于,所述生成所述用户的第二账户的第二私钥包括:The method according to claim 1, wherein the generating the second private key of the second account of the user comprises:
    利用预定的映射算法对所述第一私钥进行映射计算,得到所述第二私钥;或者,Perform a mapping calculation on the first private key using a predetermined mapping algorithm to obtain the second private key; or,
    利用预定的随机数生成算法生成第二随机数作为所述第二私钥。A predetermined random number generation algorithm is used to generate a second random number as the second private key.
  3. 如权利要求2所述的方法,其特征在于,所述根据所述第一私钥计算生成对应所述第一账户的第一账户地址包括:The method according to claim 2, wherein said calculating and generating a first account address corresponding to said first account according to said first private key comprises:
    根据所述第一私钥计算生成第一公钥;Calculating and generating a first public key according to the first private key;
    采用第一哈希函数计算所述第一公钥的第一哈希值;Calculating the first hash value of the first public key by using a first hash function;
    将所述第一哈希值作为所述第一账户的第一账户地址。Use the first hash value as the first account address of the first account.
  4. 如权利要求2所述的方法,其特征在于,所述根据所述第二私钥计算生成对应第二账户的第二账户地址包括:The method according to claim 2, wherein said calculating and generating the second account address corresponding to the second account according to the second private key comprises:
    根据所述第二私钥计算生成第二公钥;Calculating and generating a second public key according to the second private key;
    采用第二哈希函数计算所述第一公钥的第二哈希值;Calculating the second hash value of the first public key by using a second hash function;
    将所述第二哈希值作为所述第二账户的第二账户地址。Use the second hash value as the second account address of the second account.
  5. 如权利要求1所述的方法,其特征在于,所述当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产包括:The method according to claim 1, wherein when a digital asset is acquired, using the first account and/or the second account to store the acquired digital asset comprises:
    显示所述第一账户及所述第二账户;Display the first account and the second account;
    当接收用户对所述第一账户及所述第二账户的选定操作时,将用户选定的 账户作为目标账户;When receiving the user's selection operation on the first account and the second account, use the account selected by the user as the target account;
    利用所述目标账户存储所述获取到的数字资产。Use the target account to store the acquired digital asset.
  6. 如权利要求1至5中任意一项所述的方法,其特征在于,The method according to any one of claims 1 to 5, wherein:
    所述第一账户为Account账户,所述第二账户为UTXO账户;或者The first account is an Account account, and the second account is a UTXO account; or
    所述第一账户为UTXO账户,所述第二账户为Account账户。The first account is a UTXO account, and the second account is an Account account.
  7. 如权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6, wherein the method further comprises:
    定时同步或订阅所述区块链网络上新生成的数据区块;Regularly synchronize or subscribe to newly generated data blocks on the blockchain network;
    当所述数据区块中的资产为UTXO时,采用与所述UTXO账户对应的私钥过滤出所述新生成的数据区块中的UTXO,并将过滤出的UTXO添加至所述UTXO账户;When the asset in the data block is UTXO, use the private key corresponding to the UTXO account to filter out the UTXO in the newly generated data block, and add the filtered UTXO to the UTXO account;
    当所述数据区块中的资产为Account时,获取所述新生成的数据区块中的Account,并将获取到的Account添加至所述Account账户中;When the asset in the data block is Account, obtain the Account in the newly generated data block, and add the obtained Account to the Account account;
    显示所述UTXO账户的面值或者所述Account账户的金额。Display the face value of the UTXO account or the amount of the Account account.
  8. 如权利要求7所述的方法,其特征在于,所述方法还包括:8. The method of claim 7, wherein the method further comprises:
    当定时同步或订阅到所述区块链网络上新生成的数据区块时,将所述数据区块广播至所述区块链网络上的其他共识节点;When timing synchronization or subscription to the newly generated data block on the blockchain network, broadcasting the data block to other consensus nodes on the blockchain network;
    验证所述其他共识节点中是否有超过预设阈值的节点对所述数据区块进行共识;及Verifying whether any of the other consensus nodes exceeds a preset threshold for consensus on the data block; and
    当所述其他共识节点中有超过预设阈值的节点对所述数据区块进行了共识,确定所述数据区块共识完成;或When the other consensus nodes that exceed the preset threshold have reached a consensus on the data block, it is determined that the data block consensus is completed; or
    当所述其他共识节点中没有超过预设阈值的节点对所述数据区块进行共识,确定所述数据区块共识失败。When none of the other consensus nodes exceeds the preset threshold to reach a consensus on the data block, it is determined that the data block consensus fails.
  9. 一种基于多资产模型的区块链资产处理装置,其特征在于,所述装置包括:A block chain asset processing device based on a multi-asset model, characterized in that the device includes:
    请求接收模块,用于接收用户创建数字资产账户的请求;The request receiving module is used to receive the user's request to create a digital asset account;
    第一计算模块,用于生成所述用户的第一账户的第一私钥,并根据所述第一私钥计算生成对应所述第一账户的第一账户地址;A first calculation module, configured to generate a first private key of the user's first account, and calculate and generate a first account address corresponding to the first account according to the first private key;
    第二计算模块,用于生成所述用户的第二账户的第二私钥,并根据所述第二私钥计算生成对应第二账户的第二账户地址,其中所述第二账户与所述第一账户基于不同的资产模型;The second calculation module is configured to generate a second private key of the user's second account, and calculate and generate a second account address corresponding to the second account according to the second private key, wherein the second account is the same as the The first account is based on different asset models;
    资产存储模块,用于当获取到数字资产时,利用所述第一账户和/或第二账户存储获取到的数字资产。The asset storage module is configured to use the first account and/or the second account to store the acquired digital assets when digital assets are acquired.
  10. 一种计算机设备,其特征在于,所述计算机设备包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的基于多资产模型的区块链资产处理的下载程序,所述基于多资产模型的区块链资产处理的下载程序被所述处理器执行时实现如权利要求1至8中任意一项所述的基于多资产模型的区块链资产处理方法。A computer device, characterized in that the computer device includes a memory and a processor, and a download program for blockchain asset processing based on a multi-asset model that can be run on the processor is stored in the memory. When the download program of the blockchain asset processing based on the multi-asset model is executed by the processor, the method for processing the blockchain asset based on the multi-asset model as described in any one of claims 1 to 8 is realized.
  11. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有基于多资产模型的区块链资产处理的下载程序,所述基于多资产模型的区块链资产处理的下载程序可被一个或者多个处理器执行以实现如权利要求1至8中任意一项所述的基于多资产模型的区块链资产处理方法。A computer-readable storage medium is characterized in that a download program for blockchain asset processing based on a multi-asset model is stored on the computer-readable storage medium, and the downloading of the blockchain asset processing based on the multi-asset model The program can be executed by one or more processors to realize the blockchain asset processing method based on the multi-asset model as described in any one of claims 1 to 8.
PCT/CN2019/125619 2019-08-20 2019-12-16 Blockchain asset processing method based on multiple asset models and related device WO2021031473A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910769523.5A CN110535639A (en) 2019-08-20 2019-08-20 Block chain assets disposition method and relevant device based on more asset models
CN201910769523.5 2019-08-20

Publications (1)

Publication Number Publication Date
WO2021031473A1 true WO2021031473A1 (en) 2021-02-25

Family

ID=68663763

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/125619 WO2021031473A1 (en) 2019-08-20 2019-12-16 Blockchain asset processing method based on multiple asset models and related device

Country Status (2)

Country Link
CN (1) CN110535639A (en)
WO (1) WO2021031473A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114362960A (en) * 2021-12-31 2022-04-15 杭州趣链科技有限公司 Resource account data supervision method and device, computer equipment and medium

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535639A (en) * 2019-08-20 2019-12-03 深圳市网心科技有限公司 Block chain assets disposition method and relevant device based on more asset models
CN111027036B (en) * 2019-12-09 2022-10-21 武汉信安珞珈科技有限公司 Identity association method based on block chain
CN111275414A (en) * 2019-12-31 2020-06-12 深圳市网心科技有限公司 Block chain-based digital currency exchange method, device and system
CN111314066B (en) * 2020-01-23 2022-02-11 腾讯科技(深圳)有限公司 Block chain-based data transfer method, terminal and computer-readable storage medium
CN111339501B (en) * 2020-02-20 2022-10-14 百度在线网络技术(北京)有限公司 Copyright protection method, device, equipment and medium based on block chain
CN113435888B (en) * 2020-04-13 2022-05-31 腾讯科技(深圳)有限公司 Account data processing method, device, equipment and storage medium
CN111756743B (en) * 2020-06-24 2021-12-14 腾讯科技(深圳)有限公司 Resource transfer method and device based on block chain, computer equipment and storage medium
CN112187788B (en) * 2020-09-27 2022-09-16 上海万向区块链股份公司 Block chain-based multi-level asset transfer method, system and traceability method
CN113220786B (en) * 2021-05-25 2022-05-24 杭州复杂美科技有限公司 Logistics certificate storage method, computer equipment and storage medium
US11956368B2 (en) * 2021-12-17 2024-04-09 Advanced Micro Devices, Inc. Enhanced method for a useful blockchain consensus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107222312A (en) * 2017-06-20 2017-09-29 无锡井通网络科技有限公司 Assets digitizing solution based on block chain technology
CN110535639A (en) * 2019-08-20 2019-12-03 深圳市网心科技有限公司 Block chain assets disposition method and relevant device based on more asset models

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171494A (en) * 2017-11-23 2018-06-15 阿里巴巴集团控股有限公司 A kind of data processing method and device
CN108694575A (en) * 2018-06-13 2018-10-23 深圳前海微众银行股份有限公司 Verification method of transferring accounts, device and storage medium based on block chain
CN109242485B (en) * 2018-08-13 2020-07-10 阿里巴巴集团控股有限公司 Block chain transaction method and device and electronic equipment
CN109447639A (en) * 2018-10-23 2019-03-08 杭州复杂美科技有限公司 Privacy transactions balances scan method, equipment and storage medium
CN111784341B (en) * 2019-02-01 2024-05-28 创新先进技术有限公司 Block chain transaction method and device, electronic equipment and storage medium
CN110020860B (en) * 2019-04-09 2023-09-05 湖南天河国云科技有限公司 Cross-chain asset transfer method, system and computer readable storage medium
CN110096905B (en) * 2019-04-28 2021-10-01 杭州秘猿科技有限公司 Method and device for encrypting trusted assets by adopting block chain technology and electronic equipment
CN110135993B (en) * 2019-05-17 2021-07-30 深圳银链科技有限公司 Method, equipment and storage medium for adapting UTXO model to intelligent contract account model

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107222312A (en) * 2017-06-20 2017-09-29 无锡井通网络科技有限公司 Assets digitizing solution based on block chain technology
CN110535639A (en) * 2019-08-20 2019-12-03 深圳市网心科技有限公司 Block chain assets disposition method and relevant device based on more asset models

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CHAINLINK: "ChainLink White Paper: the Value of the World's First Commercial Currency LINK Token", 16 July 2019 (2019-07-16), pages 1 - 4, XP009526678, Retrieved from the Internet <URL:https://www.qukuaiwang.com.cn/news/142834.html> *
DING DONGHUI; LI KANG; JIA LINPENG; LI ZHONGCHENG; LI JUN; SUN YI: "Privacy protection for blockchains with account and multi-asset model", CHINA COMMUNICATIONS, CHINA INSTITUTE OF COMMUNICATIONS, PISCATAWAY, NJ, USA, vol. 16, no. 6, 1 June 2019 (2019-06-01), Piscataway, NJ, USA, pages 69 - 79, XP011733410, ISSN: 1673-5447, DOI: 10.23919/j.cc.2019.06.006 *
FRED KRUEGER: "LynxChain WhitePaper 1.0. I. Introducing LynxChain", 3 September 2019 (2019-09-03), pages 1 - 11, XP055782623, Retrieved from the Internet <URL:https://medium.com/lynxwallet/lynx-chain-whitepaper-1-0-6869fd9582c3> [retrieved on 20210305] *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114362960A (en) * 2021-12-31 2022-04-15 杭州趣链科技有限公司 Resource account data supervision method and device, computer equipment and medium

Also Published As

Publication number Publication date
CN110535639A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
WO2021031473A1 (en) Blockchain asset processing method based on multiple asset models and related device
US20210027289A1 (en) Asset transaction method, storage medium, and computer device
CN110825349B (en) Random number generation method, block chain node, system and medium
CN110011788B (en) Data processing method, system and related equipment based on block chain
US11875171B2 (en) Blockchain network transaction processing method, apparatus, device, and storage medium
WO2018076760A1 (en) Block chain-based transaction processing method, system, electronic device, and storage medium
CN108846753B (en) Method and apparatus for processing data
CN110569309A (en) Apparatus, method, system, and medium for implementing blockchains
CN110473104B (en) Transaction processing method and related equipment
CN109857580B (en) Block chain cross-chain contract calling method and device and storage medium
CN112150141A (en) Block chain consensus method, device and system
CN103299602A (en) Data synchronization
CN111277635B (en) Method, equipment, device and computer medium for accessing external node to block chain
CN111163130A (en) Network service system and data transmission method thereof
CN111597567A (en) Data processing method, data processing device, node equipment and storage medium
CN112492048B (en) Message synchronization method and device, electronic equipment and readable storage medium
KR20180005542A (en) Apparatus and method for verifing data integrity
CN111988418B (en) Data processing method, device, equipment and computer readable storage medium
CN105453058A (en) Directory service discovery and/or learning
CN113055380A (en) Message processing method and device, electronic equipment and medium
CN113508570B (en) Method for sharing and verifying blocks and electronic documents among nodes in block chain
US20230259930A1 (en) Cross-chain transaction processing method and apparatus, electronic device, and storage medium
CN115951923B (en) Subscription event management method, display system, device and storage medium
WO2023207529A1 (en) Data processing method and apparatus, device, medium, and product
WO2021134424A1 (en) Blockchain-based digital currency transaction method, apparatus and system

Legal Events

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

Ref document number: 19942132

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19942132

Country of ref document: EP

Kind code of ref document: A1