SHARENOTEProof of energy
Specs/The note
SNP-01draft

Proof of Energy

A self-verifying note of computational work: no issuer, no signature, denominated in Z-bits.

Summary

A Sharenote is a proof of energy. It is a small binary record that proves one identity spent a declared amount of work in a stated algorithm. Anyone can check it from the record alone, and nobody has to issue it.

Every note is denominated on one continuous scale, the Z-bit. So notes are comparable, summable and splittable with exact integer math. What a note is worth to you, and what you accept it for, is your application's choice.

everyoneapp buildersrelay operatorsminers

Kinds and tags

KindNameHow
1723Noteunsigned; a relay stores it only after the record verifies
TagMeaning
gthe algorithm id, e.g. sha256d
zthe Z-bit, e.g. 20z00 or 34z10
bthe binding in lowercase hex; present only when the note is bound

The record

A Sharenote is a compact binary record. The proof is computed over these exact bytes. Multi-byte integers are big-endian.

FieldBytesMeaning
tag SN4U4separates the record from other bytes hashed the same way
version10x01
algorithm2 + Nlength, then lowercase ASCII id
identity32x-only pubkey credited with the work
z-bit2z (at least 1), then cc (0 to 99)
binding2 + Noptional scope; length 0 means unbound
nonce2 + Nthe only field changed while mining

The minter commits who, which algorithm, the Z-bit and the binding before searching. The note is worth exactly its Z-bit. A lucky hash earns no bonus. The pubkey sits inside the hash, so the credit cannot move to another identity without fresh work. No signature is needed, so a provider can mine notes credited to you without your key.

Algorithms and bindings

Version 1 defines two algorithms. H is read as a big-endian integer over all 32 bytes.

idH
sha256dSHA-256(SHA-256(record))
scryptscrypt(record, salt = record, N = 1024, r = 1, p = 1, 32 bytes)

Values only compare and add within one algorithm. 34z10 in one is not 34z10 in another.

The binding is opaque. The application decides what it commits:

binding commitsthe note becomes
nothingprepaid energy, spent later wherever accepted
your own reaction eventa like backed by work
a service and its current epochaccess paid in work
a work templatework that earns a share of a reward

Verification

A relay or consumer checks the record, then (relays) the event. The first failing check decides.

  • 1. Tag: starts with SN4U and a version byte, else REJECT.
  • 2. Version: known, else SKIP.
  • 3. Algorithm: lowercase ASCII, else REJECT; a registry id, else SKIP.
  • 4. Canonical: every length honored, nothing left over, valid BIP-340 key, z ≥ 1, cc ≤ 99, else REJECT.
  • 5. Work: H ≤ target(z-bit), else REJECT.
  • 6. Envelope (relays): content is the record in lowercase hex, pubkey equals identity, tags are exactly g/z/b matching the record, id is the NIP-01 id. A sig is ignored.
VerdictRelayConsumer
ATTRIBUTED: valid, worth D = 2^256 / Tstorecount
REJECT: malformed or not enough workdropignore
SKIP: unknown version or algorithmdropignore

Transport on Nostr

A note rides in a kind:1723 event. It is unsigned, so the envelope differs from NIP-01: pubkey is the record's identity, content is the record in lowercase hex, created_at is publish time and not part of the proof, and there is no sig. Only relays and clients that support SNP-01 handle these events.

The event carries exactly one g, exactly one z, and one b only when the binding is non-empty. No other tag is allowed: anyone can republish an unsigned record, so a tag outside the record would carry nothing you can trust.

To get the energy behind a binding, query {"kinds":[1723], "#b":["<binding-hex>"]} and add the values per algorithm. The same note can travel in many events, so always count by proof, never by event.

Z-arithmetic

A Z-bit NNzcc maps to a target exactly, with integers only:

T(z, c) = floor( 2^(256 - z) · S_c / 2^48 )
S_c     = round( 2^(48 - c/100) )      (scale table, 100 values)

The value is the expected number of hashes, D = 2^256 / T. Implementations carry the weight w = floor(2^384 / T). To add notes, sum weights and read the total back:

T_total = floor( 2^384 / Σ w_i )
z = 256 - bitlen(T_total), plus 1 if T_total is a power of two
c = max { c' in 0..99 : T(z, c') ≥ T_total }
SumResultWhy
20z00 + 20z0021z00equal whole-bit notes add one bit
2z01 + 2z013z00targets round down
1z00 + 2z002z582 + 4 = 6, log2 6 ≈ 2.58

Rules: one algorithm only, each proof (algorithm, H) once, no floats. Compare amounts by weight, never by read-back Z-bits.

Splitting a reward

A reward of R whole units is split in proportion to work, the same for every observer, with nothing lost to rounding. Give recipient i the weight w_i of its notes and let W = Σ w_i:

s_i = floor( R · w_i / W )
r_i = R · w_i mod W
L   = R - Σ s_i

Each recipient gets s_i. The L leftover units go one each to the largest remainders r_i. Ties go to the recipient whose smallest H is smallest.

The constraints that hold everything together: only ATTRIBUTED notes count; value comes from the committed Z-bit, never from H or a float log2; sums are exact; a relay verifies before storing; and whether to accept a note, or enforce single use, is the application's policy.

Worked example

An unbound 20z00 note mined with sha256d. Its record is 534e3455 01 0007 73686132353664 (sha256d), the 32-byte identity, 14 00 (20z00), 0000 (unbound), 0004 001644e1 (nonce). Hashing gives:

H = 00000e47d8d39787c3a2f7969cfed5400eb7b47e8a80f0d428131903957d9911
T(20z00) = 2^236
  • H ≤ T: ATTRIBUTED, worth 20z00, D = 2^20, about a million hashes.
  • The same record committing 30z00 (T = 2^226): REJECT, H is too large.

Adding. 1z00 (value 2) plus 2z00 (value 4) is 6, which reads back as 2z58, not 3z00.

Splitting. R = 10 between those two notes: floors are 3 and 6, one unit left over. The 2z00 note has the larger remainder, so the final shares are 3 and 7.

Try it

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