Bounty Challenge is a WASM evaluation module for Platform Network. Miners earn rewards by discovering and reporting valid GitHub issues. Issues must be closed with the valid label by project maintainers to qualify for rewards.
IMPORTANT: To receive rewards, you MUST submit issues in this repository (PlatformNetwork/bounty-challenge). Issues submitted directly to other repositories will NOT be counted for rewards.
Before mining, register your GitHub username with your Bittensor hotkey using the CLI:
# Build the CLI
cargo build --release -p bounty-cli
# Register (replace with your values)
./target/release/bounty-cli register \
--hotkey YOUR_SS58_HOTKEY \
--github YOUR_GITHUB_USERNAME \
--signature YOUR_HEX_SIGNATURE \
--timestamp UNIX_TIMESTAMP \
--rpc-url http://VALIDATOR_IP:8080The signature is created by signing the message register_github:{username_lowercase}:{timestamp} with your sr25519 hotkey. The timestamp must be within 5 minutes of the validator's server time.
- Discover valid bugs or issues in eligible repositories
- Submit the issue in this repository (PlatformNetwork/bounty-challenge)
- Wait for project maintainers to review and close the issue with the
validlabel
# View the leaderboard
./target/release/bounty-cli leaderboard --rpc-url http://VALIDATOR_IP:8080
# Check your miner status
./target/release/bounty-cli status --hotkey YOUR_SS58_HOTKEY --rpc-url http://VALIDATOR_IP:8080
# View challenge statistics
./target/release/bounty-cli stats --rpc-url http://VALIDATOR_IP:8080Rewards are distributed based on your weight, which is calculated from your valid issues and star bonuses. See Scoring & Rewards for the full formula.
The bounty-cli binary communicates with Platform Network validators via JSON-RPC.
cargo build --release -p bounty-cli# Show leaderboard (top 50 by default)
bounty-cli leaderboard [--limit N] [--rpc-url URL]
# Register GitHub username with hotkey
bounty-cli register --hotkey HOTKEY --github USERNAME --signature SIG --timestamp TS [--rpc-url URL]
# Check miner status
bounty-cli status --hotkey HOTKEY [--rpc-url URL]
# Show challenge statistics
bounty-cli stats [--rpc-url URL]The --rpc-url flag defaults to http://localhost:8080. You can also set the BOUNTY_RPC_URL environment variable.
This project is a #![no_std] Rust crate compiled to wasm32-unknown-unknown. It implements the Challenge trait from platform-challenge-sdk-wasm and runs inside the Platform Network validator runtime.
flowchart LR
subgraph Validator["Platform Validator"]
Runtime["WASM Runtime"]
Storage["Host Storage"]
Runtime -->|"host_storage_get/set"| Storage
end
subgraph Module["bounty-challenge.wasm"]
Evaluate["evaluate()"]
Routes["handle_route()"]
Weights["get_weights()"]
end
Runtime -->|"loads"| Module
Miner["🧑💻 Miner"] -->|"submit claims"| Evaluate
API["Chain RPC"] -->|"route requests"| Routes
Chain["On-Chain"] -->|"weight queries"| Weights
- WASM Module: Runs inside the validator's sandboxed WASM runtime
- On-Chain Storage: All state persisted via host-provided key/value storage
- Validator Consensus: Multi-validator agreement on issue validity and sync data
- Weight Calculation: Normalized weight assignments for on-chain rewards
- Chain RPC Routes: Leaderboard, stats, registration, claims, and more
# Install WASM target (one-time)
rustup target add wasm32-unknown-unknown
# Build the WASM module
cargo build --release --target wasm32-unknown-unknown
# Output: target/wasm32-unknown-unknown/release/bounty_challenge.wasm
# Build the CLI
cargo build --release -p bounty-cli| Source | Points | Description |
|---|---|---|
| Valid Issue | 1 point | Issue closed with valid label |
| Starred Repo | 0.25 points | Each starred target repository |
Where:
net_points = valid_count + star_bonus - penalty- Weights are normalized to sum to 1.0 across all miners
| Rule | Description |
|---|---|
| Invalid Penalty | max(0, invalid_count - valid_count) |
| Duplicate Penalty | max(0, duplicate_count - valid_count) |
| Zero Weight | If net points ≤ 0, weight = 0 |
All routes are served through the Platform Network validator chain RPC. Access them via:
- HTTP:
GET/POST http://VALIDATOR:8080/challenge/bounty-challenge/<path> - JSON-RPC:
challenge_callmethod athttp://VALIDATOR:8080/rpc
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /leaderboard |
No | Current standings |
| GET | /stats |
No | Challenge statistics |
| GET | /status/:hotkey |
No | Hotkey status and balance |
| POST | /register |
Yes | Register GitHub username with hotkey |
| POST | /claim |
Yes | Claim bounty for resolved issues |
| GET | /issues |
No | List all synced issues |
| GET | /issues/pending |
No | List pending issues |
| GET | /hotkey/:hotkey |
No | Detailed hotkey information |
| POST | /invalid |
Yes | Record an invalid issue |
| POST | /sync/propose |
Yes | Propose synced issue data |
| GET | /sync/consensus |
No | Check sync consensus status |
| POST | /issue/propose |
Yes | Propose issue validity |
| POST | /issue/consensus |
No | Check issue validity consensus |
| GET | /config/timeout |
No | Get timeout configuration |
| POST | /config/timeout |
Yes | Update timeout configuration |
| GET | /get_weights |
No | Normalized weight assignments |
bounty-challenge/
├── Cargo.toml # Workspace + WASM crate config
├── bins/
│ └── bounty-cli/ # CLI binary
│ ├── Cargo.toml
│ └── src/main.rs
├── src/
│ ├── lib.rs # Challenge trait implementation
│ ├── types.rs # Domain types
│ ├── scoring.rs # Weight calculation
│ ├── consensus.rs # Validator consensus
│ ├── validation.rs # Issue validation and claims
│ ├── routes.rs # Route definitions and dispatch
│ ├── api/
│ │ └── handlers.rs # Route handlers
│ └── storage/
│ └── bounty_storage.rs # Host key/value storage
├── docs/ # Documentation
└── .github/workflows/ # CI configuration
# Format code
cargo fmt
# Lint (must target wasm32)
cargo clippy --target wasm32-unknown-unknown
# Check compilation
cargo check --target wasm32-unknown-unknown
# Build CLI only
cargo build -p bounty-cli| Mechanism | Description |
|---|---|
| Valid Label Required | Only issues closed with valid label count |
| Signature Verification | sr25519 signature proves hotkey ownership |
| Author Verification | GitHub username must match issue author |
| First Reporter Wins | Each issue can only be claimed once |
| Validator Consensus | Multiple validators must agree on issue validity |
| Label Protection | GitHub Actions prevent unauthorized label changes |
-
For Miners:
-
Reference:
- Cortex Foundation for the Cortex ecosystem
- Platform Network for the challenge SDK
- Bittensor for the decentralized AI network
Apache-2.0
