Skip to content

404-Repo/404-gen-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

404-gen-commit

Command line tool for the 404 subnet to submit miner solutions.

Installation

pip install -r requirements.txt

Usage

Commit hash of your solution

python commit.py commit-hash \
  --hash <full_40_char_commit_sha> \
  --wallet.name <wallet> \
  --wallet.hotkey <hotkey>

Commit repository reference of your solution

python commit.py commit-repo \
  --repo <owner/repo-name> \
  --wallet.name <wallet> \
  --wallet.hotkey <hotkey>

List all commitments

python commit.py list-all

Options

Option Default Description
--wallet.name required Wallet name
--wallet.hotkey required Wallet hotkey
--wallet.path ~/.bittensor Path to wallet
--subtensor.endpoint finney Subtensor network
--netuid 17 Subnet UID
-v Verbosity: -v INFO, -vv DEBUG

Why Two-Step Submission?

The 404 subnet uses a "king of the hill" competition where submission timing matters — earlier submissions gain priority. We use a commit-reveal scheme with Git's content-addressable hashing:

  1. Commit phase: Submit only your git commit SHA (a cryptographic hash of your code)
  2. Reveal phase: Submit your repository reference so validators can fetch and evaluate your code

The block when you call commit-hash determines your submission timestamp.

Why This Works

Git commit hashes are deterministic — derived from your code, commit message, author info, and timestamps. You cannot find different code that produces the same hash. This means:

  • Your hash commits you to specific code before anyone sees it
  • When you reveal the repo, validators verify the hash matches

Recommended Workflow

# 1. Create your solution in a PRIVATE repository
git add . && git commit -m "My solution"
git log --format="%H" -1
# → a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0 ← full 40-char SHA

# 2. Submit the hash to claim your timestamp
python commit.py commit-hash \
  --hash a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0 \
  --wallet.name miner \
  --wallet.hotkey default

# 3. Make your repo accessible to validators

# 4. Submit the repo reference
python commit.py commit-repo \
  --repo your-username/your-solution \
  --wallet.name miner \
  --wallet.hotkey default

What Breaks the Hash

Avoid these after submitting — they create new commits with different SHAs:

  • git commit --amend
  • git rebase
  • Cherry-picking into a different repo
  • Re-committing the same files (different timestamp = different hash)

About

Command Line Tool for the 404 subnet

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages