Bitcoin Forum

Other => Beginners & Help => Topic started by: AlexR12 on December 07, 2017, 06:53:59 PM



Title: Ledger
Post by: AlexR12 on December 07, 2017, 06:53:59 PM
Hello!
Could someone verify if the following is true (my understanding of distributed ledger concept as applied to Bitcoin).

Each node of the network (miners and all other nodes that run Bitcoin client) has a copy of the ledger. Thus, the ledger is stored by the nodes (it is distributed in exactly this sense!). The ledger is periodically updated with new blocks of transactions being sent to the nodes. Hypothetically: If I am a miner and want to create a fork I can easily do it by creating a block and sending it to the network and the network will add it to the ledger. For example, for the chain A-B-C-D, I can add a block B2 to B, thereby creating a fork at node B. Of course, this block will most likely be orphaned because it is not the longest branch and the miner did it, say, for fun. Is my understanding right? If not, please point out what is not right.

Thank you in advance!


Title: Re: Ledger
Post by: mayo2u on December 07, 2017, 07:37:29 PM
Hello!
Could someone verify if the following is true (my understanding of distributed ledger concept as applied to Bitcoin).

Each node of the network (miners and all other nodes that run Bitcoin client) has a copy of the ledger. Thus, the ledger is stored by the nodes (it is distributed in exactly this sense!). The ledger is periodically updated with new blocks of transactions being sent to the nodes. Hypothetically: If I am a miner and want to create a fork I can easily do it by creating a block and sending it to the network and the network will add it to the ledger. For example, for the chain A-B-C-D, I can add a block B2 to B, thereby creating a fork at node B. Of course, this block will most likely be orphaned because it is not the longest branch and the miner did it, say, for fun. Is my understanding right? If not, please point out what is not right.

Thank you in advance!

The ledger is added to every 10 minutes of so. When you broadcast to the network that you have found a block your transaction is tested. At any point along the way if you have errors then the block is dropped. You need to have the hash of the previous block plus have met the diff goal on your block. This will be checked. If you have not met the diff then the block is rejected out of hand by the network.

Now, if you did meet the diff requirements then you have, indeed found a block and added it to the blockchain.

You're scenario is one where the attacker wants to reverse a transaction of a previous block (often times called a 51% attack). At the point that he puts out B2 no one on the network will acknowledge B2 as the authentic chain. Why? Because the longest chain is the correct chain - by definition. The attacker will have to do C2, D2 and now has to race with the network to become the longest. This is theoretically possible but today, 2017, is virtual impossible except for the rarest of use cases.


Title: Re: Ledger
Post by: AlexR12 on December 07, 2017, 08:00:41 PM
The ledger is added to every 10 minutes of so. When you broadcast to the network that you have found a block your transaction is tested. At any point along the way if you have errors then the block is dropped. You need to have the hash of the previous block plus have met the diff goal on your block. This will be checked. If you have not met the diff then the block is rejected out of hand by the network.

Now, if you did meet the diff requirements then you have, indeed found a block and added it to the blockchain.
You use words "dropped", "rejected" without explaining how this is technically implemented. So far, only one thing is clear: the block is in the blockchain if it receives confirmations (consensus in the network). "Confirmation" means that subsequent blocks include its hash as the previous block's hash. But what happens to the blocks that were proposed, but for various reasons didn't end up in the longest chain? Are those still in the ledger?


Title: Re: Ledger
Post by: mayo2u on December 07, 2017, 09:31:59 PM
The ledger is added to every 10 minutes of so. When you broadcast to the network that you have found a block your transaction is tested. At any point along the way if you have errors then the block is dropped. You need to have the hash of the previous block plus have met the diff goal on your block. This will be checked. If you have not met the diff then the block is rejected out of hand by the network.

Now, if you did meet the diff requirements then you have, indeed found a block and added it to the blockchain.
You use words "dropped", "rejected" without explaining how this is technically implemented. So far, only one thing is clear: the block is in the blockchain if it receives confirmations (consensus in the network). "Confirmation" means that subsequent blocks include its hash as the previous block's hash. But what happens to the blocks that were proposed, but for various reasons didn't end up in the longest chain? Are those still in the ledger?


These are stale (often time called "orphaned") blocks. The block themselves are recorded. (You can see them at:  https://blockchain.info/orphaned-blocks) But the transactions in the orphaned block are now unconfirmed.  Now, as it happens, in real life, a lot of the transactions in the orphaned block would also be part of the winning block.


See:

Stale Block
A well-formed block which is no longer part of the difficultywise-longest and well-formed blockchain. Not to be confused with an Orphan Block (which has no known parent in the longest block chain).
https://en.bitcoin.it/wiki/Vocabulary#Stale_Block





Title: Re: Ledger
Post by: odolvlobo on December 07, 2017, 11:49:19 PM
Each node of the network (miners and all other nodes that run Bitcoin client) has a copy of the ledger. Thus, the ledger is stored by the nodes (it is distributed in exactly this sense!). The ledger is periodically updated with new blocks of transactions being sent to the nodes. Hypothetically: If I am a miner and want to create a fork I can easily do it by creating a block and sending it to the network and the network will add it to the ledger. For example, for the chain A-B-C-D, I can add a block B2 to B, thereby creating a fork at node B. Of course, this block will most likely be orphaned because it is not the longest branch and the miner did it, say, for fun. Is my understanding right? If not, please point out what is not right.

You are correct, except that your block will be rejected or eventually forgotten by everyone else but you. Nodes typically only keep the blocks in the longest chain, though they may keep orphaned blocks for a little while in case they somehow becomes the longest chain.


Title: Re: Ledger
Post by: zuwang on December 08, 2017, 12:35:38 AM
i only knows ledger wallet. thank you for explaining this, ledger in blockchain.


Title: Re: Ledger
Post by: AlexR12 on December 08, 2017, 01:29:56 AM
You are correct, except that your block will be rejected or eventually forgotten by everyone else but you. Nodes typically only keep the blocks in the longest chain, though they may keep orphaned blocks for a little while in case they somehow becomes the longest chain.
Thanks, but doesn't "...a little while..." proves that most of the time the nodes will have different versions of the ledger (some nodes will keep transactions a little longer than others)?


Title: Re: Ledger
Post by: odolvlobo on December 08, 2017, 08:13:14 AM
You are correct, except that your block will be rejected or eventually forgotten by everyone else but you. Nodes typically only keep the blocks in the longest chain, though they may keep orphaned blocks for a little while in case they somehow becomes the longest chain.
Thanks, but doesn't "...a little while..." proves that most of the time the nodes will have different versions of the ledger (some nodes will keep transactions a little longer than others)?


Doesn't matter. 1. There is no expectation that every node's block chain is the same because of forks. 2. Transactions in orphaned blocks are ignored.