Bitcoin Forum
April 28, 2024, 05:35:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do nodes confirm transactions and determine if a block is valid or not  (Read 284 times)
Abdulzuruku01 (OP)
Member
**
Offline Offline

Activity: 100
Merit: 36


View Profile
January 30, 2024, 11:56:07 AM
Merited by BlackHatCoiner (4), Outhue (3), Humblevirus (3), vapourminer (2), pooya87 (2), ABCbits (2), NotATether (2), Crypt0Gore (2), DdmrDdmr (1)
 #1

I've been trying to understand the concept of bitcoin for a while now, especially its technical aspects, so I've been doing some personal research on my own, but I still find it difficult to comprehend some parts of it.
I learned during my research that a node is a computer on the blockchain network that sends and receives transactions with other nodes while also validating and storing those transactions and I also read that transactions on the blockchain are kept and encrypted within blocks and that a  block's transactions needs to be verified in order for a new block to formed.

I need more explanation because I still don't understand how a node confirms a transaction and determines whether a block is valid, it seems too complicated.

"I'm sure that in 20 years there will either be very large transaction volume or no volume." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714325703
Hero Member
*
Offline Offline

Posts: 1714325703

View Profile Personal Message (Offline)

Ignore
1714325703
Reply with quote  #2

1714325703
Report to moderator
1714325703
Hero Member
*
Offline Offline

Posts: 1714325703

View Profile Personal Message (Offline)

Ignore
1714325703
Reply with quote  #2

1714325703
Report to moderator
hosseinimr93
Legendary
*
Online Online

Activity: 2380
Merit: 5216



View Profile
January 30, 2024, 02:25:33 PM
Merited by pooya87 (4), BlackHatCoiner (4), ABCbits (3), bitmover (3), vapourminer (2), NotATether (2), Findingnemo (1), DdmrDdmr (1), Z-tight (1)
 #2

Nodes validate all transactions they receive. If a transaction is valid, the node sends it to other nodes.
Validation means checking if the transaction follows consensus rules. For example, one of consensus rules is that the total value of outputs must not be greater than the total value of inputs.

Nodes also check if the transaction follows their own rules. For example, almost all nodes reject any transaction with the fee rate of less than 1 sat/vbyte.
Note that a transaction with the fee rate of less than 1 sat/vbyte can be valid, but nodes usually reject such transaction.


and I also read that transactions on the blockchain are kept and encrypted within blocks and that a  block's transactions needs to be verified in order for a new block to formed.
Transactions are not encrypted.
Miners include transactions in the blockchain exactly as they receive them.


I need more explanation because I still don't understand how a node confirms a transaction and determines whether a block is valid, it seems too complicated.
Transactions are not confirmed by nodes. Transactions are confirmed by miners.
Take note that confirmation means being included in the blockchain and that's different from being validated.

A miner (or a mining pool) that manage to find a block, sends the block to the network. Nodes receive the block and validate it.
Validation of a block means checking if the block and the transactions included in that are valid.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
BlackHatCoiner
Legendary
*
Online Online

Activity: 1498
Merit: 7295


Farewell, Leo


View Profile
January 30, 2024, 02:58:24 PM
Merited by vapourminer (1)
 #3

hosseinimr93's explanation was excellent. If you have questions regarding the network in general, I suggest you visit learnmeabitcoin.com and bitcoin.it.

There is a frequent confusion between confirmation and validation. While they are synonyms in the English language, they have a completely different meaning in Bitcoin.

  • Confirmation of a transaction: the act of including the transaction in a block, and mining on top of it. If the most recent block contains your transaction, it has 1 confirmation. If somebody mined a block on top of that, it now has 2 confirmations.
  • Validation of a transaction: the act of verifying if a transaction complies with the consensus rules.

A transaction can be validated even if not confirmed yet. This happens right before the node accepts it in its memory pool (or mempool for short). However, it cannot be confirmed if it is not validated. An invalid transaction in a block makes the entire block invalid.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
bitmover
Legendary
*
Offline Offline

Activity: 2282
Merit: 5902


bitcoindata.science


View Profile WWW
January 30, 2024, 05:37:17 PM
 #4

An invalid transaction in a block makes the entire block invalid.

Expanding this answer...

So if a miner decide to include an invalid transaction (like a double spending input) in a block, all other nodes will refuse that block. That miner would be considered dishonest and he would lose all his processing power spent to create that block.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
iBaba
Full Member
***
Offline Offline

Activity: 378
Merit: 230


Bitcoin in Niger State💯


View Profile WWW
January 31, 2024, 09:16:33 AM
 #5

hosseinimr93's explanation was excellent. If you have questions regarding the network in general, I suggest you visit learnmeabitcoin.com and bitcoin.it.

I would have also ordinarily ask him to visit those websites, especially, learnmeabitcoin where I also got informed about these technicalities, for him to get more information about nodes and validation of transactions.

Permit me to cite an example with the relevance of nodes in a transaction as has being an HTML in a web development for people who understands web and I'm citing this example because it is great to understand how crucial nodes are to validation of transactions. This is how it happens whenever a user sends a transaction it is sent across all the nodes that are available in the network. Afterwards, every node then go ahead to independently verify if the sender of the transaction has the funds he's sending across the network and whether it meets their consensus agreement in the network.

When these transactions are then group together it is called block and this block pass through the process called mining and mining is just a mathematical problem that is being solved so when that mathematical problem has been solved correctly, by a node, that first node gets the ability to be able to move the block into a blockchain which then serves as the security of the blockchain.

So realize that I said that all this block have to pass through a process called mining and it also have to be certified by other nodes that are in the network or the in the transaction chain, so that process of trying to certify it and getting every other node to agree based on the consensus agreement of the block transaction is what makes a secure, valid transaction for every other nodes in the network which brings about trust and the concept of decentralisation in Bitcoin

ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
January 31, 2024, 09:27:29 AM
Merited by vapourminer (4), pooya87 (4), ABCbits (4), hosseinimr93 (1)
 #6

Afterwards, every node then go ahead to independently verify if the sender of the transaction has the funds he's sending across the network and whether it meets their consensus agreement in the network.
Addresses don't have balance. The balance that you see on blockexplorers are collated and summed by the blockexplorers. In fact, nodes can only see the UTXO and not the address. When a transaction is being spent, it spends the UTXO and is essentially the removal of the input UTXOs and the creation of output UTXO.

When these transactions are then group together it is called block and this block pass through the process called mining and mining is just a mathematical problem that is being solved so when that mathematical problem has been solved correctly, by a node, that first node gets the ability to be able to move the block into a blockchain which then serves as the security of the blockchain.
Solving is would be greatly simplifying what mining does. There is no such thing as moving blocks into blockchain either. If a block is propagated across the network, other than the usual validity checks, every node also checks if it meets the target requirement for a certain difficulty period. Essentially, every block includes the coinbase which sends the block reward to the miners but only the first that meets the target requirement can be added to the blockchain by individual nodes.


.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Z-tight
Hero Member
*****
Online Online

Activity: 840
Merit: 1026


Only BTC


View Profile
January 31, 2024, 05:22:14 PM
 #7

When these transactions are then group together it is called block and this block pass through the process called mining and mining is just a mathematical problem that is being solved so when that mathematical problem has been solved correctly, by a node, that first node gets the ability to be able to move the block into a blockchain which then serves as the security of the blockchain.
This is just partly true. Nodes validate tx's and store them in their memory pool and not in blocks. Miners then pick this tx's and use them to make up their candidate block, which can also be called a temporary block, and then try to mine that block and add it to the blockchain and earn the rewards.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Abdulzuruku01 (OP)
Member
**
Offline Offline

Activity: 100
Merit: 36


View Profile
February 01, 2024, 09:41:09 AM
 #8

Nodes validate all transactions they receive. If a transaction is valid, the node sends it to other nodes.
Validation means checking if the transaction follows consensus rules. For example, one of consensus rules is that the total value of outputs must not be greater than the total value of inputs.

Nodes also check if the transaction follows their own rules. For example, almost all nodes reject any transaction with the fee rate of less than 1 sat/vbyte.
Note that a transaction with the fee rate of less than 1 sat/vbyte can be valid, but nodes usually reject such transaction.


and I also read that transactions on the blockchain are kept and encrypted within blocks and that a  block's transactions needs to be verified in order for a new block to formed.
Transactions are not encrypted.
Miners include transactions in the blockchain exactly as they receive them.


I need more explanation because I still don't understand how a node confirms a transaction and determines whether a block is valid, it seems too complicated.
Transactions are not confirmed by nodes. Transactions are confirmed by miners.
Take note that confirmation means being included in the blockchain and that's different from being validated.

A miner (or a mining pool) that manage to find a block, sends the block to the network. Nodes receive the block and validate it.
Validation of a block means checking if the block and the transactions included in that are valid.


Thank you for shedding more light, I now understand more about nodes and how transactions are validated before I was thinking that nodes and miners they are like doing similar work on the network.
Thank you for this and I will not be hesitate to ask more questions when I come across any difficulties along the line.
Gormicsta
Member
**
Offline Offline

Activity: 168
Merit: 75


View Profile
February 02, 2024, 10:53:36 AM
 #9

I've been trying to understand the concept of bitcoin for a while now, especially its technical aspects, so I've been doing some personal research on my own, but I still find it difficult to comprehend some parts of it.
I learned during my research that a node is a computer on the blockchain network that sends and receives transactions with other nodes while also validating and storing those transactions and I also read that transactions on the blockchain are kept and encrypted within blocks and that a  block's transactions needs to be verified in order for a new block to formed.

I need more explanation because I still don't understand how a node confirms a transaction and determines whether a block is valid, it seems too complicated.



I'll try to put it in simpler terms. The nodes in the Bitcoin network have been charged with verifying the validity of each new transaction before accepting it. To accomplish this, they check for things like the digital signature of the transaction and if any coins have previously been spent using highly complex mathematical calculations and encryption. We refer to this procedure as validation. The transaction is added to the blockchain and deemed "confirmed" if it successfully completes all validation checks. I hope this makes it more clear how nodes validate or confirm transactions on the block.
hosseinimr93
Legendary
*
Online Online

Activity: 2380
Merit: 5216



View Profile
February 02, 2024, 11:25:28 AM
 #10

The transaction is added to the blockchain and deemed "confirmed" if it successfully completes all validation checks. I hope this makes it more clear how nodes validate or confirm transactions on the block.
Wrong.
As I said in the first reply, transactions are confirmed by miners.

Transactions must be valid, so that they can be included in the blockchain, but it's not that a transaction is included in the blockchain once it's validated.
For a transaction being confirmed, it's required that a miner (or a mining pool) solves the proof of work problem, mines a block and includes that transaction in the block.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Gormicsta
Member
**
Offline Offline

Activity: 168
Merit: 75


View Profile
February 02, 2024, 03:43:38 PM
 #11

The transaction is added to the blockchain and deemed "confirmed" if it successfully completes all validation checks. I hope this makes it more clear how nodes validate or confirm transactions on the block.
Wrong.
As I said in the first reply, transactions are confirmed by miners.

Transactions must be valid, so that they can be included in the blockchain, but it's not that a transaction is included in the blockchain once it's validated.
For a transaction being confirmed, it's required that a miner (or a mining pool) solves the proof of work problem, mines a block and includes that transaction in the block.

You misunderstood me, I believe we are saying the same thing,
Yes it's true that transactions are confirmed by miners, now what or who are miners?
 Miners are nodes that work to add new blocks to the blockchain and are rewarded with bitcoin for doing so. So when I say "they check for things like the digital signature of the transaction" I'm simply talking about the miners.
It's important to note that people often talk about Miners and Nodes together as they're same as one, which is wrong, in as much as Miners could be considered to be nodes that work to add new blocks to the blockchain by solving some complex mathematical problems ( Proof of Work), Nodes, on the other hand, are any computers that are connected to the network and are helping to verify and relay transactions. So, we could say that all miners are nodes, but not all nodes are miners.

And when I say "The transaction is added to the blockchain and deemed "confirmed" if it successfully completes all validation checks." what I mean is that the transactions are added to the blockchain AFTER they have been confirmed and has completed all validation checks.

 
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4610



View Profile
February 03, 2024, 10:21:14 AM
Merited by ABCbits (5), ranochigo (4), pooya87 (2)
 #12

You misunderstood me,
Or, perhaps, you misunderstand how bitcoin works?

I believe we are saying the same thing
I read your words. I read his words. You are not saying the same thing. He is correct. You are not.

Yes it's true that transactions are confirmed by miners, now what or who are miners?
That word, miner, has taken on multiple meanings when talking about Bitcoin. This leads to confusion. It's good to clarify and avoid confusion.
There are:
  • Mining pools - They assemble the validated transactions into blocks and present the block headers to their participants for hashing.
  • Mining pool participants - They run ASICs, hashing the block headers that they receive from the mining pool in an attempt to find a block solution
  • Solo miners - They do both pieces, assembling blocks from valid transactions, and then hashing the header looking for a solution

Miners are nodes that work to add new blocks to the blockchain and are rewarded with bitcoin for doing so.
Mining pools, and Solo miners run nodes to validate transactions, and then run separate software to build blocks from the valid transactions.
Mining pool participants and Solo miners compute hashes of the block headers looking for a block solution.
Mining pools and Solo miners assign the block subsidy and transaction fees wherever they want to when they build the block, before it is hashed.
Mining pools and Solo miners broadcast their solved blocks to the peers they are connected to.

