Bitcoin and other cryptocurrencies are built on blockchains, which are a sort of distributed ledger. Every transaction on a cryptocurrency's network is saved in these digital files, which are accessible to all users and the general public. As a result, no money may be used more than once. Because a fake version of the public ledger would be quickly identified and rejected by the network's users, a block cannot be modified after it has been completed or mined. By controlling the majority of the processing power on the network, an attacker or a group of attackers might interrupt the process of recording new blocks. They can prevent other miners from completing blocks, allowing them to hypothetically monopolize new block mining and take all of the earnings. This is how a 51% attack functions.