Bitcoin Forum
February 20, 2020, 04:05:22 AM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Block vs Transaction vs Coin  (Read 163 times)
sarahschreiber
Newbie
*
Offline Offline

Activity: 1
Merit: 2


View Profile
October 17, 2019, 03:16:47 PM
Merited by hugeblack (1), o_e_l_e_o (1)
 #1

I'm a new comer to bitcoin but I am intrigued by the idea and the implementation. I've read the whitepaper twice now and scowered the wiki and the forums but I still find myself confused regarding some basic concepts. Hopefully I don't belabor your patience but perhaps this is a hint that maybe we need to work on the documentation a bit more.

My confusion revolves around the relationship between a block, a transaction and coins. Here are a statement of facts as I understand them:
Blocks form a chain.
Blocks form the backbone of the Proof-of-Work: a block must be "solved".
Blocks contain a header and a tree structure containing transactions.
The first transaction in a block is special. The person who solves the Proof-of-Work for the first transaction gets rewarded with the coin value of the block (currently 50 coins but decreases over time).
There is a finite number of blocks: 21,000,000
I assume there is only a single chain, starting at block B0 and eventually ending at block B21,000,000 - 1.

Question #1:
I guess a lot of my confusion revolves around what a transaction is. Perhaps I have missed something but it seems to me that any documentation I have read seems to gloss over what a transaction is. If blocks form a chain and must be solved, and if the solution of the block depends on the hash of the block, doesn't adding a transaction to a block invalidate the solution? If the number of blocks are finite and blocks are not mutable (transactions cannot be added to them), doesn't that imply that the number of transactions is also finite.

Question #2:
In the context of blocks and transactions, what exactly is a coin? If a newly created block has a single transaction containing 50 coins (as they currently do), how is a coin represented inside a transaction/block?

Question #3:
The whitepaper says, in section 7: "Once the latest transaction in a coin is buried under enough blocks, the spent transactions before
it can be discarded to save disk space." The wording "transaction in a coin" confuses me here because I would have thought it should have said "block" instead of "coin". Perhaps this would be answered by question #2.

I fully expect I am missing something here but I can't seem to find the answers in the existing documentation.
100% First Deposit Bonus Instant Withdrawals Best Odds 10+ Sports Since 2014 No KYC Asked Play Now
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
DooMAD
Legendary
*
Offline Offline

Activity: 2254
Merit: 1452


Leave no FUD unchallenged


View Profile WWW
October 17, 2019, 07:52:20 PM
Last edit: October 17, 2019, 08:13:52 PM by DooMAD
Merited by hugeblack (1), o_e_l_e_o (1)
 #2

The person who solves the Proof-of-Work for the first transaction gets rewarded with the coin value of the block (currently 50 coins but decreases over time).

Currently 12.5 and some time next year will be halved again.


I assume there is only a single chain, starting at block B0 and eventually ending at block B21,000,000 - 1.

The only way it ends is if all miners stop mining and no new miners step in to take their place.  There's no limit on the number of blocks.


I guess a lot of my confusion revolves around what a transaction is. Perhaps I have missed something but it seems to me that any documentation I have read seems to gloss over what a transaction is.

Transactions are merely a set of one or more inputs and one or more outputs.  The inputs refer to the previous transaction and the outputs are an instruction on where to send the BTC and in what quantity.  In plain English, you're telling the network what you'd like to send and where.


If blocks form a chain and must be solved, and if the solution of the block depends on the hash of the block, doesn't adding a transaction to a block invalidate the solution?

To quote from the Bitcoin Wiki:
Quote
Because transactions aren't hashed directly, hashing a block with 1 transaction takes exactly the same amount of effort as hashing a block with 10,000 transactions.

So, in essence, adding more transactions doesn't make the job any harder than it already is.  The mining hardware just keeps hashing away until the correct solution is found.  Plenty of invalid attempts will be made in the process, though.


In the context of blocks and transactions, what exactly is a coin? If a newly created block has a single transaction containing 50 coins (as they currently do), how is a coin represented inside a transaction/block?

"Coins" are simply a relatively easy way for humans to interpret the values involved.  At protocol level, everything is dealt with in satoshis, but 1 BTC is generally considered easier for a person to comprehend than 100000000.  The network doesn't actually know what a coin is.


The whitepaper says, in section 7: "Once the latest transaction in a coin is buried under enough blocks, the spent transactions before
it can be discarded to save disk space." The wording "transaction in a coin" confuses me here because I would have thought it should have said "block" instead of "coin".

I can't say I ever noticed that, heh.  I'll have to re-read it.  It scans more easily if you just remove "in a coin" altogether:

"Once the latest transaction is buried under enough blocks, the spent transactions before it can be discarded to save disk space."

DannyHamilton
Legendary
*
Offline Offline

Activity: 2338
Merit: 1718



View Profile
October 17, 2019, 09:25:11 PM
Merited by hugeblack (1)
 #3

and typically adjusts balances on the ledger.

NO.

Just no.

Do not try to answer technical questions if you don't understand how bitcoin works at the technical level.  You will only confuse others.

DannyHamilton
Legendary
*
Offline Offline

Activity: 2338
Merit: 1718



View Profile
October 17, 2019, 09:45:18 PM
Merited by hugeblack (2), o_e_l_e_o (1)
 #4

DooMAD did a great job of answering most of your questions.  I'll try to add additional details without simply repeating what he's said (as much as I can).

The person who solves the Proof-of-Work for the first transaction gets rewarded with the coin value of the block (currently 50 coins but decreases over time).

Currently 12.5 and some time next year will be halved again.

As DooMAD stated, the block subsidy is currently 12.5 BTC, and will be cut to half of that next year.  It is cut in half every 210,000 blocks.

However, the maximum allowed value of the block reward is the block subsidy PLUS the sum of all the transaction fees from all the transactions that are included in the block.  The user is technically allowed to assign a reward that is less than the maximum allowable reward, but that would be a foolish thing to do (after putting in all that work to earn the reward, why would you assign a lower reward?).

I guess a lot of my confusion revolves around what a transaction is. Perhaps I have missed something but it seems to me that any documentation I have read seems to gloss over what a transaction is.

Transactions are merely a set of one or more inputs and one or more outputs.  The inputs refer to the previous transaction and the outputs are an instruction on where to send the BTC and in what quantity.  In plain English, you're telling the network what you'd like to send and where.

Transaction outputs are assigned a value and are locked with some condition that must be met in order to spend them.  The most popular condition is to require an EDCSA signature that is generated with a private key whose public key hashes to a given value.  The hashed representation of that public key along with an indication of the requirements is then what is called an "address".

Each transaction input is a reference to a previously unspent transaction output along with some piece of data that satisfies the spending conditions placed on that output.

Transaction inputs provide value to the transaction (the sum of all the values of the referenced outputs).

Transaction outputs provide the conditions by which that value can be spent by future transactions.

The sum of the value supplied by the inputs must be greater than or equal to the sum of the value assigned to each of the outputs.  If the sum of the inputs is GREATER than the sum of the outputs, then any unassigned value becomes a transaction fee that the miner can assign to his own reward transaction when creating the block that he attempts to solve.

If blocks form a chain and must be solved, and if the solution of the block depends on the hash of the block, doesn't adding a transaction to a block invalidate the solution?

Yes.

This is why it is impossible for anyone to modify the historical record that is the blockchain.  In order to do so, they would invalidate the solved block that they are trying to modify. They would then need to re-solve that block.  However, any solution to that block will modify its hash and will therefore invalidate the next block in the chain.  In order to modify any historical block, they would need to re-solve EVERY BLOCK THAT HAS ALREADY BEEN SOLVED SINCE THAT POINT IN TIME.  However, the entire time that they are trying to get caught up, the true chain continues to grow with more blocks.  In order to ever catch up, the attacker would need to control more Bitcoin mining hash power than the entire rest of the world combined.


In the context of blocks and transactions, what exactly is a coin? If a newly created block has a single transaction containing 50 coins (as they currently do), how is a coin represented inside a transaction/block?

Coins don't exist in Bitcoin.  Not in any real sense, and not in the sense that was proposed in the whitepaper.

The whitepaper is a good introduction to the larger concepts of proof-of-work, and how transactions can be represented, but when Satoshi actually wrote the code, he made some adjustments for a variety of reasons.

Now "coins" are just a word that we humans use to make it easier to talk about the transfer of control over value.

Also, a newly created block contains MANY transactions, not just the one special transaction that provides the reward to the miner.


The whitepaper says, in section 7: "Once the latest transaction in a coin is buried under enough blocks, the spent transactions before
it can be discarded to save disk space." The wording "transaction in a coin" confuses me here because I would have thought it should have said "block" instead of "coin".

As I said, the whitepaper is NOT a perfect description of how Bitcoin actually works.  It is Satoshi's thoughts on how the concept could possibly work.  The white paper was released months before the code. Not only did Satoshi make some modifications to the design after he released the whitepaper, but more changes have been made since the initial release of the code.

pooya87
Legendary
*
Offline Offline

Activity: 1918
Merit: 2351


Remember tonight for it's the beginning of forever


View Profile
October 18, 2019, 05:40:30 AM
Merited by hugeblack (1)
 #5

and typically adjusts balances on the ledger.

NO.


So bitcoin transactions don't do that.

there is no concept of "balance" on the blockchain. there are only transactions which have outputs that have amounts.

your wallet then calculates the "balance" for convenience.
when you have a public key, your wallet should check the entire blockchain for transaction outputs (scriptpub`s) that contain your public key (or hash of it). core for instance checks all script types, but other wallets only check the script type you specify when creating the wallet/importing the key/address. the sum of these amounts is that key's total received value and when each of these transactions are spent the amount is removed from the total balance of that key hence updating the balance locally in your client.

DannyHamilton
Legendary
*
Offline Offline

Activity: 2338
Merit: 1718



View Profile
October 18, 2019, 05:11:49 PM
 #6

Any addresses chosen by the miner to include in the submitted block

No.


there is no concept of "balance" on the blockchain.


It modifies the value at the ledger entry

Just no.

Do not try to answer technical questions if you don't understand how bitcoin works at the technical level.  You will only confuse others.

DannyHamilton
Legendary
*
Offline Offline

Activity: 2338
Merit: 1718



View Profile
October 18, 2019, 05:29:16 PM
 #7

there is no concept of "balance" on the blockchain.
It modifies the value at the ledger entry
Just no.
From the new users perspective

The OP is asking for technical details, not some inaccurate "perspective".

It zeroes out the amount at the label location,

It does not.  There is no "label location" to "zero out".

and it can put some amount back there,

Back where?

or transfer it somewhere else;

Transactions do not transfer anything to any PLACE.  There is no SOMEWHERE.

rergardless zero-ing it out modifies the amount at that location.

Zeroing what out?  What location?  You are saying words, but they don't have any meaning when it comes to the technical details of how bitcoin works.

DooMAD
Legendary
*
Offline Offline

Activity: 2254
Merit: 1452


Leave no FUD unchallenged


View Profile WWW
October 18, 2019, 06:17:05 PM
 #8

Any addresses chosen by the miner to include in the submitted block

No.


What my point is why are you trying to tell a new user the wrong thing?


there is no concept of "balance" on the blockchain.

It modifies the value at the ledger entry


Quote
Just no.


From the new users perspective, yes.

It zeroes out the amount at the label location, and it can put some amount back there, or transfer it somewhere else; rergardless zero-ing it out modifies the amount at that location.

Let's approach this another way.  Your wallet software displays things in a way that a human can easily comprehend.  But at protocol level, a block doesn't contain a list of entries saying "this user now has a balance of 0 coins and that user now has a balance of whatever".  Just because your wallet is telling you that your balance is 0, that's not how the network processes it.  The network deals with inputs, outputs and signatures.  It doesn't see "coins" or "balances".  Those are just abstract concepts to make things user-friendly.

I can understand why you might want to provide a simple explanation, but if the person who started the thread wants to understand how this works on a technical level, it doesn't help if you're just describing "what it looks like" once your wallet has translated the information into something easier for humans to read.

odolvlobo
Legendary
*
Offline Offline

Activity: 2772
Merit: 1494



View Profile
October 18, 2019, 07:05:49 PM
Last edit: October 20, 2019, 01:05:29 AM by odolvlobo
 #9

Question #3:
The whitepaper says, in section 7: "Once the latest transaction in a coin is buried under enough blocks, the spent transactions before
it can be discarded to save disk space." The wording "transaction in a coin" confuses me here because I would have thought it should have said "block" instead of "coin". Perhaps this would be answered by question #2.
I believe that the word "coin" was originally used to mean what we now call a "transaction output". That seems to explain why the original uses of the word here and in other contexts may seem odd.

Buy stuff on Amazon at a discount with bitcoins or convert Amazon points to bitcoins: Purse.io
Join an anti-signature campaign: Click ignore on the members of signature campaigns.
DannyHamilton
Legendary
*
Offline Offline

Activity: 2338
Merit: 1718



View Profile
October 18, 2019, 08:39:13 PM
 #10

okay, the amount at the vector it is stored at gets destroyed.

I give up.

I'll just add you to my killfile and you can continue to spew your nonsense.  Hopefully those that want accurate answers will learn to ignore you as well.

It's bad enough that you attempt to educate others on things that you yourself don't understand, but it becomes clear that you're just a common troll when you ignore everything that is being explained to you and choose to continue to spew nonsense regardless.

plonk.

DiamondCardz
Legendary
*
Offline Offline

Activity: 1134
Merit: 1089


CryptoTalk.Org - Get Paid for every Post!


View Profile WWW
October 18, 2019, 08:49:39 PM
 #11

okay, the amount at the vector it is stored at gets destroyed.

I give up.

I'll just add you to my killfile and you can continue to spew your nonsense. 


For the original poster, I hope what I told you assists your comprehension, as the things I stated are accurate.
But they're not accurate. The ledger, nodes, etc, have no concept of 'balance'. My knowledge is a bit rusty so anyone feel free to correct me, but when a block is added to the ledger, all of the inputs used for transactions in that block are effectively 'destroyed', and outputs are created from thin air in the same block, where the total amount of Bitcoin associated with the inputs is the same as the amount of Bitcoin associated with the outputs. But there's no real concept of balance. There is a concept of an address having a certain number of unspent outputs associated with it which can then be used as inputs for new transactions, and wallets display 'balance' as the sum of the Bitcoin associated with these unspent outputs, but the ledger does not keep track of this balance.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
DiamondCardz
Legendary
*
Offline Offline

Activity: 1134
Merit: 1089


CryptoTalk.Org - Get Paid for every Post!


View Profile WWW
October 18, 2019, 09:04:08 PM
 #12

But they're not accurate. The ledger, nodes, etc, have no concept of 'balance'.

Substitute the synonym 'amount'.
They don't have a concept of 'amount' like you're referring to. You're not going to find anything in the protocol which says "update the addresses balance" or anything like that. All the ledger does that is relevant here is tracking the inputs and outputs associated with an address, it never calculates the balance of an address. I'm not going to engage beyond this point. I understand what you are trying to say but that doesn't change the fact that your explanation was not technically sound and what you were suggesting is misleading.

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
Carlton Banks
Legendary
*
Offline Offline

Activity: 2646
Merit: 2202



View Profile
October 18, 2019, 09:05:51 PM
 #13

Question #3:
The whitepaper says, in section 7: "Once the latest transaction in a coin is buried under enough blocks, the spent transactions before
it can be discarded to save disk space." The wording "transaction in a coin" confuses me here because I would have thought it should have said "block" instead of "coin". Perhaps this would be answered by question #2.
I believe that a "coin" was originally what we now call a "transaction output". That seems to explain why the original uses of the word "coin" here and in other contexts may seem odd.

it is completely arbitrary though

maybe 1 BTC is a "coin"?

there is no logical reason for that, only arbitrary reasons


1 BTC is shorthand (i.e. an arbitrary reference point to make life for humans easier) for 100 million satoshis. We humans count in tens, because we're somewhat hard-wired to handle powers of 10 after spending 100s of thousands of years counting fingers on our hands...

Computers (or the Bitcoin protocol) do not have fingers. Or hands. And they "count" in on's and off's, it's debatable whether "counting" is at all an accurate description of what computers are even doing (literally, computers do alot of adding. And they can't do anything else; subtraction, multiplication, division, calculating a square root or a logarithm... these are directly impossible using computers. We can give them contrived additions to perform that calculate such mathematics indirectly, but in essence, computers are no more than a carefully designed electric abacus).

And so, when we ask the computer to emit a period (dot) character to the screen after a bitcoin output's value has exceeded 100 million, there is nothing meaningful that's delineating that as a "coin", it's no different than deciding to stop painting the wall immediately before a paintbrush reaches the floor. The computer doesn't "know" it's a decimal place, it only places it there to be rendered to the hardware display because that's how it's been programmed to behave.

The Bitcoin protocol is behaving according to the rules of mathematics & logic, and to the consequences of the protocols algorithms operating on the inputs we provide to the computer (whose values are either random or arbitrary). Any notion of a "coin" is simply humans interpreting these values and processes and their results in a way we prefer, there are countless ways to interpret the results of Bitcoin's protocol in operation that have nothing to do with a "coin" or anything else thus far conceived.

An example would be the Namecoin protocol, which simply adjusts the patterns in the values such that those values can be resolved into IP addesses by the DNS protocol. And both the protocol (and the computer performing this task) is identically unconcerned with the meaning or significance of these values, there is no way for the protocol to determine what meaning we assign to the values as a part of it's operation (perhaps some AI could, but that's not in the Bitcoin protocol). As far as the computer is aware, it's all just a colossal number of addition arithmetic, performed for no apparent purpose at all.

Vires in numeris
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!