SHARENOTEProof of energy
Specs/Discovery
SNP-03draftneeds 01

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

KindNameHow
31724Providersigned, addressable; reached at the author's NIP-17 inbox relays
31725NSPsigned, addressable; points to an SNP-07 gRPC endpoint
31726Paysigned, addressable; one per chain, or d = lightning
5Deletion (NIP-09)withdraws an announcement by its a tag
TagMeaning
dservice id; for Pay, a chain genesis id or lightning
galgorithm (Provider: with largest Z-bit; NSP: an -aux id)
cNSP: a chain genesis id it serves
maxProvider: most notes per order
priceProvider: amount, unit, algorithm, Z-bit
urlNSP: https endpoint with no path
feeNSP: share of each block reward, parts per million
payPay: 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 url is https with no trailing slash; a relay is wss://.
  • 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 lowest id) 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).

TagRule
dservice id
galgorithm and the largest Z-bit mined; one or more, one per algorithm
maxmost notes in one order, 1 to 2^53 - 1; exactly one
horizonhow 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.

TagRule
ca parent chain's genesis id; one or more
gsha256d-aux or scrypt-aux; one or more
urlthe SNP-07 endpoint, no path; exactly one
feeshare 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, or lightning for 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, or sat against msat (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_at is at most its own. A later version announces again.
  • Only an a tag 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

Rendered from soprinter/snps/SNP-03.md. The full text has every rule; this page condenses it.