Author

Topic: All of my bitcoin questions gathered. I need some help here... (Read 488 times)

legendary
Activity: 1624
Merit: 2481
What will happen if someone sends me bitcoins to my address? Will I have to make any confirmations? What if I never open the electrum wallet? The transaction will still be written to the blockchain and I will get my bitcoins right?

When someone sends you bitcoin, he assignes them to your public key.
This is being recorded on the blockchain.

Whenever you want to spend them, you can use your corresponding private key to sign a transaction.

So.. no, you don't have to actively do anything. Just keep your private key (or master seed / mnemonic code) safe, and you are good to go.
legendary
Activity: 2758
Merit: 6830
What will happen if someone sends me bitcoins to my address? Will I have to make any confirmations? What if I never open the electrum wallet? The transaction will still be written to the blockchain and I will get my bitcoins right?

I'm just asking, because of some misunderstandings with private keys.
Yes. Basically, your wallet is just a client that reads the blockchain and make the transactions + sign them + broadcast them for you, all in a user-friendly interface. If in the blockchain it says that your address X has an input of 1 BTC (received 1 BTC), you have it. Whenever you open it with any wallet you will see it. If you have the private-key, you can spend it.

You don't need to have the wallet open when receiving the transaction.
You don't need to open it to "complete the receiving transaction".

That's why cold storage wallets work. You don't have a internet connection, but can still make the transaction outside of it (by grabbing the inputs, etc...), send to the device (through USB, scanning a QR, etc...), sign with the private-key, send back to an online device and broadcast it.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
What will happen if someone sends me bitcoins to my address? Will I have to make any confirmations? What if I never open the electrum wallet? The transaction will still be written to the blockchain and I will get my bitcoins right?

I'm just asking, because of some misunderstandings with private keys.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Quote
it also helps keep the network a tiny bit more decentralized as your node won't have a single fixed list to connect to, instead it will choose a random one and connects to.

Yes, but it's not fully decentralized, since there are prepared nodes written in bitcoin core. Right?

Let me get this straight. Node is a list of IPs that have installed bitcoin core too?

Decentralised is what it is. Distributed isn't....

Nothing on the Internet can really fully be distributed anyway since it'll have to pass through an isp or something at current.

Fully p2p solutions may come and turn the network into a distributed architecture but for now we're stuck with being decentralised and reliant on IPs and DNS server assignments from icann.

A node is something that propagates the network by storing both the mempool and other nodes ip addresses.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Yes, but it's not fully decentralized, since there are prepared nodes written in bitcoin core. Right?

No.
There is a list for your node to initially find other nodes.

You could also just enter your own IP address to connect to. This doesn't change anything regarding the decentralization.



Let me get this straight. Node is a list of IPs that have installed bitcoin core too?

No.
Look at my previous answer, i explained what a node is two times already.

I searched for it a bit more in their github and now it makes sense:
https://github.com/bitcoin/bitcoin/blob/master/contrib/seeds/nodes_main.txt

So in the case that all these nodes do not work (which is something impossible) they will simply update the software and write other ips right?
legendary
Activity: 1624
Merit: 2481
Yes, but it's not fully decentralized, since there are prepared nodes written in bitcoin core. Right?

No.
There is a list for your node to initially find other nodes.

You could also just enter your own IP address to connect to. This doesn't change anything regarding the decentralization.



Let me get this straight. Node is a list of IPs that have installed bitcoin core too?

No.
Look at my previous answer, i explained what a node is two times already.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Quote
it also helps keep the network a tiny bit more decentralized as your node won't have a single fixed list to connect to, instead it will choose a random one and connects to.

Yes, but it's not fully decentralized, since there are prepared nodes written in bitcoin core. Right?

Let me get this straight. Node is a list of IPs that have installed bitcoin core too?
legendary
Activity: 3472
Merit: 10611
Aaahh.. Now I got it! But when does this "Searching for more IPs" journey stops? I mean, it can't search for new IPs forever, right?

