Author

Topic: Summary of a transaction's journey through the Bitcoin network (Read 137 times)

newbie
Activity: 29
Merit: 13
Sharp, swapped the two, edited the summary, thanks!
hero member
Activity: 840
Merit: 932
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.
newbie
Activity: 29
Merit: 13
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?
legendary
Activity: 3472
Merit: 10611
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
newbie
Activity: 29
Merit: 13
Hey there, thanks for the input, I've edited the summary, how's it now?
legendary
Activity: 3472
Merit: 10611
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.
newbie
Activity: 29
Merit: 13
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.


Jump to: