Skip to content
Sparecycle

Reference

Billing

Paid jobs draw on a balance you keep in the SparecycleJobPayments contract. Your balance stays in that contract, not in a server wallet, and only your wallet can withdraw it. You are charged only for jobs whose two results match.

Deposit

On the Jobs page, connect your wallet and choose Deposit. That calls deposit() on the payments contract with the ETH you choose; a plain ETH transfer to the contract does the same. The contract has no owner and no admin function, so nobody else can move your balance.

Your balance, in four figures

Balance
What the contract holds for you.
Held for running jobs
The price of your jobs that have no verdict yet. Nothing has moved on-chain for them.
Pending withdrawal
An amount you asked to withdraw. It can no longer pay for new jobs.
Available for new jobs
Balance minus what is held minus a pending withdrawal.

The Jobs page shows all four. Scripts can read them from the API:

Terminal
curl -s "https://sparecycle.tech/api/v1/payments/account?address=0xYOUR_WALLET"

When you are charged

  • The price is shown before you sign. Signing a job moves nothing on-chain; the price is only held.
  • When the two results match (agreed), the job is charged at the end of the epoch, once every 6 hours, together with the epoch's other matched jobs.
  • When the two results do not match, or the two nodes give no verdict within 40 minutes of the first one starting, the job is checked again on another pair: two nodes whose owner wallets and GPUs took no part in it before, if two such nodes are registered with the network. That happens at most 2 times (3 pairs in all), and only the last pair's verdict counts. Without such a pair the mismatch is final at once. Meanwhile the job shows "Re-checking on another pair (round 2 of 3)", the price stays held and nothing is charged. Every pair runs inside the same 6-hour limit; a new pair starts only while a full 40 minutes are still left of it.
  • When no pair's results match, when the safety checker rejects an image (never checked again), or when there is no verdict within 6 hours, the job is not charged. The hold is released and nothing leaves your balance.
  • A charge sends 95% into the open epoch's node pot and 5% to the treasury Safe. The pot is shared by all matched work of that epoch, by work units, not paid to the two nodes of your job in particular. The 5% is computed on each epoch's total and rounded down, so a per-job share of it is approximate.

What is public

Every charge is on-chain: the CustomerCharged event shows your wallet and the amount per epoch. The epoch's charge (GET /api/v1/epochs/{id}/charges) shows each wallet's total and the leaves of the jobs tree below, not job ids or prices. Every leaf includes a random salt that only your receipt holds, so nobody can link your wallet to a job from the public leaves. Charge lists from before job receipts list job ids, payers and prices.

Job receipts

Every paid job also gets a receipt, next to its invoice on the Jobs page and in the playground. It appears as soon as the two results are compared and stays provisional until the epoch's charge is confirmed on-chain; then it is sealed.

  • A receipt holds the job id, your wallet, the price, whether the results matched, whether you were charged, the hash of the output, the signed statements (EIP-712) of both nodes about the result each of them sent, and the random salt of your job's leaf.
  • At each epoch close that charges at least one job, the scheduler builds a Merkle tree over every paid job settled since the last charge: charged, not charged and unpaid. Its root goes on-chain as the listHash of the payments contract's Charged event. A sealed receipt carries your job's leaf and the proof that leads to that root.
  • Verify in this browser recomputes the leaf from the receipt, follows the proof and reads the Charged event of the charge transaction from Robinhood Chain's public RPC (https://rpc.mainnet.chain.robinhood.com), not through Sparecycle. Changing any field of the receipt makes the check fail.
  • Save the receipt as a JSON file. Check a job receipt on the Jobs page checks a saved file the same way, also while the Sparecycle API is unreachable. Keep the file private: its salt is what links your wallet to your job's public leaf.

Which root is checked

The epoch's payout Merkle root, the one node owners claim from, covers node payouts: one leaf per node owner. Jobs and payers are not in it. A job receipt is checked against the jobs root in the Charged event instead.

An epoch without a charge

If an epoch close charges no job, the contract emits no Charged event, so there is no on-chain anchor for that epoch. Receipts of jobs that were not charged then say “no on-chain anchor for this epoch”, which is not a failed check. They go into the jobs root of the next epoch that charges a job.

If the public RPC does not load

Some internet providers, including many in Indonesia, block Robinhood Chain's public RPC by DNS. The check then says so and lets you paste another RPC URL of your choice. It never falls back to Sparecycle's own relay.

What a passing check shows: your job's line (job, wallet, price, verdict, charge status, output hash) is in the root committed on-chain with that charge. It does not show that the nodes computed the output correctly; the node signatures show which node keys reported the results. Over the API, with the job's read secret or a session of the paying wallet:

Terminal
curl -s -H "Authorization: Bearer READ_SECRET" https://sparecycle.tech/api/v1/jobs/JOB_ID/receipt

Withdraw

You can start a withdrawal at any time. It completes after a lock, so that jobs you already ran can still be charged.

  1. Step 1: Start the withdrawal

    Request a withdrawal on the Jobs page, or call requestWithdraw(amount). From then on that amount is no longer available for new jobs.

  2. Step 2: Wait for the lock to end

    The withdrawal unlocks once the reward contract has closed the epoch you asked in and the next one, or two days after your request if epochs stop closing. Depending on when in the epoch you start, that is one to two epoch closes. The Jobs page shows when it is ready; on-chain it is canWithdraw(yourWallet).

  3. Step 3: Complete it

    Complete it on the Jobs page, or call withdraw(). It pays the amount you asked for, or your balance if that is now lower (jobs charged in the meantime come off first). Cancelling (cancelWithdraw()) drops a request you no longer want.

Spend limit

You can cap what may be charged to you per epoch with setSpendLimit(limit) (0 removes the cap). The contract enforces it, so it holds even if the scheduler key were misused. A matched job over your limit is charged at a later epoch close.

Free trial jobs

Free trial jobs are never charged and need no balance. Their work shares the same node pot as paid work. They run on one pair only: a mismatch is final, with no re-check on another pair.

Contract source and tests: SparecycleJobPayments.sol.