Author

Topic: How are bitcoin blocks verified? (Read 195 times)

brand new
Activity: 0
Merit: 0
October 29, 2018, 07:14:17 AM
#5
member
Activity: 183
Merit: 25
October 29, 2018, 04:45:06 AM
#4
Thanks for asking the question there haha. i probably should have gone there first.
Achow explained pretty much what is was looking for anyway Smiley
sr. member
Activity: 257
Merit: 343
staff
Activity: 3458
Merit: 6793
Just writing some code
October 28, 2018, 11:01:13 PM
#2
By definition, everything in a computer is a string of bytes, even text  Grin



All kidding aside, a block has a serialized byte format. It is not transmitted over the network in JSON. The JSON output that you get from Bitcoin Core is merely something that is human readable. That is not actually how blocks are transmitted over the network.

The block format is just bytes with bytes at certain positions having specific meanings, as defined by the format. You can see the hexadecimal representation of these bytes if you call getblock with verbosity level 0 (i.e. getblock 0).

A block is not a script. Scripts are part of transactions and are in a specific field for scripts only.
member
Activity: 183
Merit: 25
October 28, 2018, 01:10:10 PM
#1
I see in the bitcoin wiki there is something called "script" which compiles down to some bytecode to be run by a very very basic virtual machine.
Does this mean that each block is actually just a string/array of bytes when it comes in and is processed by a node?
so a block in its "true" format would look something like [0x01, 0x04, 0x0f, 0xa1.... etc. ?

and then the node that recieves the block just puts the bytes into the interpreter to be run by the bitcoin VM?
or is there some plaintext involved in the block as well? so it looks something like JSON;
{
   blockhash: 12983092....,
   transactions: [ {8123098...}, {12381923...}],
   timestamp: "08:00:23 12/09/2017"
}

which is correct? a block is pure bytecode or JSON? what would a bitcoincore node understand when receiving a new block?
Jump to: