Hash Pointer and Blockchain

hash pointer is :

  • pointer to where some info is stored, and
  • cryptographic hash of the info

if we have a hash pointer, we can

  • ask to get the info back, and
  • verify that it hasn't changed

key idea: build data structures with hash pointers
linked list: use case tamper-evident log
binary tree with hash pointers = "Merkle Tree"
Advantages of Merkle trees:

  • Tree holds many items but just need to remember the root hash
  • Can verify membership in O(log n) time/space

Variant: sorted Merkle tree
can verify non-membership in O(log n) (show items before, after the missing one)

More generally,
hash pointer can be used in any pointer-based data structure that has no cycles.

How a blockchain network runs?

  1. Users interact with the blockchain via a pair of private/public keys. They use their private key to sign their own transactions, and they are addressable on the network via their public key. The use of asymmetric cryptography brings authentication, integrity, and non-repudiation into the network. Every signed transaction is broadcasted by a user's node to its one-hop peers.
  2. The neighboring peers make sure this incoming transaction is valid before replaying it any further; invalid transactions are discarded. Eventually this transaction is spread across the entire network.
  3. The transactions that have been controlled and validated by the network using the process above during an agreed-upon time interval, are ordered and packaged into a timestamped candidate block. This is a process called mining. The mining node broadcasts this block back to the network. (The choice of the mining node and the contents of the block depend on the consensus mechanism that the network employs. )
  4. The node verify that the suggested block (a) contains valid transactions, and (b) references via hash the correct previous block on their chain. If that is the case, they add the block to their chain, and apply the transactions it contains to update their world view. If that is not the case, the proposed block is discarded. This marks the end of a round.
    Note that this is a repeating process.

你可能感兴趣的:(Hash Pointer and Blockchain)