how does a blockchain work 
you might be familiar with spreadsheets or databases a blockchain is somewhat similar because it is a database where information is entered and stored but the key difference between a traditional database or spreadsheet and a blockchain is how the data is structured and accessed a blockchain consists of programs called scripts that conduct the tasks you usually would in a database entering and accessing information and saving and storing it somewhere a blockchain is distributed which means multiple copies are saved on many machines and they must all match for it to be valid the bitcoin blockchain collects transaction information and enters it into a 4mb file called a block other blockchains use different size blocks once it is full certain information is run through an encryption algorithm which creates a hexadecimal number called the block header hash the hash is then entered into the following block header and encrypted with the other information in that block s header creating a chain of blocks transactions follow a specific process depending on the blockchain they are taking place on for example on bitcoin s blockchain if you initiate a transaction using your cryptocurrency wallet the application that provides an interface for the blockchain it starts a sequence of events in bitcoin your transaction is sent to a memory pool where it is stored and queued until a miner picks it up once it is entered into a block and the block fills up with transactions it is closed and the mining begins every node in the network proposes its own blocks in this way because they all choose different transactions each works on their own blocks trying to find a solution to the difficulty target using the nonce short for number used once the nonce value is a field in the block header that is changeable and its value incrementally increases every attempt every miner starts with a nonce of zero if the resulting hash isn t equal to or less than the target hash a value of one is added to the nonce a new hash is generated and so on the nonce rolls over about every 4 5 billion attempts which takes less than one second and uses another value called the extra nonce as an additional counter this continues until a miner generates a valid hash winning the race and receiving the reward generating these hashes until a specific value is found is the proof of work you hear so much about it proves the miner did the work the amount of work it takes to validate the hash is why the bitcoin network consumes so much computational power and energy once a block is closed a transaction is complete however the block is not considered to be confirmed until five other blocks have been validated confirmation takes the network about one hour to complete because it averages just under 10 minutes per block the first block with your transaction and five following blocks multiplied by 10 equals 60 minutes not all blockchains follow this process for instance the ethereum network randomly chooses one validator from all users with ether staked to validate blocks which are then confirmed by the network this is much faster and less energy intensive than bitcoin s process blockchain decentralizationa blockchain allows the data in a database to be spread out among several network nodes computers or devices running software for the blockchain at various locations this not only creates redundancy but maintains the fidelity of the data for example if someone tries to alter a record at one instance of the database the other nodes would prevent it from happening because they compare block hashes this way no single node within the network can alter information within the chain because of this distribution and the encrypted proof that work was done the information and history like the transactions in cryptocurrency are irreversible such a record could be a list of transactions such as with a cryptocurrency but it is also possible for a non public blockchain to hold a variety of other information like legal contracts state identifications or a company s inventory most blockchains wouldn t store these items they would likely be sent through a hashing algorithm and represented on the blockchain by a token blockchain transparencybecause of the decentralized nature of the bitcoin blockchain all transactions can be transparently viewed by downloading and inspecting them or by using blockchain explorers that allow anyone to see transactions occurring live each node has its own copy of the chain that gets updated as fresh blocks are confirmed and added this means that if you wanted to you could track a bitcoin wherever it goes for example exchanges have been hacked in the past resulting in the loss of large amounts of cryptocurrency while the hackers may have been anonymous except for their wallet address the crypto they extracted is easily traceable because the wallet addresses are published on the blockchain of course the records stored in the bitcoin blockchain as well as most others are encrypted this means that only the person assigned an address can reveal their identity as a result blockchain users can remain anonymous while preserving transparency 