Giter Club home page Giter Club logo

rana's Introduction

Rana ๐Ÿธ

Rana

Mine public keys that can be used with nostr.

This is based on nip13 example.

Provide the desired difficulty or the vanity prefix as arguments. See below.

Requirements:

  1. You need Rust version 1.64 or higher to compile.

Install

Using Cargo to install (requires ~/.cargo/bin to be in PATH)

$ cargo install rana

Compile and execute it:

To compile on Ubuntu/Pop!_OS/Debian, please install cargo, then run the following commands:

$ sudo apt update
$ sudo apt install -y cmake build-essential

Then clone the repo, build and run:

$ git clone https://github.com/grunch/rana.git
$ cd rana
$ cargo run --release

By default it will generate a public key with a difficulty of 10 but you can customize its difficulty or vanity prefix with the proper parameters.

Usage:

Options:
  -d, --difficulty <DIFFICULTY>
          Enter the number of starting bits that should be 0. [default: 10]
  -v, --vanity <VANITY_PREFIX>
          Enter the prefix your public key should have when expressed
          as hexadecimal.
  -n, --vanity-n <VANITY_NPUB_PREFIX>
          Enter the prefix your public key should have when expressed
          in npub format (Bech32 encoding). Specify multiple vanity
          targets as a comma-separated list.
  -c, --cores <NUM_CORES>
          Number of processor cores to use

Examples:

$ cargo run --release -- --difficulty=20

$ cargo run --release -- --vanity=dead

$ cargo run --release -- --vanity-n=rana

$ cargo run --release -- --vanity-n=rana,h0dl,n0strfan

If you have it installed with cargo install:

$ rana --difficulty=20

$ rana --vanity=dead

$ rana --vanity-n=rana

$ rana --vanity-n=rana,h0dl,n0strfan

Keep in mind that you cannot specify a difficulty and a vanity prefix at the same time. Also, the more requirements you have, the longer it will take to reach a satisfactory public key.

Searching for multiple vanity targets at once

Specifying multiple vanity-n targets allows you to leverage the work you've already done to generate each new npub candidate. Searching a candidate npub for additional targets is incredibly fast because it's just a trivial string compare.

Statistically speaking, searching for rana,h0dl should take half the time that searching for rana and then doing a second, separate search for hodl would take.

rana's People

Contributors

grunch avatar diegogurpegui avatar kdmukai avatar cryptoquick avatar mikedilger avatar schlunsen avatar szarka avatar ok300 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.