you don't exactly "search for IPs" constantly. two nodes that communicate with each other, share the list of IP addresses that they know of. that way they can stay up to date. for example a node that was on the network yesterday may no longer be alive today or it may have changed its IP address. so your node needs to update its list regularly.
it also helps keep the network a tiny bit more decentralized as your node won't have a single fixed list to connect to, instead it will choose a random one and connects to.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
The process i have mentioned above. It roughly follows these steps (simplified):
- Resolve DNS names in the hardcoded list to IP addresses
- Query those IP addresses (nodes)
- Get more IP addresses from nodes
- Connect to these nodes
- Save IP's of active nodes into a list so you don't have to follow these steps again the next time you start core. The next time you directly connect to the IP's in the list.

Aaahh.. Now I got it! But when does this "Searching for more IPs" journey stops? I mean, it can't search for new IPs forever, right?
legendary
Activity: 1624
Merit: 2481
A list of DNS names from nodes in the source? What source? The bitcoin software's source code?

Yes.


What is initial bootstrap exactly?

The process i have mentioned above. It roughly follows these steps (simplified):
- Resolve DNS names in the hardcoded list to IP addresses
- Query those IP addresses (nodes)
- Get more IP addresses from nodes
- Connect to these nodes
- Save IP's of active nodes into a list so you don't have to follow these steps again the next time you start core. The next time you directly connect to the IP's in the list.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
There is a list containing DNS names from nodes in the source for the initial bootstrap.

A list of DNS names from nodes in the source? What source? The bitcoin software's source code?

What is initial bootstrap exactly?
legendary
Activity: 1624
Merit: 2481
So yeah, that binary is a BIG, BIG number. Are we trying to find a binary that is below the target?

Yes.

But how does random really work? I mean when I download and install the bitcoin core what exactly will my computer search? How will it search other computers that have downloaded the blockchain? This is what I'm not understanding.

There is a list containing DNS names from nodes in the source for the initial bootstrap.
Once the node is connected to the network it will receive message from the nodes containing ip addresses of other nodes. All of these IP's will be saved into a list to connect to then the next time you start up core (without needing to use the hardcoded DNS list).
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Quote
In computer systems, everything is a number. It all depends on the representation of binary data.
Just think about it like that: The hash is being translated into a bit string and then interpreted as a number.

Oh, I had forgot that. A hexademical sha256 of "hello, world!" is: 68e656b251e67e8358bef8483ab0d51c6619f3e7a1a9f0e75838d41ff368f728

Do we care about its binary? Which is that:
Code:
110100011100110010101101011001001010001111001100111111010000011010110001011111011111000010010000011101010110000110101010001110001100110000110011111001111100111101000011010100111110000111001110101100000111000110101000001111111110011011010001111011100101000

So yeah, that binary is a BIG, BIG number. Are we trying to find a binary that is below the target?





---------------------------------------------------------------------------------------------------

But how does random really work? I mean when I download and install the bitcoin core what exactly will my computer search? How will it search other computers that have downloaded the blockchain? This is what I'm not understanding.
legendary
Activity: 1624
Merit: 2481
Why every 2016 blocks? Does it have to do with maths?

That's just a fixed number.
2016 blocks have been chosen because it seemed to be a good number

2016 blocks with 10 minutes per block means 2 weeks. So there is an adjustment every 2 weeks (roughly).



SHA256 of the string "a" is: ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb

^That output is not a number. You're saying that hash is just a number that is the subject of a compression function. Yes, target seems to be a number since you say "they want the hash to fall below the target". But... Why do you say that hash is a number?  Undecided

In computer systems, everything is a number. It all depends on the representation of binary data.
Just think about it like that: The hash is being translated into a bit string and then interpreted as a number.



Quote
If yyour node connects to another, then that node will also send your IP address to other nodes if you allow incoming connections and once you're fully synced, you'll get connections from other nodes.
So having bitcoin core open means that I'm having a port open too? I thought that IPs are something hidden in the bitcoin world. I thought everything is anonymous.

1) Other nodes can receive block files from you only if you allow incoming connections in the settings AND have the corresponding port open.
2) IP's are NEVER hidden when you communicate via the internet. IP's are needed to communicate. This is NOT sensitive information. You are most likely sitting behind a NAT of your ISP anyways. Whenever you relay blocks (automatically) or send a transaction, your IP is visible. This can not be prevented.
You can hide your IP by communicating via the TOR network tho.



Okay so let's assume that I've downloaded the blockchain and I'm connected to the network. So, will I just share my blockchain file to others? Doesn't this mean that my internet will go slower?

Same answer as above applies here:
Other nodes can receive block files from you only if you allow incoming connections in the settings AND have the corresponding port open.

If you decide to do so, yes your internet connection will be slightly more occupied.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Why every 2016 blocks? Does it have to do with maths?
Because it's meant to be an average of 144 blocks a day for 14 days... I think it's a fairly reasonable sample size.

Knowing from programming, hash functions produce a fixed-length string.

SHA256 of the string "a" is: ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb

^That output is not a number. You're saying that hash is just a number that is the subject of a compression function. Yes, target seems to be a number since you say "they want the hash to fall below the target". But... Why do you say that hash is a number?  Undecided

But it is a number? It's not denary but it's a number? Which sorts of programming have you done in the past? Have you done much with statically typed objects (c#/java/c++/c/assembly)?

Do you know binary? Is 0110 a number, can we agree it's 6?
Going back to binary, we can take the last four digits of your hex string above that forms the hash 48bb
4 = 4 (and since it's a base 16 number, we multiply it by 16^4)
8 = 8 (and since it's a base 16 number, we multiply it by 16^3)
b = 11 (1101 and since it's a base 16 number, we mulitply it by 16^2)
b = 11 (and we times it by 16^0)
I get 48bb to be 18619 (quickly input so may be wrong).

Before saying this is a stupid way to represent numbers or anything, take yourself back to any lessons you may have had discussing binary and look up what a 'nibble' is in binary... Hexadecimal is just a way to represent 4 binary digits (a nibble).

Wait... So nodes are randomly choosing other nodes? How's a node looks like? Is it a string?

Nodes are randomly selected, but if you think about the rate of computation in a machine and that you're just sending a tiny amount of data or even just pinging the node to check it has that port open (I think covering this is a bit out of scope here though).

A node, in any case on the internet is represented by it's SOCKET... In bitcoin's case, it's represented by the node's IP address plus the port.

So having bitcoin core open means that I'm having a port open too? I thought that IPs are something hidden in the bitcoin world. I thought everything is anonymous.

The anonymity is a misconception. Hosting a node can actually be anonymous if it's routed through TOR (The Onion Router), however, hosting it over the light web doesn't make it anonymous at all.

Bitcoin itself is pseudoanonymous for the time being (however this will likely be subject to change in the coming years)... You can currently see where funds have come from and are going to. You may want to look into Dash, Monero or Grin to see how they achieve transaction anonymity.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
For @jackg:

Quote
A new block ins't exactly opened it's just mined. Difficulty refreshes every 2 weeks, meaning, if for a substantial amount of time in the 2016 blocks being mined that difficulty is much lower, then after the refresh it'll become easier to mine the blocks too but the refresh will take longer since they're targeting a number harder to computationally access.

Why every 2016 blocks? Does it have to do with maths?

Quote
They want the has to fall below the target given to them. A hash is just a number that is the subject of a compression function... It takes the 1mb block and reduces it down to 256 bits and that is what is compared with the actual block.

Knowing from programming, hash functions produce a fixed-length string.

SHA256 of the string "a" is: ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb

^That output is not a number. You're saying that hash is just a number that is the subject of a compression function. Yes, target seems to be a number since you say "they want the hash to fall below the target". But... Why do you say that hash is a number?  Undecided

Quote
This is done with initial peer discovery in nodes. Generally speaking the node comes with it's own information on finding other nodes and can then find new nodes from that.

Wait... So nodes are randomly choosing other nodes? How's a node looks like? Is it a string?

Quote
If yyour node connects to another, then that node will also send your IP address to other nodes if you allow incoming connections and once you're fully synced, you'll get connections from other nodes.
So having bitcoin core open means that I'm having a port open too? I thought that IPs are something hidden in the bitcoin world. I thought everything is anonymous.

----------------
For @bob123:

Quote
Nodes are computer who have the whole blockchain stored and are connected to the bitcoin network.
If you download bitcoin core, keep the whole blockchain synced with a connection to the network, you are a full (because you have the whole blockchain stored) node.

So you are downloading all the blocks from other computer storing the whole blockchain who are connected to the bitcoin network and allow incoming connections.

Okay so let's assume that I've downloaded the blockchain and I'm connected to the network. So, will I just share my blockchain file to others? Doesn't this mean that my internet will go slower?
legendary
Activity: 1624
Merit: 2481
Quote
From others (full) nodes.

Now I'm feeling a bit redicule... But the word node... I cannot translate it on my language.
So I cannot understand your quoted message at all. Are nodes verified blockchain files?  Huh Undecided

Nodes are computer who have the whole blockchain stored and are connected to the bitcoin network.
If you download bitcoin core, keep the whole blockchain synced with a connection to the network, you are a full (because you have the whole blockchain stored) node.

So you are downloading all the blocks from other computer storing the whole blockchain who are connected to the bitcoin network and allow incoming connections.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Let's start answering you. About question 2, do you mean that if the computational power dedicated to the chain is low, the difficulty of opening a new block will also be low?
A new block ins't exactly opened it's just mined. Difficulty refreshes every 2 weeks, meaning, if for a substantial amount of time in the 2016 blocks being mined that difficulty is much lower, then after the refresh it'll become easier to mine the blocks too but the refresh will take longer since they're targeting a number harder to computationally access.

About question 3, you're writing:
Quote
They're trying to get a hash of the block to fall below a certain amount

Miners are trying to get a hash (Okay until here) to fall below a certain amount? Certain amount of what? Target? Difficulty? I'm so confused...
They want the has to fall below the target given to them. A hash is just a number that is the subject of a compression function... It takes the 1mb block and reduces it down to 256 bits and that is what is compared with the actual block.

Quote
This was originally done by chainging the nonce in the coinbase (which is an up to 20 byte number that is stroable in any transaction before it's signed)
Didn't get that...

I have another question by the way. When we download and install the bitcoin core, it downloads the blockchain right? Where exactly does it download it from since there is no bitcoin authority/database?

This is done with initial peer discovery in nodes. Generally speaking the node comes with it's own information on finding other nodes and can then find new nodes from that.

If yyour node connects to another, then that node will also send your IP address to other nodes if you allow incoming connections and once you're fully synced, you'll get connections from other nodes.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Quote
Miners build their block. Then afterwards they generate the hash.
If the hash does not meet the requirements (being below the target), they change the nonce which will result in a completely different hash.
They continue to do so until all possible nonce's have been used. Then they either change different fields in the header or chose to include other transactions and start again.

While a miner tries to build the block, new transactions happen. They are added to the block as a reward (their fee) right?

So, if I understood correctly, nonce is a number? 20-byte number? This is 120bit number (1 byte = 8 bits). A 120bit number has no end, I mean its end is an amazingly big number. Do they try to match every single intergal number of all nonces numbers?

Also question about miners:

The miner that will find the solution to open the last block, will get the 12.5 + fee bitcoins right?
The thing i don't get is that mining just about transactions gives you bitcoins, but not that much. If I want to mine to validate a transaction, I will only get the transaction's fee as a reward. Does this mean that I will "steal" some satoshis from the block reward? I hope you understood me.

This is what @jackg said:
Quote
Yes? Is this a question or just a statement? They get both of these - fees are just an additive difference between transactions so a standard block may see 100.1BTC move and 100BTC be assigned, the other 0.1BTC gets added to the block reward.

---------------------------------------------------------------------

Quote
From others (full) nodes.

Now I'm feeling a bit redicule... But the word node... I cannot translate it on my language.
So I cannot understand your quoted message at all. Are nodes verified blockchain files?  Huh Undecided
legendary
Activity: 1624
Merit: 2481
About question 3, you're writing:
Quote
They're trying to get a hash of the block to fall below a certain amount

Miners are trying to get a hash (Okay until here) to fall below a certain amount? Certain amount of what? Target? Difficulty? I'm so confused...

The hash has to be below the target (which is directly related to the difficulty).
Both mean the same thing but are represented in a different way.

The highest possible target corresponds to the lowest difficulty and vice versa.



Quote
this was originally done by chainging the nonce in the coinbase (which is an up to 20 byte number that is stroable in any transaction before it's signed)
Didn't get that...

Miners build their block. Then afterwards they generate the hash.
If the hash does not meet the requirements (being below the target), they change the nonce which will result in a completely different hash.
They continue to do so until all possible nonce's have been used. Then they either change different fields in the header or chose to include other transactions and start again.



I have another question by the way. When we download and install the bitcoin core, it downloads the blockchain right? Where exactly does it download it from since there is no bitcoin authority/database?

From others (full) nodes.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
@jackg, I really appreciate your spent time writing this "essay" for me  Wink

Let's start answering you. About question 2, do you mean that if the computational power dedicated to the chain is low, the difficulty of opening a new block will also be low?

About question 3, you're writing:
Quote
They're trying to get a hash of the block to fall below a certain amount

Miners are trying to get a hash (Okay until here) to fall below a certain amount? Certain amount of what? Target? Difficulty? I'm so confused...

Quote
this was originally done by chainging the nonce in the coinbase (which is an up to 20 byte number that is stroable in any transaction before it's signed)
Didn't get that...

I have another question by the way. When we download and install the bitcoin core, it downloads the blockchain right? Where exactly does it download it from since there is no bitcoin authority/database?


Nevertheless, you opened my mind for some questions.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
In this thread I would like to gather all of my bitcoin questions I have. As many as I can think of, like how mining works, how bitcoin transaction works etc.

1)Why it does? Are miners involved in this?
The answer is simple, the number of broadcast new unconfirmed transaction have no limit and may increase or decrease depending on the situation (but each node's mempool does have limits).
While the number of transactions that can fit in a block have a limitation and the number of blocks per day is also limited to an average of 1 block per 10 minutes.

Quote from: BlackHatCoiner
2) Why block generation time is always standard?
Answered by jackg.

Quote from: BlackHatCoiner
3)What exactly are we trying to guess?
-snip-
And then how my blockchain file will be shared to all the other blockchain files of the world?
-snip-
I know that if they solve the transaction hash (?) they will get the fee as a reward. But what exactly are they trying to do in order to solve it?
Quote from: BlackHatCoiner
4) What is a target and why the block's header must be equal or lower than this number?
That depends on the difficulty (answer to #2). The higher the difficulty, the lower that "target" will be.
As the wiki said, it's a "256-bit number" which is a 64-characters (HEX) [64characters HEX = 32Bytes= 256-bit].
It's the same number of characters as a SHA-256 hash.

So the miner will try to create a "block header" with a SHA-256d hash lower than the target to win a block.
Read this: Block hashing algorithm.
If the hash isn't lower or equal to the target, then the miner will change the "nonce" that will change the hash.
If that new hash isn't lower or equal to the target, repeat the above until it does.

Quote from: BlackHatCoiner
5) If I want to send 50BTC to an address with a fee of 0.0002 do I spend 50.0002BTC and the receiver gets 50BTC or do I send 50BTC and the receiver gets 49.9998BTC?
This depends entirely on the client, some badly-configured wallets deduct the fee from the amount to send by default.
But most clients will try to find a higher valued UTXO in order to send the full amount to the desired address.
Some are configurable to do what the user wants.
legendary
Activity: 2380
Merit: 5213
1) Okay so the first question I have is about blocks. If you go here: https://blockchair.com/bitcoin you will see a transaction live count. It gets increased and decreased as well. Why it does? Are miners involved in this?
Transaction number hasn't yet changed for me but I assume when a block is found, they may find the average and add it on or it may decrease when a block becomes orphaned.
I guess the OP is referring to number of transactions in the last 24 hours or number of transactions in mempool.



To OP:

Total number of transactions is always rising.

If you are referring to number of transactions in the last 24 hours:
That depends on new transactions and also transactions that had been made 24 hours ago.
Assume that at the time I am writing this post, 1000 new transactions are made while 1200 transactions had been made 24 hours ago. Number of transactions should decrease by 200.

If you are referring to number of transactions in mempool:
They are unconfirmed transactions.
If transactions that are being confirmed are more that new transactions that come to mempool, that number should decrease.

Note that, after a transaction is verified by a node, it goes to mempool and will remain there until it is included in a block by a miner.

legendary
Activity: 3024
Merit: 2148
5) If I want to send 50BTC to an address with a fee of 0.0002 do I spend 50.0002BTC and the receiver gets 50BTC or do I send 50BTC and the receiver gets 49.9998BTC?


Yes, this is how it works, but there's nothing stopping anyone from manually changing the transaction amount to effectively take the fee from the receiver. This is exactly what exchanges and other services do, you ask them to withdraw your 50 BTC and they send you  49.9998 and 0.0002 will be paid as a fee to miners. Except they usually batch transactions and there's a lot of inputs/outputs involved, so they probably take a lot of money for themselves, so only a portion of the withdrawing fees that users see is going to miners.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
1) Okay so the first question I have is about blocks. If you go here: https://blockchair.com/bitcoin you will see a transaction live count. It gets increased and decreased as well. Why it does? Are miners involved in this?
Transaction number hasn't yet changed for me but I assume when a block is found, they may find the average and add it on or it may decrease when a block becomes orphaned.

2) Why block generation time is always standard? Every day 144 blocks are created (since 210240 every 4 years, I did the maths). Why? I've never seen such question anywhere. I think on our wiki it says new block every 10 minutes.
The blocktime adjusts every 2 weeks (2016 blocks) to amek the time for a block to be found 10 minutes. This is all based on the computation power dedicated to the chain over the past 2 weeks.

