Author

Topic: What's the mathematical puzzle miner solve? (Read 181 times)

legendary
Activity: 3472
Merit: 10611
Can you or someone explain how is the difficulty calculated with respect to the target?
Difficulty is more like a human readable value used as a quick way of understanding how "difficult" it is to mine the next block. Otherwise for anything important (verifying blocks proof of work) the target itself is used since it also doesn't lose precision.
Difficulty is calculated by dividing difficulty at smallest target (1) by the current target. details can be found here: https://en.bitcoin.it/wiki/Difficulty
hero member
Activity: 2702
Merit: 716
Nothing lasts forever
You made it more complicated rather than making it simpler Tongue
It is also not about "leading zeros" but a very simple integer comparison where we want a to be smaller than or equal to b and for example 0035 is bigger than 0031 and is rejected even though both have 2 leading zeros.

A simple explanation of mining IMO would be to compare it with rolling a dice.
Imagine if you wanted to get a number that is smaller than 3. You roll the dice and you have a chance of getting 2 and win on your first try but if you get something bigger like 5 you have to roll again. You do this random work of rolling the dice until you get a number that is smaller than or equal to your target.
That's mining. The only "math" in it is the integer comparison.

Lol, I guess I am really bad at explaining stuff  Tongue

Thanks for posting this. This thread has made me more aware of the mining part now.

Also, I didn't know that the difficulty is inversely proportional to the target required to mine the block.
Can you or someone explain how is the difficulty calculated with respect to the target?
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
What's this puzzle all about? What do miner exactly solve? Please try to avoid technical term if possible, I would like to know in easy way.

You are asking how does Proof of Work works.

I made this Proof of Work summary a few years ago:


Proof of Work is an algorithm that rewards participants who solve a cryptographic puzzle in order to validate transactions and create new blocks (this process in known as mining).
This puzzle consists in scanning for a value (called Nonce) that when hashed together with thr block data, the hash begins with a number of zeros.



In this website you can see how this process works. You can try to find a Nonce that when hashed generates a hash that start with 0000 on your own. You will see that it is hard, unless you are very lucky. And you are going to be lucky twice in row, if you do go to a casino or something like that lol.

The difficult in finding that nonce increases exponentially as more zeros are required by the block. Difficult is adjusted every 2016 blocks, based on the average hashrate of those past 2016 blocks, so that 2016 blocks are mined every two weeks. (So a block is mined every 10 minutes)

Miners only get their reward if they are mining the longest chain, as it has the greatest processing power invested. If the honest nodes control the majority processing power, the honest chain will always be the longest and will outpace attacker’s chain.

To modify a past transaction the attacker would have to redo the PoW of the block and all subsequent blocks, and outpace the honest chain. For this to happen, the attacker’s would need more processing power than the honest chain, also known as 51% attack.

The website I mentioned is very good and it explains things in a visual way.

You can see the blocks. Insert some random data (transactions) and you will see that you will have to mine the block again (finding a nonce which will make the hash meets the target) and all of subsequent blocks.. Try it Smiley
legendary
Activity: 1932
Merit: 4602
Buy on Amazon with Crypto
When we read article on mining, we get a term "solving mathematical puzzle". To get a block, miner needs to solve the mathematical puzzle and whoever can solve the puzzle will be able to get a block and thus the reward (I can be wrong technically, this is what I know).
What's this puzzle all about? What do miner exactly solve? Please try to avoid technical term if possible, I would like to know in easy way.
I think that these articles will help you find answers to all questions.
Kano(C)
Bitcoin mining details
https://kano.is/index.php?k=minedet

The simpified version:
Bitcoin mining
https://kano.is/index.php?k=mining

But I have no idea how to explain technical details without technical terms:)
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
What's the current target we are talking about? What does that mean?
Here: https://en.bitcoin.it/wiki/Target.

The target determines the validity of the hash of a block header. For it to be included in the current chain, the block hash must be lower than the target or else it won't be accepted by the nodes. When you're talking about difficulty, it is just a representation of the target numerically. In reality, the hash is compared against the target and not the difficulty. They have an inversely proportional relationship; the range of acceptable hashes narrows when the target is smaller/difficulty increases.
legendary
Activity: 2156
Merit: 2100
Marketing Campaign Manager |Telegram ID- @LT_Mouse
What's the current target we are talking about? What does that mean?
Actually I'm writing an article on mining bitcoin as I can see a lot of people are interested. I could write these term simply and write a guideline but I think it’s good to share every details, break down every terms so that a beginner gets no problem understanding what's happening behind the keyword mining.
copper member
Activity: 2156
Merit: 983
Part of AOBT - English Translator to Indonesia
oh there's old video its 6 year ago but you can see manually solved mathematical puzzle

