Bitcoin Forum
April 30, 2024, 04:27:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: what do you think about bitcoin hashing function?  (Read 2212 times)
coinprize (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


Invest NASDAQ in Bitcoin


View Profile WWW
July 12, 2013, 08:53:39 PM
 #1

Any mining software or ASIC uses the extraNounce to mine?
We all know that the nounce is 4 byte number which maps to a 32 bytes sha256 output, there's a huge prbability that mining a block may fail if extraNounce is not used. I'm just wondering are those mining software or ASIC machines like BFL using it?


I was thinking about the mining function M(nounce_of_4_bytes) -> 32_bytes_sha256, and looked at the latest block hash "000000000000000fe5ed4fe9d5d6d976e0e567ccc6484835a9761a3bdf9df8f0".

This 32 bytes number is getting smaller and smaller, and the difficuty is gettting a big jump recently (http://bitcoindifficulty.com/), since if no extraNounce were used, the function M will definitely be a injective function, which means, when difficutly gets larger and larger, the mining will definitely has huge probability of failing and more and more frequently, UNLESS extraNounce were used.

Do you agree? What do you guys think about this?

1714494442
Hero Member
*
Offline Offline

Posts: 1714494442

View Profile Personal Message (Offline)

Ignore
1714494442
Reply with quote  #2

1714494442
Report to moderator
1714494442
Hero Member
*
Offline Offline

Posts: 1714494442

View Profile Personal Message (Offline)

Ignore
1714494442
Reply with quote  #2

1714494442
Report to moderator
1714494442
Hero Member
*
Offline Offline

Posts: 1714494442

View Profile Personal Message (Offline)

Ignore
1714494442
Reply with quote  #2

1714494442
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714494442
Hero Member
*
Offline Offline

Posts: 1714494442

View Profile Personal Message (Offline)

Ignore
1714494442
Reply with quote  #2

1714494442
Report to moderator
jaywaka2713
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250


aka 7Strykes


View Profile
July 12, 2013, 10:56:44 PM
 #2

AFAIK no available mining software even uses extraNonce yet... so ASICs and current GPUs aren't doing it either.

kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
July 12, 2013, 11:21:25 PM
 #3

Uh...

Difficulty and nonce are related in such a way that it takes roughly difficulty*232 hashes on average to find a valid block.  Meaning that when the difficulty is 25 million, like it is now, then of every 25 million iterations through the entire 32 bit nonce space, you will find one hash that meets the target criteria.  If that is what you mean by "failing", then we are doing it constantly.

The stock client has used extraNonce forever (at least for the last 2 years that I've been paying attention).  But there are several other variables in the header that can change along the way, and every miner uses them.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
July 12, 2013, 11:28:38 PM
 #4

UNLESS extraNounce were used.

Change the address that receives 25 BTC and u don't need extraNonce.
coinprize (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


Invest NASDAQ in Bitcoin


View Profile WWW
July 13, 2013, 01:34:36 AM
 #5

Uh...

Difficulty and nonce are related in such a way that it takes roughly difficulty*232 hashes on average to find a valid block.  Meaning that when the difficulty is 25 million, like it is now, then of every 25 million iterations through the entire 32 bit nonce space, you will find one hash that meets the target criteria.  If that is what you mean by "failing", then we are doing it constantly.

The stock client has used extraNonce forever (at least for the last 2 years that I've been paying attention).  But there are several other variables in the header that can change along the way, and every miner uses them.

What I mean failing is that given a block header, by hashing from nonce 0 to nonce  2^32, no hash value less than the number required by current difficulty.


coinprize (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


Invest NASDAQ in Bitcoin


View Profile WWW
July 13, 2013, 01:48:04 AM
 #6

UNLESS extraNounce were used.

Change the address that receives 25 BTC and u don't need extraNonce.

You are right, but that's not efficient compare to just +1 on nonce or extranonce

kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
July 13, 2013, 02:05:30 AM
 #7

Uh...

Difficulty and nonce are related in such a way that it takes roughly difficulty*232 hashes on average to find a valid block.  Meaning that when the difficulty is 25 million, like it is now, then of every 25 million iterations through the entire 32 bit nonce space, you will find one hash that meets the target criteria.  If that is what you mean by "failing", then we are doing it constantly.

The stock client has used extraNonce forever (at least for the last 2 years that I've been paying attention).  But there are several other variables in the header that can change along the way, and every miner uses them.

What I mean failing is that given a block header, by hashing from nonce 0 to nonce  2^32, no hash value less than the number required by current difficulty.

Yes, and today, we are failing about 25 million times every 10 minutes.  Difficulty is the number of times that we expect to fail in that task for each block.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
stdset
Hero Member
*****
Offline Offline

Activity: 572
Merit: 506



View Profile
July 13, 2013, 02:29:15 AM
 #8

UNLESS extraNounce were used.

Change the address that receives 25 BTC and u don't need extraNonce.
And there are other ways to make another attempt without using extraNonce: add a transaction to the block, remove a transaction, change their order, change timestamp.

🏰 TradeFortress 🏰
Bitcoin Veteran
VIP
Legendary
*
Offline Offline

Activity: 1316
Merit: 1043

👻


View Profile
July 13, 2013, 05:48:52 AM
 #9

What OP is saying is that the higher the difficulty gets, the more likely a block after looping through all the possible nonce space will not have one that matches the difficulty. A dumb miner would keep repeating that loop and never ever find a block, a smart one would change some other part of the block like extraNonce.
coinprize (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


Invest NASDAQ in Bitcoin


View Profile WWW
July 13, 2013, 04:21:04 PM
 #10

What OP is saying is that the higher the difficulty gets, the more likely a block after looping through all the possible nonce space will not have one that matches the difficulty. A dumb miner would keep repeating that loop and never ever find a block, a smart one would change some other part of the block like extraNonce.

Thanks for the clarification, that's exactly what I meant. And I beleive all mining software needs to be **IMPROVED** such that multi-process or multi-thread distributed on different CPU cores can be mining parallel such that:

For simplest case, if only use nonce and no extraNonce or timestamp change etc,
1. mining process 1 mines [0,2^32/N] of the nonce range
2. mining process 2 mines [2^32/N, 2*(2^32/N)] of the nonce range
3. mining process 3 mines [2*(2^32/N), 3*(2^32/N)] of the nonce range
... ...
N. mining process N mines [(N-1)*(2^32/N), N*(2^32/N)] of the nonce range

oleganza
Full Member
***
Offline Offline

Activity: 200
Merit: 104


Software design and user experience.


View Profile WWW
July 13, 2013, 05:21:16 PM
 #11

Options when nonce overflows:

1. Change extraNonce.
2. Change reward address.
3. Collect new transactions in a new merkle tree (this can be done in parallel to iterating a nonce, so new merkle tree is immediately available when starting from 0). I'm talking about transactions that arrived after you started iterating.
4. Shake your mining box.  Maybe it'll help.

Bitcoin analytics: blog.oleganza.com / 1TipsuQ7CSqfQsjA9KU5jarSB1AnrVLLo
stdset
Hero Member
*****
Offline Offline

Activity: 572
Merit: 506



View Profile
July 13, 2013, 05:29:38 PM
 #12

And I beleive all mining software needs to be **IMPROVED** such that multi-process or multi-thread distributed on different CPU cores can be mining parallel such that:
Have you already reinvented bicycle?

DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 13, 2013, 05:32:30 PM
 #13

Any mining software or ASIC uses the extraNounce to mine?
AFAIK no available mining software even uses extraNonce yet... so ASICs and current GPUs aren't doing it either.

Ever miner back to the 0.1 reference client uses extraNonce.  ExtraNonce is simply a value in the coinbase.  You can put anything in there you want, you could put random values there but all miners put a numeric value and then increment it every time the nonce overflows.  In hindsight it would have made sense to just make nonce a 64 bit value, but that isn't going to change now.


What OP is saying is that the higher the difficulty gets, the more likely a block after looping through all the possible nonce space will not have one that matches the difficulty. A dumb miner would keep repeating that loop and never ever find a block, a smart one would change some other part of the block like extraNonce.

Well by that categorization every single miner that has ever existed (even the basic internal miner in the v0.1 reference client) is "smart" and no miner has every existed (and likely never will exist) which is "dumb".  Not a very useful categorization,  I think the OP is trying to solve a problem which doesn't exist.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
July 13, 2013, 05:35:02 PM
 #14

What OP is saying is that the higher the difficulty gets, the more likely a block after looping through all the possible nonce space will not have one that matches the difficulty. A dumb miner would keep repeating that loop and never ever find a block, a smart one would change some other part of the block like extraNonce.

Thanks for the clarification, that's exactly what I meant. And I beleive all mining software needs to be **IMPROVED** such that multi-process or multi-thread distributed on different CPU cores can be mining parallel such that:

For simplest case, if only use nonce and no extraNonce or timestamp change etc,
1. mining process 1 mines [0,2^32/N] of the nonce range
2. mining process 2 mines [2^32/N, 2*(2^32/N)] of the nonce range
3. mining process 3 mines [2*(2^32/N), 3*(2^32/N)] of the nonce range
... ...
N. mining process N mines [(N-1)*(2^32/N), N*(2^32/N)] of the nonce range

You could do that or you could just do
process 1: extra nonce n, nonce 0 to 2^32
process 2: extra nonce n+1, nonce: 0 to 2^32
process 3: extra nonce n, nonce 0 to 2^32
process 4: extra nonce n+1, nonce: 0 to 2^32

Neither method is any more efficient than the other one.  Neither method is going to find blocks any faster.  In the long run no matter how you change the block header you are only going to find one block solution for every (difficulty)*(2^32).
eleuthria
Legendary
*
Offline Offline

Activity: 1750
Merit: 1007



View Profile
July 13, 2013, 06:16:32 PM
 #15

Solo Mining
========
Solo mining with bitcoind and getwork requires the miner to have bitcoind do any extra legwork (as far as I'm aware).
Solo mining with bitcoind and GBT (I believe is possible) will have the miner editing the extranonce field in the coinbase to create a new merkletree, which gives another 32 bits of nonce space each iteration.
Solo miners can also use a pool server that supports stratum/GBT locally.


Pool Mining
========
Pool mining with GBT or Stratum allow the miner to edit the coinbase with extranonce data to create a new merkletree.  All current miners support this, only the ones that haven't been updated in the last 7 months do not.  They are also able to update nTime as well.

Most stratum pools use a 4-byte ExtraNonce at this time.  This gives 2^64 instead of 2^32 worth of nonce space, not including nTime, which is also by default a part of the stratum (and I believe GBT) protocols.  This means you have 64 bits of nonce space per second (assuming you don't increase nTime faster than real-time).  We are a LONG way from miners able to exhaust that amount of nonce per second.  Additionally, Stratum's ExtraNonce size is a parameter passed during the connection process.  It can be increased much larger assuming the miner software properly implemented the protocol.

RIP BTC Guild, April 2011 - June 2015
stick
Sr. Member
****
Offline Offline

Activity: 441
Merit: 266



View Profile
July 13, 2013, 06:25:37 PM
 #16

3. Collect new transactions in a new merkle tree (this can be done in parallel to iterating a nonce, so new merkle tree is immediately available when starting from 0). I'm talking about transactions that arrived after you started iterating.

This is being done after X iterations anyway. And X is much smaller than 2^32 so nonce does not overflow.

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!