Pages:
Author

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

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.
Pages:
Jump to: