A blockchain fair transaction ordering method and system based on hypergraph partitioning
By constructing a preference matrix and a one-dimensional linear baseline sequence through hypergraph partitioning, adaptive geometric clustering and cluster-level loop elimination are performed, which solves the problem of global loop ambiguity expansion in fair transaction ranking in blockchain and achieves efficient, deterministic and fair transaction ranking.
Patent Information
- Application Number
- CN202611077129.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-11-03
AI Technical Summary
Existing blockchain fair transaction sorting methods are prone to increasing global loop ambiguity, reducing sorting granularity, increasing confirmation delay, and lacking scalability in high-concurrency transactions or condorcet attack scenarios.
A hypergraph-based partitioning approach is adopted. By constructing a preference matrix and a one-dimensional linear baseline sequence, adaptive geometric clustering is performed to divide transactions into multiple clusters. A cluster-level directed quotient graph is constructed and cycles are eliminated. By combining inter-cluster topological sorting and intra-cluster sorting scores, a globally deterministic fair sorting sequence is generated.
It improves the determinism and fairness of transaction sorting, reduces the impact of global circular ambiguity on the sorting results, reduces the probability of transactions being merged into coarse-grained units, and enhances system scalability.
Smart Images

Figure CN123032371A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and in particular to a blockchain fair transaction ranking method and system based on hypergraph partitioning. Background Technology
[0002] Blockchain systems typically use consensus mechanisms to ensure that multiple nodes reach an agreement on a set of transactions and their execution order. In blockchain systems employing Byzantine fault-tolerant consensus mechanisms, each replica needs to reach a consistent order for the same batch of transactions to ensure that each replica performs the same state transitions and obtains a consistent ledger state.
[0003] Existing consensus protocols primarily focus on the consistency of transaction ordering, ensuring that all honest copies ultimately accept the same transaction sequence. However, in actual transaction processing, transaction ordering not only affects the consistency of the ledger state but can also directly impact transaction execution results and user interests. For example, in decentralized finance (DeFi) scenarios, malicious leaders or nodes may delay, insert, or rearrange transactions, causing unfair phenomena such as preemptive strikes, pincer attacks, or transaction censorship.
[0004] To improve the fairness of transaction ordering, existing technologies have proposed fair ordering methods based on pairwise reception order evidence. These methods typically utilize the transaction order observed from different replicas to construct pairwise priority relationships between transactions, and then form a transaction dependency graph based on these relationships. When circular ambiguity exists in the transaction dependency graph, existing methods usually eliminate circular ambiguity through strongly connected component aggregation, and then perform topological sorting on the aggregated graph to obtain the global transaction sequence.
[0005] However, in high-concurrency transaction scenarios or targeted Condorcet attacks, the loop range in the global transaction dependency graph can expand rapidly. Figure 3 This is a diagram illustrating a Condorcet attack, as shown below. Figure 3 As shown, for the set of transactions to be sorted The observation sequence of copy 1 is The observation sequence for copy 2 is The observation sequence for copy 3 is After pairwise majority voting aggregation, a circular ambiguity is formed in the global dependency graph. Figure 3As can be seen, under a Condorcet attack, malicious nodes manipulate the transaction propagation sequence, creating inconsistent pairwise priorities across different replicas. These inconsistent pairwise priorities, after aggregating into a global dependency graph, form numerous circular ambiguities. Furthermore, as the number of transactions increases, these cycles connect to each other through shared nodes, causing the cycle scope to expand rapidly. Directly aggregating strongly connected components into the global transaction dependency graph can easily merge a large number of transactions into the same coarse-grained unit, leading to reduced sorting granularity, increased confirmation latency, and amplified local circular ambiguities. The impact on global sorting results. Furthermore, the construction and cyclical processing of the global transaction dependency graph become increasingly complex with the number of transactions, hindering system scalability.
[0006] Therefore, there is an urgent need for a fair blockchain transaction ranking scheme that can reduce the coarse-grained cohesion problem caused by global circular ambiguity while ensuring the determinacy and fairness of blockchain transaction ranking. Summary of the Invention
[0007] The purpose of this invention is to provide a blockchain fair transaction sorting method and system based on hypergraph partitioning, in order to solve the problems of coarse sorting granularity, high confirmation delay and insufficient scalability that are easily caused by directly performing cyclic elimination on the global transaction dependency graph in existing blockchain fair transaction sorting methods.
[0008] The technical solution of this invention is: a blockchain fair transaction ranking method based on hypergraph partitioning, comprising: obtaining a set of transactions to be ranked and observation sequences of the transaction set from multiple replicas; constructing a preference matrix based on the observation sequences, the preference matrix being used to characterize pairwise priority relationships between transactions; calculating the canonical position of each transaction in the set of transactions to be ranked based on the preference matrix, the canonical position being determined based on pairwise priority relationships satisfying a consensus threshold, and generating a one-dimensional linear baseline sequence based on the ranking results of the canonical positions; performing adaptive geometric clustering along the one-dimensional linear baseline sequence, dividing transactions that satisfy the clustering conditions into multiple disjoint transaction clusters, forming a partitioning hypergraph; constructing a cluster-level directed quotient graph based on the partitioning hypergraph, and eliminating cycles in the cluster-level directed quotient graph to obtain an acyclic directed quotient graph; performing inter-cluster topological sorting on the acyclic directed quotient graph, and calculating intra-cluster ranking scores for transactions within each transaction cluster; performing intra-cluster ranking for transactions within each transaction cluster based on the intra-cluster ranking scores, and concatenating the intra-cluster ranking results of each transaction cluster according to the order of the inter-cluster topological sorting to generate a globally deterministic fair ranking sequence.
[0009] Further, constructing a preference matrix based on the observation sequence includes: for a transaction set containing multiple transactions, counting the number of replicas in which the first transaction is observed to precede the second transaction, and using the number of replicas as the pairwise priority relationship value of the first transaction relative to the second transaction; using the pairwise priority relationship value as matrix elements to construct the preference matrix.
[0010] Furthermore, before calculating the canonical position of a transaction, pairwise precedence relationships in the preference matrix are filtered based on a consensus threshold; wherein the consensus threshold is determined based on the total number of replicas, the Byzantine fault limit, and an ordering fairness parameter; the ordering fairness parameter is used to characterize the replica observation consistency strength required for a pairwise precedence relationship to be adopted.
[0011] Furthermore, the standardized position is as follows: for a target transaction, determine the target column in the preference matrix corresponding to the target transaction, count the number of matrix elements in the target column whose element values are greater than the consensus threshold, and use the number of matrix elements as the standardized position of the target transaction.
[0012] Further, adaptive geometric clustering is performed along the one-dimensional linear baseline sequence, including: comparing the canonical position differences of adjacent transactions based on the transaction arrangement order in the one-dimensional linear baseline sequence; when the difference is less than the adaptive clustering threshold, the corresponding adjacent transactions are grouped into the same transaction cluster; when the difference is not less than the adaptive clustering threshold, the current transaction cluster is terminated and a new transaction cluster is started. The adaptive clustering threshold is determined based on at least one of a fairness relaxation parameter, empirical network latency, and transaction generation interval.
[0013] Further, constructing a cluster-level directed quotient graph based on the partitioning hypergraph includes: using transaction clusters in the partitioning hypergraph as nodes in the cluster-level directed quotient graph; for any two different transaction clusters, calculating aggregation preference weights based on the pairwise priority relationship between transactions in the two different transaction clusters; comparing the aggregation preference weights between the two different transaction clusters based on the marginal parameter, and establishing a directed edge from the first transaction cluster to the second transaction cluster when the aggregation preference weight of the first transaction cluster relative to the second transaction cluster is greater than the product of the marginal parameter and the aggregation preference weight of the second transaction cluster relative to the first transaction cluster.
[0014] Further, eliminating cycles in the cluster-level directed quotient graph includes: detecting non-trivial strongly connected components in the cluster-level directed quotient graph, merging transaction clusters in the non-trivial strongly connected components into a supercluster; updating the nodes and directed edges of the cluster-level directed quotient graph based on the supercluster, and repeating the detection and merging until the acyclic directed quotient graph is obtained; wherein, the deterministic key of a transaction cluster is the minimum value of the transaction identifier in the transaction cluster.
[0015] Furthermore, the intra-cluster ranking score is a net preference score: for a target transaction in any transaction cluster, the net preference score of the target transaction is determined by summing the differences between the target transaction and other transactions in the same transaction cluster, based on the pairwise priority relationship between the target transaction and other transactions and the target transaction.
[0016] Furthermore, the intra-cluster sorting includes: arranging transactions in descending order according to net preference score; arranging transactions in ascending order according to the canonical position when the net preference scores are equal; and arranging transactions in ascending order according to transaction identifier when the net preference score and the canonical position are both equal.
[0017] This invention also provides a blockchain fair transaction ranking system based on hypergraph partitioning, comprising: an observation collection module for acquiring observation sequences of multiple replicas of a set of transactions to be ranked; a preference matrix construction module for constructing a preference matrix based on the observation sequences; a robust canonical embedding module for calculating the canonical position of each transaction in the set of transactions to be ranked based on the preference matrix, and generating a one-dimensional linear baseline sequence based on the canonical positions; an adaptive hypergraph modeling module for performing adaptive geometric clustering along the one-dimensional linear baseline sequence, dividing transactions that meet the clustering conditions into multiple disjoint transaction clusters, constructing a cluster-level directed quotient graph with the multiple disjoint transaction clusters as nodes, and eliminating cycles in the cluster-level directed quotient graph to obtain an acyclic directed quotient graph; and a hierarchical serialization module for performing inter-cluster topological sorting on the acyclic directed quotient graph, calculating intra-cluster ranking scores for transactions within each transaction cluster, performing intra-cluster ranking, and concatenating the intra-cluster ranking results of each transaction cluster according to the order of the inter-cluster topological sorting to generate a globally deterministic fair ranking sequence.
[0018] Compared with the prior art, the advantages of the present invention are: (1) A preference matrix is constructed by observing multiple replicas, and the pairwise priority relationship between transactions is converted into a one-dimensional linear baseline sequence by using the normalized position, so that the reference relationship of transaction sorting is transformed from a global pairwise relationship into a linear positional relationship, which facilitates subsequent localization processing.
[0019] (2) By performing adaptive geometric clustering on the one-dimensional linear baseline sequence, possible circular ambiguities are preferentially clustered into the same transaction cluster, thereby reducing the impact of global circular ambiguity on the sorting results.
[0020] (3) By performing cyclic elimination on the cluster-level directed quotient graph instead of directly performing strong connectivity component aggregation on the global transaction dependency graph, the probability of a large number of transactions being merged into coarse-grained units is reduced.
[0021] (4) By combining inter-cluster topological sorting and intra-cluster sorting scoring, the priority relationship between clusters is maintained, and the sorting results are refined by intra-cluster sorting, thereby improving the certainty and fairness of the sorting results. Attached Figure Description
[0022] Figure 1 A flowchart illustrating a blockchain fair transaction ranking method based on hypergraph partitioning provided by this invention; Figure 2 A schematic diagram of the structure of a blockchain fair transaction ranking system based on hypergraph partitioning provided by the present invention; Figure 3 This is a diagram illustrating a Condorcet attack. Detailed Implementation
[0023] The present invention will be further described in detail below with reference to specific embodiments: It should be noted that the term "acquisition" generally refers to the process of obtaining data or information, which can be achieved through direct acquisition by hardware or by reading stored data. The term "based on" generally refers to a description of relationships that are processed, calculated, deduced, or judged using certain data, conditions, rules, or models as input or basis, and does not exclude the simultaneous processing in conjunction with other data, conditions, rules, or models. The term "comprising" is intended to cover non-exclusive inclusion, meaning that a process, method, system, or apparatus that includes a series of elements is not limited to the explicitly listed elements, but may also include other elements not explicitly listed or inherent. The term "at least" is used to indicate a minimum quantity or level of limitation, and does not exclude situations where there is more than that minimum quantity or level.
[0024] In this invention, "transaction" refers to blockchain transactions that are to be sorted and executed by the blockchain consensus system. Unless otherwise stated, "transaction" and "transaction" have the same meaning in this invention.
[0025] This invention proposes a blockchain fair transaction sorting system based on hypergraph partitioning, which adopts a combination of robust canonical embedding, adaptive hypergraph modeling and hierarchical serialization to obtain a globally deterministic fair sorting sequence.
[0026] Figure 1 The flowchart illustrates a blockchain fair transaction ranking method based on hypergraph partitioning provided by this invention. Figure 1As shown in this exemplary embodiment, the sorting process for the blockchain transaction set to be sorted includes at least the following steps: S1, inputting the observation sequence of n replicas, the transaction set to be sorted, and parameters; S2, constructing a preference matrix and calculating the consensus threshold; S3, calculating the canonical position and generating a linear baseline sequence; S4, adaptive geometric clustering to form a partitioning hypergraph; S5, quotient graph projection, merging strongly connected components (SCCs) to obtain an acyclic quotient graph; S6, inter-cluster lexicographical topological sorting; S7, intra-cluster net preference score sorting; S8, global sequence concatenation; S9, outputting a globally deterministic fair sorting sequence. The exemplary embodiment described above will be described in detail below.
[0027] In step S1, the set of transactions to be sorted is received, denoted as... ,in Let N represent the i-th transaction, and N represent the size of the transaction set; receive the observation sequence of the transaction set from multiple replicas, denoted as . Where n represents the total number of copies, This represents the observation sequence of the k-th replica for the set of transactions. Additionally, a Byzantine fault limit needs to be set. Ranking fairness parameters Fairness relaxation parameters Experience network latency Transaction generation interval and marginal parameters The value of .
[0028] In step S2, a preference matrix is constructed based on the observed sequence. Preference matrix elements in This indicates that a transaction was observed in the multiple copies. Prior to transactions The number of replicas, i.e., the number of transactions. Relative to transactions The pairwise priority relationship. In one implementation, ,in, , Indicates the first Observation sequence of copies In the middle, affairs Located in the transaction Previously. Then based on the total number of replicas. Byzantine fault limit And sorting fairness parameters Calculate the consensus threshold. In one implementation, the consensus threshold... for: ,in, The sorting fairness parameter indicates rounding down. satisfy .
[0029] In step S3, for each transaction, the target column corresponding to that transaction in the preference matrix is determined, and the number of matrix elements in the target column whose values are greater than the consensus threshold is counted. This number of matrix elements is then used as the canonical position of the transaction. For each transaction... Its standard location is: ,in, Representing a transaction Relative to transactions The pairwise priority relationship is greater than the consensus threshold. Transactions in the transaction set are sorted in ascending order according to their canonical positions. When the canonical positions are equal, they are sorted in ascending order according to their transaction identifiers to obtain a one-dimensional linear baseline sequence. , recorded as ,in, The size is the size of the transaction set.
[0030] In step S4, adaptive geometric clustering is performed along the one-dimensional linear baseline sequence. Specifically, based on the transaction arrangement order in the one-dimensional linear baseline sequence, the canonical position difference between adjacent transactions is compared. When the difference is less than the adaptive clustering threshold, the corresponding adjacent transactions are grouped into the same transaction cluster; when the difference is not less than the adaptive clustering threshold, the current transaction cluster is terminated and a new transaction cluster is started.
[0031] The adaptive clustering threshold Based on fairness relaxation parameters Experience network latency Transaction generation interval At least one of them is determined. In one embodiment, .
[0032] After clustering, the transaction set is divided into multiple disjoint transaction clusters, forming a partitioning hypergraph. The partitioning hypergraph can be represented as a hypergraph structure with the transaction set as the vertex set and the transaction clusters as the hyperedge set.
[0033] In step S5, a cluster-level directed quotient graph is first constructed based on the partitioning hypergraph. Nodes in the cluster-level directed quotient graph correspond to transaction clusters in the partitioning hypergraph, and directed edges represent the priority relationships between transaction clusters. For any two different transaction clusters... and Aggregation preference weights are calculated based on the pairwise precedence relationships between transactions in two transaction clusters. Transaction clusters Relative to transaction clusters The aggregation preference weights are: When satisfied At that time, establish a transaction cluster Pointing to transaction cluster The directed edges, where, Denotes the marginal parameter, satisfying In particular, when hour, .
[0034] In one embodiment, after the cluster-level directed quotient graph is constructed, non-trivial strongly connected components are detected. If such a non-trivial strongly connected component exists, all transaction clusters in that component are merged into a supercluster, and the supercluster replaces the non-trivial strongly connected component, updating the nodes and edges of the cluster-level directed quotient graph. This detection, merging, and updating process is repeated until an acyclic directed quotient graph is obtained.
[0035] For the transaction cluster H in the directed quotient graph, the deterministic cluster key is defined as the minimum value of the transaction identifiers in that transaction cluster: ,in, Representing a transaction A unique transaction identifier.
[0036] It should be noted that the cyclic ambiguity elimination in this embodiment is performed on the cluster-level directed quotient graph after the formation of the partitioning hypergraph, rather than directly agglomerating strongly connected components of the global transaction dependency graph. Therefore, this invention can avoid merging a large number of transactions into the same coarse-grained unit due to the expansion of the global cyclic scope.
[0037] In step S6, inter-cluster topological sorting is performed on the acyclic directed quotient graph. Among all clusters with a current in-degree of zero, the cluster with the smallest deterministic cluster key is selected for serialization to obtain a coarse-grained inter-cluster sorting sequence.
[0038] In step S7, for each transaction within a transaction cluster, an intra-cluster ranking score is calculated. The intra-cluster ranking score is a net preference score. For transactions in transaction cluster H... Its net preference score is: All transactions within the same transaction cluster are sorted in descending order based on the net preference score; when the net preference scores are equal, they are sorted in ascending order based on the canonical position; when the net preference score and the canonical position are both equal, they are sorted in ascending order based on the transaction identifier.
[0039] In step S8, the intra-cluster sorting results of each transaction cluster are concatenated according to the order of the inter-cluster topological sorting to obtain a globally deterministic fair sorting sequence.
[0040] In step S9, the globally deterministic fair sorting sequence is output.
[0041] The following is an example illustrating the calculation process of this invention. For ease of understanding, it is assumed that the set of transactions to be sorted is... The transaction sequences observed by multiple replicas are shown in Table 1 below: Table 1 Observation sequence list
[0042] Based on the observation sequence list shown in Table 1 above, the pairwise priority relationships between any two transactions are statistically analyzed to construct a preference matrix, where rows represent priority transactions and columns represent priority-rejected transactions. One tabular form of this preference matrix is shown in Table 2 below: Table 2 Example of a Preference Matrix
[0043] Assuming a Byzantine fault ceiling Ranking fairness parameters Then the consensus threshold Calculate the canonical position of each transaction: After sorting the transactions in the transaction set in ascending order according to their canonical positions, a one-dimensional linear baseline sequence can be obtained. .
[0044] Assuming adaptive clustering threshold Along a one-dimensional linear baseline sequence Compare the canonical position differences between adjacent transactions: Based on the difference, two disjoint transaction clusters can be identified: .
[0045] Aggregate preference weights are calculated based on the pairwise priority relationship between two transaction clusters. Transaction cluster Compared to The aggregation preference weight is : Transaction cluster Compared to The aggregation preference weight is : The total number of copies Byzantine fault limit Ranking fairness parameters Marginal parameters can be calculated Assuming ,because Therefore, it is established by point to The directed edges. At this point, the cluster-level directed quotient graph has no cycles.
[0046] Perform inter-cluster topological sorting on the cluster-level directed quotient graph to obtain a sequence. .
[0047] For transaction clusters By calculating the net preference score for each transaction, we can see that: Therefore, we can obtain The items within are arranged in descending order of net preference score as follows: For transaction clusters By calculating the net preference score for each transaction, we can see that: Therefore, we can obtain The items within are arranged in descending order of net preference score as follows: .
[0048] Finally, the intra-cluster sorting results of each transaction cluster are concatenated according to the inter-cluster topological sorting order to obtain a globally deterministic fair sorting sequence: .
[0049] Based on the above method embodiments, the present invention also provides a blockchain fair transaction ranking system based on hypergraph partitioning. Figure 2 This is a schematic diagram illustrating the structure of a blockchain fair transaction ranking system based on hypergraph partitioning, as provided by the present invention. Figure 2 As shown, the system includes at least the following modules: observation collection module, preference matrix construction module, robust canonical embedding module, adaptive hypergraph modeling module, and hierarchical serialization module.
[0050] The observation collection module acquires observation sequences from multiple replicas of the set of transactions to be sorted. The preference matrix construction module constructs a preference matrix based on the observation sequences. The robust canonical embedding module calculates the canonical position of each transaction in the set of transactions to be sorted based on the preference matrix, and generates a one-dimensional linear baseline sequence based on the canonical positions.
[0051] The adaptive hypergraph modeling module is used to perform adaptive geometric clustering along the one-dimensional linear baseline sequence, dividing transactions that meet the clustering conditions into multiple non-overlapping transaction clusters, constructing a cluster-level directed quotient graph with the multiple non-overlapping transaction clusters as nodes, and eliminating the cycles in the cluster-level directed quotient graph to obtain an acyclic directed quotient graph.
[0052] The hierarchical serialization module is used to perform inter-cluster topological sorting on the acyclic directed quotient graph, calculate intra-cluster sorting scores for transactions within each transaction cluster, perform intra-cluster sorting, and concatenate the intra-cluster sorting results of each transaction cluster according to the order of the inter-cluster topological sorting to generate a globally deterministic fair sorting sequence.
[0053] In some embodiments, the fair transaction ordering system further includes a consensus authentication module. The consensus authentication module is used to authenticate or confirm the consistency of the observation sequences after the observation collection module acquires multiple copies of the observation sequences, so that subsequent ordering processes are performed based on the authenticated observation sequences.
[0054] In some embodiments, the fair trading ranking system further includes a verification module. The verification module is used to, after the hierarchical serialization module generates a globally deterministic fair ranking sequence, use the globally deterministic fair ranking sequence as a ranking result to be verified, replay the generation process of the globally deterministic fair ranking sequence based on the same input, and reject the ranking result to be verified if the replay result is inconsistent with the ranking result to be verified.
[0055] Experimental data shows that this invention significantly outperforms existing solutions in several performance metrics. In a 41-node prototype deployment, the throughput of this invention reached 12,152 TPS, which is 5.3 times that of Themis and 2.7 times that of Rashnu. In a 101-node prototype deployment, the throughput of this invention remained at 5,696 TPS, which is 77.2% of the baseline HotStuff, while Themis only retained 17.6% of the baseline. Regarding the ordering fairness parameter... In adversarial simulations, this invention reduced the maximum ranking shift from 301 positions in Themis to 34 positions, and improved the robustness of the satisfied pair from 0.813 to 0.87. Under a 50ms WANCondorcet attack scenario, the average throughput of this invention was 12.0 times that of Themis and 9.7 times that of Rashnu, demonstrating good robustness against adversarial attacks.
[0056] In summary, this invention compresses pairwise priority relationships into a one-dimensional linear baseline sequence, then uses adaptive clustering to localize cyclic ambiguities to smaller transaction clusters, and finally eliminates cycles and completes hierarchical serialization on the cluster-level directed quotient graph. This ensures the determinism and fairness of the sorting while avoiding the coarse-grained problem caused by directly performing strongly connected component agglomeration on the global dependency graph.
[0057] The above embodiments are merely illustrative of the technical concept and features of the present invention, intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly, and should not be construed as limiting the scope of protection of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects. The scope of the present invention is defined by the appended claims rather than the foregoing description, and thus all changes falling within the meaning and scope of the equivalents of the claims are intended to be included within the present invention.
Claims
1. A blockchain fair transaction ranking method based on hypergraph partitioning, characterized in that, include: Obtain the set of transactions to be sorted and the observation sequence of the set of transactions by multiple replicas; A preference matrix is constructed based on the observation sequence, and the preference matrix is used to represent the pairwise priority relationship between transactions; The canonical position of each transaction in the set of transactions to be sorted is calculated based on the preference matrix. The canonical position is determined based on the pairwise priority relationship that satisfies the consensus threshold. A one-dimensional linear baseline sequence is generated based on the sorting result of the canonical position. Adaptive geometric clustering is performed along the one-dimensional linear baseline sequence to divide transactions that meet the clustering conditions into multiple non-overlapping transaction clusters, forming a partitioning hypergraph; Based on the partitioning hypergraph, a cluster-level directed quotient graph is constructed, and the cycles in the cluster-level directed quotient graph are eliminated to obtain an acyclic directed quotient graph. Perform inter-cluster topological sorting on the acyclic directed quotient graph and calculate intra-cluster sorting scores for transactions within each transaction cluster; Based on the intra-cluster ranking score, transactions within each transaction cluster are ranked intra-clusterly, and the intra-cluster ranking results of each transaction cluster are concatenated according to the order of the inter-cluster topological ranking to generate a globally deterministic fair ranking sequence.
2. The blockchain fair transaction ranking method based on hypergraph partitioning according to claim 1, characterized in that, Constructing a preference matrix based on the observed sequence includes: For a transaction set containing multiple transactions, count the number of replicas in which the first transaction precedes the second transaction, and use the number of replicas as the pairwise priority value of the first transaction relative to the second transaction; The preference matrix is constructed by using the pairwise preference values as matrix elements.
3. The blockchain fair transaction ranking method based on hypergraph partitioning according to claim 1, characterized in that, Before calculating the canonical position of a transaction, the pairwise priority relationships in the preference matrix are filtered based on a consensus threshold; The consensus threshold is determined based on the total number of replicas, the Byzantine fault limit, and the ordering fairness parameter. The ranking fairness parameter is used to characterize the replica observation consistency strength that must be satisfied when a pairwise priority relationship is adopted.
4. The blockchain fair transaction ranking method based on hypergraph partitioning according to claim 3, characterized in that, The specified location is: For a target transaction, determine the target column in the preference matrix corresponding to the target transaction, count the number of matrix elements in the target column whose element values are greater than the consensus threshold, and use the number of matrix elements as the canonical position of the target transaction.
5. The blockchain fair transaction ranking method based on hypergraph partitioning according to claim 1, characterized in that, Adaptive geometric clustering along the one-dimensional linear baseline sequence includes: Based on the transaction arrangement order in the one-dimensional linear baseline sequence, the difference in the canonical position of adjacent transactions is compared; When the difference is less than the adaptive clustering threshold, the corresponding adjacent transactions are grouped into the same transaction cluster; When the difference is not less than the adaptive clustering threshold, the current transaction cluster is terminated and a new transaction cluster is started. The adaptive clustering threshold is determined based on at least one of the following: fairness relaxation parameter, empirical network latency, and transaction generation interval.
6. The blockchain fair transaction ranking method based on hypergraph partitioning according to claim 1, characterized in that, Constructing a cluster-level directed quotient graph based on the partitioning hypergraph includes: The transaction clusters in the partitioning hypergraph are used as nodes in the cluster-level directed quotient graph; For any two different transaction clusters, calculate the aggregation preference weight based on the pairwise priority relationship between transactions in the two different transaction clusters; The aggregation preference weights between the two different transaction clusters are compared based on the marginal parameter. When the aggregation preference weight of the first transaction cluster relative to the second transaction cluster is greater than the product of the marginal parameter and the aggregation preference weight of the second transaction cluster relative to the first transaction cluster, a directed edge is established from the first transaction cluster to the second transaction cluster.
7. A blockchain fair transaction ranking method based on hypergraph partitioning according to claim 6, characterized in that, Eliminating cycles in the cluster-level directed quotient graph includes: Detect the non-trivial strongly connected components in the cluster-level directed quotient graph, and merge the transaction clusters in the non-trivial strongly connected components into a supercluster; The nodes and directed edges of the cluster-level directed quotient graph are updated based on the supercluster, and the detection and merging are repeated until the acyclic directed quotient graph is obtained. The deterministic key of a transaction cluster is the minimum value of the transaction identifiers in that transaction cluster.
8. A blockchain fair transaction ranking method based on hypergraph partitioning according to claim 1, characterized in that, The intra-cluster ranking score is a net preference score: For a target transaction in any transaction cluster, the net preference score of the target transaction is determined by summing the differences between the target transaction's pairwise priority relationship with other transactions in the same transaction cluster and the pairwise priority relationship of other transactions with respect to the target transaction.
9. A blockchain fair transaction ranking method based on hypergraph partitioning according to claim 8, characterized in that, The intra-cluster sorting includes: Transaction sorted in descending order of net preference score; When the net preference scores are equal, the transactions are arranged in ascending order according to their normal positions. When the net preference score is equal to the normed position, the transactions are arranged in ascending order according to the transaction identifier.
10. A blockchain fair transaction ranking system based on hypergraph partitioning, characterized in that, include: The observation collection module is used to acquire observation sequences of multiple replicas of the set of transactions to be sorted; The preference matrix construction module is used to construct a preference matrix based on the observation sequence; The robust canonical embedding module is used to calculate the canonical position of each transaction in the set of transactions to be sorted based on the preference matrix, and to generate a one-dimensional linear baseline sequence based on the canonical positions. An adaptive hypergraph modeling module is used to perform adaptive geometric clustering along the one-dimensional linear baseline sequence, divide transactions that meet the clustering conditions into multiple non-overlapping transaction clusters, construct a cluster-level directed quotient graph with the multiple non-overlapping transaction clusters as nodes, and eliminate the cycles in the cluster-level directed quotient graph to obtain an acyclic directed quotient graph. The hierarchical serialization module is used to perform inter-cluster topological sorting on the acyclic directed quotient graph, calculate intra-cluster sorting scores for transactions within each transaction cluster, perform intra-cluster sorting, and concatenate the intra-cluster sorting results of each transaction cluster according to the order of the inter-cluster topological sorting to generate a globally deterministic fair sorting sequence.
