public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [Bitcoin-development] Deprecating "midstate" in getwork?
@ 2011-09-26 19:42 Nils Schneider
  2011-09-28  3:45 ` Jeff Garzik
  2011-09-29 10:23 ` John Smith
  0 siblings, 2 replies; 8+ messages in thread
From: Nils Schneider @ 2011-09-26 19:42 UTC (permalink / raw)
  To: bitcoin-development

Hey,

I'd like to simplify the internal reference miner and remove all
dependencies on cryptopp (it's the only place we use cryptopp instead of
OpenSSL).

Unfortunately, cryptopp is also used to calculate getwork "midstate".
This field is redundant and the miner could easily calculate it from the
blockheader so I'd like to remove it.

Any thoughts? Where should such a change should be announced so all
miners can be upgraded?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bitcoin-development] Deprecating "midstate" in getwork?
  2011-09-26 19:42 [Bitcoin-development] Deprecating "midstate" in getwork? Nils Schneider
@ 2011-09-28  3:45 ` Jeff Garzik
  2011-09-28  3:54   ` Luke-Jr
  2011-09-29 10:23 ` John Smith
  1 sibling, 1 reply; 8+ messages in thread
From: Jeff Garzik @ 2011-09-28  3:45 UTC (permalink / raw)
  To: Nils Schneider; +Cc: bitcoin-development

On Mon, Sep 26, 2011 at 3:42 PM, Nils Schneider <nils@nilsschneider•net> wrote:
> I'd like to simplify the internal reference miner and remove all
> dependencies on cryptopp (it's the only place we use cryptopp instead of
> OpenSSL).
>
> Unfortunately, cryptopp is also used to calculate getwork "midstate".
> This field is redundant and the miner could easily calculate it from the
> blockheader so I'd like to remove it.
>
> Any thoughts? Where should such a change should be announced so all
> miners can be upgraded?

I think one of the pools was already working on something like that?
I'm pretty sure it can be removed, and I'm pretty sure somebody has
already field-tested that guess.
-- 
Jeff Garzik
exMULTI, Inc.
jgarzik@exmulti•com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bitcoin-development] Deprecating "midstate" in getwork?
  2011-09-28  3:45 ` Jeff Garzik
@ 2011-09-28  3:54   ` Luke-Jr
  0 siblings, 0 replies; 8+ messages in thread
From: Luke-Jr @ 2011-09-28  3:54 UTC (permalink / raw)
  To: bitcoin-development

On Tuesday, September 27, 2011 11:45:48 PM Jeff Garzik wrote:
> On Mon, Sep 26, 2011 at 3:42 PM, Nils Schneider <nils@nilsschneider•net> 
wrote:
> > I'd like to simplify the internal reference miner and remove all
> > dependencies on cryptopp (it's the only place we use cryptopp instead of
> > OpenSSL).
> > 
> > Unfortunately, cryptopp is also used to calculate getwork "midstate".
> > This field is redundant and the miner could easily calculate it from the
> > blockheader so I'd like to remove it.
> > 
> > Any thoughts? Where should such a change should be announced so all
> > miners can be upgraded?
> 
> I think one of the pools was already working on something like that?
> I'm pretty sure it can be removed, and I'm pretty sure somebody has
> already field-tested that guess.

I tested removing midstate myself, and found at least one miner (cpuminer 
IIRC) requires it.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bitcoin-development] Deprecating "midstate" in getwork?
  2011-09-26 19:42 [Bitcoin-development] Deprecating "midstate" in getwork? Nils Schneider
  2011-09-28  3:45 ` Jeff Garzik
@ 2011-09-29 10:23 ` John Smith
  2011-09-29 11:40   ` Nils Schneider
  1 sibling, 1 reply; 8+ messages in thread
From: John Smith @ 2011-09-29 10:23 UTC (permalink / raw)
  To: Nils Schneider; +Cc: bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 1358 bytes --]

Nils,

Sounds good. I'm also doubtful of depending on two crypto libraries when
OpenSSL does perfectly well.

However, losing compatibility with miners is not very nice. Is there really
not a way to compute midstate with OpenSSL?

JS

On Mon, Sep 26, 2011 at 7:42 PM, Nils Schneider <nils@nilsschneider•net>wrote:

> Hey,
>
> I'd like to simplify the internal reference miner and remove all
> dependencies on cryptopp (it's the only place we use cryptopp instead of
> OpenSSL).
>
> Unfortunately, cryptopp is also used to calculate getwork "midstate".
> This field is redundant and the miner could easily calculate it from the
> blockheader so I'd like to remove it.
>
> Any thoughts? Where should such a change should be announced so all
> miners can be upgraded?
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>

[-- Attachment #2: Type: text/html, Size: 1935 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bitcoin-development] Deprecating "midstate" in getwork?
  2011-09-29 10:23 ` John Smith
@ 2011-09-29 11:40   ` Nils Schneider
  2011-09-29 11:48     ` Stefan Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: Nils Schneider @ 2011-09-29 11:40 UTC (permalink / raw)
  To: John Smith; +Cc: bitcoin-development

Yes, that's possible and what
https://github.com/bitcoin/bitcoin/pull/535 does. However, deprecating
midstate (and hash1) would allow for much cleaner code.

A pull request for marking midstate (and hash1) as deprecated can be
found at https://github.com/bitcoin/bitcoin/pull/538

On 29.09.2011 12:23, John Smith wrote:
> Nils,
> 
> Sounds good. I'm also doubtful of depending on two crypto libraries when
> OpenSSL does perfectly well.
> 
> However, losing compatibility with miners is not very nice. Is there
> really not a way to compute midstate with OpenSSL?
> 
> JS
> 
> On Mon, Sep 26, 2011 at 7:42 PM, Nils Schneider <nils@nilsschneider•net
> <mailto:nils@nilsschneider•net>> wrote:
> 
>     Hey,
> 
>     I'd like to simplify the internal reference miner and remove all
>     dependencies on cryptopp (it's the only place we use cryptopp instead of
>     OpenSSL).
> 
>     Unfortunately, cryptopp is also used to calculate getwork "midstate".
>     This field is redundant and the miner could easily calculate it from the
>     blockheader so I'd like to remove it.
> 
>     Any thoughts? Where should such a change should be announced so all
>     miners can be upgraded?
> 
>     ------------------------------------------------------------------------------
>     All the data continuously generated in your IT infrastructure contains a
>     definitive record of customers, application performance, security
>     threats, fraudulent activity and more. Splunk takes this data and makes
>     sense of it. Business sense. IT sense. Common sense.
>     http://p.sf.net/sfu/splunk-d2dcopy1
>     _______________________________________________
>     Bitcoin-development mailing list
>     Bitcoin-development@lists•sourceforge.net
>     <mailto:Bitcoin-development@lists•sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/bitcoin-development
> 
> 




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bitcoin-development] Deprecating "midstate" in getwork?
  2011-09-29 11:40   ` Nils Schneider
@ 2011-09-29 11:48     ` Stefan Thomas
  2011-09-29 12:49       ` solar
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Thomas @ 2011-09-29 11:48 UTC (permalink / raw)
  To: bitcoin-development

BitcoinJS uses OpenSSL to calculate midstate:

https://github.com/bitcoinjs/node-bitcoin-p2p/blob/master/native.cc#L380


On 9/29/2011 1:40 PM, Nils Schneider wrote:
> Yes, that's possible and what
> https://github.com/bitcoin/bitcoin/pull/535 does. However, deprecating
> midstate (and hash1) would allow for much cleaner code.
>
> A pull request for marking midstate (and hash1) as deprecated can be
> found at https://github.com/bitcoin/bitcoin/pull/538
>
> On 29.09.2011 12:23, John Smith wrote:
>> Nils,
>>
>> Sounds good. I'm also doubtful of depending on two crypto libraries when
>> OpenSSL does perfectly well.
>>
>> However, losing compatibility with miners is not very nice. Is there
>> really not a way to compute midstate with OpenSSL?
>>
>> JS
>>
>> On Mon, Sep 26, 2011 at 7:42 PM, Nils Schneider<nils@nilsschneider•net
>> <mailto:nils@nilsschneider•net>>  wrote:
>>
>>      Hey,
>>
>>      I'd like to simplify the internal reference miner and remove all
>>      dependencies on cryptopp (it's the only place we use cryptopp instead of
>>      OpenSSL).
>>
>>      Unfortunately, cryptopp is also used to calculate getwork "midstate".
>>      This field is redundant and the miner could easily calculate it from the
>>      blockheader so I'd like to remove it.
>>
>>      Any thoughts? Where should such a change should be announced so all
>>      miners can be upgraded?
>>
>>      ------------------------------------------------------------------------------
>>      All the data continuously generated in your IT infrastructure contains a
>>      definitive record of customers, application performance, security
>>      threats, fraudulent activity and more. Splunk takes this data and makes
>>      sense of it. Business sense. IT sense. Common sense.
>>      http://p.sf.net/sfu/splunk-d2dcopy1
>>      _______________________________________________
>>      Bitcoin-development mailing list
>>      Bitcoin-development@lists•sourceforge.net
>>      <mailto:Bitcoin-development@lists•sourceforge.net>
>>      https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>
>>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bitcoin-development] Deprecating "midstate" in getwork?
  2011-09-29 11:48     ` Stefan Thomas
@ 2011-09-29 12:49       ` solar
  2011-10-02  7:52         ` John Smith
  0 siblings, 1 reply; 8+ messages in thread
From: solar @ 2011-09-29 12:49 UTC (permalink / raw)
  To: bitcoin-development

It's just simple SHA2, you can implement the whole thing easily without dragging in a huge lib like OpenSSL.  I guess I haven't looked at it recently but the original CPU miner was just implemented locally in bitcoin and didn't use any libs.

It's just that because it's block based, there is no need to ever recalculate the first half since the brute forcing value is in the second half of the block..

This was the original prototype for the OpenCL miner without eliminating redundant calculations and it shows the block1 and block2 calculations clearly.

http://heliacal.net/~solar/bitcoin/sha256.cl

Laszlo

On Sep 29, 2011, at 11:48 AM, Stefan Thomas wrote:

> BitcoinJS uses OpenSSL to calculate midstate:
> 
> https://github.com/bitcoinjs/node-bitcoin-p2p/blob/master/native.cc#L380
> 
> 
> On 9/29/2011 1:40 PM, Nils Schneider wrote:
>> Yes, that's possible and what
>> https://github.com/bitcoin/bitcoin/pull/535 does. However, deprecating
>> midstate (and hash1) would allow for much cleaner code.
>> 
>> A pull request for marking midstate (and hash1) as deprecated can be
>> found at https://github.com/bitcoin/bitcoin/pull/538
>> 
>> On 29.09.2011 12:23, John Smith wrote:
>>> Nils,
>>> 
>>> Sounds good. I'm also doubtful of depending on two crypto libraries when
>>> OpenSSL does perfectly well.
>>> 
>>> However, losing compatibility with miners is not very nice. Is there
>>> really not a way to compute midstate with OpenSSL?
>>> 
>>> JS
>>> 
>>> On Mon, Sep 26, 2011 at 7:42 PM, Nils Schneider<nils@nilsschneider•net
>>> <mailto:nils@nilsschneider•net>>  wrote:
>>> 
>>>     Hey,
>>> 
>>>     I'd like to simplify the internal reference miner and remove all
>>>     dependencies on cryptopp (it's the only place we use cryptopp instead of
>>>     OpenSSL).
>>> 
>>>     Unfortunately, cryptopp is also used to calculate getwork "midstate".
>>>     This field is redundant and the miner could easily calculate it from the
>>>     blockheader so I'd like to remove it.
>>> 
>>>     Any thoughts? Where should such a change should be announced so all
>>>     miners can be upgraded?
>>> 
>>>     ------------------------------------------------------------------------------
>>>     All the data continuously generated in your IT infrastructure contains a
>>>     definitive record of customers, application performance, security
>>>     threats, fraudulent activity and more. Splunk takes this data and makes
>>>     sense of it. Business sense. IT sense. Common sense.
>>>     http://p.sf.net/sfu/splunk-d2dcopy1
>>>     _______________________________________________
>>>     Bitcoin-development mailing list
>>>     Bitcoin-development@lists•sourceforge.net
>>>     <mailto:Bitcoin-development@lists•sourceforge.net>
>>>     https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>>> 
>>> 
>> 
>> ------------------------------------------------------------------------------
>> All the data continuously generated in your IT infrastructure contains a
>> definitive record of customers, application performance, security
>> threats, fraudulent activity and more. Splunk takes this data and makes
>> sense of it. Business sense. IT sense. Common sense.
>> http://p.sf.net/sfu/splunk-d2dcopy1
>> _______________________________________________
>> Bitcoin-development mailing list
>> Bitcoin-development@lists•sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bitcoin-development
>> 
> 
> 
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> Bitcoin-development mailing list
> Bitcoin-development@lists•sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bitcoin-development




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bitcoin-development] Deprecating "midstate" in getwork?
  2011-09-29 12:49       ` solar
@ 2011-10-02  7:52         ` John Smith
  0 siblings, 0 replies; 8+ messages in thread
From: John Smith @ 2011-10-02  7:52 UTC (permalink / raw)
  To: solar; +Cc: bitcoin-development

[-- Attachment #1: Type: text/plain, Size: 491 bytes --]

On Thu, Sep 29, 2011 at 12:49 PM, solar <solar@heliacal•net> wrote:

> It's just simple SHA2, you can implement the whole thing easily without
> dragging in a huge lib like OpenSSL.  I guess I haven't looked at it
> recently but the original CPU miner was just implemented locally in bitcoin
> and didn't use any libs.
>

I don't get the 'dragging in' part. Bitcoin already depends on OpenSSL for
ecdsa, bignum, and SSL for RPC. Please, please don't try to reimplement
these locally :-)

JS

[-- Attachment #2: Type: text/html, Size: 770 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-02  7:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-26 19:42 [Bitcoin-development] Deprecating "midstate" in getwork? Nils Schneider
2011-09-28  3:45 ` Jeff Garzik
2011-09-28  3:54   ` Luke-Jr
2011-09-29 10:23 ` John Smith
2011-09-29 11:40   ` Nils Schneider
2011-09-29 11:48     ` Stefan Thomas
2011-09-29 12:49       ` solar
2011-10-02  7:52         ` John Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox