Giter VIP home page Giter VIP logo

eradicate2's Introduction

ERADICATE2

usage: ./ERADICATE2 [OPTIONS]

  Input:
    -A, --address           Target address
    -I, --init-code         Init code
    -i, --init-code-file    Read init code from this file

    The init code should be expressed as a hexadecimal string having the
    prefix 0x both when expressed on the command line with -I and in the
    file pointed to by -i if used. Any whitespace will be trimmed. If no
    init code is specified it defaults to an empty string.

  Basic modes:
    --benchmark             Run without any scoring, a benchmark.
    --zeros                 Score on zeros anywhere in hash.
    --letters               Score on letters anywhere in hash.
    --numbers               Score on numbers anywhere in hash.
    --mirror                Score on mirroring from center.
    --leading-doubles       Score on hashes leading with hexadecimal pairs

  Modes with arguments:
    --leading <single hex>  Score on hashes leading with given hex character.
    --matching <hex string> Score on hashes matching given hex string.

  Advanced modes:
    --leading-range         Scores on hashes leading with characters within
                            given range.
    --range                 Scores on hashes having characters within given
                            range anywhere.

  Range:
    -m, --min <0-15>        Set range minimum (inclusive), 0 is '0' 15 is 'f'.
    -M, --max <0-15>        Set range maximum (inclusive), 0 is '0' 15 is 'f'.

  Device control:
    -s, --skip <index>      Skip device given by index.
    -n, --no-cache          Don't load cached pre-compiled version of kernel.

  Tweaking:
    -w, --work <size>       Set OpenCL local work size. [default = 64]
    -W, --work-max <size>   Set OpenCL maximum work size. [default = -i * -I]
    -S, --size <size>       Set number of salts tried per loop.
                            [default = 16777216]

  Examples:
    ./ERADICATE2 -A 0x00000000000000000000000000000000deadbeef -I 0x00 --leading 0
    ./ERADICATE2 -A 0x00000000000000000000000000000000deadbeef -I 0x00 --zeros

  About:
    ERADICATE2 is a vanity address generator for CREATE2 addresses that
	utilizes computing power from GPUs using OpenCL.

    Author: Johan Gustafsson <[email protected]>
    Beer donations: 0x000dead000ae1c8e8ac27103e4ff65f42a4e9203

eradicate2's People

Contributors

johguse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eradicate2's Issues

Option to exit after a certain score or time limit is reached

I'm trying to automate generating salts and I think one easy would be to have a flag to run ERADAICTE2 for a couple hours or until an address with sufficient 0 bytes is found. At the end it should write the best scoring address to a file (or stdout) and then exit. I could grab this output with my deploy script and then not have to do any copy/pasting.

I haven't written any C++ in a while, but if you point me to where this would best fit, I can try to write it.

How to compile

This project looks really interesting! Thanks!

Do you have steps for compiling/installing this? What dependencies are there?

Compatibility with `CreateX` `salt` scheme

Background

CreateX is now live on 56 EVM chains (see also createx.rocks). TL;DR: CreateX is a factory smart contract to make easier and safer usage of the CREATE and CREATE2 EVM opcodes as well as of CREATE3-based (i.e. without an initcode factor) contract creations.

CreateX salt scheme

The full documentation can be viewed here.

CreateX implements some special features:

  1. Permissioned Deploy Protection
  2. Cross-Chain Redeploy Protection

The salt value implements these different safeguarding mechanisms depending on the encoded values in the salt (|| stands for byte-wise concatenation):

=> salt (32 bytes) = 0xbebebebebebebebebebebebebebebebebebebebe||ff||1212121212121212121212
  • The first 20 bytes (i.e. bebebebebebebebebebebebebebebebebebebebe) may be used to implement a permissioned deploy protection by setting them equal to msg.sender,
  • The 21st byte (i.e. ff) may be used to implement a cross-chain redeploy protection by setting it equal to 0x01,
  • The last random 11 bytes (i.e. 1212121212121212121212) allow for $2^{88}$ bits of entropy for mining a salt.

Feature Request

Make ERADICATE2 compatible with CreateX's salt scheme. Cc: @mds1 @Vectorized

Not clear about senders addr needed

Great tool -thank you - one thing not clear about is lack of input flag for the sender expected - that is -

 ./ERADICATE2.x64 -A 0x0000000000000000000000000000000111111111 -I 0x00 --leading 0
Devices:
  GPU0: GeForce GTX 1650 Ti with Max-Q Design, 4101898240 bytes available, 16 compute units

Initializing OpenCL...
  Creating context...OK
  Compiling kernel...OK
  Building program...OK

Running...

  Time:     0s Score:  6 Salt: 0x511ed2354d1def73c740e47db67e709a417f1199f90494208fcc02f15723e4d4 Address: 0x0000001e6745ef4fa01beb82d5482c0e3740462b
  Time:     1s Score:  7 Salt: 0x511ed2354d1def230f70e39bb67e709a417f1199f90494208fcc02f15723e4d4 Address: 0x00000006f96775e3d865526653b20d9242eed2f1
  Time:    13s Score:  8 Salt: 0x511ed2354d1def691217e483b77e709a417f1199f90494208fcc02f15723e4d4 Address: 0x00000000171fc90e47be5170aa7c47cfb2730221

what sender address is being assumed here?

Fails to work on Ubuntu 20.4

Compiling then running gives same empty output each time

$ ./ERADICATE2.x64 -A 0x00000000000000000000000000000000deadbeef -I 0x00 --leading 0
Devices:

don't understand the meaning of the -A parameter

If you use create2 to create a contract address, is there a factory address here? I don't understand the meaning of the - a parameter? I tried to set - A as the factory address. The generated contract address is incorrect

More thoughts on 0 bytes

So it looks like having 5 leading zero bytes is helpful in reducing deployment costs.

Would it be possible to have a pattern that requires the first 5 bytes to be zero and then adds extra score for more zero bytes anywhere else in the address?

[Feature request] Prefix on the salt

Metamorphic is a popular complementary tool, with factories for multiple contracts deployed on mainnet.

To avoid front-running / stealing of selfdestructed addresses (because the functions on the deployed factories are public), they enforce that the first 20bytes of the salt must match the msg.sender.

This is a request to include another input flag, that when non-empty, would be the prefix of the calculated salts.

Benchmark on Apple Silicon M1

./ERADICATE2.x64 -A 0x00000000000000000000000000000000deadbeef -I 0x00 --leading 0 
Devices:
  GPU0: Apple M1, 11453251584 bytes available, 8 compute units

Initializing OpenCL...
  Creating context...OK
  Compiling kernel...OK
  Building program...OK

Running...

  Time:     0s Score:  5 Salt: 0x5f5aafc533c1bcd263179c3c33d2a3e7d73ed9de8e7c0ce2f2d4dcd5bde15450 Address: 0x00000ed354bca8ae0bdb3138aad9dc77b83a6b8a
  Time:     1s Score:  6 Salt: 0x5f5aafc533c1bcb93c979c3d33d2a3e7d73ed9de8e7c0ce2f2d4dcd5bde15450 Address: 0x000000fa2afaf03a385b4a6ad31cfc37b182fc5e
  Time:     6s Score:  7 Salt: 0x5f5aafc533c1bc0b45ce9c4c33d2a3e7d73ed9de8e7c0ce2f2d4dcd5bde15450 Address: 0x00000009af1f04a3edf32096ef68b8a62fff1d62
  Time:    34s Score:  8 Salt: 0x5f5aafc533c1bcbb37849c9a33d2a3e7d73ed9de8e7c0ce2f2d4dcd5bde15450 Address: 0x00000000b6c277bf088bcba0e7d1cdf140f3ee06
Speed: 47.975 MH/s GPU0: 47.975 MH/s

segmentation fault (core dumped)

After adding the dependencies and compiling on Ubuntu, nothing would work. I ran
./ERADICATE2.x64 --benchmark

and got:

Devices:
   GPU0: NVIDIA GeForce 1660 Ti, .....
   GPU1: Intel(R) UHD Graphics .....

Initializing OpenCL...
   Creating context...Segmentation fault (core dumped)

Question

I lost money on profanti - it was hacked. Is this new fork safe? Can't they generate it?

Why is 15 the max?

With --zeros, I'm finding 15 really fast. Why is the max currently bound between 0 and 15 (f)?

./ERADICATE2.x64 -A 0x00000000000000000000000000000000deadbeef -I 0x00 --zeros
Devices:
  GPU0: Intel(R) Gen9 HD Graphics NEO, 26831261696 bytes available, 48 compute units

Initializing OpenCL...
  Creating context...OK
  Compiling kernel...OK
  Building program...OK

Running...

  Time:     1s Score: 14 Salt: 0xcd6ec5f93e88d1d34cb058f487ae3817e455667b9544d9e68c6408d3d89c39c2 Address: 0x7f7ba907683006c4010900093002e00eb503af0c
  Time:     1s Score: 15 Salt: 0xcd6ec5f93e88d17b9e3859f587ae3817e455667b9544d9e68c6408d3d89c39c2 Address: 0x0ed0700bcd0f0704b77480b20240c603030a00e8
Speed: 24.067 MH/s GPU0: 24.067 MH/s

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.