Block discovery is a bit like radioactivity, we know the average will be around 144 a day but there won't always be 144 a day there might be less, block discovery can be anywhere from around a second before to 2 hours after.

3) Mining is the main source of questions. To start with, miners want to mine for 2 reasons. For guessing the hash of a block meaning that they will earn 12.5BTC and for earning bitcoins from transactions fees.
Yes? Is this a question or just a statement? They get both of these - fees are just an additive difference between transactions so a standard block may see 100.1BTC move and 100BTC be assigned, the other 0.1BTC gets added to the block reward.

After a lot of research I have understood that each block's hash has to do with the previous block and some other things (like SHA256(some stuff in here including the prevBlockHash)). What exactly are we trying to guess? And even we if we guess that "thing" correctly, who promises me that it will write to the blockchain that "this guy mined 12.5BTC from x block".
The start of every block begins with a Coinbase, this is a transaction that has null inputs but outputs a 12.5+fee amount to the creditors' public key/address.
They're trying to get a hash of the block to fall below a certain amount, this was originally done by chainging the nonce in the coinbase (which is an up to 20 byte number that is stroable in any transaction before it's signed).

And then how my blockchain file will be shared to all the other blockchain files of the world? So the network will confirm that I really earnt 12.5BTC.
The block gets shared with new nodes and is sent to them as a packet. If you use a mining pool this is handled by them, but essentially, when you run an instance of a miner it will normally have to connect to a full node where it gets information of what it has to put in the block and also publishes the newly found block to other nodes. This needs alright connection to the internet since each block has to point to the last block in it's header and give the height of the block it will be.

These funds take a day to become spendable, for standard nodes on the network that conform to current rules.

Now about the transaction fee. When I send 50BTC to an address with a fee of 0.002BTC, does this mean that I write publicly something to the last block?. Since there is no main database of bitcoin transactions, how will the blockchain updates that I want to send x number of bitcoins to an address? And then miners see the last block's transactions and choose what transaction to solve. I know that if they solve the transaction hash (?) they will get the fee as a reward. But what exactly are they trying to do in order to solve it?
When you broadcast a transaction to neighbour nodes, they will verify it and continue it's propagation through the network.
These transactions are collated and added to a block which then has it's information changed more than 1000 trillion times a second in order to find a number below the target nonce.

4) What is a target and why the block's header must be equal or lower than this number?
In our wiki we have written what's a target: https://en.bitcoin.it/wiki/Target
The thing I don't get is here:
Quote
Each hash basically gives you a random number between 0 and the maximum value of a 256-bit number (which is huge). If your hash is below the target, then you win. If not, you increment the nonce (completely changing the hash) and try again.

If my hash is below the target?? The hash is a string and the target is a 256-bit number right? How to compare a string with an int?
Examples
(Hash: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
Target: 0000000000000000001320bc0000000000000000000000000000000000000000)
Take this a bit simpler if you want, and use a target in real terms...
If your target is simple like 512 and you have a function that gives 2048 outputs, you're after running it 4 times on average to get below 512.
You can also look at trying to convert hexadecimal into binary since that's how the block hash is stored as it's probably better to watch a youtube video on it.

Essentially it's like normal numbers but with a base of 16:
(Hash: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
Target: 0000000000000000001320bc0000000000000000000000000000000000000000)
would mean the hash is far from the target, however: 0000000000000000001220bc0000000000000000000000000000000000000000 won't be.

5) If I want to send 50BTC to an address with a fee of 0.0002 do I spend 50.0002BTC and the receiver gets 50BTC or do I send 50BTC and the receiver gets 49.9998BTC?

No, bitcoin was developed well.
10^-8 of a bitcoin is stored as a 1 (and is known as a satoshi) this may be subject to change but is currently the numbering system used.
You spend the full
500(00020000), they get 500(00000000) and the 20000 goes as a fee to the finder of the block.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
In this thread I would like to gather all of my bitcoin questions I have. As many as I can think of, like how mining works, how bitcoin transaction works etc.

1) Okay so the first question I have is about blocks. If you go here: https://blockchair.com/bitcoin you will see a transaction live count. It gets increased and decreased as well. Why it does? Are miners involved in this?

2) Why block generation time is always standard? Every day 144 blocks are created (since 210240 every 4 years, I did the maths). Why? I've never seen such question anywhere. I think on our wiki it says new block every 10 minutes.

3) Mining is the main source of questions. To start with, miners want to mine for 2 reasons. For guessing the hash of a block meaning that they will earn 12.5BTC and for earning bitcoins from transactions fees.

After a lot of research I have understood that each block's hash has to do with the previous block and some other things (like SHA256(some stuff in here including the prevBlockHash)). What exactly are we trying to guess? And even we if we guess that "thing" correctly, who promises me that it will write to the blockchain that "this guy mined 12.5BTC from x block".

And then how my blockchain file will be shared to all the other blockchain files of the world? So the network will confirm that I really earnt 12.5BTC.

Now about the transaction fee. When I send 50BTC to an address with a fee of 0.002BTC, does this mean that I write publicly something to the last block?. Since there is no main database of bitcoin transactions, how will the blockchain updates that I want to send x number of bitcoins to an address? And then miners see the last block's transactions and choose what transaction to solve. I know that if they solve the transaction hash (?) they will get the fee as a reward. But what exactly are they trying to do in order to solve it?

4) What is a target and why the block's header must be equal or lower than this number?
In our wiki we have written what's a target: https://en.bitcoin.it/wiki/Target
The thing I don't get is here:
Quote
Each hash basically gives you a random number between 0 and the maximum value of a 256-bit number (which is huge). If your hash is below the target, then you win. If not, you increment the nonce (completely changing the hash) and try again.

If my hash is below the target?? The hash is a string and the target is a 256-bit number right? How to compare a string with an int?
Examples
(Hash: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
Target: 0000000000000000001320bc0000000000000000000000000000000000000000)

5) If I want to send 50BTC to an address with a fee of 0.0002 do I spend 50.0002BTC and the receiver gets 50BTC or do I send 50BTC and the receiver gets 49.9998BTC?

These are my main questions of bitcoin, I know that I may have made some misunderstandings. Please be patient with me., I may think of others too, because that's not something quick, queries get bornt over time. The above questions have been googled, believe me too much, but I get answers that are not enough to solve the problems of my head. Trying to attach all this information the internet gives me and I always fail...

Note that I'm not stinking my merits to whoever solves my questions. Of course I will reward him. That's the point of merits anyway.
Jump to: