Work Offer
An issuer asks for work toward a fixed template; workers answer with notes; contributions are public.
Summary
An issuer publishes a work offer: the algorithm, a template, the minimum Z-bit, and optionally a reward and a close time. Workers answer with Sharenotes bound to it, so the work done for the offer is public and tied to a template that can never change.
An offer can also reward notes bound to an existing event, or to events of a given kind that reference it. Then the same work counts there too, for example likes on a post.
issuersworkersminersauditors
Kinds and tags
| Kind | Name | How |
|---|---|---|
| 1726 | Offer | signed, regular event: it can never change |
| 1723 | Note | workers answer with SNP-01 notes bound to the offer |
| Tag | Meaning |
|---|---|
| g | the algorithm; exactly one |
| z | the minimum Z-bit accepted; exactly one |
| reward | amount and unit to split among workers; optional |
| method | lightning or onchain; with reward only |
| closes | unix seconds; notes seen before it count for the reward |
| target | reward work bound to this event id instead |
| via | reward work bound to events of this kind that reference the target |
| relay | where workers publish and auditors read; 1 to 8 |
The offer
An offer is a signed kind:1726 regular event. Its content is the template: an opaque description the notes commit to through the offer id. The work is never computed over it, and its format is the application's.
zis a canonical Z-bit,1 ≤ z ≤ 255, two-digitcc ≤ 99.rewardis a positive integer in the smallest unit; the unit name is the issuer's.closes: the issuer counts only notes it first saw on its relays strictly before that second. A note'screated_atis not evidence.vianeedstarget; one tag per kind, at most 65535.- 1 to 8
relaytags, so every worker can publish to, and every auditor read, all of them.
An offer that breaks a count or form rule is invalid and ignored. Workers find offers with {"kinds":[1726], "#g":["<algorithm>"]}.
Answering an offer
A worker mines SNP-01 notes credited to itself and publishes each to the offer's relays. The binding is a single id:
| Offer has | binding |
|---|---|
| neither target nor via | the offer's id |
| target | the target's id |
| target and via | the id of a via-kind event that has an e tag to the target and is signed by the note's identity |
A note answers the offer when it verifies ATTRIBUTED, its algorithm equals g, its binding is the one rewarded, and its target is at most the z target.
A note bound to the offer's id is newer than the offer and tied to its exact template. A note proves only that work was committed to its binding. Nothing here checks that the template's task was performed.
Events of a via kind
For an offer with via, the worker first signs an event of one of those kinds, then binds its notes to that event's id. The event must:
- have a valid NIP-01
idandsig; - be signed by the same key as the notes'
identity, so work counts only through an action that person signed; - carry an
etag equal to the offer'starget.
What the event means is its own spec's business. The note has one binding and counts once: for the event, under that event's own spec, and toward the offer. For example, an offer with target = a post and via = 7 counts work behind reactions to that post.
Contributions
A worker's contribution is the total weight of its notes that answer the offer, each (algorithm, H) once. Anyone computes it from the union of the offer's relays:
| Offer has | Query on each relay |
|---|---|
| neither | {"kinds":[1723], "#b":[<offer id>]} |
| target | {"kinds":[1723], "#b":[<target id>]} |
| target and via | {"kinds":[<via>], "#e":[<target id>]}, then {"kinds":[1723], "#b":[<event ids>]} |
For the reward, the issuer counts only notes it first saw at or after it published the offer, and before closes. Later notes still count toward public contributions.
Splitting the reward
With a reward, the issuer splits it by SNP-01 §Splitting a reward. Each distinct identity is one recipient, weighted by the contribution over the notes the issuer counted. With no counted notes, nothing is split.
The issuer's counted set can differ from what an observer sees. This spec makes contributions auditable, not payouts; SNP-05 receipts close that gap. How the issuer pays is outside this spec, though method says which SNP-03 Pay destinations it uses.
Trust points: the reward is a promise with no escrow; the issuer is trusted for closes and for what it counted; a listed relay can withhold notes, so workers publish to every relay and keep their own records.
Worked example
An offer has ["reward", "1000", "sat"]. Two workers answer it:
| Worker | Notes | Contribution | Share of 1000 |
|---|---|---|---|
| Alice | 8z00, 9z00 | 2^8 + 2^9 = 768, reads 9z58 | 429 |
| Bob | 10z00 | 2^10 = 1024, reads 10z00 | 571 |
W = 1792. The floors are 1000 · 768 / 1792 = 428.57 → 428 and 1000 · 1024 / 1792 = 571.43 → 571. That leaves one unit. Alice's remainder is larger, so she gets it: 429 and 571, exactly 1000.
Try it
Work offer
Compose an offer and watch work on a post add up into a reward split.
Add and split
Add notes by weight and split a reward the way SNP-01 does it.
Rendered from soprinter/snps/SNP-04.md. The full text has every rule; this page condenses it.
