Blockchain study notes (1) - Bitcoin concepts and knowledge related to cryptography

Make some notes for yourself that you can read

1.Bitcoin History

In 2008, a person under the pseudonym Satoshi Nakamoto published a paper Bitcoin: A Peer-to-Peer Electronic Cash System. Bitcoin software was released in January 2009 and the mining of the Bitcoin cryptocurrentcy officially started. The genesis block included the
“The Times” headline: “Chancellor on brink of second bailout for banks”. The article was about the state of the British financial system following the 2007–2008 financial crisis, and many believe that this is a hint to the purpose of Bitcoin: to create a more stable financial system. Satoshi Nakamoto vanished from the digital space shortly after releasing the code
for Bitcoin, and it is unknown who this person (or possibly a group of people) is. The first known commercial transaction using bitcoin happened in 2010 - two pizzas were bought for 10000 bitcoin.

Quoting the textbook directly, the simple explanation is:
Bitcoin is a cryptocurrency, a digital asset that uses cryptography to control its creation and management, rather than relying on a central authority. So it's decentralized. The term "Bitcoin" was defined in a white paper published on October 31, 2008.
The reason Bitcoin was created was to create a digital currency that was not controlled by governments or financial institutions. Bitcoin was designed as a peer-to-peer currency, meaning it can be sent directly from one user to another without the need for a third-party intermediary.

1.1 A timeline about bitcoin
  • 2008: Satoshi Nakamoto publishes the Bitcoin white paper.
  • 2009: The first Bitcoin block is mined.
  • 2010: The first known commercial transaction using Bitcoin takes place.
  • 2011: The Bitcoin price reaches $1 for the first time.
  • 2013: The Bitcoin price reaches $1,000 for the first time.
  • 2017: The Bitcoin price reaches $20,000 for the first time.
  • 2018: The Bitcoin price crashes to $3,000.
  • 2021: The Bitcoin price reaches $65,000 for the first time.

Here is a portal for some documents to be read about the blockchain: http://t.csdn.cn/5F64K
(I will also take notes if I read it later)

About the study of blockchain
Here is recommended "Blockchain Technology and Application" by Mr. Xiao Zhen at station b. The following are his notes on cryptography, and he should also take notes on cryptography later.

2. Crytography of the Blockchain

Bitcoin is a cryptocurrency-currency (Bitcoin is a cryptocurrency), but in fact all the data on the blockchain (blockchain) is public, and the transfer amount is public.
One of the knowledge involved in blockchain cryptography is the hash function, and the other is the signature.

2.1 the Hash function

2.1.1 collision resistance

The other saying is collision free but he doesn't like it very much

if x ! =y
then H(x) = H(y)

Hash collisions exist objectively, and hash collisions cannot be artificially created. There is no efficient method
to search through brute force traversal, but this method is not practical, considering the relatively large input space
(brute-force)

Used to obtain a summary of information (message->digest)
H(m) used to detect tampering with m

MD5 (obsolete, since it is already known how to artificially create hash collisions)

2.1.2 Hiding

The hash function is one-way irreversible.
It can be obtained from the front to the back, and the back can not be pushed back to the front.
The prerequisites are: the input space must be large enough and the distribution should be relatively uniform
x -> H(x)

digital commitment / digital equivalent of a sealed envelope

The two features are collision resistance and hiding.
The prediction results cannot be disclosed in advance
. The prediction results can be used as input to calculate a hash value. The hash value
can be published as a sealed envelope, and the results will be announced after the market closes the next day
. Very limited, easy to predict the result, the stock is so small

The common method is to splice a random number after the input, and then take the hash together. The nonce
is introduced here (it will also appear after the mining miner) H(x|| nonce) ensures that the input is random enough and evenly distributed

2.1.3 puzzle friendly

The calculation of the hash value is unpredictable in advance, and the result cannot be guessed. If you want your hash value to fall within a certain range, you can only try one by one.
For example, you can try to get the following proof :
the first 20 bits are all 0 (a total of 256 bits)
H(x) -> 000000000 (20 zeros) XXXXXX
(in fact, it is already a bit of a mining concept)
miner's task is to find a nonce
nonce is a random number you can look for, change it to hash to get the result you want

Bitcoin is a blockchain, and a blockchain is a chain composed of blocks. Each block has a block header, and there are many domains in the block header. In fact, you will know it
later That is (XX||XX|| nonce)

The purpose of mining is to hash the block header so that the entire
H(block header)<= target's space
is within the target range, which is actually proof of work, which is the proof of your workload.

The concept is here:

Proof of Work (PoW) is a consensus mechanism used in blockchain networks, including Bitcoin. It is a computational puzzle that requires a significant amount of computational power to solve. The purpose of PoW is to ensure the security and integrity of the network by making it difficult and resource-intensive for malicious actors to manipulate the blockchain.
In PoW, miners compete to solve a complex mathematical problem, typically a cryptographic hash function, by repeatedly hashing different inputs until they find a solution that meets certain criteria. This solution is known as the "proof" and serves as evidence that the miner has expended a significant amount of computational effort.

The first paragraph is the concept of proof of work, and the second paragraph is the work of the miners and the proof of workload through this indicator.

"Difficult to solve, but easy to verify"
Although it takes a lot of work to find a suitable nonce, once it is found and broadcasted, it is easy for others to verify (validate its valid) whether it meets the requirements , you only need to calculate the hash value once to judge.

The hash function used in Bitcoin is called SHA-256 (secure hash algorithm)

2.2 Signature

Because Bitcoin is decentralized, there is no third party to manage it, and it is a P2P structure, so if you want to register in Bitcoin, you only need to open an account personally, and create a pair of public key and private key (public key and private
key )
This represents an account, Bitcoin information
Bitcoin: local generate public(address) privacy(password)

  • If you don’t understand, you can learn about asymmetric encryption algorithms (public keys are used for encryption, and private keys are used for decryption (but this does not guarantee identification))

Bitcoin is the other way around, first use the private key to sign the verifiied key, and verify the signature with the person's public key, because what I want to understand is that this person transfers money to me

  • What if the public and private key pairs are identical?
    It is not feasible in practice, the number of digits is 256, why do such violent dismantling?
    He said that the probability of the earth exploding is even smaller.

The premise is that there is a good source of randomness
a good source of randomness

Each signature requires a good random source to prevent leakage of the private key

Guess you like

Origin blog.csdn.net/m0_51377238/article/details/131355125