So when I say "they check for things like the digital signature of the transaction" I'm simply talking about the miners.
And you are at least partially incorrect and/or partially incomplete.

All nodes, including the ones that are NOT mining, "check for things like the digital signature". Well written wallet software ALSO "checks for things like the digital signature".

Mining pool participants do NOT "check for things like the digital signature".  They simply use their ASICs to hash the block headers they are assigned by the pool. Mining pools check the digital signatures, but I wouldn't consider that part of the "mining" process. They just do that to make sure that they don't accidentally include a transaction in their block that will be rejected by ALL nodes (resulting in an invalid block). The mining software uses the list of already verified transactions, and builds the block from those.

It's important to note that people often talk about Miners and Nodes together as they're same as one, which is wrong, in as much as Miners could be considered to be nodes that work to add new blocks to the blockchain by solving some complex mathematical problems ( Proof of Work), Nodes, on the other hand, are any computers that are connected to the network and are helping to verify and relay transactions. So, we could say that all miners are nodes, but not all nodes are miners.

This is reasonably close to accurate. Probably good enough for typical conversation about such matters.  In my opinion it's more accurate to say that miners run nodes  to be able to receive and validate the transactions from the network before they start using them in the mining process, rather than saying that they are "considered to be nodes", but being that pedantic about it is probably not helpful in most cases.

Note that the "mathematical problem" really isn't all that complex.  While it is tedious, I believe it can be done with paper and pencil by anyone that understands binary and boolean logic. I'd bet it can be taught pretty easily to the average middle-schooler if they wanted to learn it. At the currrent difficulty targe though, it does need to be calculated MANY MANY MANY times repeatedly. It would take centuries (maybe more) for the average human to perform the calculation enough times to have even a minuscule probability of finding usable result.  Like I said, it's tedious (very tedious), but not complex.

And when I say "The transaction is added to the blockchain and deemed "confirmed" if it successfully completes all validation checks." what I mean is that the transactions are added to the blockchain AFTER they have been confirmed and has completed all validation checks.

What you "meant" was MUCH more correct than what you "said", and yet still is missing some important nuance.

Transactions are definitely NOT deemed "confirmed" simply by successfully completing validation checks.
Saying that they are only creates confusion and misunderstanding.

Transactions ARE added to the blockchain AFTER they have been confirmed has completed all validation checks
However, your statement could easily be misunderstood to imply that being confirmed and completing validation checks are happening simultaneously before "being added to the blockchain".

More specifically, transactions are:
  • First verified by node software
  • Then included in an unsolved block by mining pool or solo mining software
  • Then the block is solved by people running ASICs (either pool participants or solo miners)
  • Then the solved block is broadcast to peers
  • Then the solved block is verified by those peers, and they broadcast it to their peers, and so on
  • Then, any node or wallet that receives the block and has determined it to be a valid block considers the transactions in that block to be "confirmed" BECAUSE it has seen them in a valid solved block
  • Finally those nodes and wallet software increment the quantity of "confirmations" on those transactions by 1 every time another valid block is received that extends that chain


This is a Technical Discussion sub-forum.  It is important in this sub-forum to be accurate in the information you give, and careful about how you phrase things so that you don't increase confusion and misunderstanding. People that come to this sub-forum and read these threads are looking for good, accurate, specific information about how things work.
minersday
Hero Member
*****
Offline Offline

Activity: 1484
Merit: 535


View Profile
February 09, 2024, 01:31:47 AM
 #13

I've been trying to understand the concept of bitcoin for a while now, especially its technical aspects, so I've been doing some personal research on my own, but I still find it difficult to comprehend some parts of it.
I learned during my research that a node is a computer on the blockchain network that sends and receives transactions with other nodes while also validating and storing those transactions and I also read that transactions on the blockchain are kept and encrypted within blocks and that a  block's transactions needs to be verified in order for a new block to formed.

I need more explanation because I still don't understand how a node confirms a transaction and determines whether a block is valid, it seems too complicated.



Consensus is the mechanism by which nodes validate blocks and confirm transactions. Consensus procedures in a blockchain network guarantee that all nodes concur on the ledger's current state, including which transactions are legitimate and which blocks ought to be added to the chain.

When a transaction is broadcast across the network, it propagates to all nodes. Each node checks the transaction to ensure that it fits particular conditions, such as having a valid digital signature, spending no more than the sender's balance, and so on.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!