SYSTEM AND METHOD FOR OPTIMIZING DATA WRITING TO A BLOCKCHAIN
A mempool of a miner of a blockchain system is accessed. The mempool contains at least a first transaction and a second transaction. A determination is made that the first transaction and the second transaction are related to each other. In response to the determination, the first transaction and the second transaction are linked. The linking of the first and second transactions comprises aggregating data associated with the first transaction and the second transaction into an aggregated data set. The aggregated data set is written into a single block of the blockchain system.
1 . A method, comprising:
accessing a mempool of a miner of a blockchain system, the mempool containing at least a first transaction and a second transaction;
determining that the first transaction and the second transaction are related to each other;
linking, in response to the determining, the first transaction and the second transaction, wherein the linking comprises aggregating data associated with the first transaction and the second transaction into an aggregated data set; and
writing the aggregated data set into a single block of the blockchain system.
2 . The method of claim 1 , wherein:
the first transaction and the second transaction each include a respective priority for being written into the blockchain system; and
the linking comprises reassigning a priority of at least the first transaction or the second transaction.
3 . The method of claim 2 , wherein the reassigning the priority comprises elevating the priority of at least the first transaction or the second transaction.
4 . The method of claim 2 , wherein the reassigning the priority comprises assigning a same priority to both the first transaction and the second transaction.
5 . The method of claim 1 , wherein the determining comprises determining that the first transaction and the second transaction share a common user, a common merchant, a common payment processor, a common location, or are performed within a predetermined time period within each other.
6 . The method of claim 1 , wherein the determining comprises determining that the first transaction and the second transaction originated from a same underlying event.
7 . The method of claim 1 , further comprising: introducing a delay for writing the first transaction or the second transaction into the blockchain system until the determining has been completed.
8 . The method of claim 1 , further comprising: storing transaction data from different tenants in different compartments of the mempool.
9 . The method of claim 8 , further comprising:
writing a name of a first tenant into a header of a selected block of the blockchain system; and
writing transaction data associated only with the first tenant into the selected block.
10 . The method of claim 1 , wherein the mempool further contains a third transaction and a fourth transaction, and wherein the method further comprises:
determining a first mining fee associated with mining the third transaction and a second mining fee associated with mining the fourth transaction; and
assigning a higher priority to the third transaction in response to determining that the first mining fee is greater than the second mining fee; or
assigning a higher priority to the fourth transaction in response to determining that the second mining fee is greater than the first mining fee.
11 . A system, comprising:
a non-transitory memory; and
one or more hardware processors coupled to the non-transitory memory and configured to read instructions from the non-transitory memory to cause the system to perform operations comprising:
accessing a mempool of a miner of a blockchain system, the mempool containing at least a first transaction having a first priority and a second transaction with a second priority;
determining a relatedness indication between the first transaction and the second transaction based at least on one or more factors comprising: whether the first transaction and the second transaction share a common user, a common merchant, a common payment processor, or a common location, or are performed within a predetermined time period within each other;
linking, in response to the relatedness indication exceeding a predetermined threshold, the first transaction and the second transaction, wherein the linking comprises aggregating data associated with the first transaction and the second transaction into an aggregated data set and elevating at least one of the first priority or the second priority; and
writing the aggregated data set into a single block of the blockchain system.
12 . The system of claim 11 , wherein the elevating comprises elevating the first priority and the second priority to a same priority.
13 . The system of claim 11 , wherein the operations further comprise: postponing the first transaction or the second transaction from being written into the blockchain system until the determining has been completed.
14 . The system of claim 11 , wherein the operations further comprise:
storing transaction data from different tenants in different compartments of the mempool.
writing a name of a first tenant into a header of a selected block of the blockchain system; and
writing transaction data associated only with the first tenant into the selected block.
15 . The system of claim 11 , wherein the mempool further contains a third transaction and a fourth transaction, and wherein the operations further comprise:
determining a first mining fee associated with mining the third transaction and a second mining fee associated with mining the fourth transaction; and
assigning a higher priority to the third transaction in response to determining that the first mining fee is greater than the second mining fee; or
assigning a higher priority to the fourth transaction in response to determining that the second mining fee is greater than the first mining fee.
16 . A method, comprising:
accessing mining data associated with a mined transaction performed by a miner of a blockchain system;
based on the mining data, making a first determination that the mined transaction meets one or more predefined criteria;
making a second determination that an available storage space of a mempool of the miner is below a predetermined threshold or that the mempool will become unavailable; and
causing, in response to the first determination or the second determination, the mining data to be written to the blockchain system while bypassing a storing of the mining data in the mempool of the miner.
17 . The method of claim 16 , wherein the causing comprises writing the mining data directly to the blockchain system without first storing the mining data in the mempool of the miner.
18 . The method of claim 16 , wherein the causing comprises:
broadcasting, to a network comprising a plurality of miners of the blockchain system, a request to lease a mempool from at least one of the miners;
receiving consent from one or more miners of the network to lease their mempools; and
sending the mining data to the one or more miners for storage in their mempools.
19 . The method of claim 16 , wherein the making the first determination comprises determining that the mined transaction is associated with a predetermined tenant or has a value exceeding a predefined amount.
20 . The method of claim 16 , wherein the making the second determination comprises determining that the miner is performing mining operations using a device whose battery has dropped below a predefined percentage, or that the device is located within, or will be entering, an area with unreliable network coverage or unreliable connectivity.