All Projects → sebastianst → GenesisZ

sebastianst / GenesisZ

Licence: GPL-3.0 License
Mine the Genesis Block for your Zcashy altcoin

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to GenesisZ

php-proxy-stratum
ReactPHP stratum+tcp proxy between miners and pools with database and frontend.
Stars: ✭ 36 (+63.64%)
Mutual labels:  mining
VeinMiner
Minecraft Bukkit/Spigot/Paper plugin with Fabric client side mod. Mine multiple blocks of the same type in quick succession.
Stars: ✭ 67 (+204.55%)
Mutual labels:  mining
focus-outside
📦 一个很棒的 clickOutside 库,它解决了 iframe 无法触发 clickOutside 的问题,并且它支持分组绑定处理。A good clickOutside library, which solves the problem that iframe cannot trigger clickOutside, and it supports grouping binding processing.
Stars: ✭ 74 (+236.36%)
Mutual labels:  solver
FirstOrderSolvers.jl
Large scale convex optimization solvers in julia
Stars: ✭ 20 (-9.09%)
Mutual labels:  solver
minerchk
Bash script to Check for malicious Cryptomining
Stars: ✭ 36 (+63.64%)
Mutual labels:  mining
Bismuth-FAQ
[Reference] Official Bismuth Crypto-currency FAQs
Stars: ✭ 13 (-40.91%)
Mutual labels:  mining
charnapool
High performance Node.js (with native C addons) mining pool for Cryptonote based coins, optimized for Charnacoin.
Stars: ✭ 25 (+13.64%)
Mutual labels:  mining
SilentXMRMiner
A Silent (Hidden) Monero (XMR) Miner Builder
Stars: ✭ 417 (+1795.45%)
Mutual labels:  mining
Totsu
First-order conic solver for convex optimization problems
Stars: ✭ 18 (-18.18%)
Mutual labels:  solver
zepio
Zepio | ZEC Wallet
Stars: ✭ 40 (+81.82%)
Mutual labels:  zcash
duckcoin
WIP: A cryptocurrency made from scratch, with unique ease of mining. Duckcoin's code has a focus on readability.
Stars: ✭ 35 (+59.09%)
Mutual labels:  mining
morpheus
Red pill or blue pill? - A collection of Desmos testnets
Stars: ✭ 22 (+0%)
Mutual labels:  genesis
stiff3
Adaptive solver for stiff systems of ODEs using semi-implicit Runge-Kutta method of third order
Stars: ✭ 13 (-40.91%)
Mutual labels:  solver
destatiscleanr
Imports and cleans data from official German statistical offices to jump-start the data analysis
Stars: ✭ 47 (+113.64%)
Mutual labels:  genesis
SWARM
Profit Switching Mining Administrator For HiveOS/Linux & Windows: HiveOS Integrated
Stars: ✭ 66 (+200%)
Mutual labels:  mining
Alpha
A lazy-grounding Answer-Set Programming system
Stars: ✭ 44 (+100%)
Mutual labels:  solver
gostcoin
GOST R 34.11-2012 algo, GOST R 34.10-2012 signature
Stars: ✭ 31 (+40.91%)
Mutual labels:  mining
mbsolve
An open-source solver tool for the Maxwell-Bloch equations.
Stars: ✭ 14 (-36.36%)
Mutual labels:  solver
Nonograms
A very fast japan crosswords (aka nonograms) solver and generator
Stars: ✭ 52 (+136.36%)
Mutual labels:  solver
qpmad
ROS-compatible Eigen-based Goldfarb-Idnani quadratic programming solver
Stars: ✭ 41 (+86.36%)
Mutual labels:  solver

GenesisZ

Zcash (forks) genesis block mining script. Runs an external miner for finding valid Equihash solutions. Inspired by GenesisH0, but written from scratch.

Features

  • Modify every parameter that influences the block header hash (see Usage)
  • Support for silent army and tromp equihash solvers.
  • Sensible defaults
  • Placeholders of the form {BTC}, {ETH} or {ZEC} in the TIMESTAMP input string get translated to the currency's latest block number and hash.
  • Uses the python-zcashlib, which is a (still very much unfinished) extension of the well-known python-bitcoinlib.

Getting started

Clone this repo, create a python 3 virtualenv and install dependencies with pip:

git clone --recursive https://github.com/sebastianst/GenesisZ
python3 -m venv GenesisZ
cd GenesisZ
source bin/activate
pip install -r requirements.txt

Make sure you have a working and supported equihash solver. Currently, the silent army GPU solver (only for mainnet and testnet parameters N,k=200,9) and tromp equihash CPU solver are supported.

python-zcashlib submodule

Note that the zcashlib is used as a submodule, since I haven't uploaded it to PyPI yet (and because it's easier for the current interdependent development). That's why you must use the --recursive flag during cloning. When you update this repo, don't forget to update the submodule as well, i.e., run git pull && git submodule update to update.

Examples

Zcash mainnet

Mine the zcash mainnet gensis block with the silentarmy solver by calling

