Hands-On Cybersecurity with Blockchain
上QQ阅读APP看书,第一时间看更新

How blockchain works

Let's understand the workings of the blockchain ledger in its simplest form. To understand the system in its generic form, it is important to use several states of blockchain and explore them further:

  1. Transaction preparation: At this stage, party A creates a transaction that includes information including the public address of the receiver, a source digital signature, and a transaction message. Now, this transaction is made available to all of the nodes in the blockchain.
  2. Transaction verification: The blockchain nodes work in a trustless model, where each node (the machine running the blockchain client software) receives this transaction, and verifies the digital signature with party A's public key. After successful verification, this authenticated transaction is parked in the ledger queue and waits until all the nodes successfully verify the same transaction.
  3. Block generation: The queued transactions are arranged together and a block is created by one of the nodes in the network. In the Bitcoin blockchain, Bitcoins are rewarded when a Bitcoin node, also known as a miner, creates a block by solving some mathematically complex problem.
  4. Block validation: After a successful block generation, nodes in the network are processed for an iterative validation process where the majority of the nodes have to acquire consensus. There are four popular ways to achieve consensus, Proof of Work (PoW), Proof of Stack (PoS), Delegated Proof of Stack (DPoS), and Practical Byzantine Fault Tolerance (PBFT). Bitcoin uses PoW to achieve consensus; however, Ethereum uses PoS for consensus. This mechanism impacts financial aspects and ensures the security of all transaction operations.
  1. Block chained: After a successful consensus mechanism, the blocks are verified and are added to the blockchain.

The states of the blockchain can be seen in the following diagram: