Bitcoin Forum
May 12, 2024, 10:54:25 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help for someone new  (Read 294 times)
twally (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 5


View Profile
September 04, 2020, 05:30:54 AM
Merited by ABCbits (2), o_e_l_e_o (2), Husna QA (1)
 #1

Hi all

This is pretty basic, so I apologise about that but it is something I have failed to find an answer to so far (probably just looking in the wrong places.)

Anyway, my question is this, at what exact stage does a new block get formed in the Bitcoin blockchain and how? In my research it seemed to say that a new block is formed once a miner solves the required "puzzle". From what I read, the puzzle is the first solution to a specific SHA-256 hash of the current blocks contents plus a nonce that generates a specific number of leading zeros. I understood once that is solved, a new block is created, the successful miner is rewarded and new transactions will then be written to the new block. That all seems fine (as long as my understanding is correct.)

What I do not understand in the above process, the hashing of the current block surely only works if the data inside the block is complete and unchanging. If the data is changing the data hash would keep changing. But surely if a new transaction is made, new data is being added to the block and that data is causing the hash to change.

Can anyone please set me straight on what I have wrong or am missing.

Thanks  
"With e-currency based on cryptographic proof, without the need to trust a third party middleman, money can be secure and transactions effortless." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715511265
Hero Member
*
Offline Offline

Posts: 1715511265

View Profile Personal Message (Offline)

Ignore
1715511265
Reply with quote  #2

1715511265
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
September 04, 2020, 05:41:52 AM
Merited by o_e_l_e_o (2), ABCbits (1), DougM (1)
 #2

you are slightly off.

miner first constructs a new block which includes creating the first transaction (aka coinbase tx), including as many transactions as they can find and fits in the block (along other checks such as sigopcount) and building its header (version, previous block hash, merkle root hash which is constructed from all those transactions, target, time and nonce).

then miner starts changing nonce (inside header) and computing the hash of this header and each time comparing it as an integer with the target (not just leading zeros but as in bigint1 <= bigint2) meanwhile its node keeps an eye out for others solving the same block and if they did it will inform the miner to give up and work on the next one.
if they go through all 32 bits of nonce and didn't find the appropriate hash then they change the transactions inside their block to change all hashes they are about to compute and start from nonce 0 again. and repeat this until they find the desired hash. this change could be swapping some transactions (like with txs paying higher fee) or simply changing the coinbase tx hash by changing a variable inside its script usually referred to as extraNonce.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
September 04, 2020, 10:03:56 PM
 #3

What I do not understand in the above process, the hashing of the current block surely only works if the data inside the block is complete and unchanging. If the data is changing the data hash would keep changing. But surely if a new transaction is made, new data is being added to the block and that data is causing the hash to change.
Miners won't necessarily "care" about any new transaction being made... Especially when there are more transactions in their mempool than can actually "fit" in a block. Generally, they'll only try and include it if the money to made from including it, is worth more than the "cost" of including it.

This is why you often need to pay $$$ in fees if you want "next block"... it makes your transaction more "attractive" to the miners and gives them an incentive to include it... whereas, if you pay the minimum 1 sat/vbyte... you end up in the big pile at the bottom of the mempool with the other 10,000+ transactions waiting for days Tongue

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
twally (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 5


View Profile
September 06, 2020, 07:19:56 AM
 #4

Thank you both very much for replying. The whole mining process and block construction looks somewhat more complicated than my simple understanding but you have both given me areas to investigate further for my understanding. Thank you again, it is much appreciated.
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
September 11, 2020, 06:07:30 PM
 #5

want to accept bitcoin what are top sites to join

http://manashost.com


Ye sure..

Code:
Domain Name: MANASHOST.COM
Registry Domain ID: 2550514742_DOMAIN_COM-VRSN
Registrar WHOIS Server: whois.syrahost.com
Registrar URL: http://www.crazydomains.com
Updated Date: 2020-08-30T18:27:12Z
Creation Date: 2020-08-03T00:00:00Z


I would recommend to not trust newbies advertising a completely new website.
Visit / use it at your own risk. You have been warned.

When using bitcoin services, stick to reputable and trusted ones.

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!