# Bitcoin and Cryptocurrency Technologies Notes 1

## Introduction

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

Collision:
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 bits output by roughly calculate 2 128 2^{128} hashs, but it is queit a tremendous number.
About birthday paradox:Click here

Application:
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) , there is no feasible way to figure out what is the input 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。

Supplementary:
A hash function H is hiding if: when a secret value ​ 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) is infeasible to find x x . || means concatenation.

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

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

#### 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) The term I V 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: 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.

04-30 2619                                                                          05-14 1328
05-05 562
05-15 300
05-26 279
05-15 277
05-15 225
04-30 1684
09-13 8750
05-24 700
05-04 417
09-04 1万+
03-02 5134
04-22 455
05-17 1万+
09-29 98
05-28 106
10-13 2741
07-24 4264
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林