Skip to content

๐Ÿš€ A blazingly fast, parallel CapJS proof-of-work solver implemented in Rust (Powered By Claude)

License

Notifications You must be signed in to change notification settings

liuzhen9320/capjs-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ›๏ธ CapJS Proof-of-Work Solver CLI

๐Ÿš€ A blazingly fast, parallel Capjs proof-of-work solver implemented in Rust

โœจ Features

  • ๐ŸŽฏ Single Challenge Solving: Solve individual proof-of-work challenges with precision
  • ๐Ÿ“ฆ Batch Processing: Generate and solve thousands of challenges in parallel
  • ๐Ÿ”ง JSON Support: Import/export challenges in structured JSON format
  • ๐Ÿงต Multi-threading: Configurable worker threads for maximum CPU utilization
  • ๐Ÿ“Š Progress Tracking: Beautiful progress bars with ETA for long operations
  • ๐ŸŽจ Flexible Output: Choose between plain text, JSON, or pretty-printed formats
  • โšก Zero-Copy Operations: Optimized buffer operations for maximum performance
  • ๐Ÿ”’ SHA-256 Hashing: Industry-standard cryptographic hashing

๐Ÿ› ๏ธ Installation

From Source

git clone https://github.com/liuzhen9320/capjs-cli.git
cd capjs-cli
cargo install --path .

Pre-built Binaries

Download the latest release from our GitHub Releases page.

๐Ÿš€ Quick Start

๐ŸŽฏ Solve a Single Challenge

# Basic usage
pow-solver single --salt "a5b6fda4aaed97cf61d7dd9259f733b5" --target "d455"

# Output:
# Salt: a5b6fda4aaed97cf61d7dd9259f733b5
# Target: d455
# Nonce: 67302
# Duration: 371.226518 ms

๐Ÿ“ฆ Generate and Solve Multiple Challenges

# Standard web page validation. The data here can be obtained from the http://API_HOST/API_KEY/challenge endpoint
pow-solver multi -c 50 -d 4 -s 32 -t 4097a4371e6852602a1b7d91bd4eccf5e356365756fef135b9

# More scientific, using JSON output for easier parsing
pow-solver multi -c 50 -d 4 -s 32 -t 4097a4371e6852602a1b7d91bd4eccf5e356365756fef135b9 -o json

๐ŸŽจ Output Formats

Plain Text (Default)

Challenge 0: salt=a1b2c3, target=000012, nonce=87654, duration=0.234s
Challenge 1: salt=d4e5f6, target=000034, nonce=12345, duration=0.456s

JSON Compact

[
  {
    "challenge_index": 0,
    "salt": "a1b2c3",
    "target": "000012",
    "nonce": 87654,
    "duration": 0.234
  }
]

JSON Pretty

[
  {
    "challenge_index": 0,
    "salt": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
    "target": "000012",
    "nonce": 87654,
    "duration": 0.234
  }
]

โš™๏ธ Command Reference

๐ŸŽฏ single - Solve Single Challenge

Flag Description Example
-s, --salt Salt string for hashing --salt "mysalt123"
-t, --target Target hex prefix --target "00000a"

๐Ÿ“ฆ multi - Batch Processing

Flag Default Description
-t, --challenge Required Seed token for generation
-c, --count 1 Number of challenges
-s, --salt-length 32 Generated salt length
-d, --target-length 6 Target difficulty length
-w, --workers 0 Worker threads (0=auto)
-o, --output plain Output format

๐Ÿ“‹ json - JSON Input Mode

Flag Default Description
-i, --input Required JSON challenge array
-w, --workers 0 Worker threads (0=auto)

๐Ÿงฎ Difficulty Guide

Understanding target difficulty:

Length Avg Attempts Difficulty Use Case
3 ~4K ๐ŸŸข Easy Development/Testing
4 ~65K ๐ŸŸก Medium Small-scale mining
5 ~1M ๐ŸŸ  Hard Production use
6 ~16M ๐Ÿ”ด Very Hard High security
7 ~268M โšซ Extreme Enterprise/Research

๐Ÿ’ก Tip: Each additional hex character increases difficulty by ~16x

๐Ÿค Contributing

We welcome contributions!

๐Ÿ› Found a Bug?

  1. ๐Ÿ” Check existing issues
  2. ๐Ÿ“ Create a detailed bug report
  3. ๐Ÿท๏ธ Add appropriate labels

๐Ÿ’ก Feature Requests

  1. ๐Ÿ’ญ Open an issue with the "enhancement" label
  2. ๐Ÿ“‹ Describe the use case and benefits
  3. ๐Ÿค Discuss implementation approaches

Third-Party Libraries Used

@cap.js/wasm

This project uses this library and complies with the requirements of the Apache-2.0 license. The full license text is included in the appendix.

About

๐Ÿš€ A blazingly fast, parallel CapJS proof-of-work solver implemented in Rust (Powered By Claude)

Topics

Resources

License

Stars

Watchers

Forks

Languages