./genesis.py -s "/path/to/sa-solver" -r 5000 -t 1477641360

or cheat, because you already know the right nonce:

./genesis.py -s "/path/to/sa-solver" -n 1257 -t 1477641360

Zcash testnet

This time using Tromp's solver with 4 threads, checking up to 10 nonces.

./genesis.py -c testnet -t 1477648033 -b 0x2007ffff -E 0x1f07ffff -s '/path/to/equihash/equi' -T 4 -r 10

It will find the right solution for nonce 6.

Zcash regtest

Using Tromp's 48,5 solver with

./genesis.py -c regtest -t 1296688602 -b 0x200f0f0f -E 0x1f07ffff -s '/path/to/equihash/eq485' -T 4 -r 10

will find the correct regtest solution for nonce 9.

Zclassic mainnet

Zclassic decided to use a custom extra nonce of 0x1d00ffff. Let's mine their mainnet solution (already setting the right nonce to 0x00...021d) with

./genesis.py -c mainnet -t 1478403829 -E 0x1d00ffff -C Zclassic -z "No taxation without representation. BTC #437541 - 00000000000000000397f175a94dd3f530b957182eb2a9f7b79a44a94a5e0450" -s '/path/to/equihash/equi' -T 4 -n 21d

Usage

usage: genesis.py [-h] [-c {mainnet,testnet,regtest}] [-t TIME] [-C COINNAME]
                  [-z TIMESTAMP] [-Z PSZTIMESTAMP] [-p PUBKEY] [-b BITS]
                  [-E EXTRANONCE] [-V VALUE] [-n NONCE] [-r ROUNDS]
                  [-s SOLVER] [-S {tromp,silentarmy}] [-T THREADS] [-v]

This script uses any Equihash solver to find a solution for the specified
genesis block

optional arguments:
  -h, --help            show this help message and exit
  -c {mainnet,testnet,regtest}, --chainparams {mainnet,testnet,regtest}
                        Select the core chain parameters for PoW limit and
                        parameters N and K.
  -t TIME, --time TIME  unix time to set in block header (defaults to current
                        time)
  -C COINNAME, --coinname COINNAME
                        the coin name prepends the blake2s hash of timestamp
                        in pszTimestamp
  -z TIMESTAMP, --timestamp TIMESTAMP
                        the pszTimestamp found in the input coinbase
                        transaction script. Will be blake2s'd and then
                        prefixed by coin name. Default is Zcash's mainnet
                        pszTimestamp. You may use tokens of the form {XYZ},
                        which will be replaced by the current block index and
                        hash of coin XZY (BTC, ETH or ZEC). Always the latest
                        block is retrieved, regardless of time argument.
  -Z PSZTIMESTAMP, --pszTimestamp PSZTIMESTAMP
                        Specify the pszTimestamp directly. Will ignore options
                        -C and -z
  -p PUBKEY, --pubkey PUBKEY
                        the pubkey found in the output transaction script
  -b BITS, --bits BITS  the target in compact representation, defining a
                        difficulty of 1
  -E EXTRANONCE, --extra-nonce EXTRANONCE
                        Usually, the coinbase script contains the nBits as
                        fixed first data, which in bitcoin is also referred to
                        as extra nonce. This conventional behaviour can be
                        changed by specifying this parameter (not recommended
                        for mainnet, useful for testnet).
  -V VALUE, --value VALUE
                        output transaction value in zatoshi (1 ZEC = 100000000
                        zatoshi)
  -n NONCE, --nonce NONCE
                        nonce to start with when searching for a valid
                        equihash solution; parsed as hex, leading zeros may be
                        omitted.
  -r ROUNDS, --rounds ROUNDS
                        how many nonces to check at most
  -s SOLVER, --solver SOLVER
                        path to solver binary. Currently supported are
                        silentarmy (sa-solver) and Tromp (equi/equi485).
                        Command line arguments may be passed, although that
                        should be unnecessary.
  -S {tromp,silentarmy}, --solver-type {tromp,silentarmy}
                        Set the type of solver explicitly. Otherwise GenesisZ
                        tries to infer the type from the binary name (equi* ->
                        tromp, sa-solver -> silentarmy)
  -T THREADS, --threads THREADS
                        How many CPU threads to use when solving with Tromp.
  -v, --verbose         verbose output

Tromp solver

Make sure to select the right binary with -s when using Tromp's equihash solver:

#threads main/testnet (N,K=200,9) regtest (N,K=48,5)
1 equi1 eq4851
>1 equi eq485

Note that make only builds equi{,1}, so you have to run make eq485{,1} in Tromp's source directory if you need the solver for regtest.

TODO

  • More structured and complete output of intermediate information and results. Currently, you need to specify verbose output to see all necessary information.
  • Use solvers' native APIs instead of reading stdout. None of the supported solvers expose such an API now. Maybe write little C wrapper...
  • Make block number selectable for the TIMESTAMP placeholders. Like {BTC:1234} for block #1234.

License

Released under the GPLv3, see LICENSE file.

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].