Bitcoin Forum
May 04, 2024, 06:44:23 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: question on finding nonce  (Read 242 times)
icehouse (OP)
Jr. Member
*
Offline Offline

Activity: 37
Merit: 1


View Profile
April 19, 2018, 09:06:13 PM
 #1

Hi Guru,

I have a 7 gpu miner. I don't have money to invest in more hardware but would like to improve the miner software.

As I know each gpu is finding the nonce to meet a block difficult. A nonce is a 32 bits number.
gpu sequential loop through the 32 bits numbers + block items -> hash?
or it randoms pick a number to do the hash?

When there are multiple GPU, how miner coordinate the GPUs to find a nonce effectively?
1714848263
Hero Member
*
Offline Offline

Posts: 1714848263

View Profile Personal Message (Offline)

Ignore
1714848263
Reply with quote  #2

1714848263
Report to moderator
1714848263
Hero Member
*
Offline Offline

Posts: 1714848263

View Profile Personal Message (Offline)

Ignore
1714848263
Reply with quote  #2

1714848263
Report to moderator
The forum strives to allow free discussion of any ideas. All policies are built around this principle. This doesn't mean you can post garbage, though: posts should actually contain ideas, and these ideas should be argued reasonably.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714848263
Hero Member
*
Offline Offline

Posts: 1714848263

View Profile Personal Message (Offline)

Ignore
1714848263
Reply with quote  #2

1714848263
Report to moderator
1714848263
Hero Member
*
Offline Offline

Posts: 1714848263

View Profile Personal Message (Offline)

Ignore
1714848263
Reply with quote  #2

1714848263
Report to moderator
hushan
Member
**
Offline Offline

Activity: 61
Merit: 15


View Profile
April 19, 2018, 11:51:02 PM
Merited by ABCbits (1)
 #2

First, yes, mining is running the nonce from 0 to uint32_max, to find the value that the resulted block hash is less than the target.
It's not random because it won't help anything, you still have to "randomly" try every possible nonce value.

For multiple GPU, it's just like multithreaded processing, the miner software will divide the work to smaller tasks and distribute to each gpu.

BTC: 38ykUxZeSv5aqav1keCc4KUxXLPPGkfrm5 LTC: MPpWNvqDCVB1PHJt4A28j9oFfc6Y1KKDno ETH: 0x07C8c68d5253247038947EF9495b054160c8737c
icehouse (OP)
Jr. Member
*
Offline Offline

Activity: 37
Merit: 1


View Profile
April 20, 2018, 01:34:58 AM
 #3

First, yes, mining is running the nonce from 0 to uint32_max, to find the value that the resulted block hash is less than the target.
It's not random because it won't help anything, you still have to "randomly" try every possible nonce value.

For multiple GPU, it's just like multithreaded processing, the miner software will divide the work to smaller tasks and distribute to each gpu.

Thanks Hushan!

Agree, as the nonce is like randomly located between 0 to unit32_max.
when miner divide the work to each gpu,
does it divide in a way that they won't overlap?
starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
April 20, 2018, 05:36:19 AM
 #4

Agree, as the nonce is like randomly located between 0 to unit32_max.
when miner divide the work to each gpu,
does it divide in a way that they won't overlap?

Most likely. What the point of computing twice the same thing by the way?

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
icehouse (OP)
Jr. Member
*
Offline Offline

Activity: 37
Merit: 1


View Profile
April 20, 2018, 01:12:18 PM
Last edit: April 20, 2018, 02:28:44 PM by icehouse
 #5

Agree, as the nonce is like randomly located between 0 to unit32_max.
when miner divide the work to each gpu,
does it divide in a way that they won't overlap?

Most likely. What the point of computing twice the same thing by the way?

I have a gpu miner with mixed gpu. 1080, 1060 6GB and 1060 3GB.
if miner divide the nonce evenly to each gpu, the chance of finding the nonce will be also the same for each gpu.
however, i can see 1080 finds more share than 1060. as 1080 is much faster.
I suspect each thread are trying the nonce randomly.
hushan
Member
**
Offline Offline

Activity: 61
Merit: 15


View Profile
April 20, 2018, 02:57:21 PM
 #6

Agree, as the nonce is like randomly located between 0 to unit32_max.
when miner divide the work to each gpu,
does it divide in a way that they won't overlap?

Most likely. What the point of computing twice the same thing by the way?

