Full lesson
Gradientmine
What it does
From the project README:
GradientMine turns model improvement into an outcome market. A task owner freezes the parent model, metric, minimum useful delta, evaluator, deadline and reward. Independent workers submit bounded model updates. After cutoff, a named evaluator scores every admitted candidate on the same held-out set and selects the best eligible fix. Solana handles escrow and settlement; model files and evaluation stay off-chain.
- Original
- kapasainitishreddy/Gradientmine
- SuperStack fork
- Blockchains/Gradientmine @
442cb50 - Stars
- 0
- Last push (original)
- 2026-10-28
- Languages
- Python, HTML, JavaScript, CSS, Rust, Dockerfile
- Detected stack
- Native Rustsolana-py
- Categories
- Other
- Licence
- MIT
Architecture
52 source files. By extension: .py ×51, .rs ×1.
| Top-level directory | Source files |
|---|---|
gradientmine | 20 |
tests | 17 |
scripts | 9 |
submission | 4 |
program | 1 |
.github | 1 |
Dapp: devnet deploy pending
⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/gradientmine/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
program/src/lib.rs L181–204 @ 442cb50 · MIT · original require(arr(data, 1)? != [0; 32] && arr(data, 33)? != [0; 32])?; let (expected, bump) = Pubkey::find_program_address(&[b"submission", account.key.as_ref(), worker.key.as_ref()], program); require(expected == *submission.key)?; allocate_pda(program, worker, submission, system, &[b"submission", account.key.as_ref(), worker.key.as_ref(), &[bump]], SUBMISSION_SIZE, 0)?; let mut bytes = submission.try_borrow_mut_data()?; bytes[..8].copy_from_slice(SUB_MAGIC); bytes[8..40].copy_from_slice(account.key.as_ref()); bytes[40..72].copy_from_slice(worker.key.as_ref()); bytes[72..104].copy_from_slice(&data[1..33]); bytes[104..136].copy_from_slice(&data[33..65]); bytes[136..144].copy_from_slice(&now.to_le_bytes()); bounty.count = bounty.count.checked_add(1).ok_or_else(bad)?; bounty.encode(&mut account.try_borrow_mut_data()?) } Some(2) => { require(data.len() == 65 && accounts.len() == 4)?; let validator = next_account_info(&mut iter)?; let account = next_account_info(&mut iter)?; let worker = next_account_info(&mut iter)?; let submission = next_account_info(&mut iter)?; signer(validator)?; let mut bounty = load_bounty(program, account)?; bounty.can_settle(Clock::get()?.unix_timestamp, validator.key)?;- Line 182
let (expected, bump) = Pubkey::find_program_address(&[b"submission", account.key.as_ref(),: Derives a PDA from seeds and the program ID and returns the address with its canonical bump. - Line 182
let (expected, bump) = Pubkey::find_program_address(&[b"submission", account.key.as_ref(),: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 193
bounty.count = bounty.count.checked_add(1).ok_or_else(bad)?;: Uses checked arithmetic so overflow fails instead of wrapping. - Line 204
bounty.can_settle(Clock::get()?.unix_timestamp, validator.key)?;: Reads on-chain time from the Clock sysvar.
How to run, build and test
These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.
| Directory | Command | Runs |
|---|---|---|
. | npm run test | node --test tests/web/*.test.mjs |
What you could build from it
- Fork the SuperStack copy and extend it within the Other gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)