Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore scrypt8k #199

Closed
JayDDee opened this issue Jul 21, 2019 · 5 comments
Closed

Explore scrypt8k #199

JayDDee opened this issue Jul 21, 2019 · 5 comments

Comments

@JayDDee
Copy link
Owner

JayDDee commented Jul 21, 2019

Scrypt8k uses parameters: N=8192, R=8, p=1.
The current scrypt code can handle different N values but R and P are hard coded at 1.

The following is an unoptimized version of scrypt with a variable R parameter.

https://git.xmr.pm/wownero/node-multi-hashing/src/branch/master/scryptn.c

Explore whether the optimized Pooler code in cpuminer-opt can be modified to support
different R values.

@JayDDee
Copy link
Owner Author

JayDDee commented Jul 24, 2019

As expected the Pooler code has lost a lot of structure due to its extreme optimization.
Whether there is enough structure left to implement variable R parameter is still unknown.
Even if possible it may require some restructuring that would likely affect performance.
Hopefully it only affects buffer sizes and loop counters that exist in both implementations.
More analysis is required.

I've identified the following locations that use the R parametrer.

  • the size of the scratchpad
  • PBKDF2 SHA256 block length
  • scrypt core/smix

@JayDDee
Copy link
Owner Author

JayDDee commented Jul 31, 2019

Things are not looking good for using the existing Pooler scrypt code with a variable R.
It is optimized for a fixed R value. Suppporting multiple R values woudl require seperate
copies of the code, each one optimized for one R value. That would not be acceptible.

Modifying the Pooler code to support variable R would likely have a performance impact and
would also be unacceptible, even if possible.

At this time the only option appears to be to import the Wonero scrypt code to support
scrypt variations where R != 1 at significantly reduced performance.

Although importing code without optimizing is not consistent with the primary goal of cpuminer-opt
it does offer some forward compatibility with future variations of scrypt using different R values
and is worth considering.

@JayDDee
Copy link
Owner Author

JayDDee commented Aug 1, 2019

More problems.

I can't get the Wonero code to work with scrypt (1024, 1, 1). I replaced the Pooler hash function
with Wonero and all I got was invalid shares. Since the 2 functions are so dissimilar there are
no common test points to collect debug data for comparison.

At this point I'm stuck.

@JayDDee
Copy link
Owner Author

JayDDee commented Aug 28, 2019

I'm thinking of abandoning this enhancement due to lack of interest. I can't find a single pool
supporting this algo. Also without a working reference the chances of success are very low.

Unless these problems are resolved shortly this isue will be closed.

@JayDDee
Copy link
Owner Author

JayDDee commented Sep 3, 2019

Closed.

@JayDDee JayDDee closed this as completed Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant