Bitcoin Forum
November 19, 2024, 08:39:35 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Block construction?  (Read 165 times)
Katherine_Alicia (OP)
Jr. Member
*
Offline Offline

Activity: 32
Merit: 6


View Profile WWW
June 26, 2024, 02:14:11 PM
Merited by vapourminer (1), ABCbits (1)
 #1

I`m trying to understand Bitcoin a bit more, but have a problem I can`t quite figure out, and I`m so unsure about it that I don`t even know how to ask the question (so don`t shout at me!).

How are the "blocks" constructed? on my mining pool I can see blocks being constructed out of transactions, and I know my miner is guessing numbers and when a block is finished the Nodes all get a copy of this new block and the transactions within it, but what part does the fitting of these transactions into a block?

But I`v been told that even if all the electricity on the planet died, all it would take is for someone to spin up a node and Bitcoin`s back in action again (and I assume you`de need at least one miner to start hashing as well).
so if all you need is a node and miner, I`m really missing something in the middle here (I think).
what`s the missing bit? because the info I have doesn`t really make any sense when it`s all put together.

For instance, I consolidated about 30 UTXOs the other day and could see it on Mempool as a consolidation, what part of the Bitcoin machinery is this done on? the Miners, the Nodes or something else I haven`t heard of yet?


cassondracoffee
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
June 26, 2024, 02:33:57 PM
 #2

I`m trying to understand Bitcoin a bit more, but have a problem I can`t quite figure out, and I`m so unsure about it that I don`t even know how to ask the question (so don`t shout at me!).

How are the "blocks" constructed? on my mining pool I can see blocks being constructed out of transactions, and I know my miner is guessing numbers and when a block is finished the Nodes all get a copy of this new block and the transactions within it, but what part does the fitting of these transactions into a block?

But I`v been told that even if all the electricity on the planet died, all it would take is for someone to spin up a node and Bitcoin`s back in action again (and I assume you`de need at least one miner to start hashing as well).
so if all you need is a node and miner, I`m really missing something in the middle here (I think).
what`s the missing bit? because the info I have doesn`t really make any sense when it`s all put together.

For instance, I consolidated about 30 UTXOs the other day and could see it on Mempool as a consolidation, what part of the Bitcoin machinery is this done on? the Miners, the Nodes or something else I haven`t heard of yet?



read this https://learnmeabitcoin.com/beginners/guide/mining/
                 https://learnmeabitcoin.com/technical/mining/memory-pool/
Katherine_Alicia (OP)
Jr. Member
*
Offline Offline

Activity: 32
Merit: 6


View Profile WWW
June 26, 2024, 02:51:43 PM
 #3

Riiight! so the bit I was missing belongs in the Nodes functionality, that makes sense now Smiley

I`v so gotta get one of those!
hosseinimr93
Legendary
*
Offline Offline

Activity: 2590
Merit: 5690



View Profile
June 26, 2024, 03:00:30 PM
Merited by vapourminer (2), d5000 (2), ABCbits (2)
 #4

How are the "blocks" constructed? on my mining pool I can see blocks being constructed out of transactions, and I know my miner is guessing numbers and when a block is finished the Nodes all get a copy of this new block and the transactions within it, but what part does the fitting of these transactions into a block?
Miners (or mining pools) build a candidate block and then they solve the proof of work problem which is actually finding a number.
To build the candidate block, miners are free to include any valid transaction. Since the block size is limited, miners usually prioritize transactions based on their fee rate to maximize their profit.


For instance, I consolidated about 30 UTXOs the other day and could see it on Mempool as a consolidation, what part of the Bitcoin machinery is this done on? the Miners, the Nodes or something else I haven`t heard of yet?
Once you broadcast a transaction, it's sent to some nodes. Those nodes validate your transaction and if it's valid they put your transaction in their mempool and then send it to some other nodes.
After a few seconds, almost all nodes should have your transaction in their mempool. Mempool is like a waiting room for unconfirmed transactions and each node can have its own mempool.

Miners (or a mining pool) pick some transactions from their mempool, build a candidate block and then try to solve the proof of work problem. Once a miner (or a mining pool) mines a block, all the tranactions that were picked by the miner go to the blockchain and become confirmed.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
Katherine_Alicia (OP)
Jr. Member
*
Offline Offline

Activity: 32
Merit: 6


View Profile WWW
June 26, 2024, 03:12:58 PM
 #5

So if there were a single miner and node, then all candidate transactions would be stored in that nodes memory pool  until the miner figured out the correct hash and then the block containing those transactions would be formed and added to the blockchain, obviously with just a single node and miner the difficulty level would have to brought right down to fit the 10 minute time slot.

Thanks guys! Smiley
hosseinimr93
Legendary
*
Offline Offline

Activity: 2590
Merit: 5690



View Profile
June 26, 2024, 03:26:52 PM
Last edit: June 26, 2024, 03:42:41 PM by hosseinimr93
Merited by vapourminer (1), ABCbits (1)
 #6

So if there were a single miner and node, then all candidate transactions would be stored in that nodes memory pool  until the miner figured out the correct hash and then the block containing those transactions would be formed and added to the blockchain,
Correct.


obviously with just a single node and miner the difficulty level would have to brought right down to fit the 10 minute time slot.
If miners shut down their devices now and there's only one miner, the network hash rate will decrease significantly and to maintan the average block time of 10 minutes, the difficulty should decrease. But there will be two problems here.

1. The difficulty is adjusted every 2016 blocks and it may take years until difficulty is adjusted.
2. Every time difficulty is adjusted, it can't be decreased by more than 75%.

Take note that I am talking about the theory and in practice the above scenario is very unlikely to happen.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
Katherine_Alicia (OP)
Jr. Member
*
Offline Offline

Activity: 32
Merit: 6


View Profile WWW
June 26, 2024, 03:36:26 PM
 #7

2. Every time difficulty is adjusted, it can't be decreased by more than 75%.

Now that`s interesting, I never knew that!
I know I read somewhere that the dificulty is adjusted every 2 weeks, but that`s probably only true for the current hashrate.
hosseinimr93
Legendary
*
Offline Offline

Activity: 2590
Merit: 5690



View Profile
June 26, 2024, 03:51:25 PM
 #8

I know I read somewhere that the dificulty is adjusted every 2 weeks, but that`s probably only true for the current hashrate.
The difficulty is adjusted every 2016 blocks. Since a new block is mined every ∼ 10 minutes on average, it's estimated that the difficulty is adjusted every 2 weeks.
If blocks are mined less than 10 minutes on average, the difficulty would be adjusted before 2 weeks and if they are mined more than 10 minutes on average, the difficulty would be adjusted after 2 weeks.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
Cricktor
Legendary
*
Offline Offline

Activity: 952
Merit: 1541


Crypto Swap Exchange


View Profile
June 30, 2024, 07:03:24 PM
 #9

2. Every time difficulty is adjusted, it can't be decreased by more than 75%.

Now that`s interesting, I never knew that!
I know I read somewhere that the dificulty is adjusted every 2 weeks, but that`s probably only true for the current hashrate.
A lot to learn you have, young padawan.

As hosseinimr93 states, difficulty adjustment is done after 2016 blocks have been mined in a difficulty period. This 2016 period length was likely chosen to have a difficulty adjustment in about every two weeks. Significantly shorter or longer adjustment periods have serious disadvantages and likely two weeks is a good compromise.

Then there's another rule in the node's code which hosseinimr93 mentioned, that difficulty adjustment can't exceed a change more than 4x or less than 1/4 of current difficulty. The reason is to prevent some sort of attack, but I forgot the details.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
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!