Blockchain Patterns, Mechanisms, Models, Metrics > Integrity and Validation Patterns > Block Singleton
How can a user be prevented from adding a duplicate block to a chain?
A malicious user can attempt to create a duplicate block (or a block containing duplicate records) and send it to the blockchain network to be added to the main chain, thereby compromising the integrity of the distributed ledger.
The blockchain application is designed to check whether blocks and records submitted to the blockchain network already exist in the main chain.
The consensus processor and hashing engine mechanisms are programmed to check each newly submitted block and its contents against blocks existing in the chain in order to identify duplicates.
Node A submits a new block (1). Regardless of the block’s Block ID value, the hashing engine checks the header hash of the block to determine if any other block in the chain has the same header hash (2). If it finds a duplicate header hash the block is rejected. The consensus processor checks the hash of each record in the block to see if any of its hashes previously exist in the distributed ledger (3). If it finds a duplicate record hash, the block is rejected.