Ordinal management for cryptocurrency
By allocating globally unique currency numbers to the minimum currency unit of cryptocurrency in the blockchain system, the problem of difficult traceability and management of the smallest currency unit in the existing technology is solved, and the traceability and management efficiency of the cryptocurrency flow process are improved.
Patent Information
- Application Number
- PCT/CN2025/079763
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-29
- Filing Date
- 2025-02-28
- Publication Date
- 2025-09-04
AI Technical Summary
The lack of ordinal management of the minimum currency unit of cryptocurrency in the current blockchain system makes it difficult to trace and manage the flow process of specific minimum currency units.
By assigning a globally unique currency number to each minimum currency unit in the blockchain system, recording the currency sequence of the minimum currency unit corresponding to the value transferred by the exchange, and determining and recording the input and output currency sequence of each transaction using the ordinal management system.
The traceability and management of the minimum currency unit of cryptocurrency is realized, and the traceability and management efficiency of cryptocurrency flow in the blockchain system is improved.
Smart Images

Figure CN2025079763_04092025_PF_FP_ABST
Abstract
Description
Ordinal Management of Cryptocurrencies Technical Field
[0001] The embodiments of this specification belong to the field of blockchain technology, and more particularly to an ordinal management system and method for cryptocurrency. Background Art
[0002] Blockchain is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. In a blockchain system, data blocks are linked sequentially in chronological order to form a chain-like data structure, and cryptographically guaranteed to be tamper-proof and unforgeable.
[0003] Cryptocurrencies can be circulated in current blockchain systems. In such systems, which are based on the UTXO (Unspent Transaction Outputs) model, the circulating cryptocurrency can be traced based on references between transactions. Such cryptocurrencies can be composed of minimal monetary units. Related technologies have proposed the Ordinals protocol, which numbers minimal monetary units, but effective implementation and application of the Ordinals protocol is currently lacking within the industry.
[0004] To accurately distinguish each minimum monetary unit, a globally unique ordinal number (also known as a serial number, serial number, or serial number) can be assigned to each circulating minimum monetary unit. However, current blockchain networks typically only record transactions and the flow and value of the transferred cryptocurrency, without recording the ordinal number of the minimum monetary unit corresponding to that value. This makes it difficult to subsequently trace and manage the circulation of specific minimum monetary units. Summary of the Invention
[0005] The purpose of the present invention is to provide an ordinal management system and an ordinal management method for cryptocurrency, which are used to record the currency ordinal range of the smallest currency unit corresponding to the transfer value of an exchange.
[0006] According to a first aspect of one or more embodiments of this specification, a method for ordinal management of cryptocurrency is proposed, which is applied to an ordinal management system corresponding to a blockchain system, wherein the blockchain system is implemented based on an unspent transaction output (UTXO) model, and the cryptocurrency circulating in the blockchain system is composed of minimum currency units, each minimum currency unit having a globally unique currency ordinal. The method comprises: for any transaction in the current block, determining at least one previous UTXO referenced by any transaction and at least one current UTXO generated by any transaction, wherein the previous UTXO is generated by a previous transaction and the previous transaction is executed before any transaction; obtaining the corresponding values of each previous UTXO respectively. The input currency ordinal range is an input currency ordinal range, wherein the cryptocurrency value of any previous UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the input currency ordinal range corresponding to the previous UTXO, and each input currency ordinal range is arranged in sequence according to the reference order of the said previous UTXOs to constitute the transaction currency ordinal range of the said any transaction; within the said transaction currency ordinal range, the output currency ordinal range corresponding to each current UTXO is determined in sequence according to the generation order of each current UTXO, wherein the cryptocurrency value of any current UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the output currency ordinal range corresponding to the current UTXO.
[0007] According to a second aspect of one or more embodiments of this specification, an ordinal management system is proposed. The blockchain system corresponding to the ordinal management system is implemented based on the UTXO model. The cryptocurrency circulating in the blockchain system is composed of minimum currency units, and each minimum currency unit has a globally unique currency ordinal. The system is used to: for any transaction in the current block, determine at least one previous UTXO referenced by the any transaction and at least one current UTXO generated by the any transaction, the previous UTXO being generated by the previous transaction and executed before the any transaction; obtain the input currency ordinal range corresponding to each previous UTXO, The cryptocurrency value of any previous UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the input currency ordinal range corresponding to the previous UTXO, and the input currency ordinal ranges are arranged in sequence according to the reference order of the said previous UTXOs to constitute the transaction currency ordinal range of the said any transaction; within the said transaction currency ordinal range, the output currency ordinal range corresponding to each current UTXO is determined in sequence according to the generation order of each current UTXO, and the cryptocurrency value of any current UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the output currency ordinal range corresponding to the current UTXO.
[0008] According to a third aspect of one or more embodiments of this specification, an electronic device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the method as described in any one of the first aspects by running the executable instructions.
[0009] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0010] According to a fifth aspect of one or more embodiments of this specification, a computer program product is proposed, comprising a computer program and / or instructions, which, when executed by a processor, implement the steps of the method described in any one of the first aspects.
[0011] In the embodiment of this specification, the cryptocurrency circulating in the blockchain system corresponding to the ordinal management system is composed of minimum currency units, and each minimum currency unit has a globally unique currency ordinal. For any transaction in the current block, the system first determines at least one previous UTXO referenced by the transaction and at least one current UTXO generated by it, and then obtains the input currency ordinal range corresponding to each previous UTXO, wherein each input currency ordinal range is arranged in the order of reference of the previous UTXO to constitute the transaction currency ordinal range of the transaction. Based on this, within the transaction currency ordinal range, the output currency ordinal range corresponding to each current UTXO is determined in sequence according to the generation order of each current UTXO.
[0012] It can be understood that the output currency ordinal range corresponding to each current UTXO, determined in sequence according to the generation order of each current UTXO, together constitutes the output currency ordinal range of any transaction. All minimum currency units whose currency ordinals are within this range are the cryptocurrencies transferred when the blockchain network executes any transaction, and the sum of the values of these minimum currency units is the value transferred when the transaction is executed. In addition, the ordinal management system processes each transaction in the current block in the above manner to determine the output currency ordinal range of each transaction; and the above processing is performed on each block in the distributed ledger maintained by the blockchain network to determine the output currency ordinal range of each transaction in each block. The ordinal management system can maintain the output currency ordinal range determined in the above manner, thereby recording the ordinal of the minimum currency unit corresponding to the transferred value, so as to subsequently trace and manage the circulation process of the specific minimum currency unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] FIG1 is a schematic diagram of an ordinal number management system provided by an exemplary embodiment.
[0014] FIG2 is a flowchart of a method for managing ordinal numbers of a cryptocurrency provided by an exemplary embodiment.
[0015] FIG3 is a schematic diagram of input and output of a transaction provided by an exemplary embodiment.
[0016] FIG4 is a schematic diagram of a process for splitting a currency ordinal range provided by an exemplary embodiment.
[0017] FIG5 is a schematic diagram of an ordinal management model provided by an exemplary embodiment.
[0018] FIG6 is a schematic structural diagram of a device provided by an exemplary embodiment.
[0019] FIG7 is a block diagram of a device for managing ordinal numbers of a cryptocurrency provided by an exemplary embodiment. DETAILED DESCRIPTION
[0020] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments derived by those skilled in the art based on the embodiments in this specification without creative effort shall fall within the scope of protection of this specification.
[0021] To address the aforementioned issues in related technologies, this specification proposes an ordinal management system and an ordinal management solution implemented by this system, for determining and recording the ordinal of the smallest monetary unit corresponding to the transferred value (this ordinal is specifically represented by a currency ordinal range). This solution can serve as an effective implementation and application of the aforementioned Ordinals protocol. This solution is described in detail below with reference to the accompanying figures.
[0022] Please refer to Figure 1, which is a schematic diagram of an ordinal management system provided by an exemplary embodiment. As shown in Figure 1, ordinal management system 101 is connected to blockchain network 103 via blockchain client 102. Ordinal management system 101 includes multiple functional modules, such as block processing module 1011, transaction processing module 1012, currency range determination module 1013, and persistence module 1014.
[0023] During the operation of the blockchain network 103, the blockchain nodes can initiate and execute transactions, as well as package the executed transactions to generate blocks and add them to the end of the chain structure (i.e., block chain). The blockchain client 102 has access capabilities to the blockchain network 103. Users can initiate transactions to the blockchain network 103 through the client, or they can query data on the chain through the client. For example, the ordinal management system 101 can synchronize and generate blocks that have not yet been chained or have been completed from the chain through the client, so as to process the synchronized blocks using the ordinal management scheme described in this specification. Of course, this specification does not limit the specific method for the ordinal management system 101 to access the blockchain network 103. In addition to accessing the network in the manner shown in Figure 1, in some embodiments, the ordinal management system 101 can also be directly connected to the blockchain network 103 and access the network (at this time, the network can be accessed without the aforementioned blockchain client 102).
[0024] The block processing module 1011 is used to perform preliminary processing on the blocks obtained from the blockchain network 103, such as parsing each transaction in the blockchain, determining the execution order of each transaction and marking it, etc. In addition, it can also be used to determine whether the most recently obtained block (hereinafter referred to as the local latest block) is the latest block on the chain generated by the blockchain network 103 (such as the block with the largest block height on the aforementioned chain structure): if the local latest block is not the latest block on the chain (that is, the block height of the local latest block is less than the maximum block height on the chain), the ordinal number management system 101 can be triggered to continue to obtain a block with a larger block height from the blockchain network 103; and if the local latest block is the latest block on the chain, it can wait for a preset period of time or receive the latest block on the chain notification issued by the blockchain network 103 before continuing to obtain the said latest block on the chain from the blockchain network 103.
[0025] The transaction processing module 1012 is used to execute each transaction serially or in parallel based on the reference relationships between transactions within the same block. Multiple transactions that do not reference each other can be executed in parallel by multiple threads; whereas multiple transactions that do reference each other can be executed serially (or sequentially) by a single thread, thereby ensuring the order of transaction execution while improving the overall execution efficiency of all transactions within the block. By executing any transaction, the previous UTXO referenced by the transaction and the current UTXO generated can be determined. Of course, it is understood that the process of executing any transaction by the transaction processing module 1012 (off-chain execution) is different from the process of executing the transaction by the blockchain nodes in the blockchain network 103 (on-chain execution). In addition, the ordinal management system 101 can also deploy a virtual machine, in which the transaction processing module 1012 executes the above-mentioned transactions, thereby ensuring that the on-chain and off-chain execution environments of the same transaction remain consistent, and thus ensuring that the execution results obtained by on-chain and off-chain execution are consistent.
[0026] The currency range determination module 1013 is used to obtain the input currency ordinal range corresponding to each previous UTXO referenced by any transaction in the manner described in the following embodiments, and based on this, determine the output currency ordinal range corresponding to each current UTXO generated by the transaction. For details, please refer to the detailed description of the embodiments below and will not be repeated here.
[0027] The persistence module 1014 can be used to persistently store the determined currency ordinal range. For example, it can persistently store the output currency ordinal range determined by the currency range determination module 1013 in a preset storage space, such as the local storage space of the ordinal management system 101 or a pre-associated external database (not described in detail here). The saved output currency ordinal range can be queried and managed at any subsequent time. Furthermore, the persistence module 1014 can also be used to store transaction records, such as the blocks retrieved from the blockchain network 103 and the execution results of each transaction therein.
[0028] In one embodiment, in addition to the various functional modules shown in Figure 1, the ordinal management system 101 may also include an ordinal query module (used to respond to a request to query the persistent storage of the aforementioned output currency ordinal range, block or transaction execution results, etc.), a token engraving module (used to complete the token engraving processing in response to the token engraving request) and other functional modules. The specific functional implementation process of each module can be found in the embodiments below and will not be repeated here.
[0029] The blockchain system corresponding to the ordinal management system is implemented based on the UTXO model. The cryptocurrency circulating in the blockchain system is composed of minimum currency units, each of which has a globally unique currency ordinal number. That is, each currency ordinal number is used to represent a minimum currency unit. The currency ordinal numbers of each minimum currency unit increase in the order in which the minimum currency units were generated. Furthermore, any unit of cryptocurrency is composed of one or more minimum currency units, meaning that there is a fixed conversion factor between the cryptocurrency and the minimum currency unit. For example, a cryptocurrency in a blockchain network is composed of one or more currency units. For example, the conversion factor between BTC and SAT in the Bitcoin blockchain network is 10^8.
[0030] This specification does not limit the type of cryptocurrency circulating in the blockchain system, that is, the embodiments of this specification do not limit the type of blockchain network. For example, the cryptocurrency may be Bitcoin, Antshares (NEO), Litecoin (LTC), Cardano (ADA), Zerocash, etc. The following description only takes Bitcoin as an example.
[0031] When implementing the ordinal management scheme described in this specification, the ordinal management system 101 may: for any transaction in the current block, determine at least one previous UTXO referenced by the transaction and at least one current UTXO generated by the transaction, wherein the previous UTXO is generated by a previous transaction that is executed before the transaction; obtain the input currency ordinal range corresponding to each previous UTXO, wherein the cryptocurrency value of any previous UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the input currency ordinal range corresponding to the previous UTXO, and the input currency ordinal ranges are arranged in sequence according to the order in which the previous UTXOs are referenced to constitute the transaction currency ordinal range of the transaction; within the transaction currency ordinal range, determine the output currency ordinal range corresponding to each current UTXO in sequence according to the generation order of each current UTXO, wherein the cryptocurrency value of any current UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the output currency ordinal range corresponding to the current UTXO.
[0032] In particular, the current block described in the embodiments of this specification can be any block obtained by the ordinal management system from the blockchain network, and the any transaction is a transaction used for transfer in the block. It should be noted that the current transaction may include multiple transactions, which can be divided into two categories: ordinary transfer transactions and block reward transactions, and any transaction described in this specification is any ordinary transfer transaction. In particular, the ordinary transfer transaction is a transaction for transferring cryptocurrency between different addresses. The transaction is used to transfer a certain value of cryptocurrency from at least one transferor address to at least one transferee address. The blockchain system executes the ordinary transfer transaction to enable this part of the cryptocurrency to be transferred (referred to as currency transfer), that is, the monetary value of this part of the cryptocurrency is circulated between different addresses (referred to as value circulation). The block reward transaction is used to allocate a corresponding amount of cryptocurrency to a preset address (bound to the blockchain node that packages and generates the current block), that is, to allocate a certain amount of monetary value (of this part of the cryptocurrency) created by the system to the preset address. In addition, the block reward transaction can also be used to transfer the cryptocurrency corresponding to the handling fees of each ordinary transfer transaction in the block from the corresponding address (such as the address pre-specified by the transaction initiator) to the preset address, thereby rewarding the aforementioned blockchain node for packaging each ordinary transfer transaction into the current block. Each of the above addresses is an address registered in the blockchain network and can be regarded as an account used to carry cryptocurrency.
[0033] It can be understood that the output currency ordinal range corresponding to each current UTXO, determined in sequence according to the generation order of each current UTXO, together constitutes the output currency ordinal range of any transaction. All minimum currency units whose currency ordinals are within this range are the cryptocurrency transferred when the blockchain network executes any transaction, and the sum of the values of these minimum currency units is the value transferred when the transaction is executed. In addition, the ordinal management system processes each transaction in the current block in the above manner to determine the output currency ordinal range of each transaction; and the above processing is performed on each block in the distributed ledger maintained by the blockchain network to determine the output currency ordinal range of each transaction in each block. The ordinal management system can maintain (such as persisting the output currency ordinal range in a local or preset database) the output currency ordinal range determined in the above manner, thereby recording the ordinal of the minimum currency unit corresponding to the transferred value, so as to subsequently trace and manage the circulation process of the specific minimum currency unit.
[0034] Please refer to Figure 2, which is a flowchart of a cryptocurrency ordinal management method provided by an exemplary embodiment. This method is applied to an ordinal management system corresponding to a blockchain system implemented based on the UTXO model. The cryptocurrency circulating in the blockchain system is composed of minimum currency units, each of which has a globally unique currency ordinal. As shown in Figure 2, the method includes steps 202-206.
[0035] Step 202: For any transaction in the current block, determine at least one previous UTXO referenced by the transaction and at least one current UTXO generated by the transaction, where the previous UTXO is generated by a previous transaction that is executed before the transaction.
[0036] In one embodiment, the current block is obtained from the blockchain network by the ordinal management system. For example, the ordinal management system can obtain all blocks in the blockchain ledger maintained by the blockchain network at any time, and then receive the latest block pushed by the currency ordinal range (i.e., a new block added to the end of the blockchain ledger after any of the aforementioned times); or it can request the latest block within the currency ordinal range according to a fixed query cycle (i.e., a new block added to the end of the blockchain ledger within a cycle after any of the aforementioned times). For another example, it is also possible to traverse and process the old blocks that have been obtained while obtaining the new block. For example, after obtaining block 0 (i.e., a block with a block height of 0, the same below), it can process this block as the current block and obtain block 1 at the same time; then, after processing block 0, it can continue to process block 1. Subsequent blocks are similar and will not be described in detail.
[0037] For the multiple blocks obtained from the blockchain network, these blocks can be traversed and processed in the order in which they were generated (i.e., in order of block height from small to large). When processing any of the blocks, the block is used as the "current block" described in the embodiments of this specification. Among them, the execution order of each transaction in the block can be determined first, and then each transaction can be traversed and processed in sequence according to the execution order. The process of processing any transaction is shown in the steps of Figure 2. The any transaction is any ordinary transfer transaction in the current block. The meaning of the ordinary transfer transaction can be found in the previous record and will not be repeated here.
[0038] In a blockchain system based on the UTXO model, any transaction transfer requires reference to at least one UTXO (unspent transaction output) generated by a previous transaction (executed before the transaction). These UTXOs are equivalent to the inputs of any transaction, hereinafter referred to as the previous UTXO. In addition, executing any transaction will generate at least one new UTXO, which is equivalent to the output of any transaction, hereinafter referred to as the current UTXO.
[0039] Given that any previous UTXO belongs to and only belongs to one previous transaction, that is, any previous UTXO is generated by a previous transaction. As mentioned above, any transaction can reference at least one previous UTXO, and these referenced UTXOs can belong to the same previous transaction or to multiple previous transactions. In other words, if any transaction references m1 previous UTXOs, and these previous UTXOs belong to m2 previous transactions, then m1 and m2 are both positive integers, and m1 is greater than or equal to m2.
[0040] As previously mentioned, the predecessor transaction of any transaction will be executed before any transaction (i.e., the predecessor transaction is executed before any transaction). In the case of referencing a predecessor UTXO in at least one predecessor transaction, at least one of these predecessor transactions may belong to the current block, i.e., any transaction and the at least one predecessor transaction it references are in the same block—in this case, the execution timing of this at least one predecessor transaction in the current block must be earlier than that of any transaction. And / or, at least one of these predecessor transactions may belong to a predecessor block of the current block, the block height of the predecessor block being lower than the block height of the current block, i.e., the predecessor block is executed and added to the end of the blockchain ledger first, and the current block is executed and added to the end of the blockchain ledger after (where "executing any block" means executing each transaction in that block). Therefore, each transaction in the predecessor block will be executed before any transaction, and the predecessor transaction in the predecessor block referenced by any transaction must also be executed before any transaction.
[0041] It should be noted that the "execution" of any preceding transaction and any transaction described herein should be understood as the on-chain execution performed by the currency ordinal range as described above, rather than the off-chain execution performed by the ordinal management system. Therefore, when acquiring claims for multiple blocks, the ordinal management system can flexibly select the order of off-chain execution for two blocks or two transactions that do not reference each other, and can even execute them in parallel to improve processing efficiency.
[0042] In one embodiment, the previous UTXO and current UTXO of any transaction are recorded in the transaction content (i.e., the source code of the transaction), so the ordinal management system can read the transaction content to determine at least one previous UTXO referenced by the transaction and at least one current UTXO generated by the transaction. For example, the block processing module in the ordinal management system can read the transaction content during the execution of any transaction to determine (or extract) the at least one previous UTXO and at least one current UTXO.
[0043] In one embodiment, when any of the transactions contains vin and vout fields, the ordinal management system can read these fields to extract the at least one previous UTXO and the at least one current UTXO. For example, at least one previous UTXO referenced by the transaction can be extracted from the vin field of any of the transactions, and at least one current UTXO generated by the transaction can be extracted from the vout field of any of the transactions. It can be understood that extracting the corresponding UTXO from any field means reading the description information of the corresponding UTXO from the field content (or value) contained in the field.
[0044] For example, the source code of any transaction in the current block is as follows:
[0045] The source code above shows that the vin field of any transaction contains a previous UTXO (referenced by the transaction), where the transaction ID of the previous transaction is "7957a35fe64f80d234d76d83a2a8f...". The referenced previous UTXO is the UTXO with index number 0 in the vout field of the previous transaction. Furthermore, the vout field of any transaction contains two current UTXOs (generated by the transaction). The current UTXO with index number 0 has a monetary value of 0.15 cryptocurrency, and the current UTXO with index number 1 has a monetary value of 0.85 cryptocurrency. As previously mentioned, the cryptocurrency described in this specification is composed of one or more minimum currency units. There is a fixed conversion factor between cryptocurrency and minimum currency units. Therefore, the 0.15 cryptocurrency mentioned above should be understood as the cryptocurrency being composed of 0.15*10^8 minimum currency units, that is, the total value of these minimum currency units is equal to the value of the 0.15 cryptocurrency.
[0046] Similarly, the referenced previous transaction also includes vin and vout fields. Among them, when any previous transaction is an ordinary transfer transaction, the transaction can further reference the UTXO generated by other transactions; or, when any previous transaction is a block reward transaction, the transaction does not reference the UTXO generated by other transactions (it does not have a vin field or the value of the vin field is empty). In this way, any UTXO referenced or generated by any exchange in the blockchain network can be traced back to the block reward transaction according to the reference relationship between transactions, that is, the cryptocurrencies circulating on the chain are all generated by the allocation of blockchain nodes with a currency ordinal range of the packaged block. Of course, in some other embodiments, the cryptocurrencies circulating on the chain can also be generated based on off-chain resources of corresponding value. At this time, the cryptocurrencies corresponding to the UTXO generated by each transaction can be traced back to the transactions that generated these cryptocurrencies, which will not be repeated here.
[0047] The above method can be used to determine at least one previous UTXO referenced by any transaction and at least one current UTXO generated by it. It is noted that when there are multiple previous UTXOs, any two of them can belong to the same address or different addresses.
[0048] As shown in Figure 3, any transaction references m previous-order UTXOs (i.e., UTXO_in1 to UTXO_inm) and generates n current UTXOs (i.e., UTXO_out1 to UTXO_outn). Any previous-order UTXO belongs to a previous-order transaction, and different previous-order UTXOs can belong to the same or different previous-order transactions. For example, UTXO_in1 and UTXO_inx belong to previous-order transactions Tx1 and Txx, respectively (the arrow from UTXO_in1 to previous-order transaction Tx1 indicates that previous transaction Tx1 generates UTXO_in1, meaning that UTXO_in1 belongs to previous transaction Tx1. The same applies to other arrows).
[0049] Step 204: Obtain the input currency ordinal ranges corresponding to each preceding UTXO, wherein the cryptocurrency value of any preceding UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the input currency ordinal range corresponding to the preceding UTXO. The input currency ordinal ranges are arranged in sequence according to the order in which the preceding UTXOs are referenced to form the transaction currency ordinal range of any transaction.
[0050] For at least one previous UTXO determined, the ordinal management system can obtain the input currency ordinal range corresponding to each previous UTXO. The currency ordinal range corresponding to any previous UTXO is the currency ordinal set of all cryptocurrencies corresponding to the UTXO, that is, the currency ordinal range records the currency ordinals of all cryptocurrencies corresponding to this UTXO.
[0051] In one embodiment, the ordinal management system can maintain the location information of each UTXO generated by the previous transaction and at least one corresponding currency ordinal range. For example, in the case where the previous transaction belongs to the previous block, the ordinal management system can save the currency ordinal range and its location information in a preset storage space (such as the local storage or preset database of the ordinal management system) after processing the previous transaction in the previous block to obtain its currency ordinal range (the range can be regarded as the current currency ordinal range of the previous transaction itself). The above-mentioned currency ordinal range and its location information are saved in the same record table by the customer, or the location information of the above-mentioned currency ordinal range can also be saved in the ordinal position record table, and the above-mentioned currency ordinal range (actually the description information of the range) can be saved in the ordinal range record table. Based on this, in the process of processing any of the transactions, obtaining the input currency ordinal range corresponding to any preceding UTXO may include: first determining the target preceding transaction that generates any of the UTXOs and the target location information of any preceding UTXO; then querying the target location information and its corresponding at least one target currency ordinal range in the maintained location information of the target preceding transaction and its corresponding at least one currency ordinal range; and arranging the at least one target currency ordinal range in order to form the input currency ordinal range corresponding to any preceding UTXO. In this way, the ordinal management system can accurately and quickly obtain the input currency ordinal ranges corresponding to each preceding UTXO referenced by any of the transactions from the above information maintained by itself.
[0052] For example, as shown in Figure 4, any transaction references two previous UTXOs (i.e., the 0th and 1st in UTXO_in). The monetary value of the 0th previous UTXO is 2000 sats, and the input currency ordinal range corresponding to this previous UTXO is [0, 1999]. This means that the monetary ordinals of the 2000 smallest currency units corresponding to this previous UTXO are: 0, 1, 2, 3, ..., 1999. Similarly, the monetary value of the 1st previous UTXO is 3000 sats, and the input currency ordinal range corresponding to this previous UTXO is [3000, 5999]. This means that the monetary ordinals of the 3000 smallest currency units corresponding to this previous UTXO are: 3000, 3001, 3002, 3003, ..., 5999. The input currency ordinal ranges are arranged in sequence according to the reference order of the preceding UTXOs (i.e., [0, 1999] first and [3000, 5999] last) to form the transaction currency ordinal range of any transaction. The subsequent step 206 is a process of determining the output currency ordinal ranges corresponding to each current UTXO in the transaction currency ordinal range, that is, a process of splitting the transaction currency ordinal range into individual output currency ordinal ranges.
[0053] As mentioned above, the ordinal management system can maintain an ordinal position record table and an ordinal range record table of the previous transactions. The ordinal position record table is used to record the position information, and the ordinal range record table is used to record the currency ordinal range corresponding to each UTXO generated by any of the previous transactions. The position information of any recorded UTXO points to at least one currency ordinal range corresponding to the recorded UTXO. The pointing can be achieved in a variety of ways. For example, in the case where any transaction references m previous UTXOs, the ordinal position record table can contain m entries corresponding to these m previous UTXOs, wherein the entry corresponding to any previous UTXO records the ordinal position information of the previous UTXO. The number of the ordinal range record tables can be one or more. For example, in the case where any transaction generates m current UTXOs, one or n ordinal range record tables can be maintained: when one ordinal range record table is maintained, all the currency ordinal ranges of the m current UTXOs can be recorded in the table, and each currency ordinal range corresponds to one table entry; and when n ordinal range record tables are maintained, all the currency ordinal ranges (one or more) of the UTXO can be recorded in the ordinal range record table corresponding to any current UTXO, and each currency ordinal range corresponds to one table entry.
[0054] In addition, the above-mentioned pointing can be achieved in a variety of ways. For example, any table entry in the ordinal range record table can include the ID of the table entry or the ID of the currency ordinal range corresponding to the table entry, and the table entry corresponding to at least one currency ordinal range in the ordinal position record table can record the ID set composed of the IDs of these currency ordinal ranges; or, any table entry in the ordinal position record table can include at least one pointer, each pointer pointing to a corresponding ordinal range record table or to different tables in the same ordinal range record table.
[0055] Based on the above-mentioned ordinal position record table and ordinal range record table, when the ordinal management system queries the target position information and the at least one target currency ordinal range corresponding to the position information of the target predecessor transaction and the at least one currency ordinal range corresponding to the target transaction, it can include: querying the target position information in the ordinal position record table of the target predecessor transaction, and determining the at least one currency ordinal range pointed to by the target position information in the ordinal range record table of the target predecessor transaction. In this way, the currency ordinal range and its position information are stored in different record tables respectively, realizing the independent storage of the currency ordinal range and its position information, helping to reduce the amount of information in a single table item, and realizing information decoupling, thereby helping to improve the efficiency of information management.
[0056] In one embodiment, the present invention proposes an ordinal management model for any transaction described above. The model includes four tables: an input ordinal information table (hereinafter referred to as M1), an output ordinal information table (hereinafter referred to as M2), an ordinal position record table (hereinafter referred to as M3), and an ordinal range record table (hereinafter referred to as M4). After determining at least one (assuming m) previous UTXO and at least one (assuming n) current UTXO of any transaction described above in step 202, M1 (containing m entries) and M2 (containing n entries) for the transaction can be generated.
[0057] M1 includes m entries corresponding to m previous UTXOs (i.e., UTXO_in1 information to UTXO_inm information), where any entry corresponding to any previous UTXO can contain the basic information and positioning information of the previous UTXO. The basic information may include the transaction hash (such as txid) of the reference transaction to which the previous UTXO belongs, the unlocking script segregated witness; the index number of the previous UTXO in the previous transaction (such as n in vout), the reference script address in the previous transaction (such as scriptPubKey_address in vout), the reference locking script type in the previous transaction (such as scriptPubKey_type in vout), the monetary value of the previous UTXO (such as value in vout), etc. The positioning information may include the transaction hash of the previous transaction and the block hash of the current block.
[0058] M2 includes n entries corresponding to n current UTXOs (i.e., UTXO_out1 information to UTXO_outn information), wherein any entry corresponding to any current UTXO may contain the basic information and positioning information of the current UTXO. The basic information may include the index number of the current UTXO in any transaction (such as n in vout), the monetary value of the current UTXO (such as value in vout), the current script address in any transaction (such as scriptPubKey_address in vout), the current locking script type in any transaction (such as scriptPubKey_type in vout), etc. The positioning information may include the transaction hash of any transaction and the block hash of the current block, etc.
[0059] M3 includes n entries (i.e., sat1 position information to satn position information) that correspond one-to-one to n current UTXOs (i.e., one-to-one to n entries in M2). Any entry corresponding to any current UTXO may include the transaction hash of any transaction, the index number of the current UTXO in any transaction (e.g., n in vout), the monetary value of the current UTXO (e.g., value in vout), the current script address in any transaction (e.g., scriptPubKey_address in vout), and the ID set of each output currency ordinal range corresponding to the current UTXO.
[0060] The number of M4s can be one or n. As shown in Figure 5, when there are n M4s corresponding to n current UTXOs, the M4 corresponding to any current UTXO contains all the output currency ordinal ranges of the UTXO, such as the M4 corresponding to the sat1 position information contains the sat1 ordinal range 1 (UTXO_out1 has only one output currency ordinal range), the M4 corresponding to the sat2 position information contains the sat2 ordinal range 1...sat2 ordinal range y (UTXO_out2 has y output currency ordinal ranges), etc., which will not be repeated. In M4, the table entry corresponding to any output currency ordinal range can include the id (sat_uids) of the currency ordinal range, the starting ordinal (start) of the currency ordinal range, the offset (offset) and the currency value (value).
[0061] After step 204 is completed, the entries in M1 and M3 are complete. Each entry in M3 records all information except the ID set (the ID set field of each entry is temporarily empty), and M4 is temporarily empty. After step 406 is completed and the output currency ordinal range corresponding to each current UTXO of any transaction is determined, the entries in M4 can be generated according to these ranges, and the IDs in each entry are aggregated and merged into the corresponding ID set and written into the corresponding entry in M3, thereby generating the complete four tables mentioned above.
[0062] In step 206, within the transaction currency ordinal range, the output currency ordinal range corresponding to each current UTXO is determined in sequence according to the generation order of each current UTXO, wherein the cryptocurrency value of any current UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the output currency ordinal range corresponding to the current UTXO.
[0063] It should be noted that the generation order of each current UTXO refers to the order in which each UTXO is generated during the execution of any transaction. Determining the output currency ordinal range corresponding to each UTXO in accordance with this generation order ensures that the transaction currency ordinal range of any transaction is orderly split, thereby ensuring that each output currency ordinal range is as complete as possible, avoiding ordinal confusion and minimizing the number of currency ordinal ranges that need to be maintained.
[0064] As previously mentioned, the output currency ordinal range corresponding to each current UTXO is determined within the transaction currency ordinal range. This is done by splitting the transaction currency ordinal range into the output currency ordinal ranges corresponding to each current UTXO. As shown in Figure 4, the transaction currency ordinal range is sequentially composed of [0,1999] (corresponding to the 0th UTXO_in) and [3000,5999] (corresponding to the 1st UTXO_in). Through this splitting, the range can be split into three output currency ordinal ranges: [0,1999], [3000,4999] (both corresponding to the 0th UTXO_out), and [5000,5999] (corresponding to the 1st UTXO_out).
[0065] In the aforementioned embodiments of this specification, the cryptocurrency circulating in the blockchain system corresponding to the ordinal management system is composed of minimum currency units, and each minimum currency unit has a globally unique currency ordinal. For any transaction in the current block, the system first determines at least one previous UTXO referenced by the transaction and at least one current UTXO generated by it, and then obtains the input currency ordinal range corresponding to each previous UTXO, wherein each input currency ordinal range is arranged in the order of reference of the previous UTXO to constitute the transaction currency ordinal range of the transaction. Based on this, within the transaction currency ordinal range, the output currency ordinal range corresponding to each current UTXO is determined in sequence according to the generation order of each current UTXO.
[0066] It can be understood that the output currency ordinal range corresponding to each current UTXO, determined in sequence according to the generation order of each current UTXO, together constitutes the output currency ordinal range of any transaction. All minimum currency units whose currency ordinals are within this range are the cryptocurrencies transferred when the blockchain network executes any transaction, and the sum of the values of these minimum currency units is the value transferred when the transaction is executed. In addition, the ordinal management system processes each transaction in the current block in the above manner to determine the output currency ordinal range of each transaction; and the above processing is performed on each block in the distributed ledger maintained by the blockchain network to determine the output currency ordinal range of each transaction in each block. The ordinal management system can maintain the output currency ordinal range determined in the above manner, thereby recording the ordinal of the minimum currency unit corresponding to the transferred value, so as to subsequently trace and manage the circulation process of the specific minimum currency unit.
[0067] The specific splitting method is described below with reference to an embodiment. In one embodiment, the ordinal management system can also write the input currency ordinal ranges into the tail of the transaction ordinal queue in sequence according to the reference order of the previous UTXOs; and then traverse and process the current UTXOs in the order in which the current UTXOs are generated. Processing any current UTXO includes: sequentially extracting an input currency ordinal range from the transaction ordinal queue, and determining the total available value of at least one input currency ordinal range extracted at this time, wherein the total available value is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the at least one input currency ordinal range; and, if the total available value is not less than the to-be-output value of any current UTXO (i.e., the sum of the values of all smallest currency units within the output currency ordinal range corresponding to the UTXO), determining the output currency ordinal range corresponding to any current UTXO from at least one input currency ordinal range extracted at this time (including the most recently extracted input currency ordinal range, and possibly also including other input currency ordinal ranges extracted before this). The transaction ordinal number queue operates according to the FIFO (First In First Out) rule; in other words, for any two current currency ordinal ranges written into the queue from the end of the queue, the one written earlier is removed from the front of the queue relatively earlier, and the one written later is removed from the front of the queue relatively later, that is, the relative removal order of the two is consistent with their relative writing order. In this way, the transaction currency ordinal range is sequentially split into the output currency ordinal range corresponding to each current UTXO according to the generation order of each current UTXO, effectively avoiding ordinal omissions in the splitting process and achieving high splitting accuracy and efficiency.
[0068] In addition, when the total available value is less than the value to be output, the next input currency ordinal range can be taken out from the transaction ordinal queue, and the total available value of all the input currency ordinal ranges that have been taken out at this time can be determined until the total available value is not less than the value to be output.
[0069] In one embodiment, when the available total value is not less than the value to be output of any current UTXO, when determining the output currency ordinal range corresponding to any current UTXO from at least one input currency ordinal range that has been withdrawn at this time: if the available total value is equal to the value to be output, then all input currency ordinal ranges that have been withdrawn at this time can be arranged in order to form the output currency ordinal range corresponding to any current UTXO; if the available total value is greater than the value to be output, then the input currency ordinal range withdrawn last time can be split into an available currency ordinal range and a surplus currency ordinal range, wherein the available total value corresponding to the available currency ordinal range and other withdrawn input currency ordinal ranges is equal to the value to be output; and, the available currency ordinal range and other withdrawn input currency ordinal ranges are arranged in order to form the output currency ordinal range corresponding to any current UTXO, and the surplus currency ordinal range is written to the head of the transaction ordinal queue. In this way, a complete output currency ordinal range can be split, thereby ensuring that the total available value corresponding to the split available currency ordinal range and other input currency ordinal ranges that have been taken out is exactly equal to the value to be output, so as to minimize the loss of currency ordinal numbers caused by inaccurate splitting.
[0070] As shown in Figure 4, the two input currency ordinal ranges (i.e., [0,1999] and [3000,5999]) that constitute the transaction currency ordinal range can be written into the transaction ordinal queue in sequence (the two ranges and their descriptions are actually written, as shown in M4). Based on this, for the two current UTXOs generated in sequence by any of the above transactions, the corresponding output currency ordinal ranges can be determined in sequence according to their generation order.
[0071] Taking the zeroth current UTXO (sat_uid is 1234) as an example, assuming that the value to be output for this current UTXO is 1500 sats (this situation is not shown in Figure 4), then after taking out the first input currency ordinal range (i.e., [0,1999]), the total available value at this time is 2000 sats, satisfying the condition that the total available value is greater than the value to be output (i.e., the total value of the currency in the current currency ordinal range that has been taken out at this time can meet the transfer demand of the zeroth current UTXO, and there is still a surplus). Therefore, at this time, [0,1999] can be split into the available currency ordinal range [0,1499] and the excess currency ordinal range [1500,1999] - at this time, the new available total value corresponding to the available currency ordinal range [0,1499] is equal to the value to be output, so the available currency ordinal range [0,1499] can be determined as the output currency ordinal range corresponding to the zeroth current UTXO. In addition, the aforementioned excess currency ordinal range [1500, 1999] can be written back to the head of the transaction narrative queue, that is, the excess currency ordinal range is used to replace the most recently withdrawn input currency ordinal range. Alternatively, assuming that the output value of the 0th current UTXO is 2000 sats (this case is not shown in Figure 4), then after withdrawing the first input currency ordinal range (i.e., [0, 1999]), the total available value at this time is exactly equal to the output value (i.e., the total value of the currency in the current currency ordinal range that has been withdrawn at this time is exactly enough to meet the transfer requirements of the 0th current UTXO, with no surplus). Therefore, there is no need to split [0, 1999] at this time, but this range can be directly determined as the output currency ordinal range corresponding to the 0th current UTXO.
[0072] Alternatively, as shown in Figure 4, assuming that the output value of the current UTXO of the 0th transaction is 4000 sats, after taking out the first input currency ordinal range (i.e. [0,1999]), the total available value at this time is less than the output value (i.e. the total value of the currency in the current currency ordinal range that has been taken out at this time cannot meet the transfer demand of the current UTXO of the 0th transaction), so it is necessary to take out the next input currency ordinal range from the transaction description queue in order, and update the total available value at this time, and then compare to determine whether the total available value is greater than or equal to the output value: if the total available value is still less than If the available total value is equal to the value to be output, the next input currency ordinal range will be taken out from the transaction ordinal queue until the available total value is greater than or equal to the value to be output; after any input currency ordinal range is taken out, if the available total value at this time is exactly equal to the value to be output, the currently taken out input currency ordinal ranges can be arranged in order to serve as the output currency ordinal range of the 0th current UTXO; if the available total value at this time is greater than the value to be output, the most recently taken out input currency ordinal range will be further split into the available currency ordinal range and the excess currency ordinal range and processed accordingly, which will not be repeated here.
[0073] Continuing with the embodiment shown in FIG4 , corresponding to the two current UTXOs and their corresponding three output currency ordinal ranges shown in FIG4 , the corresponding M3 is shown in Table 1 below, and the M4 corresponding to the 0th and 1st UTXOs are shown in Table 2 and Table 3 below respectively (the following table only shows the values of the key fields, and the values of the other fields are not shown, for special explanation). Table 1 Ordinal position record table Table 2 Ordinal range record table Table 3 Ordinal range record table
[0074] In one embodiment, the ordinal management system may further maintain an ordinal range record table for any transaction. Based on this, after determining the output currency ordinal ranges corresponding to each current UTXO, these output currency ordinal ranges may be recorded in the ordinal range record table for any transaction, such as recording them in the aforementioned M4.
[0075] In one embodiment, after the generation of the above-mentioned M1 to M4 is completed, these four tables may be persistently saved as processing results of any of the transactions.
[0076] In one embodiment, after traversing and processing each current UTXO of any transaction, if there is a remaining (at least one) currency ordinal range in the transaction ordinal queue, the currency value corresponding to the currency ordinal range can be determined as the handling fee (or fee) for executing any transaction. As shown in Figure 4, assuming that the output value of the first current UTXO (sat_uid is 3456) is 600 sats, after the above split is completed, there will be a remaining currency ordinal range with a currency value of 400 sats in the transaction ordinal queue. For this, the 400 sats corresponding to the currency ordinal range can be determined as the handling fee of any transaction. Exemplarily, at least one currency ordinal range corresponding to the above handling fee (the so-called handling currency ordinal range of the transaction) can be written to the end of the block ordinal queue of any transaction, so that the above handling fee can be subsequently allocated to the preset address corresponding to the block reward transaction.
[0077] In the UTXO model, the input value of any ordinary transfer transaction should be equal to the sum of its output value and the handling fee. Therefore, after the traversal processing of each output currency ordinal range generated by any of the transactions is completed, it is possible to verify whether the input value and output value of the transaction are equal. For example, on the one hand, the monetary values corresponding to each input currency ordinal range can be accumulated (that is, the total number of minimum currency units contained in each input currency ordinal range is counted) to obtain the input value Value_in of the transaction; on the other hand, the monetary values corresponding to each output currency ordinal range can be accumulated (that is, the total number of minimum currency units contained in each output currency ordinal range is counted) to obtain the output value Value_out of the transaction, and the total number of minimum currency units contained in the handling currency ordinal range is counted to obtain the handling fee fee. At this time, if Value_in=Value_out+fee holds true, it means that the above splitting process is correct; otherwise, it can be split again and / or an error is reported, which will not be repeated.
[0078] In one embodiment, the blockchain node that generates the current block is bound to a preset address, and the current block also includes a block reward transaction that allocates rewards to the preset address. In this regard, the ordinal management system can also calculate the reward value corresponding to the current block based on the block height of the current block, and allocate a corresponding reward currency ordinal range for the reward value; then, for each transaction in the current block except the block reward transaction, determine the transaction currency ordinal range corresponding to the transaction fee of each transaction; at this time, the reward currency ordinal range and the transaction currency ordinal range are arranged in order to constitute the output currency ordinal range corresponding to the block reward transaction.
[0079] In addition to ordinary transfer transactions, each block in the blockchain network also includes the above-mentioned block reward transactions (such as coinbase transactions). When traversing to the current block, the ordinal management system can first calculate the reward value Reward corresponding to the block according to the block height (such as 50 cryptocurrencies, 25 cryptocurrencies or 12.5 cryptocurrencies, etc.), and then assign it a corresponding reward currency ordinal range, and write the range to the end of the block ordinal queue. Then start traversing and processing each ordinary transfer transaction. For any ordinary transfer transaction traversed, the above embodiment can be used to process it to determine the output currency ordinal range corresponding to each current UTXO generated by the transaction and the transaction fee. Of course, the fee of any transaction can be zero or greater than zero. In the case where the fee of any transaction is greater than zero, the fee currency ordinal range corresponding to the fee can be written to the end of the aforementioned block ordinal queue. Until all ordinary transfer transactions in the current block are traversed and processed, the block ordinal queue will store the reward currency ordinal range of the block reward transaction and the procedure currency ordinal range of each ordinary transfer transaction in the order of execution of each transaction. These currency ordinal ranges are arranged in order to form the output currency ordinal range corresponding to the block reward transaction.
[0080] In the UTXO model, the output value of the block reward transaction in the current block should be equal to the sum of its block reward value and the handling fees of each ordinary transfer transaction in the blockchain. Therefore, after traversing and processing each ordinary transfer transaction, it is possible to verify whether the output value of the block reward transaction is equal to the sum of its block reward value and the handling fees of each ordinary transfer transaction. For example, on the one hand, the block reward value Rerard and its output value Value_out of the block reward transaction can be determined (i.e., the total number of minimum currency units included in the output currency ordinal range of the transaction can be counted), and on the other hand, the handling fees of each ordinary transfer transaction can be accumulated to obtain fee1+fee2+…+fees (assuming a total of s ordinary transfer transactions). At this time, if Value_out = Reward+fee1+fee2+…+fees holds, it means that the output currency ordinal range of the determined block reward transaction is accurate; otherwise, it can be re-determined and / or an error can be reported, which will not be repeated here.
[0081] In one embodiment, the output currency ordinal ranges corresponding to each current UTXO of any of the transactions are saved and can be queried by the user. For example, the ordinal management system can respond to an ordinal query request initiated by a blockchain client and query the output currency ordinal range (specifically, the range and its description) of the corresponding UTXO in the saved output currency ordinal ranges based on the index information carried in the request (such as block height, transaction ID, transaction hash, and output index, etc.), and return the query results to the user for viewing.
[0082] In one embodiment, the above-described ordinal management scheme can be used to implement token inscription, allowing the issuance of NFT (Non-Fungible Token) assets based on a blockchain system. For example, a user can initiate a token inscription transaction to the blockchain network through a blockchain client. This transaction carries the target content (i.e., the content to be inscribed, such as an image, text, video, audio, etc.). During the execution of this transaction, the blockchain network can initiate a token inscription request carrying the target content to the ordinal management system. The ordinal management system can respond to the request, determine the target currency ordinal corresponding to the request, and associate and store the target currency ordinal with the target content carried in the token inscription request. Therefore, token inscription involves binding specific target content to a specific currency ordinal (i.e., the target currency ordinal), that is, binding the target content to the smallest monetary unit represented by the target currency ordinal. The target content can be stored in a script in the segregated witness zone of the token inscription transaction and bound to the target currency ordinal. Among them, the target currency ordinal number can be one or more (i.e., an ordinal set), which can be specifically specified by the user, allocated by the blockchain node, or allocated by the ordinal management system, etc., and the embodiments of this specification are not limited to this.
[0083] FIG6 is a schematic structural diagram of a device provided by an exemplary embodiment. Referring to FIG6 , at the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 602 reading the corresponding computer program from the non-volatile memory 610 into the memory 608 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or logic devices.
[0084] As shown in FIG7 , FIG7 is a block diagram of an ordinal management device for a cryptocurrency provided by this specification according to an exemplary embodiment. The device can be applied to the device shown in FIG6 to implement the technical solution of this specification. The device is applied to the ordinal management system corresponding to the blockchain system. The blockchain system is implemented based on the unspent transaction output UTXO model. The cryptocurrency circulating in the blockchain system is composed of minimum currency units. Each minimum currency unit has a globally unique currency ordinal. The device includes: an input and output determination unit 701, which is used to determine, for any transaction in the current block, at least one previous UTXO referenced by any transaction and at least one current UTXO generated by any transaction. The previous UTXO is generated by a previous transaction, and the previous transaction is executed before any transaction; an input range acquisition unit 702, which is used to obtain the input currency ordinal range corresponding to each previous UTXO. The cryptocurrency value of any previous UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the input currency ordinal range corresponding to the previous UTXO, and the input currency ordinal ranges are arranged in sequence according to the reference order of the previous UTXOs to constitute the transaction currency ordinal range of the any transaction; the output range determination unit 703 is used to determine the output currency ordinal range corresponding to each current UTXO within the transaction currency ordinal range according to the generation order of each current UTXO, wherein the cryptocurrency value of any current UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the output currency ordinal range corresponding to the current UTXO.
[0085] Optionally, the ordinal management system maintains the location information of each UTXO generated by the previous transaction and its corresponding at least one currency ordinal range; the input range acquisition unit 702 is specifically used to: determine the target previous transaction that generates any UTXO and the target location information of any previous UTXO; query the target location information and its corresponding at least one target currency ordinal range in the maintained location information of the target previous transaction and its corresponding at least one currency ordinal range; arrange the at least one target currency ordinal range in order to form the input currency ordinal range corresponding to any previous UTXO.
[0086] Optionally, the ordinal management system maintains an ordinal position record table and an ordinal range record table of the previous transaction, the ordinal position record table is used to record the position information, and the ordinal range record table is used to record the currency ordinal range corresponding to each UTXO generated by any previous transaction, and the position information of any recorded UTXO points to at least one currency ordinal range corresponding to the recorded UTXO; the input range acquisition unit 702 is specifically used to: query the target position information in the ordinal position record table of the target previous transaction, and determine at least one currency ordinal range pointed to by the target position information in the ordinal range record table of the target previous transaction.
[0087] Optionally, it further includes a queue writing unit 704, which is used to write the input currency ordinal ranges into the tail of the transaction ordinal queue in sequence according to the reference order of the previous UTXOs; the output range determination unit 703 is specifically used to: traverse and process the current UTXOs in the generation order of the current UTXOs; wherein, processing any current UTXO includes: sequentially taking out an input currency ordinal range from the transaction ordinal queue, and determining the total available value of at least one input currency ordinal range taken out at this time, the total available value being equal to the sum of the values of the smallest currency units represented by each currency ordinal within the at least one input currency ordinal range; and, when the total available value is not less than the value to be output of any current UTXO, determining the output currency ordinal range corresponding to any current UTXO from at least one input currency ordinal range taken out at this time.
[0088] Optionally, it also includes: a next extraction unit 705, which is used to extract the next input currency ordinal range from the transaction ordinal queue when the available total value is less than the value to be output, and determine the available total value of all input currency ordinal ranges that have been extracted at this time until the available total value is not less than the value to be output.
[0089] Optionally, the output range determination unit 703 is specifically used to: if the total available value is equal to the value to be output, then arrange all the input currency ordinal ranges that have been taken out at this time in order to form the output currency ordinal range corresponding to any current UTXO; if the total available value is greater than the value to be output, then split the input currency ordinal range taken out for the last time into an available currency ordinal range and an excess currency ordinal range, wherein the total available value corresponding to the available currency ordinal range and other taken out input currency ordinal ranges is equal to the value to be output; and, arrange the available currency ordinal range and other taken out input currency ordinal ranges in order to form the output currency ordinal range corresponding to any current UTXO, and write the excess currency ordinal range to the head of the transaction ordinal queue.
[0090] Optionally, it also includes: a handling fee determination unit 706, which is used to determine the monetary value corresponding to the currency ordinal range as the handling fee for executing any of the transactions after traversing and processing the current UTXOs.
[0091] Optionally, the blockchain node that generates the current block is bound to a preset address, and the current block also includes a block reward transaction that allocates rewards to the preset address. The device also includes: a reward allocation unit 707, which is used to calculate the reward value corresponding to the current block according to the block height of the current block, and allocate a corresponding reward currency ordinal range for the reward value; a procedure range determination unit 708, which is used to determine the procedure currency ordinal range corresponding to the handling fee of each transaction in the current block except the block reward transaction. The reward currency ordinal range and the procedure currency ordinal range are arranged in order to constitute the output currency ordinal range corresponding to the block reward transaction.
[0092] Optionally, the ordinal management system maintains an ordinal range record table of any transaction, and the device further includes: an ordinal range recording unit 709, which records the output currency ordinal range corresponding to each current UTXO in the ordinal range record table of any transaction.
[0093] Optionally, it also includes: a token inscription unit 710, which is used to respond to the token inscription request initiated by the blockchain system, determine the target currency ordinal corresponding to the token inscription request, and associate and save the target currency ordinal and the target content carried in the token inscription request.
[0094] Optionally, the input / output determination unit 701 is specifically configured to extract at least one previous UTXO referenced by the transaction from the vin field of any transaction, and extract at least one current UTXO generated by the transaction from the vout field of any transaction.
[0095] Optionally, at least one of the previous transactions belongs to the current block; and / or, at least one of the previous transactions belongs to a previous block of the current block, and the block height of the previous block is lower than the block height of the current block.
[0096] Corresponding to the aforementioned embodiments, this specification also proposes a computer program product, including a computer program and / or instructions, which implement the steps of the method described in any of the aforementioned embodiments when executed by a processor.
[0097] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.
[0098] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.
[0099] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a server system. Of course, the present invention does not exclude that with the future development of computer technology, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, an in-vehicle human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0100] Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any particular order.
[0101] For the convenience of description, the above devices are described in terms of functions divided into various modules. Of course, when implementing one or more of the present specifications, the functions of each module can be implemented in the same or multiple software and / or hardware, or the module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0102] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.
[0103] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0104] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0105] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0106] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0107] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0108] Those skilled in the art will appreciate that one or more embodiments of this specification may be provided as a method, system, or computer program product. Thus, one or more embodiments of this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0109] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In distributed computing environments, program modules may be located in local and remote computer storage media, including storage devices.
[0110] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between the various embodiments can be referenced across them. Each embodiment focuses on the differences from the other embodiments. In particular, since the system embodiments are generally similar to the method embodiments, their description is relatively simple. For relevant parts, reference can be made to the description of the method embodiments. Throughout this specification, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and integrate the different embodiments or examples, and features of different embodiments or examples, described in this specification, without conflict.
[0111] The foregoing is merely an example of one or more embodiments of this specification and is not intended to limit the one or more embodiments of this specification. It will be apparent to those skilled in the art that various modifications and variations may be made to one or more embodiments of this specification. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this specification shall be included within the scope of the claims.
Claims
1. A method for managing ordinal numbers of cryptocurrency, applied to an ordinal number management system corresponding to a blockchain system, wherein the blockchain system is implemented based on an unspent transaction output (UTXO) model, wherein the cryptocurrency circulating in the blockchain system is composed of minimum currency units, each minimum currency unit having a globally unique currency ordinal number, the method comprising: For any transaction in the current block, determine at least one previous UTXO referenced by the transaction and at least one current UTXO generated by the transaction, where the previous UTXO is generated by a previous transaction that was executed before the transaction. Obtain the input currency ordinal range corresponding to each preceding UTXO, where the cryptocurrency value of any preceding UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the input currency ordinal range corresponding to the preceding UTXO. The input currency ordinal ranges are arranged in the order in which the preceding UTXOs are referenced to form the transaction currency ordinal range of any transaction. Within the transaction currency ordinal range, the output currency ordinal range corresponding to each current UTXO is determined in sequence according to the generation order of each current UTXO, where the cryptocurrency value of any current UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the output currency ordinal range corresponding to the current UTXO.
2. According to the method of claim 1, the ordinal management system maintains the location information of each UTXO generated by the previous transaction and its corresponding at least one currency ordinal range; Get the input currency ordinal range corresponding to any previous UTXO, including: Determine the target preceding transaction that generated any of the UTXOs and the target location information of any of the preceding UTXOs; In the maintained location information of the target preceding transaction and the at least one corresponding currency ordinal range, query the target location information and the at least one corresponding target currency ordinal range; Arrange the at least one target currency ordinal range in order to form the input currency ordinal range corresponding to any preceding UTXO.
3. The method according to claim 2, wherein the ordinal management system maintains an ordinal position record table and an ordinal range record table of the previous transaction, wherein the ordinal position record table is used to record the position information, and the ordinal range record table is used to record the currency ordinal range corresponding to each UTXO generated by any previous transaction, and the position information of any recorded UTXO points to at least one currency ordinal range corresponding to the recorded UTXO; querying the target position information and the at least one target currency ordinal range corresponding to the maintained position information of the target previous transaction and the at least one currency ordinal range corresponding to the target transaction comprises: The target position information is searched in the ordinal position record table of the target preceding transaction, and at least one currency ordinal range pointed to by the target position information is determined in the ordinal range record table of the target preceding transaction.
4. The method according to claim 1, Also includes: Write the input currency ordinal ranges to the end of the transaction ordinal queue in sequence according to the reference order of the preceding UTXOs; Determining, within the transaction currency ordinal range, the output currency ordinal range corresponding to each current UTXO in sequence according to the generation order of each current UTXO, including: traversing and processing each current UTXO in the generation order of each current UTXO; Among them, processing any current UTXO includes: sequentially taking out an input currency ordinal range from the transaction ordinal queue, and determining the total available value of at least one input currency ordinal range that has been taken out at this time, wherein the total available value is equal to the sum of the values of the smallest currency units represented by each currency ordinal in the at least one input currency ordinal range; and, when the total available value is not less than the to-be-output value of any current UTXO, determining the output currency ordinal range corresponding to any current UTXO from the at least one input currency ordinal range that has been taken out at this time.
5. The method according to claim 4, further comprising: When the total available value is less than the value to be output, the next input currency ordinal range is taken out from the transaction ordinal queue, and the total available value of all the input currency ordinal ranges that have been taken out at this time is determined until the total available value is not less than the value to be output.
6. The method according to claim 4, wherein determining the output currency ordinal range corresponding to any current UTXO from the at least one input currency ordinal range that has been withdrawn at this time comprises: If the total available value is equal to the value to be output, then all the input currency ordinal ranges that have been withdrawn at this time are arranged in order to form the output currency ordinal range corresponding to any current UTXO; If the total available value is greater than the value to be output, the input currency ordinal range withdrawn last time is split into an available currency ordinal range and an excess currency ordinal range, wherein the total available value corresponding to the available currency ordinal range and other withdrawn input currency ordinal ranges is equal to the value to be output; and, the available currency ordinal range and other withdrawn input currency ordinal ranges are arranged in order to form the output currency ordinal range corresponding to any current UTXO, and the excess currency ordinal range is written to the head of the transaction ordinal queue.
7. The method according to claim 4, further comprising: After traversing and processing each current UTXO, if there is a remaining currency ordinal range in the transaction ordinal queue, the currency value corresponding to the currency ordinal range is determined as the handling fee for executing any of the transactions.
8. The method according to claim 1, wherein the blockchain node that generates the current block is bound to a preset address, and the current block also includes a block reward transaction that allocates a reward to the preset address, and the method further includes: Calculate the reward value corresponding to the current block according to the block height of the current block, and assign a corresponding reward currency ordinal range to the reward value; For each transaction in the current block other than the block reward transaction, determine the transaction currency ordinal range corresponding to the transaction fee of each transaction. The reward currency ordinal range and the transaction currency ordinal range are arranged in sequence to constitute the output currency ordinal range corresponding to the block reward transaction.
9. The method according to claim 1, wherein the ordinal number management system maintains a record table of ordinal number ranges of any transaction, and the method further comprises: The output currency ordinal range corresponding to each current UTXO is recorded in the ordinal range record table of any transaction.
10. The method according to claim 1, further comprising: In response to a token inscription request initiated by the blockchain system, a target currency ordinal number corresponding to the token inscription request is determined, and the target currency ordinal number and the target content carried in the token inscription request are associated and saved.
11. According to the method of any one of claims 1 to 10, determining at least one previous UTXO referenced by any transaction and at least one current UTXO generated by executing any transaction comprises: Extract at least one previous UTXO referenced by the transaction from the vin field of any transaction, and extract at least one current UTXO generated by the transaction from the vout field of any transaction.
12. The method according to any one of claims 1 to 10, At least one of the preceding transactions belongs to the current block; and / or, At least one of the previous transactions belongs to a previous block of the current block, and the block height of the previous block is lower than the block height of the current block.
13. An ordinal management system, wherein the blockchain system corresponding to the ordinal management system is implemented based on the UTXO model, wherein the cryptocurrency circulating in the blockchain system is composed of minimum currency units, each minimum currency unit having a globally unique currency ordinal number, and wherein the system is used to: For any transaction in the current block, determine at least one previous UTXO referenced by the transaction and at least one current UTXO generated by the transaction, where the previous UTXO is generated by a previous transaction that was executed before the transaction. Obtain the input currency ordinal range corresponding to each preceding UTXO, where the cryptocurrency value of any preceding UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the input currency ordinal range corresponding to the preceding UTXO. The input currency ordinal ranges are arranged in the order in which the preceding UTXOs are referenced to form the transaction currency ordinal range of any transaction. Within the transaction currency ordinal range, the output currency ordinal range corresponding to each current UTXO is determined in sequence according to the generation order of each current UTXO, where the cryptocurrency value of any current UTXO is equal to the sum of the values of the smallest currency units represented by each currency ordinal within the output currency ordinal range corresponding to the current UTXO.
14. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 12 by running the executable instructions.
15. A computer-readable storage medium having computer instructions stored thereon, wherein when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer program product comprising a computer program and / or instructions, wherein when the computer program and / or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Ordinal number management system and ordinal number management method of cryptocurrency
CN118917842A
Virtual currency management program and method
JP2018160179A