1

Let's say Alice owns 12 BTC in her wallet, and she tries to send 5 BTC to Bob. First the transaction is broadcast to all nodes, then transaction is in the transaction pool. Then miners would choose Alice's transaction and add it to their block and find the nonce, and once they've found the nonce, they will broadcast the block with Alice's transaction. In that flow, at which stage is the transaction validated?

  1. Whether while each node receives the transaction ?. Is it the stage , requires 51 % confirmation to validate the transaction?

  2. Otherwise at the stage , once miner found the nonce, he has to broadcast the transaction , other miners will verify the correct combination of nonce.In this stage , does miners need to verify the nonce along with the all the transactions in the block??

2 Answers 2

3

@James C.'s answer is correct, but I'll add a bit to address your two questions specifically:

Whether while each node receives the transaction ?. Is it the stage , requires 51 % confirmation to validate the transaction?

No, each node acts independently, and there is no way to measure what percentage of them have accepted a transaction as valid. Because of this, whether or not a transaction is valid has no bearing on its permanence or place in the blockchain record, it is simply a yes/no check on whether the transaction is valid according to the network's rules. Invalid transactions will of course be rejected by the nodes, and thus not relayed through the network.

Any valid transaction can then be included in a new block. Once that happens, the transaction is said to be 'confirmed', though it is prudent to wait for a few confirmations before considering a transaction to be finalized.

Notice the difference between 'validation' and 'confirmation'. It is possible for a valid transaction to never be confirmed in the blockchain (perhaps it has zero tx fees, or somehow is never relayed to a miner), but it is not possible for an invalid transaction to be confirmed.

Otherwise at the stage , once miner found the nonce, he has to broadcast the transaction , other miners will verify the correct combination of nonce.In this stage , does miners need to verify the nonce along with the all the transactions in the block??

A miner will construct a block from valid transactions, and if a valid block is found, it will be relayed to the network. All other nodes and miners will check this block to ensure they have validated each of its parts. Similarly to transaction validation, invalid blocks will be rejected by the network's nodes.

2

The transaction is validated before its acceptance into the mempool/unconfirmed transaction pool of a node. Newly accepted tx’s are propagated to all connected peers who have not seen it yet.

When a miner begins to mine the next block, it constructs the blocktemplate from the mempool of its full-node. These tx’s are already validated.

Once the newly mined block is found and propagated, it must be validated, along with its included tx’s. If a full-node has already seen and validated a given tx in this block when it was accepted to the mempool, it doesn’t need to repeat this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.