Announcement
Addressable Nostr events that say: I mine notes for you, I serve block templates, or pay me here.
Summary
A key announces what it offers around Sharenotes, and how to pay it, so others can find it. There are three announcements: a provider (31724), a node service provider (31725) and a pay destination (31726).
Each is an addressable event. The author keeps one per d value, replaces it to update and deletes it to withdraw. Jobs, orders and receipts name the version they relied on by event id, so past terms stay provable.
providersNSPsminersworkersapp builders
Kinds and tags
| Kind | Name | How |
|---|---|---|
| 31724 | Provider | signed, addressable; reached at the author's NIP-17 inbox relays |
| 31725 | NSP | signed, addressable; points to an SNP-07 gRPC endpoint |
| 31726 | Pay | signed, addressable; one per chain, or d = lightning |
| 5 | Deletion (NIP-09) | withdraws an announcement by its a tag |
| Tag | Meaning |
|---|---|
| d | service id; for Pay, a chain genesis id or lightning |
| g | algorithm (Provider: with largest Z-bit; NSP: an -aux id) |
| c | NSP: a chain genesis id it serves |
| max | Provider: most notes per order |
| price | Provider: amount, unit, algorithm, Z-bit |
| url | NSP: https endpoint with no path |
| fee | NSP: share of each block reward, parts per million |
| pay | Pay: method and destination, preferred first |
Common rules
- A chain is named by its genesis block id, 64 lowercase hex in the chain's display order.
- A
urlishttpswith no trailing slash; arelayiswss://. - Numbers are decimals without sign or leading zeros. Counts and seconds are at most
2^53 - 1; amounts have no bound. - The newest version of an address (greatest
created_at, then lowestid) is the announcement. If it breaks a rule, the address has no valid announcement. Clients never fall back to an older one. - An optional NIP-40
expiration; from that second on the announcement is expired. - An announcement binds only its author. Clients trust a URL by the key that announced it.
Provider (kind 31724)
A key that mines notes on others' behalf (SNP-06).
| Tag | Rule |
|---|---|
d | service id |
g | algorithm and the largest Z-bit mined; one or more, one per algorithm |
max | most notes in one order, 1 to 2^53 - 1; exactly one |
horizon | how far ahead an order may expire, seconds; absent means 86400 |
price | <amount> <unit> <algorithm> <Z-bit>: the price of one note of that size; at most one per algorithm |
A provider has no url. Orders reach it as gift wraps at its NIP-17 kind:10050 inbox relays. An announcement with a url tag is not valid. Find providers with {"kinds":[31724], "#g":["sha256d"]}.
NSP (kind 31725)
A key that runs chain nodes and serves block templates (SNP-07). One event per service.
| Tag | Rule |
|---|---|
c | a parent chain's genesis id; one or more |
g | sha256d-aux or scrypt-aux; one or more |
url | the SNP-07 endpoint, no path; exactly one |
fee | share of each block reward paid to the NSP, ppm, at most 1000000; absent means none |
Miners find NSPs with {"kinds":[31725], "#c":["<genesis id>"]}. A client names the service by its address 31725:<pubkey>:<d> and the version by event id. A template paying the NSP more than its fee is dropped by the client.
Pay (kind 31726)
Where to pay an identity, signed by the key its notes credit, so no one else can redirect its pay.
d: a chain genesis id, orlightningfor any payment over Lightning.pay:["pay","lightning",<address or LNURL>]or["pay","onchain",<address>], preferred first. A destination that carries a secret, such as a wallet connection string, must never be announced.min: the smallest payment wanted; a payer carries smaller amounts over. Compared only in the same unit, orsatagainstmsat(1 sat = 1000 msat).relay: at most 8; payers publish receipts here too.
A payer queries {"kinds":[31726], "authors":[<identity>], "#d":[<chain>, "lightning"]}. A receipt names the version it paid to.
Withdrawal
An author withdraws an announcement with a NIP-09 kind:5 deletion carrying ["a", "<kind>:<pubkey>:<d>"].
- It withdraws every version whose
created_atis at most its own. A later version announces again. - Only an
atag naming the deletion's own key withdraws. A deletion by another key does nothing. - A withdrawn or expired announcement offers nothing. Clients must not order, connect or pay by it.
- A job, order or receipt that already names one of its versions still stands.
An announcement is a claim, not a guarantee. SNP-06 and SNP-07 define what can be checked of what it delivers.
Worked example
The provider from the SNP-06 example announces one service:
"kind": 31724,
"tags": [
["d", "main"],
["g", "sha256d", "24z00"],
["max", "100"],
["price", "1", "sat", "sha256d", "16z00"]
]
It mines sha256d notes up to 24z00, at most 100 per order. One 16z00 note costs 1 sat, so smaller notes cost proportionally less. No horizon, so orders may expire at most 86400 seconds ahead.
A Pay announcement with ["min", "5000", "msat"] compares with a payment of 3 sat: 3 sat is 3000 msat, below the minimum, so the payer carries it over. A min in a unit the payer cannot compare means the payer must not pay by that announcement.
Try it
Network directory
Providers, NSPs and Pay announcements on relays.
Buy work
Order notes from a mining provider when your device can't mine.
Rendered from soprinter/snps/SNP-03.md. The full text has every rule; this page condenses it.
