Читать книгу Cryptocurrency Mining For Dummies - Peter Kent - Страница 61

Verifying the transaction

Оглавление

The first thing the node does when receiving the transaction is to use the public key to decrypt the message so that it can read it. It must then verify the transaction. This process ensures that the transaction is valid, based on a number of different criteria. We won’t go into all the details, but essentially the node asks itself (and answers) questions like these:

 Is the message properly structured and not exceeding the maximum message size?

 Does the message contain valid information — for example, does it contain valid input and output addresses and sums, within valid ranges, assigned to the addresses?

 Does the input address exist in the blockchain with a valid balance?

 Is a sufficient transaction fee associated with the transaction?

 Does the wallet sending the transaction have a right to send the transaction — that is, is the public key sent with the message associated with the address from which the cryptocurrency is being sent?

What happens if the message is not valid in some way? The node throws it away because there’s no point sending it on to the next node. But if it’s valid, the node adds it to a pool of valid transactions (a memory pool or mempool), and sends it to other nodes on the network. These other nodes will do the same: decrypt and verify the transaction and add to their mempool if they find it valid. (That’s part of the consensus process, ensuring that everyone agrees.) Thus the message, in a matter of seconds, propagates (spreads) across the crypto network, being picked up by node after node.

So the mempool is a collection of transactions waiting to be confirmed, solidified, and included into a block. The size of the mempool ebbs and flows depending on the current number of transactions hitting the network, and, of course, as the network congestion goes up, transaction fees go up. (You can find a very useful site for inspecting the current backlog of transactions in the mempool and current transaction fees at https://jochen-hoenicke.de/queue/#0,all.)

Some nodes are mining nodes. These nodes add blocks to the blockchain, in a competition to earn Bitcoin. These nodes are also creating memory pools, collections of transactions that need to be added to the blockchain.

Cryptocurrency Mining For Dummies

Подняться наверх