Ask
An owner tells its own mining rig what to mine, for how long, and reads back status and hashrate.
Summary
An ask is an owner telling its own mining rig what to mine: notes bound to what, how much, and until when. The rig queues it, mines it, reports its state, and returns to its usual work when it ends.
An owner can also request a report of the rig's hashrate and current work. Everything travels gift-wrapped. The notes are ordinary SNP-01 notes, which the owner checks without trusting the rig.
rig ownersminersapp builders
Kinds and tags
| Kind | Name | How |
|---|---|---|
| 1728 | Ask | rumor from owner to rig, NIP-59 gift-wrapped |
| 1729 | Status | rumor from rig to owner, gift-wrapped |
| 1730 | Report | request and answer rumors, gift-wrapped both ways |
| Tag | Meaning |
|---|---|
| d | ask id, 64 random hex; required |
| expiration | when the ask ends; required |
| b | binding hex, empty for unbound; required |
| want | total work wanted; default: mine until expiration |
| z | Z-bit of each note; default: the rig's share size |
| g | algorithm; default: the rig's |
| identity | key the notes credit; default: the owner |
| priority | order among this owner's asks; default 0 |
| relay | where notes go; default: the rig's note relays |
Owners and rigs
- Owner: a key allowed to command a rig, configured by the rig's operator with a rank.
- Rig: software driving mining hardware, such as a stratum server, under its own key. It needs no owner's key: notes need no signature.
- Usual work: what the rig mines with no ask running, templates from its own node or an NSP, or nothing (standby).
All messages are NIP-59 gift wraps to the recipient's kind:10050 inbox relays. A rig drops, without answering, any message not from one of its owners, and any ask without a valid d or expiration. Relays see neither who commands which rig nor what is asked.
The ask and its versions
An ask is (owner, d). b, g and identity are fixed for the life of an ask; a version changing them is refused with immutable. A rig that mines several algorithms refuses an ask without g.
To update, the owner sends a new rumor with the same d. The rig applies the latest created_at, ties to the larger rumor id, and ignores older ones. To cancel, the owner sends a version whose expiration has passed.
Numbers are decimals without sign or leading zeros, at most 2^53 - 1. A bad number makes the ask refused with invalid-tag.
Lifecycle
| State | Meaning |
|---|---|
queued | valid, waiting for hashrate |
running | being mined |
done | want reached, or expiration reached with no want |
expired | expiration reached before want, or cancelled |
failed | unavailable or stopped by the operator |
refused | unsupported-algorithm, ambiguous-algorithm, immutable, invalid-tag, queue-full, over-limit |
A version whose want is at or below the progress made ends the ask done at once. Final states stay final. A rig never starts or resumes an expired ask, and drops an ask received already expired.
Status and queue
A kind:1729 status names the ask (d), the version applied (e) and the state. While queued or running it gives the resolved g and z. It adds queue (position, running ask = 1), progress (notes and summed Z-bit), rate and reason as they apply.
The rig keeps one queue, ordered by owner rank, then priority, then arrival. priority orders only that owner's asks, so no owner can jump ahead of a higher-ranked one. An arrival ahead of the head preempts it back to queued, progress kept. A rig may bound the queue (queue-full) and how far ahead an expiration may lie (over-limit).
Reports and checking
An owner sends a kind:1730 request with expiration and optional every (at least 60 seconds). The rig answers once, or at that interval until expiration, with rate per algorithm, workers, one worker tag per miner (name, algorithm, rate, last share), mining (ask, usual or standby), queue, and d only when the running ask is the requester's.
A status is a claim. The owner counts the notes itself with {"kinds":[1723], "authors":[<identity>], "#b":[<b>]}, in g, at least z, each proof once. A rig can only misreport progress and rate, and the rate can be estimated from shares (SNP-02).
For an -aux algorithm on real work, only the z-chain header changes, so the same hashing still mines blocks.
Worked example
Alice's rig mines scrypt-aux on its usual work.
| Ask | Rig |
|---|---|
A: b = an offer binding, want 20z00, 1 day | queued 1, g scrypt-aux, z 12z00, then running |
| (mining) | A running, progress 7 14z80 |
B: b = a service epoch, priority 5, 1 hour | B running; A queued 2 |
| (1 hour) | B done; A running |
A, newer: want 21z00 | A running |
| (mining) | A running, progress 300 20z22 |
A, newer: want 20z00, below progress | A done; usual work |
| A, older version replayed | ignored |
| C, received already expired | dropped |
| from a key not an owner | dropped |
Seven 12z00 notes are 7 · 2^12 = 28,672, which reads back as 14z80.
Try it
Command your rig
Send an ask to your own rig and watch the queue respect rank and priority.
Hashrate planner
What your hardware mints per second, and what hashrate public shares imply.
Rendered from soprinter/snps/SNP-08.md. The full text has every rule; this page condenses it.
