The blockchain is connected by hashprev
generally, y = hash (x) is used in the instry to calculate a hash value y by calculating X.
According to experts, blockchain can be understood as a distributed public ledger, which is connected by various blocks into a chain. In the traditional bookkeeping system, the bookkeeping right is controlled by the central server
on the "account book" of blockchain, every point in the chain can record information on it, forming a point-to-point accounting system. Therefore, blockchain technology is considered as a decentralized technology
For example, in a village of 100 people, Zhang San bought a cow from Li Si and paid him 10000 yuan. In the past, he had to rely on Zhao Liu, a middleman, to transfer his 10000 yuan to Li Siwith the blockchain system, Zhang San can directly record his 10000 yuan to Li Si's account book, and the transaction information will be transmitted to the whole village, that is, the whole blockchain system, so that other 98 people can see the information. The whole transaction process is recorded by the system, which has the advantage of traceability to prevent the loss of Zhao Liu's account book or Li Si's denial of account
extended data
in 2008, Nakamoto first proposed the concept of blockchain. In the following years, blockchain became the core component of electronic currency bitcoin: as a public account book for all transactions. By using peer-to-peer network and distributed timestamp server, the blockchain database can be managed independently
the blockchain invented for bitcoin makes it the first digital currency to solve the problem of repeated consumption. The design of bitcoin has become a source of inspiration for other applications
blockchain is composed of a series of blocks generated by cryptographic algorithm. Each block is filled with transaction records, and the blocks are connected in sequence to form a chain structure, which is the blockchain ledger
taking bitcoin as an example, when miners generate new blocks, they need to calculate the new hash value and random number according to the hash value, new transaction block and random number of the previous block. In other words, each block is generated on the basis of the previous block data, which ensures the uniqueness of the blockchain data
because subtle changes in transaction records will completely change the result of hash value, miners can't cheat when competing for computing power. Each miner must wait until the previous block is generated before starting to calculate the qualified random number according to the data of the previous block, which ensures the fairness of mining.
In today's era of high development of the Internet, we are using the Internet more and more frequently, which has become an indispensable and important tool in our life. In particular, the mobile phone used for Internet communication has been used as a medium. In today's era, we are using mobile payment more and more, There are more and more ways to move. So what is digital currency? What do you know about it{ But generally speaking, it is a form of money< p> Finally, for such a form of transaction, it's all for the convenience of our daily life, and it's also for serving our own broad masses of people, so we don't have to worry about the advantages and disadvantages of digital currency and mobile payment
it is suggested that netizens should stay away from bitcoin and its related things if they don't understand bitcoin. This netizen can send me a private letter and tell me what you know. I will sort out and report on it.
Yes
use PHP code to define blocks:
class block {
public $prevhash
public $hash;
public $timeStamp;
public $data;
}
prevhash: the hash value of the previous block; Hash: hash value of the current block; Timestamp: the time stamp generated by the block; Data: data stored in the block; The fields prevhash, hash and timestamp are called block headers in the blockchain, and the hash value of the block is calculated by SHA-256 algorithm
extended data
the practical use and significance of blockchain:
blockchain is a decentralized distributed ledger. What is decentralization? There is no center, or everyone can be a center. This is different from the traditional way of centralization. Distributed ledger means that the storage of data is not only on each node, but each node will and share the data of the whole ledger
In addition, blockchain has the characteristics of disintermediation and information transparency. For example, for example, when we shop on Taobao, after we place the order, the cost we pay is first hit in Alipay. After we receive the courier and confirm the receipt, the money will be transferred to the seller's account. In the blockchain, buyers and sellers can trade directly without any platform as a third-party certification authoritythe system will broadcast the transaction information of both parties. All hosts will record and back up the transaction data after receiving the information. If the order of one machine is wrong, the backup data of other machines will not be affected