仓库源文站点原文


layout: post title: "Hash Pointers and Data Structures" subtitle: "Bitcoin and Cryptocurrency Technologies-Week 1" author: "赵化冰" date: 2018-05-12 image: "/img/2018-05-06-cryptocurrency_week1/blockchain.png" published: true description: "Hash pointer is used to bulid some key data structures in cryptocurrency, such as Block chain and Merkel tree." tags:

- Cryptocurrency
- Blockchain
- Bitcoin

categories: [ Tech ] URL:: "/2018/05/12/cryptocurrency_week1_hash_pointer_and_data_structures/"


This series of articles are my notes of "Bitcoin and Cryptocurrency Technologies" online course.

Hash Pointer

Hash Pointer is comprised of two parts:

Data Structures Built with Hash Pointers

Blockchain

Hash pointers can be used to build a linked list, which is also called a blockchain.
blockchain

We should Note that the hash stored in the hash pointer is the hash of the whole data of the previous block, which also includes the hash pointer to the block before that one. This makes it's impossible to tamper a block in the blockchain without letting others know.

Tamper Evident Property of Blockchain
We only need to keep the hash pointer to the last block of the blockchain. Then when somebody shows the whole blockchain later and claim the data in it is not modified, we can tell if any block in the chain is tampered by traversing the blocks backwards and verifying the hashes one by one.

Explanation

tamper evident

Merkle Tree

Merkle tree is a binary tree building with hash pointers. The leaves are data blocks, nodes further up in the tree are the hashes of their respective children.

merkel tree

Features

Example Codes on GitHub