Bitcoin Forum
May 03, 2024, 08:18:44 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Summary of a transaction's journey through the Bitcoin network  (Read 120 times)
FbnGbz (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 8


View Profile
October 20, 2023, 10:31:29 AM
Last edit: October 20, 2023, 02:53:41 PM by FbnGbz
Merited by pooya87 (2), hosseinimr93 (1)
 #1

Yes, it's my content... https://www.reddit.com/u/Fabs_-/s/sHSWMLSrYu

Bitcoin is a digital currency that operates on a decentralized network of computers, called nodes. Decentralized means that there is no central entity that controls the network, and thus, no central authority which assembles the state of the ledger, known as the blockchain. Instead, Bitcoin uses a mechanism called “emergent consensus”, which is achieved through nodes respecting the same rules, allowing thousands of individual nodes to assemble the same local copy of the blockchain, without being dependent on a central authority.

A transaction is added to the blockchain as part of a block, which essentially records a batch of new transactions into the blockchain.

Once a transaction is broadcast to the network, nodes independently verify the transaction against the consensus rules first, after which it's verified against their policy rules, which are a set of rules or conditions that are defined by the individual node. Once validated, the transaction is temporarily stored into a node’s mempool, where it waits for a miner to take it along with other validated transactions, and aggregate it into a candidate block, which is a block that is not yet confirmed nor added to the blockchain.

The candidate block then enters the process of “mining”, which refers to the computational and energy-intensive task of finding a "valid" hash, also known as a Proof-of-work, which is made-up of the candidate blocks contents (transaction data(inputs and outputs), block header) + a random input. The difficulty of finding a valid hash changes approximately every two weeks or 2016 blocks through a mechanism called the “difficulty adjustment”. This mechanism changes the conditions depending on the amount of time it took to calculate the hashes during the former epoch, as well as total hash rate available in the network.

Once a valid hash has been found, the miner broadcasts the candidate block + hash to the network, where nodes independently verify the block, its contents and the hash against the consensus rules, which are the fundamental, unchanging rules that are hard-coded into the blockchain’s protocol and are agreed upon by the entire network, they determine how blocks are created, validated, and added to the blockchain. Once the block is validated, it's added to the node's local copy of the blockchain and propagated across the network to its peers.


1714724324
Hero Member
*
Offline Offline

Posts: 1714724324

View Profile Personal Message (Offline)

Ignore
1714724324
Reply with quote  #2

1714724324
Report to moderator
1714724324
Hero Member
*
Offline Offline

Posts: 1714724324

View Profile Personal Message (Offline)

Ignore
1714724324
Reply with quote  #2

1714724324
Report to moderator
1714724324
Hero Member
*
Offline Offline

Posts: 1714724324

View Profile Personal Message (Offline)

Ignore
1714724324
Reply with quote  #2

1714724324
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714724324
Hero Member
*
Offline Offline

Posts: 1714724324

View Profile Personal Message (Offline)

Ignore
1714724324
Reply with quote  #2

1714724324
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10532



View Profile
October 20, 2023, 10:39:20 AM
Merited by BlackHatCoiner (4), ABCbits (3), hosseinimr93 (2), Zaguru12 (2), vapourminer (1), DdmrDdmr (1), Charles-Tim (1)
 #2

nodes independently verify the transaction against their policy rules, which are a set of rules or conditions that are defined by the individual node.
A node has to first validate a transaction with the consensus rules not just policy rules. Otherwise they can end up with an invalid tx in their mempool and end up broadcasting it to others too.

Quote
task of finding a valid “hash”, which is made-up of the candidate blocks contents + a random input.
Miner computes hash of the block header that is a fixed size structure that includes version, previous block header's hash, merkle root hash (computed from the transactions in the block), block time, target and a nonce.

Quote
This mechanism changes the conditions depending on the amount of active miners participating.
Difficulty changes based on the time it took to mine the last 2015 blocks every 2016 blocks.

Quote
Once a valid hash has been found, the miner broadcasts the candidate block + hash to the network,
Technically they only need to broadcast the block (or the header first), the receiving node computes the hash from the header itself.

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

Activity: 14
Merit: 8


View Profile
October 20, 2023, 11:07:04 AM
 #3

Hey there, thanks for the input, I've edited the summary, how's it now?
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10532



View Profile
October 20, 2023, 11:23:07 AM
Merited by vapourminer (2), ABCbits (2), hosseinimr93 (2)
 #4

The candidate block then enters the process of “mining”, which refers to the computational and energy-intensive task of finding a "valid" hash, also known as a Proof-of-work, which is made-up of the candidate blocks contents (Merkle Tree of transactions, block header) + a random input.
A block consists of two parts. An 80 byte header and an array of transactions (the array is preceded by its item count).
The header consists of:
Code:
[4-byte version][32-byte previous block header hash][32-byte merkle root hash][4-byte time][4-byte target][4-byte nonce]
The random input you have in mind is the fixed 4-byte nonce at the end of the block header that is an arbitrary value.

The merkle tree you said above is not part of the "block content", the block actually contains the transactions as a simple array. Transactions come one after the other.
The merkle tree is not stored anywhere either. The tree is only computed using the transaction's hashes and discarded after we compute the "merkle root hash" which is used in the block header.

These two pages should be helpful too:
https://developer.bitcoin.org/devguide/block_chain.html
https://developer.bitcoin.org/reference/block_chain.html

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

Activity: 14
Merit: 8


View Profile
October 20, 2023, 11:30:13 AM
 #5

Thanks for the details, I'll have them written down somewhere else, for I want this summary to explain it without getting too technically detailed.

In regards to the Merkle Tree; it's a product which is generated later-on in the process, it's not part of a block, only the transactions, formed in a simple array, are part of a block, correct?
Zaguru12
Hero Member
*****
Offline Offline

Activity: 686
Merit: 867



View Profile
October 20, 2023, 01:25:48 PM
 #6

In regards to the Merkle Tree; it's a product which is generated later-on in the process, it's not part of a block, only the transactions, formed in a simple array, are part of a block, correct?

It’s actual the Merkle root that is part of the block not the Merkle tree directly. We know the Merkle root is gotten by combining or grouping the hash of each transactions, so it is not this individual hashes (Merkle tree) that is stored but the combined hash of the transactions hashes.

A bitcoin block is comprised of a block header and a block body. The Merkle root is stored in block header with other components like the nonce, pervious block hash, target and timestamp. While the body holds the transaction data.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
FbnGbz (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 8


View Profile
October 20, 2023, 01:52:11 PM
 #7

Sharp, swapped the two, edited the summary, thanks!
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!