Bitcoin and Cryptocurrency Technologies Notes 1

Bitcoin and Cryptocurrency Technologies Notes 1

本文搬运princeton的同名书籍,这部分写到hash point,下部分开始写自己手动翻译版的。


All currency need way to Control Supply and enforce some security properties to prevent cheating
The difference between cryptocurrency and fiat currency is that the security rules of cryptocurreny is enforced purely technologically and without relying on central authority

Hash Functions

Hash function is a mathematical function whitch satisfies:

  • Arbitrary-length inputs
  • Produce a fixed size output
  • Efficiently computable

Cryptographic hash function needs three additional properties:

  • Collision resistence
    We say a hash function is collision-resistent if it is infeasible to find a collision
    infeasible but not inpossible

    Two distinct inputs produce the same output

    A Conclusion of Birthday paradox:
    We can find a collision by only examing roughly the square root of the number of all possible output. Thus, we can find a collision of a hash function with 256 256 256 bits output by roughly calculate 2 128 2^{128} 2128 hashs, but it is queit a tremendous number.
    About birthday paradox:Click here

    Ensure the files 'integrity. Preventing the potentially malicious behaviour by other entities is at the Core of what cryptography gives us.

  • Hiding(and Binding)

    Primary: Given the output of a hash function y = H ( x ) y=H(x) y=H(x), there is no feasible way to figure out what is the input x x x.
    But we can easily find out that it is not true in a stated form. Consider the case in which has few possible input, then by the given output it is not hard to retrospect the input.
    To solve this problem, we can hide even an input that is not spread out by concatenating it with another input that ​is spread out。

    A hash function H is hiding if: when a secret value ​ r r r ​is chosen from a probability distribution that has ​high min-entropy ​(which means spread-out). Then given H ( r ∣ ∣ x ) H(r||x) H(rx) is infeasible to find x x x. || means concatenation.

    Binding(Indeed collision-free but not the same): It is infeasible to find two pairs ( r ∣ ∣ x ) (r || x) (rx) and ( r ′ ∣ ∣ x ′ ) (r'||x') (rx) such that x ≠ x ′ x\not=x' x=x and H ( r ∣ ∣ x ) = H ( r ′ ∣ ∣ x ′ ) H(r||x) = H(r'||x') H(rx)=H(rx). ​
    In cryptography, the term ​ n o n c e nonce nonce ​is used to refer to a value that can only be used once. Practically, the term r r r can be substituted by n o u c e nouce nouce.

  • Puzzle-friendliness
    A hash function ​ H H H ​is said to be puzzle-friendly if for every possible n n n-bit output value ​ y y y ​, if k k k is chosen from a distribution with high min-entropy, then it is infeasible to find ​ x ​x x ​such ​that H ( k ∣ ∣ x ) = y H(k || x) = y H(kx)=y in time significantly less than ​ 2 n 2^n 2n.

How hash functions work on arbitraty-length inputs

As long as we can build a hash function works on fixed-length inputs, a method called Merkle-Damgard transform can convert it into a function works on arbitrary-length inputs. The underlying collision-resistant hash function is called Compression Function in common terminology.
The graph behind shows how general hash function works(SHA-256)
Graphical deciption of the working mechinism of SHA-256(Simplified)
The term I V IV IV is called Initialization Vector.

Hash Pointer

A hash pointer is a pointer to where data is stored together with a cryptographic hash of the value of that data at some fixed point in time(在某个特定时间点).

Block Chain: Link list using hash pointers.
Here is the intuition graph of a block chain:
Block chain
In block chain, each block not only tells us where the value previous block, but also contains a digest of that value that allows us to verify that the value has not change.

©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页