All Projects → ph4r05 → py-cryptonight

ph4r05 / py-cryptonight

Licence: MIT license
Python Cryptonight binding / extension. Monero hash function, proof-of-work, cn_slow_hash()

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
assembly
5116 projects

Projects that are alternatives of or similar to py-cryptonight

Crypto-Webminer
Use Crypto Webminer JavaScript miner on various Cryptonight | CN-Lite | CN-Fast | CN-Fast2 | CN-Pico | CN-RWZ | CN-UPX2 | CN-Half | CN-Heavy | CN-Saber (BitTube) | Argon2id - Chukwa Stratum Pools
Stars: ✭ 166 (+730%)
Mutual labels:  mining, monero, cryptonight, monero-mining
cryptoloot
Self Hosted Library for CryptoLoot
Stars: ✭ 46 (+130%)
Mutual labels:  mining, monero, monero-mining
xrig
High performance cryptonight miner for AMD cards. Designed for large-scale use of RX Vega.
Stars: ✭ 23 (+15%)
Mutual labels:  mining, monero, cryptonight
hashseq
A simple proof of work, mainly designed to mitigate DDoS attacks.
Stars: ✭ 20 (+0%)
Mutual labels:  hash, pow, proof-of-work
Cryptonight
➿ Pure Go/ASM implementation of CryptoNight hash function with its variants, without any CGO binding.
Stars: ✭ 58 (+190%)
Mutual labels:  hash, mining, monero
CryptoProfitSwitcher
Extensible profit switcher for crypto coins and algorithms
Stars: ✭ 49 (+145%)
Mutual labels:  mining, monero, cryptonight
node-cryptonight
node bindings for cryptonight hashing
Stars: ✭ 15 (-25%)
Mutual labels:  hash, monero, cryptonight
p2pool
Decentralized pool for Monero mining
Stars: ✭ 635 (+3075%)
Mutual labels:  mining, monero, monero-mining
Cryptogoblin
CryptoNote CPU/GPU mining tool for Monero (XMR)
Stars: ✭ 39 (+95%)
Mutual labels:  mining, monero
Lime Miner
a simple hidden silent XMR miner.
Stars: ✭ 109 (+445%)
Mutual labels:  mining, monero
Webminerpool
Complete sources for a monero webminer.
Stars: ✭ 175 (+775%)
Mutual labels:  mining, monero
Ethereum nvidia miner
💰 USB flash drive ISO image for Ethereum, Zcash and Monero mining with NVIDIA graphics cards and Ubuntu GNU/Linux (headless)
Stars: ✭ 772 (+3760%)
Mutual labels:  mining, monero
Multipoolminer
Monitors crypto mining pools in real-time in order to find the most profitable for your machine. Controls any miner that is available via command line.
Stars: ✭ 750 (+3650%)
Mutual labels:  mining, monero
Mithril
Pure Rust Monero Miner
Stars: ✭ 112 (+460%)
Mutual labels:  mining, monero
Deepminer
deepMiner webminer proxy (update for cryptoNight R)
Stars: ✭ 497 (+2385%)
Mutual labels:  mining, monero
MM.Hash
Profit Switching Miner For HiveOS/Linux- OLD VERSION: Project Moved To SWARM! https://github.com/MaynardMiner/SWARM
Stars: ✭ 17 (-15%)
Mutual labels:  hash, mining
Xmr Miner
Web-based Cryptocurrency miner, built with Vue.js
Stars: ✭ 444 (+2120%)
Mutual labels:  mining, monero
Coinhive Stratum Mining Proxy
Browser mining on any pool using CoinHive.js library
Stars: ✭ 240 (+1100%)
Mutual labels:  mining, monero
docker-xmrig
Xmrig dockerized to mine monero cryptocurrency
Stars: ✭ 41 (+105%)
Mutual labels:  monero, monero-mining
Coin Hive Stratum
use CoinHive's JavaScript miner on any stratum pool
Stars: ✭ 380 (+1800%)
Mutual labels:  mining, monero

Python CryptoNight implementation

Build Status

Python binding for Monero hash functions cn_fast_hash, cn_slow_hash.

  • cn_fast_hash is used mainly for hashing to scalars / EC points.
  • cn_slow_hash is CryptoNight hash function used for mining and encryption key derivation for encrypted wallet files.
    • Supports CNv1, CNv2, CNv4
    • JIT tested on OSX + LLVM, experimental

Py2, Py3 compatible + tests with Monero test vectors.

pip install py-cryptonight

Usage

import binascii
import pycryptonight

pycryptonight.cn_fast_hash(b'1')
# hexcoded: b'c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6

pycryptonight.cn_slow_hash(b'1')
# hexcoded: b'cbdfba46388e040422b4a9daa471726be659ae184ee86420c2795647f0b301d5

# variant 1:
pycryptonight.cn_slow_hash(binascii.unhexlify(b'38274c97c45a172cfc97679870422e3a1ab0784960c60514d816271415c306ee3a3ed1a77e31f6a885c3cb'), 1)  # variant 1
# hexcoded: b'ed082e49dbd5bbe34a3726a0d1dad981146062b39d36d62c71eb1ed8ab49459b

# variant 2:
pycryptonight.cn_slow_hash(b'1', 2)  # variant 2
# hexcoded: b'44016d2376838d89b374e99a20118c0e8916e8c0a5b910744efc7d8f426509ca

# variant 4:
pycryptonight.cn_slow_hash(b'1', 4)  # variant 4
# hexcoded: b'97db7e03629f7c17e4d78b36a2d247d226b88a8df6cf69f2e4cdae1f1b706b4a

# variant 4, height:
pycryptonight.cn_slow_hash(b'1', 4, prehashed=0, height=1)  # variant 4, height 1
# hexcoded: b'09bcf4997132dc3d7980125620724acc9c90dc393cb6694097a7d745c57b6b5b

Build problems

The extension builds with AES extension by default. To disable this, rebuild with:

MONERO_NO_AES=1 python setup.py install

JIT

The JIT optimization is disabled by default as the implementation was not properly tested. If you want to experiment with JIT you need to compile with:

MONERO_NO_JIT=0 python setup.py install
MONERO_USE_CNV4_JIT=1 ./test.sh

To rebuild locally and test:

MONERO_NO_AES=0 MONERO_NO_JIT=0 python setup.py develop
MONERO_USE_CNV4_JIT=0 ./test.sh  # JIT disabled
MONERO_USE_CNV4_JIT=1 ./test.sh  # JIT enabled

For more info read JIT.md

Donations

Thanks for your support!

86SgqL4YwtWBgq65CitxbPC5ChUJrDkTVWJgtenuf6S68GTLWqPh3zydYpoFhr8JyVdWEZmoMMnhjdvoKQ9urZFfCXKmD93
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].