Blockchain: Transactions, Blocks and Adding Data

all right so let's look at some some

blocked in Backlund so have a look at

how transactions are created and how

these are built into blocks and what

we'll do is we'll add Iran bit on to the

block tune and sure actually have a

service mind okay so this is our basic

set up that that we have what we have is

a number of transactions that happen we

have an existing block team so we have a

block this is the genisis block here

the miners then clear hash of this kick

up to five six hash so they must

purchase see the new hash for the block

and server finds that will be rewarded

for their work

then we create and get more transactions

add a new blog and what we must do is

find the they complete hash of all of

the blocked in up to now so we keep

adding blogs and then the hash functions

on when we have new transactions the

sentiment is kind that the miners will

weed and gather together all the

transactions and then what they must do

is create the new hash and then create a

consensus around the hash so whoever

finds the right hash will transmit it to

the rest of the miners and they're all

update their their existing block chain

so that they have the same so this is

good because if there was to be miners

which were destroyed on the network and

there's at least one blocked in left

then we could rebuild the whole of the

structure from that blog team so nothing

is really deleted from the blockchain

all the blog's exist and all the

transactions exist then we get a concept

of what's called a gas so gas is set gas

values as for one crypto hash plus

there's also cost of six more gas

elements for every 200

six bits of updated app that we use okay

so on this example here what we're going

to do is still store the water law in

the block team and a transaction so this

is the hex equivalent of Havel h-e-l-l-o

and then we're going to send a

transaction from our account

that's account zero and we're going to

distort our data so there isn't a

transaction from one account to another

this is purely as I adding some data on

to be on to the block team okay so

that's that's how it works or now let's

look at a real example so here we are

so if medium is running this now and

we're on this block number you can see

the hash number of that block so what

we'll do is that now we'll go ahead and

we'll add some data so we'll add the

what hello just in case we want to see

if the one follow for later okay so

we're going to do both I'm just going to

make sure that the miners are actually

stopped so I'm just going to attach my

console just to show you that nothing

really happens and creating the blocked

in unless we have the miners started I

just make sure the miners are not to be

stopped just LAN so now what I'm going

to do is we're going to just load up

some data

so I've already converted this into

hexadecimal this is the word to long

looking for the next thing that we're

going to do is we'll send the

transaction and fight what would those

we just earn

we'll just authenticate ourselves okay

so this is account I can zero okay so

there's the two account on the system

were clicking this again yeah there

should be some credits and that cancel

we should be able to pay the miners for

our work so before going to do is when

they send that transaction and I want

you submitted here so we can actually

see is getting ready to be mined but


well happens we have a transaction

number so what we can actually do is

have a look to see and the details of

that transaction and the transaction



okay so that is the one thing to notice

there is there's no block number and

there's no harsh so it hasn't actually

been mined yet so we can see there's the

input so there is an intense string so

there is data there and the transaction

is really just floating until our miners

actually start so those will just go

ahead and start our miners okay we can

see them starting to work looks like

they're there they're creating a new

mining record okay so you can see

they're going ahead and creating new

blocks so all those will just stop them

laughs now we'll go back to our

transaction and there you go okay so

there's block number five one seven nine

this is my ID here okay and do the

transaction hours of the block hash so

we've added the transaction on tooth

block five one seven nine okay so we can

see here the episode without the miner

start a miner and then eventually we

should see hi

the block hash and the blocks number so

what we'll do now is we'll have a look

at the block we're going to get the

whole block so we're looking at five one

seven nine there won't be any other

transactions because with war not adding

any other transactions here so if we

look at this block so this is our blog

so when we look back our diagram okay

this is the block here the clock and we

can see the hash I can see the hash

there for that whole block

and then what we should see is one or

more transactions so in this case is

only our transaction this is our

transaction here and it's been added on

to the on to the block okay it's cost us

some gas to be able to get that mind the

toefl it's worth it so now what we'll do

is we'll have a look at that transaction

so on Ellis transactions zero here's our

number you can put the the ID there but

it's probably easier if I just put a

zero services transactions zero and that

is there okay so in this case the value

that we have for input is hello okay so

that's how we are the data onto a

blockchain sphere forever it's never

going to be deleted our transaction is

non reputable we know when happened and

and when it was mined

and you can see the data there okay so

hopefully that explained how we can set

up transactions blocks and miners

a little bit about gas and then also how

we can add our own data to the blocked

in so it's going to be quite costly if

we add too much data to the blog tune so

we typically keep the data quite small

just now because it's going to be costly

and this is the way that we can convert

things like images audio and so on but

normally what we would do is we would

get a hash of a file I mean my ID the

hash on to be on to the blocked in and

that gives us a basic check of when this

the five existed okay thanks