Bitcoin Forum
May 08, 2024, 07:54:36 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How do Bitcoin nodes verify the integrity of "Data"?  (Read 216 times)
cowsgomoo (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
May 18, 2018, 06:09:22 AM
 #1

As far as I understand, mining works like this.

They get the "data" from the pool, in in order to verify them and put them in a "block",

they try to find the nonce with which if hashed with the data and the previous hash data produces

the hash result that starts with 0000000000xxxxxx...xxx.

What I don't understand is, what is this "pool" where they send the data to all the nodes? Also, how do the nodes

verify the integrity?

What if the pool is compromised and sends the wrong data in the first place?

How is finding the right nonce alone guarantee the integrity of data and transactions ?

I would very appreciate if anyone could explain please.

Thank you.
1715154876
Hero Member
*
Offline Offline

Posts: 1715154876

View Profile Personal Message (Offline)

Ignore
1715154876
Reply with quote  #2

1715154876
Report to moderator
1715154876
Hero Member
*
Offline Offline

Posts: 1715154876

View Profile Personal Message (Offline)

Ignore
1715154876
Reply with quote  #2

1715154876
Report to moderator
1715154876
Hero Member
*
Offline Offline

Posts: 1715154876

View Profile Personal Message (Offline)

Ignore
1715154876
Reply with quote  #2

1715154876
Report to moderator
Bitcoin mining is now a specialized and very risky industry, just like gold mining. Amateur miners are unlikely to make much money, and may even lose money. Bitcoin is much more than just mining, though!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715154876
Hero Member
*
Offline Offline

Posts: 1715154876

View Profile Personal Message (Offline)

Ignore
1715154876
Reply with quote  #2

1715154876
Report to moderator
1715154876
Hero Member
*
Offline Offline

Posts: 1715154876

View Profile Personal Message (Offline)

Ignore
1715154876
Reply with quote  #2

1715154876
Report to moderator
Xynerise
Sr. Member
****
Offline Offline

Activity: 322
Merit: 363

39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD


View Profile
May 18, 2018, 07:32:08 AM
Merited by suchmoon (5), ABCbits (3)
 #2

As far as I understand, mining works like this.

They get the "data" from the pool, in in order to verify them and put them in a "block",
I'll assume by pool You mean mempool which is where unconfirmed transactions are stored in nodes. There's no global mempool; all nodes have theirs.
And by "data" I assume you mean unconfirmed transactions.
Quote
they try to find the nonce with which if hashed with the data and the previous hash data produces

the hash result that starts with 0000000000xxxxxx...xxx.
There are other things concatenated with the previous block header hash before it is hashed to find the target: the version, the Merkle root of all the transactions in the block, the timestamp, target and nonce.
This is the template for the candidate block's block header hash. They hash this while iterating the nonce, then the timestamp until they find a hash that is lower than the target hash.
Quote
What I don't understand is, what is this "pool" where they send the data to all the nodes?
As explained above, it is the mempool and is peculiar to each node.
Quote
Also, how do the nodes

verify the integrity?
They verify it against the set of protocol rules. For example a transaction is not allowed to have more output than input (ie spend more than it has). If any transaction doesn't follow the rule then it's invalid and is discarded by the node and not related further in the network. If a node keeps relaying invalid transactions to another node then the recipient node will ban that node for some time.
Quote
What if the pool is compromised and sends the wrong data in the first place?
I don't see how the mempool can be compromised but like I said above, if you send invalid transaction or block to the node it will discard it and won't relay it so it doesn't propagate in the network.
Quote
How is finding the right nonce alone guarantee the integrity of data and transactions ?
Finding the right nonce is the job for the miners as they are the only ones allowed to append blocks to extend the blockchain, so the process must not be trivial.
For a miner to be able to extend the blockchain with his block then he must have expended some costs (usually in the form of electricity) and so is incentivized to follow the rules.
However, if he doesn't follow the rules and includes invalid transactions (transactions that don't follow the protocol rules) in his block, then his block will be rejected by other nodes in the network and his work will be a waste.

Finding a nonce which hashes to less than a particular target is hard work because you have to try a whole lot of values but verifying that this nonce is valid is just one hash which doesn't take time or consume CPU resources at all.
punitstar7
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
May 18, 2018, 09:12:56 AM
 #3

This has all the answers you need and explained in simpler terms --
https://www.quora.com/Blockchain-Technology-How-are-transactions-verified-blocks-secured
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
May 18, 2018, 01:50:16 PM
Merited by Welsh (3), ABCbits (2)
 #4

As far as I understand, mining works like this.

Your understanding is missing some important pieces, and is incorrect about some of the pieces.  You'll need to do some more learning.  The posts in this thread do a good job of sending you down the correct path.

They get the "data" from the pool,

Are you talking about a mining pool?  Or are you talking about a mempool?

If you are solo-mining, then you build your own blocks from the transactions that are in your own mempool (which your full node has built).

If you are mining in a mining pool, then the software run by the mining pool operator builds the blocks for you from the transactions that are in their mempool (which their full node has built). The mining pool software just sends you a mid-state (which is a partially hashed block HEADER), and you complete the proof-of-work on that mid-state.

in in order to verify them and put them in a "block",

If you are solo-mining, then your software builds the block and then sends the mid-state (the partially hashed block HEADER) to your ASIC equipment.

If you are mining in a mining pool, then the software run by the mining pool operator builds the block and then sends the mid-state to your software.

they try to find the nonce with which if hashed with the data and the previous hash data produces

the hash result that starts with 0000000000xxxxxx...xxx.

The block header consists of 6 pieces of information:
  • Version
  • Previous Block Hash
  • Merkle Root (A hash that represents the transactions in the block)
  • Timestamp
  • Current difficulty target (frequently called "bits")
  • Nonce

This data is partially hashed to create something called a mid-state.  Then the "miner" tries to find a nonce which if used for the completion of the hashing produces a hash result that is LOWER THAN the value indicated by the current difficulty target.

What I don't understand is, what is this "pool" where they send the data to all the nodes?

That depends on if you are asking about the mempool or a mining pool.

Also, how do the nodes

verify the integrity?

Are you asking about how a miner verifies the integrity of the mid-state that it receives? Or are you asking about how all the nodes on the network verify the completed/solved blocks that they receive before they relay them to their peers? Or are you asking about how the nodes verify the integrity of the transactions before they relay them to the solo-miners and mining pools?

How the integrity is verified depends on what you are asking about.

What if the pool is compromised and sends the wrong data in the first place?

If it is a mining pool, then the participants will just try to find the nonce for the mid-state that they receive.  The participants don't know or care if that mid-state is valid. All they care about is getting paid for completing the work.  However, the mining pool will quickly run out of money if they are paying their participants and they aren't creating valid blocks. They eventually won't be able to afford to pay their participants, and the participants will all leave to find another mining pool.

If you are asking about the mempool of a solo-miner, then the solo-miner is responsible for running a valid node that verifies the transactions before it adds them to its own mempool.  If it is compromised, then the solo-miner will create invalid blocks and he will never earn any money.
 
How is finding the right nonce alone guarantee the integrity of data and transactions ?

It doesn't.

Bitcoin is a trustless system.  Every node on the network validates EVERY transaction and EVERY block that it receives.  It NEVER trusts a block or a transaction that it receives from ANY other node regardless of whether the proof-of-work is complete or not.  Each node will only add to its own blockchain the blocks that it independently determines for it self are valid.

Finding the right nonce provides a way for the decentralized nodes to all come to agreement on which VALID blocks to include in their chain, and which VALID block to reject. That way everyone is working from the same chain of blocks.

It also makes it extremely difficult and expensive to try to go back and modify ANY historical blocks.
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!