https://www.youtube.com/watch?v=y3dqhixzGVo

so basically it try mining using pencil and paper  Grin
copper member
Activity: 2996
Merit: 2374
A simple explanation of mining IMO would be to compare it with rolling a dice.
Imagine if you wanted to get a number that is smaller than 3. You roll the dice and you have a chance of getting 2 and win on your first try but if you get something bigger like 5 you have to roll again. You do this random work of rolling the dice until you get a number that is smaller than or equal to your target.
That's mining. The only "math" in it is the integer comparison.
This is a good explanation.

To explain to someone who doesn't have basic knowledge of bitcoin:
equations have inputs and outputs. For example the equation y = 2x + 4 has one input, x, and out output, y. When you pass the input "3" into this equation, the output will be 10 because 2(3) equals 6 and 6 plus 4 equals 10. (remember PEMDAS).

In order to find a valid block, a miner will need to figure out the input to an equation that has an output below a certain value. The equation that is used is much more complex  than my above example, sha256. The equation used is also non-linear, which means if the inputs, 1, 2 and 3 were passed through the equation the output for the input 1 may or may not be greater than the output for the input of 2, and the output for the input of 3 may or may not be greater than the output of 2.

It is very easy to calculate the output based on the input, but it is impossible to calculate the input based on the output. So miners basically use the "guess and check" method by checking many inputs to see what the output is. Unlike most math tests you took in school, there are an unlimited number of possible inputs that can possibly be used to calculate the output. 
legendary
Activity: 3472
Merit: 10611
When we read article on mining, we get a term "solving mathematical puzzle". To get a block, miner needs to solve the mathematical puzzle and whoever can solve the puzzle will be able to get a block and thus the reward (I can be wrong technically, this is what I know).
What's this puzzle all about? What do miner exactly solve? Please try to avoid technical term if possible, I would like to know in easy way.

I will try to keep this simple.
To understand the puzzle you will first have to understand how the SHA256 algorithm works.

Each block contains a merkle root, block header, block size, transactions, transaction count, nonce etc...
A miner uses his hashing power to generate hash of a block. This is where the SHA256 hashing algorithm comes into picture.
Example: https://www.blockchain.com/btc/block/0000000000000000000ab0825fc30cf2844723262e0c0f2bfd048b2e752029da

The mathematical puzzle which the bitcoin miners solve are nothing but the hash with required number of leading zeroes.
The number of leading zeroes are determined based on the difficulty and when a miner finds out the particular hash, it signals the other miners regarding the same thus claiming the block rewards.
You made it more complicated rather than making it simpler Tongue
It is also not about "leading zeros" but a very simple integer comparison where we want a to be smaller than or equal to b and for example 0035 is bigger than 0031 and is rejected even though both have 2 leading zeros.

A simple explanation of mining IMO would be to compare it with rolling a dice.
Imagine if you wanted to get a number that is smaller than 3. You roll the dice and you have a chance of getting 2 and win on your first try but if you get something bigger like 5 you have to roll again. You do this random work of rolling the dice until you get a number that is smaller than or equal to your target.
That's mining. The only "math" in it is the integer comparison.
hero member
Activity: 2702
Merit: 716
Nothing lasts forever
When we read article on mining, we get a term "solving mathematical puzzle". To get a block, miner needs to solve the mathematical puzzle and whoever can solve the puzzle will be able to get a block and thus the reward (I can be wrong technically, this is what I know).
What's this puzzle all about? What do miner exactly solve? Please try to avoid technical term if possible, I would like to know in easy way.

I will try to keep this simple.
To understand the puzzle you will first have to understand how the SHA256 algorithm works.

Each block contains a merkle root, block header, block size, transactions, transaction count, nonce etc...
A miner uses his hashing power to generate hash of a block. This is where the SHA256 hashing algorithm comes into picture.
Example: https://www.blockchain.com/btc/block/0000000000000000000ab0825fc30cf2844723262e0c0f2bfd048b2e752029da

The mathematical puzzle which the bitcoin miners solve are nothing but the hash with required number of leading zeroes.
The number of leading zeroes are determined based on the difficulty and when a miner finds out the particular hash, it signals the other miners regarding the same thus claiming the block rewards.
legendary
Activity: 2268
Merit: 18748
Here is an ELI5:

Each block has what is called a block header at the start. The block header is a summary of the block. It tells you things like what the previous block was, what time it is, and a thing called a Merkle Root which is a summary of every transaction in that block. It also contains a number called the nonce, which can be changed freely.

When a miner wants to solve a block, they first build the block by choosing transactions, and then they calculate the block header. They hash the block header twice and end up with a number. If this number is smaller than the current target, they have successfully mined a block. If their number is larger than the target, then they change something in the block header (usually the nonce), and try again.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
They are finding a suitable hash that meets the current target. PoW as the term describes, requires the miners to provide a hash of the block header that is less than or equal to the current target. As the occurance of a hash is rare when the difficult gets higher, miners are essentially going through many iterations of the block headers by changing specific components, most commonly the nonce or the extra nonce to try to find a valid block which meets the target requirement.

Block headers consist of the merkle root, timestamp, nonce, last block hash, etc. They are hashed twice to produce a result and is only valid at the current target if the value of the hash is below the current target.

It is not accurate to call it a puzzle we they're not exactly given a problem to solve.
full member
Activity: 442
Merit: 101
Maths has two different types of algorithms, linear and non linear.

Linear algorithms follow rules such as for addition:
As input x gets bigger and output y gets bigger, output z will get bigger.

The other type of algorithm is non linear for example taking the remainder after a decimal:
Regardless of the size of the input, we know the output will be between 0 or 1.

The sha algorithm uses blocks that are of the same size and runs a function on each pair of bits to return either a 0 or a 1 as an output for each bit. This is essentially the mathematical problem being solved.

(the problem with trying to fudge the numbers for non linear algorithms is that it's much harder to guess what second it is than what day it is)..
OMG, even reading your explanations on the matter, I still cannot understand it roughly  Embarrassed In short, is it the use of an algorithm and decoding what's inside it? Really confusing, today, most of us, we know BTC as a money-making tool, I must admit it
legendary
Activity: 3346
Merit: 3125
...
What's this puzzle all about? What do miner exactly solve? Please try to avoid technical term if possible, I would like to know in easy way.

The mining is related to sha256, I remember an old video from 2014 where a user show us how to mine a block by hand step by step, so if you want to understand how it is done the I will leave the link to the video, I hope this helps.

Mining Bitcoin with pencil and paper
legendary
Activity: 3024
Merit: 2148
"Mathematical puzzle" is simply a very bad naming. The word "puzzle" implies that there's is some sort of optimal solution to the problem that is better than just guessing. But miners are actually doing exactly that - guessing. They guess a number that when passed into a function together with block data would produce a valid result, in this case another number with certain amount of zeroes at the start. It takes very little tries to find a number that would produce a few zeroes at the start, but nowdays you need to get much more zeroes, so it takes a lot of tries. Mining hardware, aka ASICS, are computers designed to calculate this one specific function as fast as possible, so they can try billions or trillions of guesses per second.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Maths has two different types of algorithms, linear and non linear.

Linear algorithms follow rules such as for addition:
As input x gets bigger and output y gets bigger, output z will get bigger.

The other type of algorithm is non linear for example taking the remainder after a decimal:
Regardless of the size of the input, we know the output will be between 0 or 1.

The sha algorithm uses blocks that are of the same size and runs a function on each pair of bits to return either a 0 or a 1 as an output for each bit. This is essentially the mathematical problem being solved.

(the problem with trying to fudge the numbers for non linear algorithms is that it's much harder to guess what second it is than what day it is)..
legendary
Activity: 2156
Merit: 2100
Marketing Campaign Manager |Telegram ID- @LT_Mouse
When we read article on mining, we get a term "solving mathematical puzzle". To get a block, miner needs to solve the mathematical puzzle and whoever can solve the puzzle will be able to get a block and thus the reward (I can be wrong technically, this is what I know).
What's this puzzle all about? What do miner exactly solve? Please try to avoid technical term if possible, I would like to know in easy way.
Jump to: