Bitcoin – Transaction block chains


The last really essential
or salient piece for understanding the
mechanics of how Bitcoins work is what we call the
transaction block chain. So if you recall in
the previous video, you had a motivating
example of a user, Alice, who wanted to send
some number of Bitcoins to another user,
Bob, in the system. And what Alice has to do to
initiate that transaction was to construct a transaction–
a record of sorts– that contained information
about the transaction and that was signed with
Alice’s signing key. And that actually contained
Alice’s public verification key and Bob’s public
verification key as well. And that transaction information
was basically broadcast out, as we mentioned, to the
entire Bitcoin ecosystem. To all the nodes on the
Bitcoin peer-to-peer network. And the various nodes
in the Bitcoin ecosystem are going to sit there. They’re going to
receive information about this transaction. But they’re also going
to be getting information about a lot of
other transactions that are taking place
around the same time. And what these notes
are going to start doing is they’re going to work on
incorporating this transaction record into a ledger of all
transactions that have ever taken place in the
Bitcoin system. And so what happens is that
each node basically starts off by taking all of the previously
unincorporated transactions that they’ve ever received. So there’s going to be all these
transactions out there that have kind of happened
within a given time window. And there’s all these
Bitcoin transactions kind of floating around. And these nodes– these Bitcoin
miners as they’re called– are going to receive
information about all these different
transactions and they’re going to start working
on incorporating those transactions. And their first goal is to
collate these transactions into what’s known as
a transaction block. So if you recall
our ledger analogy, a single Bitcoin
transaction essentially corresponds to a proposed
entry in a ledger. In that capacity,
a transaction block would basically correspond
to her page in a ledger where you have multiple
transactions that are listed in that
page of the ledger. And the goal– the Bitcoin
miner’s goal– is to really, essentially, to take
that page and get it added to the global ledger book,
the global comprehensive ledger book. Now to engage in this sort of
work, what these nodes will basically do is they’ll first
take all the transactions that have been broadcast out. And let’s say these
four transactions have been broadcast out. And they’re going to basically
hash these transactions in pairs in basically
a tree-like structure. They’ll take these
two transactions and they’ll apply a
[? graphic ?] hash function to those details. And we’ll get a
[? cars ?] flying digest, goes the same for these
two, and then they’ll take these two
digests and hash them to get a single digest value. And this digest effectively
encodes all of the transactions that were previously
unincorporated and that were received by
these individual nodes. And then this
digest is basically going to be combined with
the hash of the transaction block that was previously
accepted by the network. So you can imagine if
there is– the network will have a series
of transaction blocks that were previously accepted. And in fact, every
transaction block as I mentioned just
now incorporates the previous transaction lock. So this transaction
block will incorporate the one that was
used just before it, and this transaction
block will incorporate the one that was
used just for it. And it’s going to
go on literally until the beginning
of Bitcoin times. So this is really
where the Bitcoin– the beginning of time for
the Bitcoin system, this is just time equals
zero for Bitcoin. And they’re going to
take this last block and they’re going
to, essentially now, take this last block and combine
it with this most recent block. And so if you imagine that
you have now, not just an individual block, because
each individual block incorporates the
block before it. We’re not dealing anymore with
an isolated or distinct block of transactions, but rather
with a chain of blocks that starts literally at the
beginning of the entire Bitcoin system. Now when you do all
of this combination, at the end of the
day, you’re going to do some cryptographic
hashing and you basically will end up with a
sequence of numbers. And this sequence
of numbers will be derived by incorporating
all these blocks together. You’ll get a
sequence of numbers, and what we’re going
to basically do is take this sequence of numbers
and convert that sequence of numbers into a challenge
in a proof of work protocol. Now I did a separate video
on proof of protocols, I would encourage you
to watch that if you want to get a better
sense for how they work. But the short of it is that
what the Bitcoin mining node has to do at this point is he’ll
take that Bitcoin– he’ll take the challenge and
he’ll have to come up with a separate sequence of
numbers– which we typically termed the proof, or
the proof of work– and this proof of
work has to have a very specific
mathematical property. And what that
property entails is that if you take the
challenge numbers, and you take these
proof numbers, and you concatenate
them together, and you make them the input
to a cryptographic hash function, the
resulting output has to have a large prefix
of zeroes And that doesn’t have to be all
zeroes, but a large portion of the beginning– the
prefix– has to be all zeroes And if you think about
for a moment, given that cryptographic
hash functions, given that their output
tends to look fairly random, it’s unlikely in
any given instance that you are going
to see a proof. A proposed proof
that provides you with a large string of
zeroes at the beginning. And so what the Bitcoin miner
will have to do is on average, he’ll have to try out
many possible choices for these proof numbers
until he finally gets lucky and he stumbles
upon one that has this kind of off-beat or
strange statistical property. And the actual difficulty of
finding these proof numbers, as you can tell, is
dependent on exactly how many leading zeroes
are required. The more leading zeroes
you require in this proof, the longer it takes to
actually solve a problem. The longer it takes to
actually come up with a proof that works with respect
to a given challenge. The fewer zeroes
that you require, the less time it will take. Now the exact number of
bits of zero bits required in the Bitcoin protocol
actually does change over time. It gets calibrated. And it’s designed
to not, on average, the average time taken
across the whole system should be about 10 minutes. So you want to take about 10
minutes for at least one node to come up with a valid
proof, but keep in mind that a lot of nodes are working
on this proof concurrently. All right, now once this
proof of work is found, let’s say that the proof of
work is eventually found. The Bitcoin miner will
announce the results to the overall
peer-to-peer network. He’s going to take this proof
and really all the challenge, and so on, and he’s going to
announce it to all the notes. And they’re now going to
see that, hey, there’s this proof out there,
somebody found it. Let’s drop the other
stuff we were doing and we’re going to now
start to work and build on top of this new proof. Remember, this new proof of
this new challenge, these all incorporate all the
previous transaction blocks. Really, what they’re
starting to do is starting to work off of a
new, updated transaction block chain. And they’re going to incorporate
any new unincorporated transactions into that
new transaction blocking. Now there are a couple of
points I want to make here. So first of all, as part of
constructing these transactions blocks, and really as
part of incorporating them into a transaction block
chain, Bitcoin miners are actually allowed–
one little special treat– they are allowed to include
in that transaction block– a special node for themselves. And this node will
basically be a little reward if they can get– and
let me use the greenish color for that
reward– they could take the first block,
the first transaction item, the first
transaction record, and they can put in that
transaction record– they can assign a reward
to themselves. Now the amount of that
reward will change over time. But I do want to point out what
this transaction is typically called is called a coin-based
transaction, or a generation transaction. This is how new coins get
included in the Bitcoin system. So whenever a minor
succeeds in coming up with a proof as part of
that he’ll have been allowed to come up with his own
transaction to reward himself, a special little
reward, for extending the effort necessary to
come up with this proof and for doing all this
work associated with adding a new transaction block to
the existing transaction block chain for Bitcoin. And I think that’s reasonable. After all these notes are using
a lot of computational power to come up with these
proofs and if they’re using computational
power that must mean that somewhere along
the line, somebody is spending money on
electricity and so on. Now, I also want to point
out that in addition to this coin-base
award, the nodes who’re doing the Bitcoin mining,
the ones who succeed. Also get to collect
the transaction fees that were specified
in the transaction records. If you recall, a person issuing
a transaction in Bitcoin can allocate or set aside a
certain amount of money– maybe it can be a Bitcoin or
a fractional Bitcoin– for the node who
succeeds in coming up with the actual
proof of working, and effectively the
node that succeeds in being able to
add that transaction to the overall bitcoin
transaction block chain. And so that node that
does the work succeeds, gets a reward, another
transaction fee. Now this could actually
become quite large because the node will not
only get the transaction fee before one transaction. You’ll get the transaction
fee for all the transactions that appeared in
the current block. It’s going to give
the aggregate over all these different transactions. Now the second
point I want to make is that it might be
possible for two nodes to solve the proof of work
independently of each other. And somehow, they
both end up trying to add to that existing
chain in some ways. You make get some weird
chain forking happening. If that happens, the peers
in the Bitcoin network will basically break a tie
by sticking with the longest chain. And by longest, I
don’t mean the one that has to be the most
transactions in it. I really need the one
that has the highest aggregate difficulty
associated with that underlying proof of work protocol in each
of the transaction blocks. And we’ll basically look at
the total amount of effort that was required to generate
that chain with regard to that proof of work. And whichever chain has
the most work associated with it is a chain
that’s sacrosanct, it’s a chain that
everybody will accept. Now you may get some
word discrepancies because of network
latency issues and so on. But the idea is that after maybe
a couple of rounds when there are ties, they’ll quickly
resolve themselves as long as most of the
nodes are being honest and really stick to the
implementation of the protocol. Now since Bitcoin miners
are generating bitcoins, I think there’s an interesting
question that comes up here which is, how is the Bitcoin
money supply, controlled, and how is it managed? And I’m going to talk about that
concept in a subsequent video.

43 thoughts on “Bitcoin – Transaction block chains”

  1. Is it possible for the fork to get very large – for example global internet problems during a world war, a big net split and two long chains developing. Or can somebody apply a supercomputer or some kind of distributed computing to older transactions and outdo the current chain with one of greater complexity?

  2. You could theoretically encounter strange situations like this if not all nodes could communicate with each other. However, once there are two "different" chains out there, (honest) bitcoin mining nodes will start building on top of the one with the most work put into it.

  3. If dishonest nodes had enough computation power, they could try to cheat the system by outdoing the current chain. However, as long as the honest nodes collectively have more than half the computing power, it will be an uphill battle for the dishonest nodes. It just takes one honest node to win the race and solve the proof of work first. Also, if you have the computing power, you're financially better off using it for good (e.g., bitcoin mining), so that's an added incentive to behave well.

  4. when the bitcoins reach their max, 21million (i think), are the rewards for the miners simply the transaction fee? Is it a problem that there is a transaction fee; how high can this fee become?

  5. How is the coin base award calibrated? It is like the inflation rate, right? Why it's 21 million capped?

  6. Fee will be determined by the market, no way to know exactly how large or small it will be. Won't be large enough to hinder exchanges, obviously. And will be competing with other methods of exchange. The fee will have to be smaller tan other methods, or if larger, provide an advantage to overcome this fee differential.

  7. in bitcoin why is there a "chain" cant the transaction be completed then that information deleted? why is all the information saved as a chain all they way back to the start?

  8. The transaction fee will be decided by the user making the transaction. The higher tip (or transaction fee), the higher the probability it will be mined. But this is like 100 years off. This is kind of irrelevant to you and I unless you intend to live for a few more centuries.

  9. So which one contains the information about the bitcoin transactions: the "challenge" or the "proof of work" (which by the way is the same as a solution to the equation, right?)? If the bitcoin transactions data is included in the "challenge", then each computer's "proof of work" is unique to itself, isn't it? (not that it's a problem), because it contains the coinbase transaction. If the "proof of work" contains all the transaction data however, how can you make sure that the computer has not edited reciever/amount/etc of OTHER transactions than only the coinbase transaction?

  10. I still do not understand it. It is complicating. Can somebody tell me how is bitcoin formed and how or where will I start to make money out of it. Thank you

  11. This is a poorly done video because there are lots of concepts and jargon thrown in. Using words like hashing and not explaining it is not good. Using terms like time zero make the explanation confusing. Obviously not Sal. And just repeating the sentence doesn't make it easier to understand. Stop using jargon to doing smart, speak with simple, direct words and if you introduce any concept – please explain it before you continue on. If the viewer doesn't understand that concept you just glazed over, the rest of the video is useless and frustrating. Sal repeats things using different words – he is empathizing with the listener who might not know simple things like what a universal ledger is.

  12. What happens when there isn't any more reward incentive for miners? Will people start competing for the lowest fee? How much will it cost to use bitcoin?

  13. thanks for sharing the information is high value but has no subtitles in Spanish what is limiting the bitcoin community of Spanish and Latin-speaking America.

  14. If you hash multiple transactions into one block, how can you figure out about each transaction? For example, when Alice pays Bob again, the nodes will have to check that Alice has enough money – by tracking down all the past transactions and recording the gain and loss by Alice. How could the nodes do that if the transactions are hashed?

  15. So… in order for the nodes to verify transactions for any given Alice or Bob they need to look at their previous transaction records which are contained within the block chain. So do nodes need to decrypt the block chain back a certain number of iterations to find those records to verify them? What I don't understand is how information on previous transactions is not lost inside the block chain eventually? It seems that by iterating those hash functions back months or years you would lose data at some point. Or does the block chain get longer as time goes on to incorporate more data?

  16. At the end of this video the speaker says that the longst chain is the one that shows the most effort made. So, basically is saying that the total amount of valid blocks is not a parameter to measure length?

  17. iam from gaza i dont hava anything … there is no work nothing to please help me blackchain
    xpub6Cx1iwRNJnsx9JCLByq5Tg9FUwt2A6cEiNKyyHBYmDyF4SBqdQsc3KzknRVJ47GH4CMC6wpjXaeyx82Wxu21bwewbawp5Wz2Q6Xs61aUeiD plz plz

  18. Hey Matt…I sent a small transaction of bitcoin from my Copay wallet (v3.2.1), however forgot to insert a recipient address (left the bar blank). How do I recover these funds or move them to the recipient?
    The transaction says the funds have been "moved". I sent these funds On the 25th May, 2017
    Any help would be appreciated!

  19. Miners will basically qualify or disqualify transactions=CENTRALIZED…your jargon is overtly convoluted…similar to the explanation of fractional reserve lending…MINER= MIDDLEMAN. Period.

  20. Maybe i misunderstood it but at around 4:15 mark the blockchain shown has arrows pointing the wrong direction right? Each block depends on the previous block not the next block that has not even been created yet.

  21. I have doubts request you to please clarify ..
    1 . I read every block can contain 1 mb data ( let say around 10 transaction)so suppose in one time stamp there are 100 transaction so how miner are picking the transaction or this will be grouped 10 each..
    2. If not in grouped then suppose miner are choosing transaction . So if 1 miner working on 1 to 5 and 15 to 20 transaction and another working on 1 to 10 so when they post their block who will get money for transaction 1 to 5..

Leave a Reply

Your email address will not be published. Required fields are marked *