I have a gpu miner with mixed gpu. 1080, 1060 6GB and 1060 3GB.
if miner divide the nonce evenly to each gpu, the chance of finding the nonce will be also the same for each gpu.
however, i can see 1080 finds more share than 1060. as 1080 is much faster.
I suspect each thread are trying the nonce randomly.

Those are mining hardware, what software do you use? The allocation of the work is done by the mining software. I believe an intelligent mining software will use each GPU's capacity as a hint on how much work they are assigned to. Infact, it's a process of  feedback and adjust constantly. The miner will measure each chip's hashrate and decide whether to increase or decrease the work.

BTC: 38ykUxZeSv5aqav1keCc4KUxXLPPGkfrm5 LTC: MPpWNvqDCVB1PHJt4A28j9oFfc6Y1KKDno ETH: 0x07C8c68d5253247038947EF9495b054160c8737c
Betwrong
Legendary
*
Offline Offline

Activity: 3276
Merit: 2150


I stand with Ukraine.


View Profile
April 20, 2018, 07:18:24 PM
 #7

This is a very interesting topic to me because I'm doing my best in trying to understand how Bitcoin mining really works.

I've never thought of the possibility of assigning different tasks to different miners and I'm not sure about if that even possible, taking into account that S9, for example, does 14 tera hashes per second, but here's what I think. What if it would be more efficient to make each miner to try to find nonces for different sets of transactions rather than finding nonces for the same set?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Xynerise
Sr. Member
****
Offline Offline

Activity: 322
Merit: 363

39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD


View Profile
April 20, 2018, 07:46:01 PM
 #8

What if it would be more efficient to make each miner to try to find nonces for different sets of transactions rather than finding nonces for the same set?
The nonce is iterated to find a block hash lower than the target.
Before you start trying nonces you must have a candidate block already (complete with transactions)
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4616



View Profile
April 21, 2018, 06:27:26 AM
 #9

when miner divide the work to each gpu,
does it divide in a way that they won't overlap?

In most cases, I would expect that the mining software would simply build completely different blocks for each, rather than trying to split up nonce range.
Betwrong
Legendary
*
Offline Offline

Activity: 3276
Merit: 2150


I stand with Ukraine.


View Profile
April 21, 2018, 12:21:34 PM
 #10

What if it would be more efficient to make each miner to try to find nonces for different sets of transactions rather than finding nonces for the same set?
The nonce is iterated to find a block hash lower than the target.
Before you start trying nonces you must have a candidate block already (complete with transactions)

That's right, but I heard in a lecture on Bitcoin mining that in case a miner can't guess the needed nonce for too long it includes more transactions in the block(or excludes some of them) to change the Merkle root and to start guessing nonces for the new one. Is that info correct? And if yes then that's what I was asking about.

Also the reply by DannyHamilton is pretty much about the same thing:

when miner divide the work to each gpu,
does it divide in a way that they won't overlap?

In most cases, I would expect that the mining software would simply build completely different blocks for each, rather than trying to split up nonce range.

And one more thing. I think that there are so many variants of possible nonces that being picked randomly they almost never overlap.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4166


View Profile
April 21, 2018, 12:42:47 PM
 #11

That's right, but I heard in a lecture on Bitcoin mining that in case a miner can't guess the needed nonce for too long it includes more transactions in the block(or excludes some of them) to change the Merkle root and to start guessing nonces for the new one. Is that info correct? And if yes then that's what I was asking about.
That's correct. Nonce are pretty limited since they are only essentially numbers that has a max limit of 4 bytes.

However, I suspect that it won't be the first data that they would change when the nonce is exhausted. The block header consists of merkle root, hash of last block, target, time stamp, version and nonce. Of them, the merkle root, timestamp and nonce are pretty variable. The miner would likely change the timestamp and the nonce first before trying to change the merkle root. The miners aren't fond of changing the merkle root first as it takes additional computing power.

Changing the merkle root doesn't mean that they will include/exclude any transactions. The miner can simply change the order of the transactions or extra nonce to change the witness commitment and the merkle root.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Xynerise
Sr. Member
****
Offline Offline

Activity: 322
Merit: 363

39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD


View Profile
April 21, 2018, 02:08:28 PM
 #12

The miner can simply change the order of the transactions or extra nonce to change the witness commitment and the merkle root.

Changing the order of transactions in a block that has a segwit transaction is actually hard, as the miner would have to recompute the witness transaction IDs stored in the Coinbase transaction
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!