Blockchain Transaction Repeat Checking With Bloom Filters
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The limited node internal memory in blockchain systems restricts the number of transactions that can be cached, leading to frequent access of the blockchain database for repeat transaction verification, which decreases efficiency and query performance.
Innovation Solution
Implement a repeat transaction verification method using a bit array and K hash functions to determine the existence of transactions in the node internal memory, reducing the need for database access by directly verifying transactions through a repeat transaction verifier.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the blockchain node frequently accesses the blockchain database for repeat transaction verification, then the verification completeness is improved, but the query performance and verification efficiency deteriorate
Solution Approach 1:
The patent applies preliminary action by pre-loading transaction data into a Bloom filter data structure before verification queries. The Bloom filter is constructed in advance with all transactions from the blockchain database, enabling rapid verification of repeat transactions without repeated database access. This preliminary preparation resolves the contradiction by caching verification data in memory, maintaining verification completeness while dramatically improving query efficiency.
Solution Approach 2:
The patent introduces the Bloom filter as an intermediary data structure between the blockchain database and the verification process. This intermediary layer filters out non-repeat transactions quickly using in-memory bit array operations, reducing the frequency of database access. The Bloom filter acts as a mediator that maintains verification reliability while protecting the database from excessive query load, thus resolving the efficiency-performance contradiction.
2Productivity
If the node internal memory caches more transactions, then the verification efficiency is improved, but the memory capacity is exceeded
Solution Approach 1:
The patent applies parameter changes by transforming the transaction storage format from full transaction objects to compact Bloom filter representations. Instead of storing complete transaction data in memory, the system encodes transactions as bit patterns in a Bloom filter data structure, dramatically reducing the memory footprint. This parameter transformation enables efficient verification while staying within memory capacity constraints.
Solution Approach 2:
The patent uses copying by creating a compressed representation (Bloom filter) of the transaction set rather than storing actual transaction copies. The Bloom filter copies only the essential verification information (transaction hashes encoded as bit patterns) into memory, eliminating the need to store full transaction objects. This copying approach maintains verification capability while minimizing memory usage.
3Measurement precision
If the blockchain database is accessed multiple times for frequent transactions, then the verification accuracy is improved, but the database query performance deteriorates
Solution Approach 1:
The patent applies preliminary action by pre-computing the Bloom filter structure containing all transaction hashes from the database before the verification process begins. This preliminary computation stores the verification reference data in memory, eliminating the need for repeated database queries during transaction verification. The pre-computed Bloom filter maintains verification accuracy while reducing database access time to minimal levels.
Solution Approach 2:
The patent introduces the Bloom filter as an intermediary cache layer between the database and verification logic. This intermediary structure holds pre-loaded transaction information in memory, intercepting verification queries and answering them without database access when possible. The Bloom filter mediator preserves verification accuracy by maintaining complete transaction hash coverage while eliminating repeated database query overhead.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Disclosed in the present application are a transaction repeat checking method and apparatus, and a device and a medium. The method comprises: acquiring a transaction to be processed, which is to be on-chained to a blockchain network; when first transaction repeat checking is performed on said transaction by means of a transaction repeat checker, acquiring a bit array of the transaction repeat checker and K hash functions, and taking the acquired bit array as a bit array to be queried, which corresponds to said transaction, wherein the bit array to be queried comprises M array elements, the M array elements comprise a first array element, M is an integer greater than 1, and K is a positive integer less than M; mapping, on the basis of the K hash functions, said transaction to K target identification positions of the bit array to be queried, and determining transaction mapped values on the K target identification positions; and determining an association relationship between the first array element and the transaction mapped values on the K target identification positions, and obtaining a first transaction repeat checking result of said transaction on the basis of the association relationship. In the present application, by means of introducing a transaction repeat checker, the efficiency of transaction repeat checking can be improved.