Chinese meaning of blockchain pow
In 2009, bencong invented bitcoin, and set that there are only 21 million bitcoins. By participating in the proction of blocks and providing proof of work (POW), he can get the reward of bitcoin network. This process is mining
the concept of "mining" comes from the existing concepts in our real economic life, such as gold mining and silver mining. Because minerals are valuable, it drives people to pay labor to dig
another important point of bitcoin mining is that the miners who participate in mining recognize the value of bitcoin, and some of them are willing to spend money in the bitcoin market. Therefore, the mining of bitcoin is meaningful
extended data
currency characteristics of bitcoin
1, decentralized
bitcoin is the first distributed virtual currency, and the whole network is composed of users without central bank. Decentralization is the guarantee of bitcoin's security and freedom
2, bitcoin can be managed on any computer connected to the Internet. No matter where you are, anyone can dig, buy, sell or collect bitcoin
3, exclusive ownership
controlling bitcoin requires a private key, which can be stored in any storage medium in isolation. No one can get it except the user himself
4, low transaction cost
bitcoin can be remitted free of charge, but in the end, about 1 bitfen transaction fee will be charged for each transaction to ensure faster transaction execution
5, no hidden cost
as a means of payment from a to B, bitcoin has no cumbersome limit of quota and proceres. If you know the other party's bitcoin address, you can pay
6, cross platform mining
users can explore the computing power of different hardware on many platforms
POW: full name of proof of work
pos: proof of stake
both of them are the consensus mechanism of blockchain and the bookkeeping method of digital currency
the difference is:
1. POW mechanism: workload proof mechanism, that is, the proof of workload, is the requirement that must be met when generating a new transaction information (that is, a new block) to be added to the blockchain. In the blockchain network based on workload proof mechanism, the ability of nodes to obtain the correct numerical solution to generate blocks by calculating the numerical solution of random hash hash is the specific performance of node computing power
POS mechanism: the proof of rights and interests requires the certifier to provide a certain amount of ownership of cryptocurrency. The operation mode of the proof of rights and interests mechanism is that when creating a new block, the miners need to create a "currency right" transaction, and the transaction will send some coins to the miners themselves according to the preset proportion. According to the proportion and time of token owned by each node, the equity proof mechanism reces the mining difficulty of nodes proportionally according to the algorithm, so as to speed up the speed of searching for random numbersextended materials:
the concept of bitcoin was first proposed by Nakamoto in 2009. According to Nakamoto's ideas, the open source software and the P2P network on it were designed and released. Bitcoin is a kind of P2P digital currency. Point to point transmission means a decentralized payment system
unlike most currencies, bitcoin does not rely on specific currency institutions. It is generated by a large number of calculations based on specific algorithms. Bitcoin economy uses the distributed database composed of many nodes in the whole P2P network to confirm and record all transactions, and uses the design of cryptography to ensure the security of all aspects of currency circulation. The decentralized nature and algorithm of P2P can ensure that it is impossible to artificially manipulate the value of bitcoin through mass proction
by the way, it's not a panacea, nor is it
because the private chain is a closed ecological storage network, that is to say, the traditional distributed consistency model should be optimal; Due to the semi closed and semi open characteristics of alliance instry chain, the use of delegated proof of XXX is the best. We can consider adding Byzantine fault tolerance / security protection mechanism to improve the traditional consistency algorithm
public chain POW should still be the best choice
bitcoin, Ruitai coin, Laite coin and doggy coin all use pow.
function prototype is double pow (double a, double B)
the math.h header should be included when using<
1, mathematical function editing in C / C + +
prototype: in TC2.0, the prototype is external float pow (float x, float y), In VC6.0, the prototype is double pow (double x, double y)
header file: math.h/cmath (in C + +)
function: calculate the Y power of X
return value: if x cannot be negative and Y is a decimal, or if x is 0 and Y is less than or equal to 0, the result of power exponent is returned
return type: double, int, float will give warning<
2, overload editing of pow functions
C + + provides the following overload forms of pow functions:
double pow (double x, int y)< br />float pow(float X,float Y);< br />float pow(float X,int Y);< br />long double pow(long double X,long double Y);< br />long double pow(long double X,int Y);
the parameter type should be set reasonably when using to avoid multiple "pow" instances matching the parameter list
among them, overloading is more likely to occur when using shapes such as:
int, x, y< br />int num=pow(X,Y);
this is a commonly used function, but the compiler will remind that there are multiple "pow" instances matching the parameter list
casts can be used to solve this problem: num = pow ((float) x, y);