Coder Social home page Coder Social logo

libcryptohive's Introduction

libcryptohive

A CoinHive-compatible CryptoNight hashing library
Now support variant 2!

NOT MAINTAINED ANYMORE

CoinHive is now closed down.

What?

Since the April 7 Monero hard fork, CoinHive's script no longer submits the correct hash to a non-CoinHive pool.
This caused all the "CoinHive proxy" software to stop working (see here).
After analyzing the code, I found the source of the hash error: the CryptoNight library implemented by CoinHive is not standard.
For example, for
blob = 0707998e9edc055c022dd408ffe8e243fe9e6fb24a63c18873f492e34ffd2d0df6e8f569b00080a0d1d017dcc6117b6a0720cb4e780fcc1f4b35f95febda8ae9801
nonce = 0b100000
The correct result should be
result = 032fe2ad6afbadc7e1ef7be11da918f4702ca4491242836020d3d05cc8d71100
The result of CoinHive implementation is
result = 346ba98c32de42306f963abc8f1d896e762e6aa599fc3930fe82c8c3f4ac351a
However, this part of the code is compiled into a WebAssembly file(Download Download no longer available), which is difficult to analyze.
So I created this repo to transform the WebAssembly file into a library available in other languages.

Usage

Important note: I do not guarantee that it can compile correctly, run correctly, calculate correctly, and so on.
I only tested it on my own computer (Win10 x64, MinGW-w64, CoinHive 'worker-v8.wasm').

Just compile all C files together to generate a .dll / .so file.
Turn on -O3 for better (about 7x) performance.
See libcryptohive.h and Tests/Test*.c for details.

License

wasm-rt* files from wasm2c: Apache License 2.0
Other files: GLWTPL

libcryptohive's People

Contributors

ezforever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.